Ampoule Bottle Detection Equipment Research and Development

With the continuous development of computer vision technology, its application is more and more extensive. In recent years, the application of computer vision technology in the area of medical packing detection also made great achievements. This paper detailed a scientific and reasonable scheme of an ampoule bottle automatic detection equipment. In this scheme we use the computer vision technology and CNC technology, and select the appropriate transport mechanism and cameras to get images of ampoules. After getting the images, we use a software named MATLAB, which can deal with the images, to obtain some useful information about the ampoules. Then we can evaluate the quality of the ampoule according to these information.


Introduction
In recent years, with the development of computer vision technology, the method of ampoule detection has acquired a new huge development.The traditional methods mainly depend on manual detection with some professional optical instruments.These methods have many defects, such as slow detection speed, low accuracy, often mistaken and missed detection and so on, so that it has been difficult to meet the requirements of the ampoule bottle modern production.On the contrary, the emerging computer vision technology can meet all the demands of detection with its brilliant advantages, like fast detection speed, high precision, high degree of automation and so on [1].Therefore, a new ampoule bottle detection equipment, which is based on computer vision technology, emerges as the times require.

Discussed Problems
The ampoule bottle is a kind of sealed vial whose capacity is generally 1-25ml, commonly used for depositing serum, vaccine and drug for injection [2].Its detection indicator mainly includes the following aspects, size, sloping bottom, bottle crack, stains, foreign body and etc, the size includes bubble diameter, neck diameter, mouth diameter [3].If the neck diameter and bubble diameter are not well controlled, it will lead to a phenomenon that the liquid levels between two ampoules are uneven through the dose of liquid is the same.The mouth diameter have an effect on liquid filling, if the size of it is smaller than normal, the filling needle tube will touch inner wall of the bottle when it fills liquid, thus there will be liquid adhesive on the inner wall; if the diameter size is bigger, the general strength flame cannot seal well.Sloping bottom will cause the bottle placed instable, the filling needle can not fill accurately.Bottle crack could cause liquid leak.In addition, if there are foreign bodies in bottles, they would have an bad influence on the quality of the liquid medicine, when inject them, that may cause serious consequences.The stain will directly affect the sales of the bottle.

Mechanical Structure
After observing practical production environment and considering the position of cameras, lights, processors and controllers, we put forward a feasible scheme of mechanical structure.The mechanical structure mainly includes delivery mechanism, image acquisition mechanism and defective bottles eliminating mechanism.

The Delivery Mechanism
The delivery mechanism is mainly used to deliver and position ampoules.A conveyor belt moves ampoules to the specified location, then a fixture clamps them and cameras take a picture.

The Image Acquisition Mechanism
The main part of the image acquisition mechanism is light and the camera.A good light solution not only ensure the brightness sufficient, but also could make the characters of detected object clear [4].The camera is the key to get a good image, the ability to obtain sufficient MATEC Web of Conferences resolution image will directly affect the accuracy of the detection system.There are many advantages of CCD camera, like high resolution, good sensitivity, and high performance in image denoising [5], so we choose the CCD camera.

The Defective Bottles Eliminating Mechanism
Once the machine finds a defective bottle, it could move the bottle out from production line immediately with the defective bottles eliminating mechanism.The mechanism depends on a strong airflow, whose pressure is 0.2 MPa at least, to move the defective bottle out.And the mechanism is also provided with an electromagnetic valve to control the airflow.This mechanism has the advantages of fast frequency, high efficiency, long service life.

Control System
The control system consists of a control console and cabinet.The console includes computer, screen, keyboard and mouse, is the Human-machine interaction part of the system.The staff can debug system and collect detection data through it.The control cabinet mainly includes (Programmable Logic Controller), drive, power supply and cabinet control button etc.It controls all the mechanical devices.The communication between the control console and cabinet is industrial Ethernet.The structure of the control system is shown in Fig. 1.

Computer
Computer, the key of Human-machine interaction, is responsible for system debugging and commissioning, image processing and outputting results.

PLC
PLC is used for storing, compiling and executing a specific control program, with it the feasible solution and instructions could turn into mechanical movements we wanted.

Control Button
There are three buttons with different color in the front of control cabinet, the green one, the yellow one and the red one.The green can start the equipment; the yellow can stop it under normal condition; the red stop it in an emergency.

Image Processing and Analysis
We get some useful information of ampoules through a software named MATLAB, then count and analysis of the information of defective bottles, like size, sloping bottom, bottle crack, stains, foreign body and etc.At last, we'll provide a quality testing report to the staff of ampoules manufacture, so that they could adjust their production line to improve the production capacity.This process is divided into four parts, filter processing, binaryzation, edge detection and image recognition [6].

Filter Processing
Due to the impact of the surroundings, the images can't directly provide some useful information we wanted.Image noise is one of the most common influences, then we should take some effective denoising methods.Given the surroundings of ampoule detection, the median filter is the best choice.It sequence the pixels in a selected region and chooses the median to replace the value of the center pixel [7].The mathematical model can be written as follow: The commonly used matrix template is The effect picture of filter processing as follow:

Binaryzation
The binaryzation can separate object from its background in a image, then we get a black-and-white image, which named binary image.The effect of binaryzation is shown in Figure 3:

ICMEE 2015
Edge detection is an essential step in image analysis and recognition.When detect the bubble diameter, we find there are two or more pixels in the edge, however we need a edge whose width is only one pixel.So we need to find the right edge, as the red lines shown in Figure 4:

Pattern Recognition
Pattern recognition refers to the steps of identifying and grouping objects of study according to its basic characteristics [8].The characteristics of ampoules include bubble diameter, neck diameter, mouth diameter, sloping bottom, bottle crack, stains, foreign and body.We count ampoules with one or more characteristics presented above, then provide a quality testing report to the mpoules manufacture.The results of pattern recognition is shown in Figure 5:

Conclusions
With the technology of machine vision and CNC , the equipment acquires image through transport mechanism and cameras which controlled by PLC, then uses a software named MATLAB, which can get some useful information from the images, to evaluate the quality of the ampoules.The equipment can completely replace the manual detection, it would greatly improve the detection efficiency and bring enormous economic benefits.
This is an Open Access article distributed under the terms of the Creative Commons Attribution License 4.0, which permits distribution, and reproduction in any medium, provided the original work is properly cited.XQUHVWULFWHG XVH DOI: 10.1051/ C Owned by the authors, published by EDP Sciences, 2015 Article available at http://www.matec-conferences.orgor http://dx.doi.org/10.1051/matecconf/20153103005

Figure 1 .
Figure 1.Structure of the control system.

Figure 2 .
Figure 2. Effect picture of filter processing.

Figure 4 .
Figure 4. Effect picture of edge detection.

Figure 5 .
Figure 5. Results of pattern recognition interface.