0% found this document useful (0 votes)
84 views11 pages

Engineering Science and Technology, An International Journal

This document discusses research on machine vision technologies for empty bottle inspection systems. It proposes algorithms for bottle locating, tracking, and defect detection based on images of the bottle mouth, bottom, and walls. The algorithms aim to improve detection accuracy and speed while maintaining simplicity, ease of implementation, and adaptability to different bottle types. Experiments showed the proposed system improved detection accuracy and speed compared to other approaches.

Uploaded by

jeanca32
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views11 pages

Engineering Science and Technology, An International Journal

This document discusses research on machine vision technologies for empty bottle inspection systems. It proposes algorithms for bottle locating, tracking, and defect detection based on images of the bottle mouth, bottom, and walls. The algorithms aim to improve detection accuracy and speed while maintaining simplicity, ease of implementation, and adaptability to different bottle types. Experiments showed the proposed system improved detection accuracy and speed compared to other approaches.

Uploaded by

jeanca32
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Engineering Science and Technology, an International Journal 21 (2018) 159–169

Contents lists available at ScienceDirect

Engineering Science and Technology,


an International Journal
journal homepage: www.elsevier.com/locate/jestch

Full Length Article

Research and implementation of machine vision technologies for empty


bottle inspection systems
Bin Huang, Sile Ma ⇑, Ping Wang, Huajie Wang, Jinfeng Yang, Xinyi Guo, Weidong Zhang, Huiquan Wang
School of Control Science and Engineering, Shandong University, Ji’nan, China

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

Step 3. Calculate the gradient direction


 
Gx
h ¼ arc tan h ð4Þ
Gy
Step 4. Apply non-maximum suppression on dense edge points
from gradient operation. The non-edge points can be eliminated
along the gradient of the contour. Through the direction of the gra-
dient, the adjacent pixels of one pixel in the direction of the gradi-
ent can be fixed. If the amplitude of the central point in the
neighborhood is not larger than that of the two adjacent points
in the direction along the gradient line, then this point is a non-
edge point.
Fig. 1. Structure diagram of the empty bottle inspection system (1) Initial Step 5. Calculate thresholds using cumulative histogram. All
inspection (2) Residual liquid inspection (3) Bottle wall inspection (4) Operation pixels that their gradient values are larger than the high threshold
and control unit (5) Control panel and bottle mouth image acquisition device (6) must be elements of the edge; those which are smaller than the
Bottle bottom image acquisition device (7) Gearing (8) Bottle wall inspection (9)
low threshold must be not. When the gradient value of a pixel is
Reject apparatus (10) Rejection confirm.
between the high and low thresholds, whether the pixel is one ele-
ment of the edge depends on its adjacent pixels. If there is pixel
inspecting are studied in this paper based on Refs. belonging to the edge in its adjacent pixels, then it is; otherwise,
[20,10,24,14,15,16,17,21,5], and the methods presented are suc- it is not. If there are, then it is; otherwise, it is not.
cessfully applied to the inspection system.
The rest of the paper is organized as follows. Section 2 describes 2.1.3. Bottom positioning
the inspection area location and tracking. Section 3 expresses In the process of empty bottles transmission at high speed, the
visual defect detection algorithm of empty bottles. Experimental bottle bottom position in each image may vary because of mechan-
results and discussion are reported in Section 4. The conclusion ical vibration and time error of image acquisition. Therefore, it is
is presented in Section 5. necessary to calculate the position of the bottle bottom in each
image accurately to ensure it is in the region of interest. In practical
2. Inspection locations of bottles and their tracking application, the required velocity of empty bottles detecting is up
to 20 bottles/s, so it is crucial to develop a quick and efficient posi-
2.1. Bottle bottom inspection tioning algorithm to improve the performance of the system.
Bottom positioning is actually circle detection in the image of a
2.1.1. Image preprocessing bottle bottom. Therefore, in order to obtain all parameters of the
Because of the high speed movement of empty bottles on trans- circle quickly and efficiently, the clutter edge is filtered first and
mission, the original images captured by CCD camera are not ideal then gets the parameters of the circle on this basis.
such as noise interference and uneven illumination, which may After edge detection, the image of a bottle bottom contains
appear when the target deviates from the center of the light source. abundant edge information, in which some edges unimportant or
Therefore, five nearest neighbor smoothing filter is used to remove irrelevant to bottom positioning will influence the effect of loca-
noise and Eq. (1) is employed to achieve the grayscale transforma- tion greatly. Therefore, these unnecessary edges must be filtered.
tion to enhance image contrast and improve the effect of output Firstly, calculate the perimeter of each edge using equation as
images. follows.
8 11 pffiffiffi
< 27 ½f ðx; yÞ  120 þ 200 120 6 f ðx; yÞ 6 255
> perimeter ¼ ne þ 2n0 ð5Þ
gðx; yÞ ¼ 37 ½f ðx; yÞ  30 þ 15 30 6 f ðx; yÞ < 120 ð1Þ
>
:1
18 Here, ne is the number of the chain code with even numbers,
2
f ðx; yÞ 0 6 f ðx; yÞ < 30 and n0 is the number of the chain code with odd numbers. The even
where f ðx; yÞ is the original image and gðx; yÞ is the image after numbers in the chain code represent horizontal and vertical direc-
grayscale transformation. tions, and the odd numbers represent the other directions.
Then the unnecessary edges can be removed according to the
perimeter threshold set after calculating each edge perimeter by
2.1.2. Edge detection Chain-code tracing.
After enhancing the contrast of images, edge detection of a bot- After clutter edge filtering, the algorithm shown in Fig. 2 for cir-
tle bottom is achieved in this paper using the following algorithm cle detection is employed to improve the real-time performance of
[1]. circle detection, and the specific steps can be obtained from the fig-
Step 1. Smooth the image using the equation as follows. ure. Where D is an edge point set, p is circle parameter, P is a unit
Gðj; kÞ ¼ G0 ðj; kÞ  Fðj; kÞ ð2Þ set of circle parameter, K is cycle times, and Mmin is the set value of
the minimum pixel number of a circle.
Here, Fðj; kÞ and Gðj; kÞ denote images of input and output. The results of bottom location are shown in Fig. 3.
 
