CN115713485A - Defect detection method for insufficient glass bottle opening - Google Patents

Defect detection method for insufficient glass bottle opening Download PDF

Info

Publication number
CN115713485A
CN115713485A CN202211281486.1A CN202211281486A CN115713485A CN 115713485 A CN115713485 A CN 115713485A CN 202211281486 A CN202211281486 A CN 202211281486A CN 115713485 A CN115713485 A CN 115713485A
Authority
CN
China
Prior art keywords
area
line segment
bottle
slope
curve
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211281486.1A
Other languages
Chinese (zh)
Inventor
陈尧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yueyang Yuhua Glass Products Co ltd
Original Assignee
Yueyang Yuhua Glass Products Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yueyang Yuhua Glass Products Co ltd filed Critical Yueyang Yuhua Glass Products Co ltd
Priority to CN202211281486.1A priority Critical patent/CN115713485A/en
Publication of CN115713485A publication Critical patent/CN115713485A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The invention provides a defect detection method for insufficient bottle mouth of a glass bottle, which belongs to the technical field of defect detection of the bottle mouth of the glass bottle and comprises the following steps: carrying out binarization processing on a glass bottle photo, removing background and miscellaneous points to obtain effective pixels of a bottle opening to-be-detected area, then generating a minimum external rectangle of the effective pixels, then obtaining a bottle opening curve in the rectangular area, carrying out line segment fitting on the bottle opening curve to obtain coordinates and a slope of a fitting line segment, arranging the slopes of the fitting line segment in an ascending order from left to right according to a horizontal coordinate of a starting point of the line segment to obtain a slope array, judging the trend of elements in the slope array from small to large according to a subscript, and when the slope value is changed into continuous descending, the bottle opening is qualified, otherwise, the bottle opening is not qualified. The non-contact detection is realized, the dependence on complex machinery is not needed, and the detection precision is high.

Description

