Application of Machine Vision Technology in Tablet Packaging Defect Inspection System

Abstract : The concept of machine vision and the defect detection system for tablet packaging based on machine vision technology are introduced. The hardware components of the system, the software module structure of the control system and the working process are given.
Keywords: machine vision; tablet packaging; detection system
1 INTRODUCTION At present, most pharmaceutical factories in the tablet packaging production line generally use manual visual inspection methods to sort defective products. The inspection personnel's working conditions have a great influence on the detection results, and this working method has low detection efficiency and high cost. , Labor intensity. The insertion of manual labor seriously affects the work efficiency of the tablet packaging production line. It not only wastes a lot of labor resources, but also cannot guarantee the quality of packaging at all. Some manufacturers use video recorders for a long time to compensate for the errors caused by manual inspections, but this has lost the significance of real-time detection, and also has the problem of high detection costs.
The use of machine vision systems instead of humans for tablet packaging defect detection can increase production efficiency and reduce production costs. Based on machine vision technology, the tablet packaging defect detection system is an electromechanical product integrating machine vision, optical sensors, and electromechanical technology. It also has the characteristics of high precision and high speed of the computer. It can quickly and accurately detect tablet packaging. Defects and conduct a comprehensive analysis to reliably separate finished products and waste products.
2 Machine vision concept Machine vision, also known as computer vision, is a technique that uses computers to simulate people or reproduce certain intelligent behaviors related to human vision. It extracts information from images of objective things, processes them, and understands them. Finally, it is used in practice. Detection, measurement and control. Machine vision is an integrated technology that includes: digital image processing technology, mechanical engineering technology, control technology, electric light source lighting technology, optical imaging technology, sensor technology, analog and digital video technology, computer software and hardware technology, human-machine interface technology Wait. These technologies are side-by-side in machine vision. Coordinated application of these technologies can form a successful industrial machine vision application system. A typical industrial machine vision application system includes an image capture system, a lighting system, an image digitization module, a digital image processing module, an intelligent decision making module, and a machine control execution module.
The image capture system uses a CCD camera to convert the job object and background to be recognized into an image signal, which is recorded in the form of an image, and then converted into a digital signal for transmission to a dedicated image processing system. Various operations are performed based on the information such as pixel brightness and color distribution. To extract the characteristics of the target, according to the preset tolerance and other conditions to output the results of the judgment.
The illumination system provides suitable illumination for image acquisition to facilitate subsequent image processing and analysis.

Image digitalization module, digital image processing module, and intelligent decision-making module are the core of the machine vision system. The computer performs specific processing. The processed digital signal needs to be converted into a video signal to be displayed by the display and output by the output terminal of the image acquisition board. To control the corresponding actuators.
The mechanical control execution module operates according to the instructions of the computer and finally completes the tasks required by the system.
3 The overall design of the tablet packaging defect detection system Based on the machine vision technology, the tablet packaging defect detection system is generally composed of two parts: hardware and software. Its working principle is: the packed tablets are transferred in the delivery device, and the delivery device is in the machine. The middle area is divided into two areas: detection area and separation area. In the detection area, the continuous tablet image in the transmission is transmitted to the computer through a high-speed CCD camera. The computer analyzes the recorded images to identify discarded tablets. When the medicine plate is cut into the separation zone, the laterally disposed spray gun ejects high-pressure gas to quickly blow out the waste plate and fall into the waste container, and the finished medicine plate normally falls into the finished product area, thereby realizing the separation of the finished product and the waste product.
The overall structure of a tablet packaging defect detection system based on machine vision technology is shown in Figure 1. In order to make full use of the original production line and effectively perform defect detection of tablet packaging, two CCD cameras can be installed in the detection area for reliable detection, and appropriate lighting equipment can be added to enhance the detection effect.

4 Detection System Hardware The hardware of the tablet packaging defect detection system based on machine vision technology includes the camera system and the separation system.
4.1 Camera System The camera system employs a charge-coupled solid-state camera (CCD) widely used in the industry. It is a solid-state imaging device that acts as a light sensor and has a wide dynamic range, wide spectral response, small size, low power consumption, and reliability. Advanced features. The output of the CCD image sensor is simple, and it is convenient to convert the spatial distribution of the image signal into a time-series distribution of the electrical signal according to a determined linear relationship, and perform subsequent processing. The CCD can be integrated with a MOS circuit on a chip, which has both a photoelectric conversion function and a signal storage, transfer, and readout function. Therefore, the CCD image sensor can be regarded as an image converter, transforming a spatially distributed light image into a The video voltage signals distributed in chronological order are transmitted to a computer for processing.
CCD cameras can be divided into line arrays and area arrays according to the CCD devices they use, because linear array CCD cameras can only obtain one line of information at a time, and the objects being photographed must be moved in a straight line from the camera. Get a complete image, for the actual work, using a linear array CCD camera.
4.2 Image Acquisition Card In the PC-based machine vision system, the image acquisition card is an important device for controlling the camera to complete image acquisition and digital coordination of the entire system, its structural design and performance are closely related to the efficiency of the entire system. The general image acquisition card has the following functional modules: image signal reception and A/D conversion module; camera control input/output interface; bus interface; communication interface.
This system uses NI Corporation's PCI-1408 image acquisition card, which supports multi-channel image acquisition, and uses dual CCD input to improve the resolution and reliability of the system. The image of the medicine plate is converted into a digital image by the CCD camera and then the acquisition card. Enter the computer, after the computer processing to determine whether there is a waste board.
4.3 Separation system The main design of the separation system is the shape, position, jet pressure and jet time control of the jet. The distance between the jet port and the camera and the operating speed of the conveyor belt determine the time and delay time of the jet. Through the computer's real-time calculation of the entire operating process, the controller sends commands to the controller. The controller controls the movement to make it specified. After the time, the air flow is jetted and the waste plate is blown into the waste container.
5 The control system of the detection system includes three subsystems: identification algorithm, user interface and communication, which complete detection, control, and communication functions.

The system software is based on the Windows platform, written in Delphi language, and introduces the NI company's LabVIEW language for graphics processing. The software structure is shown in Figure 2. It is divided into seven modules: parameter setting, preprocessing, digital image processing, intelligent decision making, mechanical control, communication and user interface. Parameter settings provide database data file settings and storage operations; pre-processing module to complete the initialization operation according to the set value; digital image processing module to complete the real-time acquisition of the CCD image digital processing; intelligent decision-making module for image data comparison and judgment processing The mechanical control module completes the control of the circuit; the communication module completes the two-way communication of the detection system with the host computer and the database, and the reporting of statistical data; the user interface adopts a graphical manner to provide the user with convenient operation and statistical display, which is convenient for the user to detect the variety change. Replace the parameter settings in time and add, delete, or modify the database.
6 Concluding remarks This kind of machine vision system, which can replace people's detection and classification work, can significantly reduce inspection costs, improve product quality, greatly increase labor productivity, and create a comfortable working environment for workers. It is of practical value to use a machine vision recognition system to replace the manual detection of tablet packaging. In particular, automated production lines instead of manual work on rapid, monotonous product inspection work can achieve rapid and accurate results.