2
j2 þk
While G0 ðj; kÞ is filter template, and G0 ðj; kÞ ¼ 2pr
1
2 exp  2r2
,
2.2. Bottle mouth inspection
r2 is variance, which shows the range of smooth.
Step 2. Find out the partial derivatives ðGx ; Gy Þ of image gray Bottle mouth location and tracking are the most difficult tasks
level along the two directions using derivative operator and obtain in empty bottle vision inspection. The speed and accuracy of this
gradient. step have a great influence on the performance of the inspection
qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi system. The region of interest in a bottle mouth image is defined
jGj ¼ G2x þ G2y ð3Þ in order to improve the processing speed. The regions of three rings
in the image are defined as areas A, B and C successively, as shown
B. Huang et al. / Engineering Science and Technology, an International Journal 21 (2018) 159–169 161

Fig. 2. Circle detection algorithm.

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

Fig. 4. Regions dividing of a bottle mouth image.


Fig. 5. The minimum rectangle region of bottle mouth image fluctuation.

in Fig. 4. Region A, the circular area, is the image of sealing surface;


region B is the middle circular ring in the image; and region C is the
area from out edge of the middle circular ring to the outside of bot-
tle mouth illuminated by a light source. The date needs to be pro-
cessed can be reduced greatly if we consider the three regions only.
The bottle mouth position is different in each image because of
high speed, mechanical vibration, time error of image acquisition,
and the poor quality of a bottle neck. This means that the process-
ing region is unfixed. Therefore, it is necessary to determine the
size and position of the region need to process. This means that
we need to determine the center coordinates, the inner and outer
diameters of the three circles according to the feature of a bottle
mouth image.
The difficulty here is that the width of region B is 4 to 5 pixels
only, so the absolute errors of the extracted features, such as the
coordinate of circle center, inner radius, outer radius, must be within
2 pixels. Therefore, the automatic detection and tracking algorithm Fig. 6. Radial scanning.

should have the advantages of minor calculation and high accuracy.


Therefore, an algorithm of region tracking is proposed in this
The edge point set Ci contains 72 edge points extracted using
paper. The focus shifted to the domain of lines crossing the bottle
above algorithm because two edge points can be obtained from
mouth edge and grayscale scanning along the lines is applied. Then
every scanning line segment. There are 36 points belonging to
the edge point sets of bottle mouth image can be acquired by clas-
inside edge and 36 to outside edge in set Ci, i = 1,2,..0.72.
sifying the saltation grayscale pixels obtained. Finally, the least-
square circle fitting is applied to the image edges to get bottle
mouth parameters. Experiments show that the algorithm proposed 2.2.3. Classification of the edge point set Ci
can improve the speed and precision of positioning significantly. After studying the image characteristics of 2000 bottles mouth,
the contour of bottle mouth in images can be divided into three
classes. The bottle mouth images with three circles are classified
2.2.1. Rough estimation of the region of image fluctuation
as the first category, as shown in Fig. 7(a). The images with outside
A total of 500 bottles are chosen as samples to estimate the
and middle circles or middle and inside circles are classified as the
minimum rectangle region of bottle mouth images fluctuation
second category, as shown in Fig. 7(b) and (c), while Fig. 7(d)
roughly. The deviation of bottle mouths in image sequences in hor-
shows the third category, which only has one circle in the image.
izontal and vertical directions is recorded during the process of
The most of gray discontinuous points are on the three dark cir-
obtaining the region, as shown in Fig. 5. The barycentric coordinate
cles in the bottle mouth image, so the two edge points Pe1 and Pe2
O(X0,Y0) of rectangular region is taken as the circle center coordi-
extracted from every scanning line segment are on them probably.
nates of the domain of lines.
If points Pe1 and Pe2 belong to the circles, the relative position of
them will conform to the structural characteristics of the bottle
2.2.2. Radial scanning mouth. Therefore, the relative position parameters of the three
A method of saltation grayscale pixel analysis based on radial dark circles can be used to classify the edge point set Ci twice. Sup-
scanning in linear domain is proposed in our research [24]. A pose the edge point set is Pi after the first classification and is Qi
spoke-structure line group with the same circle center is selected, after the second operation, the points of Qi are those in the middle
and the lines pass through the inside and outside edges of bottle circle.
mouth image, as shown in Fig. 6. The line group consists of 36 line Step 1. The first classification
segments with same angle between them and bi-directional radial In the set Ci, the points located in the middle circle can be clas-
scanning method is adopted. The specific algorithm is described in sified as set Pi after the first classification, and the specific classifi-
the Ref. [16]. cation algorithm is implemented by Eq. (5).
B. Huang et al. / Engineering Science and Technology, an International Journal 21 (2018) 159–169 163

