Detection of the Impurities in Bottled Mineral Water Based on Computer Vision System

Bottled mineral water is an indispensable drink in our daily life. It’s important for us to guarantee quality of the products. In this study, a computer vision based detection system is established to detect the impurities in bottled mineral water. With the help of high speed industrial camera, the images of RGB model images could be obtained in real-time. The recorded images are transformed into HSI color format to reduce the effect of environmental brightness on the industrial assembly line. The corresponding threshold of the hue and saturation for bottled mineral water are set, according to which the image segmentation is carried out. After Gaussian filtering, the image decomposition and edge detection are applied to the images. The impurities in the bottled mineral water could be determined, marked by red dots. Based on the detection results, unqualified products will be removed from the industrial assembly line. By using this system, the accuracy and efficiency could be improved for the detection of impurities in bottled mineral water.


Introduction
Bottled mineral water is an indispensable drink in daily life, which occupies a huge market share in the retail industry. However, due to many deficiencies in the existing production line and testing equipment, the filling process of mineral water may contain visible suspended solids. Once the products containing suspended solids entering the market, they will not only damage people's health [1], but also cause huge losses to the reputation of the enterprise and the economy. Therefore, water quality detection is an important link during the quality management of drinking water manufacturing. As a result, it is necessary to detect whether there are suspended solids in the bottled mineral water before leaving the factory, which is related to the drinking water safety. At present, the manual observation method is used for most of the water companies, which cannot meet the high speed, high precision, high stability and other indicators of the production line. Therefore, new method is urgent for the detection of bottled mineral water with high speed and high accuracy.
With the continuous progress of science and technology, the computer vision and image processing technologies are applied to more and more fields. This technology has the advantages of fast detection speed, good stability and high detection quality, which could effectively improve the flexibility and automation of production. For example, H. Dai and his coworkers [2] assessed the effects of floc quantity, floc equivalent diameter and fractal dimension by means of the machine vision system and computerized analysis. With respect to the deficiency of traditional water content detection methods, G. Liang et al. [3] established a machine vision based non destructive testing method to detect the moisture content of withered leaves, which would provide a new train of thought and theoretical basis for the online water content monitoring technology of automated production of black tea. Y.  [4] investigated the use of machine vision for monitoring water content in Sunagoke moss, the main goal of which was to predict water content by utilizing machine vision as non-destructive sensing and Neural-Genetic Algorithm as feature selection techniques.
In this study, a computer vision based detection system is established to detect the impurities in bottled mineral water. With the help of high speed industrial camera, the images of RGB model images would be obtained in real-time. The recorded RGB model images are transformed into HSI color format to reduce the effect of environmental brightness on the industrial assembly line. According to the calculated hue and saturation values, the characteristic of bottled mineral water and impurities could be determined. The threshold of the hue and saturation for bottled mineral water was set, according to which the image segmentation was carried out. After Gaussian filtering, the image decomposition and edge detection are applied to the images. The impurities in bottled mineral water could be determined, which are marked by red dots. Based on the detection results, unqualified products will be removed from the industrial assembly line. The accuracy and efficiency can be improved for the detection of impurities by this system.  Firstly, an industrial color camera is employed to shoot the images of the bottled mineral water on the industrial assembly line in real time. The industrial color camera has 3840×2160 pixels at a frame rate of 30 fps, which is suitable for object detection with very short exposure time in high-speed automation. Normally, the images obtained from the industrial color camera were in the RGB color model. However, the calculated RGB values of images were usually different, which were greatly affected by the light intensity of the shooting location in actual industrial conditions. In order to enhance the accuracy of the detection results, the achieved images from the industrial color camera in RGB model were transformed into HSI color format. The conversion relationship from RGB to HSI are given by the following equation [5]:

Experimental Setup
where R is the value of red, G is the value of green, B is the value of blue, H is the value of hue, S is the value of saturation, I is the value of Intensity. The characteristic of bottled mineral water could be determined according to the calculated hue and saturation values. The corresponding threshold of the hue and saturation for bottled mineral water was set, according to which the image segmentation from the hue and saturation diagram was carried out. After that, the Gaussian filter is applied to the image for the following image decomposition and edge detection. Then, the impurities could be identified and determined, the locations of which are marked. Based on the detection results, the information of whether impurities exist in bottled mineral water was identified. Finally, unqualified products will be removed from the industrial assembly line. Fig. 2 shows the original images achieved from industrial color camera. As showed in Fig. 2(a), there are no impurities observed in the mineral water sample, which is clean and clear. However, there are many impurities in the bottled mineral water, as displayed in Fig. 2(b). Therefore, the bottled mineral water is unqualified product, which should be removed from the industrial assembly line. It should be pointed out that the impurities could be deposited at the bottom of the bottle after long time standing. In order to enhance the accuracy of detection results, all samples should be shaken to make the impurities suspended before shooting. Then, the obtained RGB format images of mineral water samples are transformed into HSI color format. After that, the Gaussian filtering is applied to the images for the following image  Fig. 3 displays the results of edge detection for the mineral water sample. It is observed that the contour of the mineral water bottle was identified after the edge detection. Then, the impurities inside the outline would be detected. As the color of the bottle is close to the background, the detected edge of the mineral water bottle is discontinuous. However, this discontinuity doesn't affect the following impurities detection.  In this region, the detected impurities would be marked by red dots. It is observed that there are no marked red dots in Fig. 4(a), which means that the bottled mineral water is qualified. However, the regions containing impurities in the image are marked by red dots in Fig. 4(b). Once the red dots exist in the detection region, it means the mineral water is unqualified, which should be removed from the industrial assembly line. At the same time, the source of impurities should be found to avoid more mineral water being polluted. In addition, the samples with impurities would be filtered, refilled, and tested again. Therefore, this computer vision based system could effectively improve the accuracy and efficiency of impurities detection.

Conclusion
Bottled mineral water is an indispensable drink in our daily life. It's important for us to guarantee quality of the products. In this study, we established a machine vision based system to detect the impurities in bottled mineral water. The images of the bottled mineral water are recorded in real-time with the help of high speed industrial camera. In order to reduce the effect of environmental brightness on the industrial assembly line, the obtained RGB model images are transformed into HSI color format. Then, the contour of the bottle is obtained after edge detection. According to the corresponding threshold of the hue and saturation for bottled mineral water, the image segmentation is carried out. After that, all impurities could be detected in the region inside the bottle, marked by red dots. Unqualified bottled mineral water would be removed from the industrial assembly line for subsequent processing. This machine vision based system could effectively improve the accuracy and efficiency of impurities detection.