Engineering Science and Technology, An International Journal
Engineering Science and Technology, An International Journal
a r t i c l e i n f o a b s t r a c t
Article history: Key technologies in empty bottle inspection systems are studied in this paper to solve detecting error and
Received 13 July 2017 poor adaptability problems. Those technologies have two different approaches: the ones in the first group
Revised 5 January 2018 locate and track bottle mouth, bottle bottom and walls while the other group technologies involve defect
Accepted 10 January 2018
detecting. Such vision inspection systems are required to perform with high accuracy and adaptability
Available online 1 February 2018
under high speed and mechanical vibration working conditions. This study proposes distinctive algo-
rithms for bottle locating, tracking and defect detecting based on inspection requirements and images
Keywords:
of bottle mouth, bottom and walls. On the premise of satisfying the inspecting requirements, the simplic-
Machine vision
Bottle inspection
ity, ease of implementation and universality of the algorithms are considered to improve the detection
Region location speed and the adaptability of the system to different kinds of bottles. Experiments showed that the sys-
Image tracking tem proposed in this paper can improve the detection accuracy and speed.
Defect detection Ó 2018 Karabuk University. Publishing services by Elsevier B.V. This is an open access article under the CC
BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).
1. Introduction countries due to the beer and beverage industry standards are dif-
ferent from country to country. In China, for example, the low qual-
Glass bottles in beer filling line must be inspected prior to fill- ity and reutilization of empty bottles often lead to high false
ing. Located after the bottle washing machine and before the filling detection rate [8]. Therefore, it is still a hotspot for research and
machine, an quality inspection system is used to inspect empty development of an empty bottle detection system. [22,25]
bottles on line as an important component of the automatic filling designed an empty bottle defect detection system, respectively.
line [15]. It is an intelligent equipment with machine vision, preci- However, they did not specify the implementation and perfor-
sion machinery and real-time control, which mainly consists of mance of the system. He [6] described the methods of image acqui-
pre-inspection unit, wall inspection unit, mouth inspection unit, sition and processing, but there is no further discussion on how to
bottom inspection unit, control unit and human–computer interac- do that. The authors in Refs. [14,16,17,26] researched the location
tion unit and man–machine interface unit, as shown in Fig. 1. The of empty bottles and realized the tracking of bottle mouth and bot-
main functions include bottle mouth breakage inspection, the dirt tom image. A method of bottle mouth inspection based on Extreme
and foreign body inspection of the bottle mouth, bottom and the Learning Machine is proposed in Ref. [13], and the detection rate
wall and rejecting the bottles unqualified in time [11]. can be reached to 99.41%. Huang et al. [7] researched the method
The research of beer bottle inspection using machine vision of bottle defect classification and realized the recognition of bottle
technology began in the 1990s. At present, some big companies, mouth defects using Support Vector Machine with recognition rate
such as Heuft, Krones, Miho in Germany and Filtec in America, have 91.6%. In addition, some methods about defect detection of bottle
their own empty bottle inspection systems, which have been mouth are described in Ref. [12,23,3,19]. Jaina George et al. [2]
applied to beer beverage production lines. The study of an empty researched defect detection of bottle wall based on Fuzzy C Means
bottle inspection system mainly focuses on how to improve the Clustering. The authors in Ref. [5] proposed an algorithm of bottom
detection accuracy, speed and reliability. Moreover, the above detection and achieved good results. To solve the problem that
products mentioned are not ideal in practical application in some detection result is affected by pattern on glass bottle, Zheng et al.
[27] propose a glass bottle texture area detection algorithm of
phase only based transition, which can achieve the detection rate
⇑ Corresponding author at: School of Control Science and Engineering, Shandong
97%. However, the studies above just involve in some aspects of
University, 17923, Jingshi Road, Ji’nan 250061 China.
empty bottle vision inspection system, and the results are not sat-
E-mail address: [email protected] (S. Ma).
isfactory. Therefore, the key technologies of empty bottles visual
Peer review under responsibility of Karabuk University.
https://doi.org/10.1016/j.jestch.2018.01.004
2215-0986/Ó 2018 Karabuk University. Publishing services by Elsevier B.V.
This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).
160 B. Huang et al. / Engineering Science and Technology, an International Journal 21 (2018) 159–169
Fig. 3. Results of bottom location (a) Original image (b) Image by edge detection (c) Image filtered by chain code tracking (d) Image by circle detection.
162 B. Huang et al. / Engineering Science and Technology, an International Journal 21 (2018) 159–169
8
< Pe1 ðx; yÞ; Dd 2 ½d3 r3 ; d3 þ r3 [ ½0; r4
>
Pi ðx; yÞ ¼ Pe2 ðx; yÞ; Dd 2 ½d2 r2 ; d2 þ r2 ð6Þ
>
:
U; Dd 2 ½d1 r1 ; d1 þ r1
where Dd is the distance between the edge points Pe1 and Pe2 on the
same scanning line. Three kinds of distance d1, d2 and d3 are defined
according to the position of the edge points as shown in Fig. 8. r1,
r2, r3 is the permissible error of d1, d2, d3, respectively, and r4 is
the permissible error of area 0.
Most of the elements of set Pi are the points on the circle after
the first classification.
Step 2. The second classification
In order to obtain the points of the middle circle, it is neces-
sary to classify set Pi. Suppose the coordinate of the element of
Pi with h scanning direction is Pi(x,y) and the element’s in the
opposite direction is Pi+180(x,y). The starting angle and ending
angle are 0 and 180, respectively, with every 10 degrees for a
scanning angle interval. After classification, the coordinate of
the point is Pterminal(x,y), the edge point set is Qi(N) and N is the
size of the set, Ddiameter is the statistic of bottle mouth diameter
and rd is permissible error of Ddiameter.
The flowchart of the classification algorithm is shown in Fig. 9,
and the elements of set Qi obtained by classifying twice are the
points on the middle circle.
Finally, the center and radius of the circle can be obtained, and
the results are shown in Fig. 10. In the figure, the dotted circle is
the fitting circle, and the intersection is the position of the circle
Fig. 8. The edge points position. center.
164 B. Huang et al. / Engineering Science and Technology, an International Journal 21 (2018) 159–169
Fig. 10. The results of fitting circle. Fig. 11. Detection area division of bottle well.
The circle fitting method used above can track the detection than that in tracking accuracy. Therefore, the algorithm proposed
area of bottle mouth accurately with the error in the range of in this paper can improve the tracking accuracy under the premise
allowable. Meanwhile, the running time of the algorithm can meet of meeting the requirements of detection speed.
the speed requirements of 72,000 bottles per hour.
The circle fitting method used above can track the detection 2.3. Bottle wall inspection
area of bottle mouth accurately with the error in the range of
allowable. Meanwhile, the running time of the algorithm can meet 2.3.1. Detection area division of bottle well
the speed requirements of 72,000 bottles per hour. In order to improve the detection speed, the image of bottle
wall is divided into four different detection areas: bottle mouth,
bottleneck, bottle shoulder and bottle body, as shown in Fig. 11.
2.2.5. Tracking effect testing Because of bottle structure and the bottle washing process on fill-
The testing of detection region tracking is carried out using the ing line, foreign matters are easy to adhere to bottleneck and bottle
improved Hough Transform detection algorithm [18], barycenter body. Therefore, it demands a higher accuracy relatively. Because
method [9] and the proposed method in this paper, respectively, the pattern on the bottle shoulder decreases the detection accu-
on a 2.4G CPU P4 computer. A total of 5000 image samples are racy, this area can be detected with lower demands. In order to
acquired at the test platform’s speed of 36,000 bottles per hour. increase the computing speed, distinct processing methods can
Tracking accuracy and time consumption of the three algorithms be used according to different detecting areas.
above are shown in Table 1. It shows that the tracking accuracy
of the proposed method in this paper is close to the algorithm of 2.3.2. Detection area tracking
improved Hough Transform, with error of 1 or 2 pixels, but time The position of a bottle in each image may vary during trans-
consumption is less than it obviously. The proposed method is portation at high speed because of mechanical vibration and time
not good as Barycenter method in time consumption, but is better error of image acquisition. Therefore, a specific automatic tracking
algorithm must be used to ensure the subsequent area detecting
Table 1 and processing in the right region.
Tracking accuracy and time consumption of the three algorithms.
The tracking of detection area focuses on how to acquire the
Experimental date Algorithm centerline of the bottleneck, which need to obtain its X axis coor-
Improved Barycenter Proposed dinates. The specific steps are as follows.
Hough method method in this Step 1. Linear scanning in horizontal direction is applied to bot-
Transform paper tleneck image to get edge points, which are the points with a sud-
The average error of the 1 3 1 den change in gray value.
center coordinate x Step 2. Then the X axis coordinates of the bottleneck centerline
(pixel) can be calculated using Eq. (8), and this can be taken as a reference
The average error of the 1 4 1
center coordinate y
value of X coordinates labeling the region center.
(pixel) xa þ xb
The maximum error of the 2 5 2 xc ¼ ð8Þ
2
center coordinate x
(pixel) where xc is a reference value of X-coordinate of central point; xa and
The maximum error of the 2 6 2 xb are the left and right edge points, respectively, on the same scan
center coordinate y
line.
(pixel)
The average error of the 1 3 1 Step 3. Count the number of times of xc appeared at different
center coordinate (pixel) values and get the distribution of the bottleneck center value. Thus
The maximum error of the 2 3 1 a range can be obtained and the occurrence number of reference
radius r (pixel)
value of central point in this range can be calculated using Eq. (9).
The average error of the 1 2 1
radius r (pixel) X
xþK
Time consumption (ms) 20 3 3–3.5 SðxÞ ¼ Nðxc Þ ð9Þ
(P4 2.4GCPU) xc ¼x
B. Huang et al. / Engineering Science and Technology, an International Journal 21 (2018) 159–169 165
where N(x) is the occurrence number of xc at x and K is the range Set an area threshold value ts and if Aj is greater than Ts, the con-
given. Different S(x) values can be obtained by changing initial point nected domain may be defect area, otherwise it may be the noise
and the central point most likely to be in the area where S(x) value area and should be removed
is maximum. Bottle mouth image with defects and the results of connectivity
Step 4. The final value of central point in this area can be analysis of the three regions are shown in Fig. 12. The area thresh-
obtained by the method of averaging. old value is 30 pixels, and the feature extraction results are shown
PxþK in Table 2. In the table, there are three connection domains in
C ¼ xC ¼x ½NðxC Þ xC region A with labels 0, 1 and 2. The four columns on the right
X ð10Þ
Smax ðxÞ describe the features of the connection domains.
where the value range of xc is the area where S(x) value is maxi-
mum, and the location of processing area of a bottle body can be 3.1.2. Defect recognition
C. The method based on connected domain search introduced in
determined by X
the above section is used to extract the following features in the
three regions in a bottle mouth image.
3. Visual defect detection algorithm for empty bottles
(1) The number of defect areas F b ð1Þ ¼ N d ;
3.1. Bottle mouth defect detection PN b
(2) The total area of defect areas F b ð2Þ ¼ j¼1 j:Aj ;
The processing area of bottle mouth can be obtained after get- (3) The area of the largest in the defect areas F b ð3Þ ¼ Am ;
ting its actual location. In order to improve the processing speed, (4) The width of the defect areas F b ð4Þ ¼ W j ;
fixed threshold is applied in the binary segmentation of bottle (5) The distance from the center of defect area to the center of
mouth image because of the obvious contrast between the target circular ring F b ð5Þ ¼ Db ;
and background regions. According to the image characteristics (6) The posture ratio of defect areas F b ð6Þ ¼ Bj ;
and the regions defined in Section 2.2 (Fig. 4, the defect detection
of bottle mouth involves fracture detection in region B and spotti- After features extraction, defect areas are judged using the rule
ness detection in regions A and C. as follows:
Fig. 12. The results of connectivity analysis (a) Original image (b) The results of region A (c) The results of region B (d) The results of region C.
Table 2
The results of feature extraction from the connection domains in bottle mouth image.
Fig. 15. Bottle wall image connectivity analysis and defect judgment (a) The original image (b) The image of results.
The results of bottle bottom defect recognition based above PR 2. Bottle bottom detection
algorithm are shown in Fig. 14 where (a) and (b) are the images 1. Should detect stains with 2 mm 2 mm size on the circu-
with defects after preprocessing and (c) and (d) are the results of lar region form bottle bottom center to the inside of anti-
defect recognition. Because the foreign matter in image (a) is lar- slip grain.
ger, the result, as shown in image (c), can be obtained using the 2. Should detect stains with 3 mm 3 mm size in the circu-
Blob algorithm directly without considering the interference of lar region of anti-slip grain.
anti-skid grain. For a foreign matter with a small sectional area, 3. The detection rate of the unqualified bottle bottom is
for example a long hair in image (b), Fourier transform and inverse more than 99%.
transform algorithms must be used to filter out the anti-skid grain PR 3. Bottle wall detection
to eliminate the interference of the regular texture feature, and the 1. Should detect stains with 6 mm 6 mm size in the region
processing result is image (d). of bottle body (except the pattern area of bottle shoulder),
bottle neck and the outside of bottle mouth.
3.3. Bottle wall defect detection 2. Should detect stains with 6 mm 6 mm size in the pat-
tern area of bottle shoulder.
Considering the requirements of accuracy and speed, we use 3. The detection rate of the unqualified bottle wall is more
maximum between-class variance method to segment the bottle than 99%.
wall image. The same connectivity analysis method as bottle 4. In order to test the reliability, accuracy and speed of the
mouth and bottom is adopted to process the four regions to obtain system, a test platform for online empty bottle inspection
the defect features after image segmentation and then determine system, as shown in Fig. 16, is designed to simulate the
whether each connected domain detected is defective by the fea- actual production situation.
tures such as centroid position, body ratio, area, and so on [21].
The image processing is shown in Fig. 15. 4.2. Result and discussion
4. System testing In this experiment, the test is conducted at the speed of the test
platform 3600 bottles per hour. The test results are shown in
4.1. Test requirement and platform Table 3. In the table, Nt is the total number of bottles, Nd is the
number of defective bottles, Dd is the number of defective bottles
Take the performance index of an online empty bottle inspec- detected, De is the number of bottles error detected, rq is the detec-
tion system in current market as the standard of our research. tion rate of qualified bottles, rd is the detection rate of defective
From the view of practicability, stability, reliability and low cost, bottles and re is the error-detected rate. rq, rd and re are defined
the performance requirements (PR for short) of the system are as as follows:
follows [10]: Nt N d De
rq ¼ 100% ð13Þ
Nt Nd
PR 1. Bottle mouth detection
1. Should detect the sealing face damage with a size of seal- Dd
ing face width, length, and depth of 2 mm, accurately. rd ¼ 100% ð14Þ
Nd
2. Should detect opaque stains with 2 mm 2 mm size on
sealing surface. De
3. The detection rate of unqualified bottle mouth is more re ¼ 100% ð15Þ
Nt
than 99%.
168 B. Huang et al. / Engineering Science and Technology, an International Journal 21 (2018) 159–169
Fig. 16. Test platform for online empty bottle inspection system.
Table 3
Acknowledgements
Test results of bottle detection.
The authors would like to express their profound gratitude to
Nt Nd Dd De rq rd re
the Vanta Packaging Machinery Co., Ltd, PR China, for providing
Bottle mouth 4318 110 110 7 99.83% 100% 0.16% partial financial support for the study.
Bottle bottom 4100 100 100 18 99.55% 100% 0.44%
Bottle walls 3830 90 90 2 99.55% 100% 0.05%
References
As the chart shows, the detection rate of bottle mouth, 1-re, is [1] John Canny, A computational approach to edge detection, Pattern Anal. Mach.
99.84%, which is the highest when compared with Ref. [13] with Intell. 8 (6) (1986) 679–697.
[2] Jaina George, S. Janardhana, J. Jaya et al., Automatic defect detection
99.41%, Ref. [7] with 91.6% and Ref. [3] with 97.8%. Similarly, the inspectacles and glass bottles based on Fuzzy C Means Clustering, in:
detection rate of bottle walls in Ref. [27] is 97%, which is lower International Conference on Current Trends in Engineering and Technology
than the detection result in this paper. Although the detection (2013) 8–12.
[3] Keyou Guo, Libing Lian, Na. Li, et al., Research on beer bottle mouth damage
rate of bottle bottom is the lowest in the three test items in this detection system based on OpenCV, Manuf. Automat. 15 (2014) 61–63.
paper, it is higher than Ref. [25], which can achieve detection rate [4] Bin He, Tianyu Ma, Yunjuan Wang, et al., Visual C++ Digital Image Processing,
98%. second ed., Posts and Telecom Press, Beijing, 2002.
[5] Bin Huang, Sile Ma, Yufeng Lv, et al., Research on bottom detection in intelligent
empty bottle inspection system, Telkomnika 11 (10) (2013) 5571–5578.
5. Conclusions [6] Xiaohu He, Empty bottle inspection method to realize image acquisition
technology based on computer vision, Food Machinery 32 (5) (2016) 105–107.
[7] Zhihong Huang, Jianxu Mao, Yaonan Wang, et al., Research on beer bottle
A visual inspection system for empty bottle quality detection is defect classification detection method based on machine vision, J. Electr. Meas.
introduced in this paper, and it includes mainly detection regions Instrum. 30 (6) (2016) 873–879.
[8] Jing Kang, The Application of Image Analysis in Industrial Production: Defect
location and defect detection. The precise location and tracking Detection of Beer Bottles and Research on its key Technologies, Nanjing
of the detection regions of the empty bottle are realized by distinct University of Posts and Telecommunications, 2015.
location and tracking algorithms proposed in detection regions [9] Zhaohui Liu, Yanwen Yan, Xu. Lutie, Remote laser facula monitoring system of
terminal guidance ammunition, Laser Infrared 36 (2) (2006) 88–91.
location according to the different characteristic of bottle mouth, [10] Minmin Liang, Research and Development of Online High Speed Intelligent
bottle bottom and bottle walls. In the process of bottle mouth posi- Empty Bottle Inspection System, Shandong University, 2008.
tioning and tracing, the speed and accuracy are improved by using [11] Minhua Lan, Application of controlling technology on the empty bottle
inspection, Mech. Electr. Eng. Technol. 40 (8) (2011) 133–136.
edge points double classifying and least squares fitting algorithm [12] Na Li, The Research on Beer Bottle Mouth Defect Inspection System, Beijing
for the problem of the bigger position error caused by bottle shak- Technology and Business University, 2013.
ing. In the defect inspection, the bottle mouth and bottom detec- [13] Muxing Li, Zhihong Huang, Research on beer bottle defect detection method
based on extreme learning machine, Comput. Technol. Automat 35 (4) (2016)
tion methods are mainly researched. In the bottom defect
117–120.
detection, the anti-skid grain at bottom is filtered effectively using [14] Sile Ma, Bin Huang, Huajie Wang, et al., Algorithm research on location of
improved Fourier transform algorithm to eliminate the effect of it bottle mouth and bottom in intelligent empty bottle inspection system, IEEE
on the detection results. Experiments showed that the system pro- Int. Conf. Automat. Log. (2009) 819–824.
[15] Sile Ma, Huiquan Wang, Zengben Hao et al., Application research of machine
posed in this paper can effectively improve the detection accuracy vision technique in intelligent empty bottle inspection system, in: The 8th
and speed. World Congress on Intelligent Control and Automation. (2010a) 4462–4466.
B. Huang et al. / Engineering Science and Technology, an International Journal 21 (2018) 159–169 169
[16] Sile Ma, Bin Huang, Yanli Wu et al., Algorithm Research on detection Region [22] Wenhua Wang, Xiaopeng Li, Design of the beer bottle detection system based
Tracking of Bottle Mouth Image in Intelligent Empty Bottle Inspection System, on machine vision, Electr. Qual. 9 (2014) 35–38.
in: 2010 8th World Congress on Intelligent Control and Automation. (2010b) [23] Xianhua Xia, Jingming Xie, Fengkai Ke, et al., Research and development of
6073–6077. glass bottle online detection system based on machine vision, Machinery
[17] Sile Ma, Bin Huang, Yinzhou He, et al., Implementation of fast positioning for Electr. 11 (2013) 67–70.
the bottom of bottle in intelligent empty bottle inspection system, Process [24] Jinfeng Yang, Research and Application of Machine Vision Technology in
Automat. Instrum. 33 (10) (2012) 39–41. Empty Bottle Inspection System, Shandong University, 2008.
[18] Milan Sonka, Vaclav Hlavac, Roger Boyle, Image Processing, Analysis, and [25] Yu. Xiaoning, Fengping Zhang, The implementation of the empty bottle defect
Machine Vision, third ed., CL-Engineering, 2007. detection system design and implementation, Electr. Des. Eng. 24 (13) (2016)
[19] Jiming Sa, Jie Zhang, Jinlin Zhou et al., Defect detection of transparent bottle 80–84.
mouth online, in: The 12th International Conference on Signal Processing. [26] Xian’en Zhou, Yaonan Wang, Kangjun Li, et al., New bottle mouth positioning
(2014) 747–750. method based on multiple randomized circle detection and fitting degree
[20] Huajie Wang, Research on Intelligent Empty Bottle Inspection System Based evaluation, Chin. J. Sci. Instrum. 36 (9) (2015) 2021–2029.
on Machine Vision, Shandong University, 2007. [27] Yexin Zheng, Yaonan Wang, Xianen Zhou, et al., Empty bottle texture area
[21] Huiquan Wang, Research and Development of Online Empty Bottle Inspection defect detection based on POBT, J. Electr. Meas. Instrum. 31 (4) (2017) 549–
System Based On Machine Vision System, Shandong University, 2010. 558.