Defect detection method for insufficient glass bottle opening
Technical Field
The invention relates to the technical field of glass bottle mouth defect detection, in particular to a defect detection method for glass bottle mouth deficiency.
Background
In the in-process at production macrostoma glass bottle, the mouth is not enough to be a common defect, the gas tightness of comparatively obvious insufficient mouth defect accessible comprehensive bottle inspection machine detects the function and detects, small insufficient mouth defect can't be detected at the production stage through existing equipment, artifical lamp is examined and also can't be detected, when low reaches customer used macrostoma bottle as food container, generally can adopt the spiral cover of taking the safety button to seal, the gas leakage that the small mouth is not enough to cause can make the safety button float, thereby play the warning effect. At present, the requirements of downstream customers on bottle manufacturers are further improved, the bottles are required to be matched with bottle caps without safety buttons, and meanwhile, products deteriorated by air leakage cannot flow to final consumers, so that the bottle manufacturers must adopt a new method to reliably detect the defect of insufficient tiny openings so as to meet the requirements of the customers.
Disclosure of Invention
The invention aims to provide a defect detection method for insufficient glass bottle mouth, and solves the technical problems that the defect detection precision of the existing large-mouth glass bottle is not high, and the quality guarantee of food production and packaging is influenced.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
a method for defect detection of insufficient glass bottle mouths, the method comprising the steps of:
step 1: selecting the range of the glass bottleneck to-be-detected area to obtain the bottleneck to-be-detected area;
and 2, step: identifying a frame of the glass bottle mouth in a to-be-detected area of the bottle mouth, then generating a minimum external rectangle of the glass bottle mouth, and then reducing the minimum external rectangle to obtain a reduced rectangular area;
and 3, step 3: fusing the rectangular area and the bottleneck area to be detected to obtain a filling area;
and 4, step 4: generating a contour line for the filling area, and then fitting the contour line to obtain the coordinates and the slope of a plurality of line segments;
and 5: filtering the coordinates and the slope of a plurality of line segments to obtain a fitted line segment parameter array;
step 6: arranging the fitted line segment parameter arrays in ascending order by the horizontal coordinate of the starting point of the line segment to obtain an ordered slope array;
and 7: and judging the trend of the elements in the slope array according to the subscript from small to large, wherein when the slope value is changed into continuous reduction, the bottle mouth is qualified, and otherwise, the bottle mouth is unqualified.
Further, the specific process of step 1 is: the method comprises the steps of installing a camera above a transmission line for transmitting the glass bottle, then placing the glass bottle on the transmission line for transmitting, shooting an area of the glass bottle mouth to be detected by using the camera to obtain an image of a detected glass bottle mouth area, then manually setting a rectangular selection area on the image of the detected glass bottle mouth area, then performing threshold segmentation on the rectangular selection area, filtering out a background and a miscellaneous point, and obtaining effective pixels of the image of the glass bottle mouth.
Further, in step 2: the minimum external rectangle of the glass bottle mouth is taken as a reference, the ordinate of the top edge is kept unchanged, the abscissa of the left side and the abscissa of the right side symmetrically move inwards, the ordinate of the bottom edge moves upwards, a reduced rectangular selection area is obtained, and the bottle mouth ranges of the vertical edges of the bottle mouth on the two sides of the bottle mouth and the bottle mouth ranges on the two sides of the vertical edges of the bottle mouth are filtered out.
Further, in step 3: and performing Boolean operation on the reduced rectangular selected area and the area to be detected of the bottle mouth, reserving an overlapped area, and then performing internal filling on the overlapped area to obtain a filling area to be detected without pores, wherein the filling area to be detected is a closed area formed by vertical lines at the left side and the right side, a horizontal line at the bottom edge and an arc line at the top end, and the arc line at the top end of the area is a curve coincident with the radian of the bottle mouth.
Further, in step 4: pasting a filling area on a two-dimensional coordinate axis, then generating a contour line on the outer side of the filling area, deleting a left vertical line, a right vertical line and a bottom side horizontal line, only keeping a top curve, and then fitting the top curve by using a Douglas-Peucker algorithm (Douglas-Peucker algorithm), wherein the fitting process is as follows:
1) Connecting a line segment XY between the points X and Y of the head and the tail of the top curve, wherein the line segment is a chord of the curve;
2) Acquiring a point Z with the maximum distance from the straight line segment XY on the curve, and calculating the distance d between the point Z and XY;
3) Comparing the distance d with a preset threshold value Max1, if d is less than Max1, taking the straight line segment XY as a fitting line segment of a curve, and finishing the processing of the curve;
4) If d is greater than Max1, dividing the curve into two ends of XZ and ZY by using a point Z, and respectively carrying out 1-3 treatments on the curves at the two ends;
5) When all the curves are processed, the broken lines formed by connecting all the segmentation points at one time can be used as a fitting line of the top curves;
6) And acquiring the horizontal coordinate and the slope of the starting point of each section of the fitting line segment, and putting the obtained horizontal coordinate and the slope into an array for later use.
Further, in step 6: and setting the abscissa of the starting point of each line segment and the slope mapping relation of each line segment, then performing ascending processing on the numerical values of the abscissas to obtain an ordered abscissa numerical value array, and then replacing the numerical values with the slopes mapped by the numerical values of the abscissas to obtain a slope array.
Further, in step 7: subtracting the nth item from the (n + 1) th item of the slope array, checking whether all results are reduced in sequence, and if so, indicating that the bottle mouth curve is a continuous arched curve, and judging that the bottle mouth is qualified; if the calculation result is not reduced in sequence but enlarged, the curve of the bottle mouth is concave or convex on the arch, and the bottle mouth can be judged to be unqualified.
Due to the adoption of the technical scheme, the invention has the following beneficial effects:
by adopting a computer vision technology, the detection equipment based on the invention can realize non-contact detection without depending on complex machinery, so that the detection speed is far higher than that of mechanical contact detection, and the characteristic parameters extracted by image processing have obvious causal connection with physical defects, so that the detection precision is also far higher than that of mechanical contact detection; in addition, the influence caused by factors such as mechanical vibration, clamping stagnation and the like is avoided, the omission factor and the false inspection rate are greatly reduced, the debugging difficulty and the maintenance cost are reduced, and the defects of the common insufficient mouth can also be detected in a compatible mode, so that the comprehensive bottle inspection machine at the rear end of the production line can omit a set of mechanical air tightness detection equipment, a valuable station is vacated, the detection precision is improved due to other detection, and the condition that food is deteriorated in later-period food storage is avoided.
Drawings
FIG. 1 is a flow chart of the method of the present invention;
FIG. 2 is a diagram of the detection process of the present invention;
fig. 3 is a diagram of the fill area of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings and preferred embodiments. It should be noted, however, that the numerous details set forth in the description are merely for the purpose of providing the reader with a thorough understanding of one or more aspects of the present invention, which may be practiced without these specific details.
1-3, a method for defect detection of insufficient glass bottle mouths, the method comprising the steps of:
step 1: the method comprises the steps of installing a camera above a transmission line for conveying glass bottles, then placing the glass bottles on the transmission line for conveying, shooting an area of a glass bottle mouth to be detected by using the camera to obtain an image of a detected glass bottle mouth area, then manually setting a rectangular selection area on the image of the detected glass bottle mouth area, and then carrying out binarization processing on the rectangular selection area and filtering out impurity points.
And 2, step: the edge of the glass bottle mouth in the area of the bottle mouth to be detected is identified, then the minimum external rectangle of the effective image of the glass bottle is generated, and then the minimum external rectangle is subjected to reduction processing to obtain the reduced rectangular area so as to filter the part which does not need to be detected. The minimum external rectangle of the glass bottle mouth is taken as a reference, the ordinate of the top end edge is kept unchanged, the abscissa of the left side and the ordinate of the right side are symmetrically moved inwards, the ordinate of the bottom edge is moved upwards, a reduced rectangular selection area is obtained, and the ranges of the bottle mouth on the vertical sides of the bottle mouth on the two sides of the bottle mouth and the bottle mouth on the two sides of the vertical sides of the bottle mouth are filtered out.
And step 3: and taking out the overlapped part of the reduced rectangular area and the area to be detected of the bottle mouth to obtain an overlapped area. The filling area to be detected is obtained by filling the overlapping area, the shape of the filling area to be detected is a closed area and comprises a vertical line on the left side and the right side, a horizontal line on the bottom side and an arc line on the top end, the left side and the right side are vertical lines, and the arc line on the top end is a curve coincident with the radian of the bottle opening.
And 4, step 4: and generating a contour line for the filled area, and fitting the contour line to obtain the coordinates and the slope of the line segments. The filling area is attached to a two-dimensional coordinate axis, then a contour line is generated on the outer side of the filling area, then the contour line is fitted, parameters are continuously adjusted in the fitting process, so that the contour to be measured is attached to the fitting line segment, the length of the time line segment is the optimal solution, the broken line segment is avoided, and then the initial point coordinate and the slope of each line segment are placed into an array.
The process of fitting the top curve includes the following steps: a (c)
1) Connecting a line segment XY between the points X and Y at the head and the tail of the top curve, wherein the line segment XY is a chord of the curve;
2) Acquiring a point Z with the maximum distance from the straight-line segment XY on the curve, and calculating the distance d between the curve and XY;
3) Comparing the distance d with a preset threshold value Max1, and if d is less than Max1, taking the straight line segment XY as a fitting line segment of the curve, and finishing the processing of the curve;
4) If d is greater than Max1, dividing the curve into two ends of XZ and ZY by using a point Z, and respectively carrying out the processing of the steps 1) to 3) on the curves at the two ends;
5) When all the curves are processed, connecting the broken lines formed by all the segmentation points once, and using the broken lines as a fitting line of the top curves;
6) And acquiring the horizontal coordinate and the slope of the starting point of each section of the fitting line segment, and putting the obtained horizontal coordinate and the slope into an array for later use.
And 5: and filtering the coordinates and the slope of the line segments to obtain a fitted line segment parameter array. And filtering the array, and filtering coordinates and slope numbers of fitting line segments corresponding to left and right vertical lines and bottom edges of the filling area to be detected to obtain a line segment parameter array fitted in the area to be detected of the bottle mouth.
And 6: and (4) arranging the fitted line segment parameter arrays in ascending order by the horizontal coordinate of the starting point of the line segment to obtain the ordered slope array. Acquiring the numerical value of the abscissa of the starting point of each line segment in the fitted line segment parameter array, setting the abscissa of the starting point of each line segment in a slope mapping relation with each line segment, then performing ascending processing on the numerical value of the abscissa to obtain an ordered abscissa numerical value array, and then replacing the numerical value with the slope mapped by the numerical value of the abscissa to obtain a slope array.
And 7: and judging the elements in the slope array from small to large according to the subscript, wherein when the slope array is changed into continuous reduction, the bottle mouth is qualified, and otherwise, the bottle mouth is unqualified.
Whether the bottle mouth has defects is judged by the slope change trend of the contour fitting line segment of the bottle mouth, detection equipment based on the algorithm is successfully put into use by Yihua glass, the effect is in line with expectation after several months of actual use, and the problem that the defects of the tiny mouth are not reliable to detect is solved.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that those skilled in the art can make various improvements and modifications without departing from the principle of the present invention, and these improvements and modifications should also be construed as the protection scope of the present invention.