Fig. 7. Contour features of bottle mouth.

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.

2.2.4. Bottle mouth contour fitting


Suppose the standard equation of a circle is x2+y2+Dx + Ey+F = 0
and substitute the coordinates of the edge point obtained above
into this equation. Then, using the method in Ref. [14], we can
obtain the center coordinates and radius as Eq. (7).

Fig. 9. The flowchart of classification algorithm.


8  
< Oðx0 ; y0 Þ ¼  D20 ;  E20
qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ð7Þ
: R ¼ 1 D2 þ E2  4F 0
2 0 0

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:

If ðAj P T j Þ Y j ¼ 1; else Y j ¼ 0 ð11Þ


3.1.1. Feature extraction
P
In the binary image obtained by threshold segmentation, the where Aj ¼ 6i¼1 wij FðijÞ, wij is the weight of the ith feature in the jth
gray value of the background area in region B is 255 and the target area, F(ij) is the ith feature in the jth area, Tj is the defect judgment
area, i.e. defect area, is 0. In contrast, the value of background area threshold of the jth area, Yj is the judgment result of the jth area.
of regions A and C is 0 and target area is 255. In this paper, the Run- Yj=1 means that there are defects in area j, while Yj=0 represents
length encoding algorithm is applied to analyze the connectivity. there are not.
Numbered the connected domains obtained successively and Analyze the three target regions in a bottle mouth image suc-
the serial number Nd of the last one is the number of connected cessively, and output, respectively, the result Yj which denotes
domains, which are the defect areas probably. Suppose the area whether there are defects in this region. Then the defects in a
of connected domain is Aj and it is used to pre-judge the defects. bottle mouth are judged using the following rules.

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.

Label of connection Feather category


domains
Domain area (pixels) Domain length (pixels) Domain width (pixels) Posture ratio
Region A 0 1076 74 32 2.31
1 297 39 20 1.95
2 96 18 10 1.80
Region B 0 59 99 44 2.25
1 82 17 9 1.89
Region C 0 208 29 12 2.42
1 64 32 6 5.33
166 B. Huang et al. / Engineering Science and Technology, an International Journal 21 (2018) 159–169

Moreover, the products, such as Heuft, Krones, Miho and Filtec,


are not ideal in practical application in some countries because of
industry standards, the low quality or reutilization of empty bot-
tles. The high false detection rate mainly focuses on the bottle
mouth detection because the defects are liable to occur in a bottle
mouth. Therefore, the threshold Tj in Eq. (11) can be adjusted
according to the detecting demands in this paper to improve the
adaptability of the inspection system.

3.2. Bottle bottom defect detection

There are two detecting regions in the image of a bottle bottom


according to its imaging characteristics, as shown in Fig. 13. Region
B is a surface, so Blob algorithm based connection domain is
adopted to inspect the defect. Region A is an area with anti-skid
grain, which can affect the detection result greatly. Therefore, it
Fig. 13. Detection regions dividing of bottle bottom. is necessary to filter out the patterns using a special algorithm
! before detecting defects by Blob algorithm.
X
3
Fourier transform and inverse transform algorithms are used to
if Y j ¼ 0 d ¼ 0; else d ¼ 1 ð12Þ
filter out the regular texture feature according to the characteris-
j¼1
tics of anti-skid grain at a bottle bottom [20]. After Fourier trans-
where d is the defect recognition result of bottle mouth. If d = 0, form, the regular texture features become frequency elements
there is no defect and the bottle inspected is qualified; and if d = with their power distributed in a ring. The frequency elements
1, it means the bottle has defect and it is unqualified. with high power distribute mainly around the central point, and
The judgment algorithm above involves in simple linear opera- the intensity of their power decreases with the ring radius increase
tion only, so the results can be obtained easily and quickly. Fur- [4]. Choose an optimal radius and remove the frequency elements
thermore, the algorithm is based on the comprehensive analysis of the central point and the range out of the radius and then restore
of the features of multiple connection domains in the target area. the image using inverse Fourier transform. Thus the regular texture
Therefore, it has higher accuracy if the weights and thresholds can be filtered out; the bottle bottom image without anti-skid
are selected properly. Furthermore, it can eliminate the noise grain can be obtained finally after the steps above. The specific
interference because multiple features are considered. algorithm is described in the Ref. [5].

Fig. 14. Bottle bottom image processing and defect recognition.


B. Huang et al. / Engineering Science and Technology, an International Journal 21 (2018) 159–169 167

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.

You might also like