Claims (7)

1. A defect detection method for insufficient glass bottle openings is characterized by comprising the following steps: the method comprises the following steps:
step 1: manually setting a rectangular selection area for the glass bottle picture, and roughly including the glass bottle image;
and 2, step: carrying out binarization processing on the picture selection area in the step 1, adjusting parameters to remove background and miscellaneous points, generating an effective pixel area of the bottle body, generating a minimum external rectangle of the effective pixel area according to the effective pixel area, then carrying out reduction processing on the minimum external rectangle, and filtering the area of the bottle body which does not need to be detected to obtain a bottle mouth selection area;
and step 3: taking out the overlapped part of the bottleneck selection area and the effective pixel area of the bottle body to obtain a filling area;
and 4, step 4: generating a contour line for the filling area, reserving a bottle mouth top curve, then performing line segment fitting on the bottle mouth top curve by using a Douglas-Pock algorithm to obtain the horizontal coordinates and the slope of the starting points of a plurality of line segments, and putting the horizontal coordinates and the slope into an array;
and 5: arranging the elements in the array in ascending order by the horizontal coordinate of the starting point to obtain a slope array of each line segment of the bottle mouth curve fitting line segment from left to right;
and 6: and judging the trend of the elements in the slope array according to the subscript from small to large, wherein when the slope value is changed into continuous reduction, the bottle mouth is qualified, and otherwise, the bottle mouth is unqualified.
2. The method of claim 1 for detecting defects in an insufficient mouth of a glass bottle, wherein: the specific process of the step 1 is as follows: the method comprises the steps of installing a camera above a transmission line for transmitting the glass bottles, then placing the glass bottles on the transmission line for transmitting, shooting an area of a glass bottle opening to be detected by using the camera to obtain an image of a detected glass bottle opening area, then manually setting a rectangular selection area on the image of the detected glass bottle opening area, then performing threshold segmentation on the rectangular selection area and filtering out miscellaneous points.
3. The method of claim 1 for detecting defects in an insufficient mouth of a glass bottle, wherein: in the step 2: the minimum external rectangle of the glass bottle mouth is taken as a reference, the ordinate of the fixed end side is kept unchanged, the abscissa of the left side and the abscissa of the right side symmetrically move inwards, the ordinate of the bottom side moves upwards, a reduced rectangular selection area is obtained, and the ranges of the bottle mouths on the two sides of the bottle mouth and the vertical sides of the bottle mouth are filtered out.
4. The method of claim 1 for detecting defects in an insufficient mouth of a glass bottle, wherein: step 3 is as follows: performing Boolean operation on a rectangular area and an area to be detected of a bottle opening, then reserving an overlapping area, performing internal filling on the overlapping area to obtain a filling area to be detected, wherein the filling area to be detected is in a shape of a closed area and comprises a vertical line at the left side and the right side, a horizontal line at the bottom side and an arc line at the top end, the left side and the right side are vertical lines, and the arc line at the top end is a curve coincident with the radian of the bottle opening.
5. The method of claim 1 for detecting defects in an insufficient mouth of a glass bottle, wherein: in the step 4: the method comprises the steps of attaching a filling area to a two-dimensional coordinate axis, then generating a contour line on the outer side of the filling area, only keeping a top curve, then fitting the top curve, in the fitting process, enabling a fitting line segment to be close to the curve as far as possible and not to generate broken line segments through parameter adjustment, and then putting the starting point abscissa and the slope of each line segment into an array.
6. The method of claim 5 for defect detection of glass bottle neck finish deficiency, wherein: in the step 5: acquiring the numerical value of the abscissa of the starting point of each line segment in the fitted line segment parameter array, setting the abscissa of the starting point of each line segment in a slope mapping relation with each line segment, then performing ascending processing on the numerical value of the abscissa to obtain an ordered abscissa numerical value array, and then replacing the numerical value with the slope mapped by the numerical value of the abscissa to obtain a slope array.
7. The method of claim 5 for defect detection of glass bottle neck finish deficiency, wherein: the process of fitting the top curve includes the following steps: a
1) Connecting a line segment XY between the points X and Y at the head and the tail of the top curve, wherein the line segment XY is a chord of the curve;
2) Acquiring a point Z with the maximum distance from the straight-line segment XY on the curve, and calculating the distance d between the curve and XY;
3) Comparing the distance d with a preset threshold value Max1, and if d is less than Max1, taking the straight line segment XY as a fitting line segment of the curve, and finishing the processing of the curve;
4) If d is greater than Max1, dividing the curve into two ends of XZ and ZY by using a point Z, and respectively carrying out the processing of the steps 1) to 3) on the curves at the two ends;
5) When all the curves are processed, connecting the broken lines formed by all the segmentation points once, and using the broken lines as a fitting line of the top curves;
6) And acquiring the horizontal coordinate and the slope of the starting point of each section of the fitting line segment, and putting the obtained horizontal coordinate and the slope into an array for later use.
CN202211281486.1A 2022-10-19 2022-10-19 Defect detection method for insufficient glass bottle opening Pending CN115713485A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211281486.1A CN115713485A (en) 2022-10-19 2022-10-19 Defect detection method for insufficient glass bottle opening

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211281486.1A CN115713485A (en) 2022-10-19 2022-10-19 Defect detection method for insufficient glass bottle opening

Publications (1)

Publication Number Publication Date
CN115713485A true CN115713485A (en) 2023-02-24

Family

ID=85231225

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211281486.1A Pending CN115713485A (en) 2022-10-19 2022-10-19 Defect detection method for insufficient glass bottle opening

Country Status (1)

Country Link
CN (1) CN115713485A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116703900A (en) * 2023-08-03 2023-09-05 山东明佳科技有限公司 Image detection method, system, equipment and storage medium for bottle mouth crack of milk glass bottle

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116703900A (en) * 2023-08-03 2023-09-05 山东明佳科技有限公司 Image detection method, system, equipment and storage medium for bottle mouth crack of milk glass bottle
CN116703900B (en) * 2023-08-03 2023-10-20 山东明佳科技有限公司 Image detection method, system, equipment and storage medium for bottle mouth crack of milk glass bottle

Similar Documents

Publication Publication Date Title
CN112881432B (en) Method for detecting bottle mouth cracks of liquid glass bottle
CN115082485B (en) Method and system for detecting bubble defects on surface of injection molding product
CN113537301B (en) Defect detection method based on template self-adaptive matching of bottle body labels
CN108896574B (en) Bottled liquor impurity detection method and system based on machine vision
CN111709948B (en) Method and device for detecting defects of container
CN104764746B (en) A kind of detection method of comprehensive PET bottle lid anti-theft ring defect
CN115713485A (en) Defect detection method for insufficient glass bottle opening
JP7055223B2 (en) Mask defect inspection method
CN114359246B (en) Conveyor belt detection method, device, system, electronic device and medium
CN105954301B (en) A kind of bottleneck quality detection method based on machine vision
CN102519972A (en) Detection method of PET bottle cap and liquid level
CN106370659A (en) Visual inspection method for bottle packaging quality
CN110434090A (en) A kind of carrot surface flaw detecting method
CN107664644A (en) A kind of apparent automatic detection device of object based on machine vision and method
CN111766245B (en) Button cell negative electrode shell defect detection method based on machine vision
CN114445707A (en) Intelligent visual fine detection method for defects of bottled water labels
CN106841229A (en) A kind of online PE bottles of detection method of bottle sealing defect based on machine vision
CN109738448A (en) A kind of industrial products intelligent detection device and method
CN114519696A (en) PVC heat shrinkage film detection method and system based on optical intelligence
CN110060239B (en) Defect detection method for bottle opening of bottle
US20010004401A1 (en) Process for inspecting the quality of an article in particular one made of glass
CN116008294B (en) Key cap surface particle defect detection method based on machine vision
CN108171691B (en) Detection method of plastic container
CN209214867U (en) A kind of vacuum in canned product on-line measuring device
CN116205860A (en) Wine bottle packaging defect detection system based on machine vision

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination