Movatterモバイル変換


[0]ホーム

URL:


CN110060239B - A kind of defect detection method for bottle mouth - Google Patents

A kind of defect detection method for bottle mouth
Download PDF

Info

Publication number
CN110060239B
CN110060239BCN201910265598.XACN201910265598ACN110060239BCN 110060239 BCN110060239 BCN 110060239BCN 201910265598 ACN201910265598 ACN 201910265598ACN 110060239 BCN110060239 BCN 110060239B
Authority
CN
China
Prior art keywords
area
image
bottleneck
region
bottle mouth
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.)
Active
Application number
CN201910265598.XA
Other languages
Chinese (zh)
Other versions
CN110060239A (en
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.)
Guangdong Weihua Intelligent Technology Co ltd
Original Assignee
Guangzhou University
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 Guangzhou UniversityfiledCriticalGuangzhou University
Priority to CN201910265598.XApriorityCriticalpatent/CN110060239B/en
Publication of CN110060239ApublicationCriticalpatent/CN110060239A/en
Application grantedgrantedCritical
Publication of CN110060239BpublicationCriticalpatent/CN110060239B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本发明实施例公开了一种用于瓶子瓶口的缺陷检测方法,包括:对所述瓶口图像进行阈值分割、特征提取,并提取待建立模板区域;根据所述待建立模板区域的中心坐标和轮廓最高点的纵坐标,生成待裁剪区域;所述瓶口图像中裁剪出所述待裁剪区域,并对所述待裁剪区域进行阈值分割后得到区域面积;所述瓶口图像为瓶口完整的图像时,得到的区域面积作为面积标准;将所述瓶口图像得到的区域面积与面积标准相减,所述相减得到的差值的绝对值与预设值做对比,若所述差值的绝对值大于预设值,则所述瓶口不合格。采用本发明,能够实现快速检测瓶口缺陷,并且检测的准确率高。

Figure 201910265598

An embodiment of the present invention discloses a defect detection method for a bottle finish, comprising: performing threshold segmentation and feature extraction on the bottle finish image, and extracting a template area to be established; and according to the center coordinates of the template area to be established and the ordinate of the highest point of the contour to generate the area to be cropped; the area to be cropped is cut out from the bottle finish image, and the area to be cropped is obtained by thresholding the area to be cropped; the bottle finish image is the bottle finish In the case of a complete image, the obtained area area is used as the area standard; the area area obtained from the bottle mouth image is subtracted from the area standard, and the absolute value of the difference obtained by the subtraction is compared with the preset value. If the absolute value of the difference is greater than the preset value, the bottle mouth is unqualified. By adopting the invention, the bottle mouth defect can be quickly detected, and the detection accuracy is high.

Figure 201910265598

Description

Defect detection method for bottle opening of bottle
Technical Field
The invention relates to the field of image processing, in particular to a defect detection method for a bottle opening of a bottle.
Background
At present, manufacturers of beer, beverage and the like mostly use recyclable glass bottles for environmental protection and cost saving. In the recycling of beer bottles, the detection of the mouth of a beer bottle by a visual inspection method is a work which consumes manpower and time and can not ensure the reliability of detection. In order to reduce the labor time cost and realize industrial automation, the robot vision-based automatic detection of the machine is suitable for transportation, but most of the detection machines adopted in China at present are imported and expensive, and can not be purchased by common medium and small enterprises, and in addition, foreign detection equipment is not completely suitable for China due to the factors such as the size, the color and the national conditions of bottles. Therefore, it is necessary to develop a rapid and effective method for detecting the bottle opening.
Disclosure of Invention
In order to solve the problems, the invention provides a defect detection method for a bottle mouth of a bottle, which has the advantages of high speed and high accuracy for detecting the defects of the bottle mouth and can meet the requirements on a production line.
Based on this, the invention provides a defect detection method for a bottle opening, which comprises the following steps:
performing threshold segmentation and feature extraction on the bottleneck image, and extracting a template area to be established;
generating a region to be cut according to the center coordinate of the region of the template to be established and the vertical coordinate of the highest point of the outline;
cutting the region to be cut out from the bottleneck image, and performing threshold segmentation on the region to be cut out to obtain the region area;
when the bottleneck image is a complete image of the bottleneck, the area of the obtained area is used as an area standard;
and subtracting the area standard from the area obtained by the bottleneck image, comparing the absolute value of the difference obtained by subtracting with a preset value, and if the absolute value of the difference is greater than the preset value, determining that the bottleneck is unqualified.
And denoising the complete image of the bottle opening before reading the image to be detected.
The threshold segmentation and feature extraction of the bottle opening image and the extraction of the template area to be established comprise the following steps:
performing global threshold segmentation on the bottleneck image, and extracting pixel points with gray values within a preset gray range;
performing connected region combination on the pixels, and extracting a maximum area region as an image to be processed according to the shape area characteristics of the connected regions;
and performing gray level closed operation on the image to be processed to be used as a template area to be established.
The method for global threshold segmentation comprises the following steps: histogram bimodal method.
And averaging the row coordinates and the vertical coordinates of the pixel points to obtain the area center coordinates.
And the point with the minimum vertical coordinate of the pixel point is the highest point of the contour.
The generating of the area to be cut according to the center coordinate of the area to be built and the vertical coordinate of the highest point of the outline comprises the following steps:
and generating a rectangular region to be cut by taking the central coordinate as a center, wherein the region to be cut is symmetrical by taking the bottle mouth as the center.
The threshold segmentation is used for segmenting the bottleneck image into a target area and a background area with different gray levels according to the gray level difference between the bottleneck image and the background image, selecting a threshold and determining that each pixel point in the bottleneck image belongs to the target area or the background area to generate a corresponding binary image.
And the global threshold is realized by calculating the gray value of the peak in the region to be cut minus a preset gray value.
If the absolute value of the difference is smaller than a preset value, the bottleneck is qualified, if the absolute value of the difference is smaller than one tenth of the preset value, the bottleneck is a first-class bottleneck, and if the absolute value of the difference is larger than one tenth of the preset value and smaller than the preset value, the bottleneck is a second-class bottleneck.
The bottle mouth defect detection method has the advantages of high speed and high accuracy, and can meet the requirements on production lines.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a method for defect detection of a bottle mouth provided by an embodiment of the present invention;
FIG. 2 is a schematic view of a completed bottle mouth provided by an embodiment of the present invention;
fig. 3 is a schematic view of a sample vial finish to be tested according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
S101, performing threshold segmentation and feature extraction on the bottleneck image, and extracting a template area to be established;
the method comprises the steps of carrying out threshold segmentation and feature extraction on a bottle opening image, and carrying out denoising processing on the bottle opening image before extracting a template region to be established.
Image noise is a luminance distribution that interferes with the reception of a planar two-dimensional luminance distribution if the luminance distribution is visually received when information is transmitted from a subject or an information source to a viewer by some method. Image noise is typically quantified or described in terms of a signal-to-noise ratio.
The bottle opening image is subjected to denoising processing, so that the bottle opening image is improved, and the problem that the image quality is reduced due to noise interference of the bottle opening image is solved. The image quality can be effectively improved through denoising processing, the signal to noise ratio is increased, and information carried by the bottleneck image is better embodied.
And denoising the bottleneck image by adopting methods such as Gaussian filtering, median filtering and the like.
The threshold segmentation and feature extraction of the bottleneck image and the extraction of the template area to be established comprise the following steps:
performing global threshold segmentation on the bottleneck image, and extracting pixel points with gray values within a preset gray range;
performing connected region combination on the pixels, and extracting a maximum area region as an image to be processed according to the shape area characteristics of the connected regions;
and performing gray level closed operation on the image to be processed to be used as a template area to be established.
Image segmentation is an image segmentation algorithm that divides a digital image into non-overlapping regions and extracts an object of interest, and is generally based on one of two properties of gray scale: discontinuities and similarities. A first application of the property is to segment images based on discrete changes in gray scale. The main application of the second property is to segment images into similar regions according to a predetermined criterion.
Image segmentation is one of the most basic and important fields in image processing and low-level vision in the field of computer vision, and is a basic premise for performing visual analysis and pattern recognition on images. Image threshold segmentation is one of the methods, and image segmentation can also be understood as extracting meaningful feature regions or feature regions to be applied in an image, where the feature regions may be gray values of pixels, object contour curves, texture features, and the like, or may be a threshold segmentation technique such as spatial spectrum or histogram features. The basic principle of thresholding an image is described as follows: the difference of the gray characteristics of the target object to be extracted and the background thereof in the image is utilized, the image is regarded as the combination of two types of areas (target and background) with different gray levels, and a proper threshold value is selected to determine whether each pixel point in the image belongs to the target area or the background area, so that a corresponding binary image is generated.
The threshold segmentation is a simple and effective image segmentation method, and is particularly effective for image segmentation with strong contrast between an object and a background, all pixels with gray levels larger than or equal to a predetermined value are judged to belong to the object, the gray level value is 255 to represent the foreground, otherwise, the pixel points are excluded from the object area, and the gray level value is 0 to represent the background.
Wherein, the threshold segmentation of the bottleneck image includes but is not limited to: and carrying out global threshold segmentation on the bottleneck image, wherein the global threshold is realized by calculating the gray value of the wave crest in the bottleneck image and subtracting a preset gray value.
The method for carrying out threshold segmentation on the bottleneck image comprises a global threshold segmentation method and a threshold segmentation method such as self-adaptive threshold segmentation.
The global threshold segmentation method comprises a histogram bimodal method, and a maximum inter-class variance method and the like.
The communication area is an area G on the complex plane, and if a simple closed curve is made in any area G, the interior of the closed curve always belongs to G, and the G is called as a single communication area. A region is referred to as a multiply connected region if it is not a singly connected region.
Connectivity is an important concept describing areas and boundaries, including: requirements for 4-pass, 8-pass, m-pass, and two-pixel pass: 1. whether the two pixel positions are adjacent; 2. whether the two pixel gray values satisfy a certain similarity criterion.
(1)4, communication: two pixels p and q, if p is in the 4 neighborhood of q, the two pixels are said to be 4 connected;
(2)8, communication: two pixels p and q, if p is in the 8 neighborhood of q, the two pixels are said to be 8 connected;
(3) m is connected with: 1. two pixels p and q, p being in the 4 neighborhood of q, or p being in the D neighborhood of q, 2, and the intersection of the 4 neighborhoods of p and q being empty, i.e. m connectivity is a mixed (mixture) connectivity of 4 connectivity and D connectivity.
Each connected set in the bottleneck image forms a region of the bottleneck image, and a maximum area region is extracted as an image to be processed according to the shape area characteristics of the connected region;
and performing gray level closed operation on the image to be processed to be used as a template area to be established.
The process of expansion followed by erosion is called closed-loop operation, and is used to fill small voids in objects, connect neighboring objects, smooth their boundaries, and not significantly change their areas.
Erosion is a process by which boundary points are eliminated and the boundaries are shrunk inward. Can be used to eliminate small and meaningless objects. The algorithm of corrosion: with a 3 × 3 structure element, each pixel of the scanned image is anded with the structure element and its overlaid binary image if both are 1, resulting in that pixel of the image being 1. Otherwise it is 0. As a result: the binary image is reduced by one turn.
Dilation is the process of merging all background points in contact with an object into the object, expanding the boundary outward. Can be used to fill in voids in objects. The algorithm of inflation: with a 3 × 3 structuring element, each pixel of the scanned image is anded with the structuring element and the binary image it overlays if both are 0, resulting in that pixel of the image being 0. Otherwise it is 1. As a result: the binary image is enlarged by one turn.
And performing gray level closed operation on the image to be processed to be used as a template area to be established.
S102, generating a region to be cut according to the center coordinate of the region of the template to be established and the vertical coordinate of the highest point of the outline;
and averaging the row coordinates and the vertical coordinates of the pixel points to obtain the area center coordinates. And the point with the minimum vertical coordinate of the pixel point, namely the highest point of the outline, takes the central coordinate as the center to generate a rectangular area which is symmetrical by taking the bottle mouth as the center, namely the area to be cut.
S103, cutting the region to be cut out from the bottleneck image, and performing threshold segmentation on the region to be cut out to obtain a region area;
cutting the region to be cut out from the bottleneck image, namely separating the region to be cut out from the bottleneck image, so that the proportion of the part of the bottleneck in the image, which accounts for the image, becomes larger, and performing threshold segmentation on the region to be cut out to obtain the region area.
S104, when the bottle mouth image is a complete bottle mouth image, the area of the obtained area is used as an area standard;
fig. 2 is an image of a complete bottle mouth, and the area of the region obtained after the operations from S101 to S103 are performed on the image of the complete bottle mouth is used as an area standard, and the area standard is a constant for judging whether the bottle mouth is qualified.
S105, subtracting the area standard from the area of the area obtained by the bottleneck image, and comparing the absolute value of the difference obtained by subtracting with a preset value;
the bottleneck image comprises a complete bottleneck image and a damaged bottleneck image, the damaged bottleneck image is subjected to operations from S101 to S103 to obtain an area, the area of the area is subtracted from an area standard to obtain a difference value, and the difference value may be a negative number, so that an absolute value of the difference value is compared with a preset value.
S106, judging whether the absolute value of the difference value is larger than a preset value or not;
s107, if the absolute value of the difference is larger than a preset value, the bottle mouth is unqualified;
and S108, if the absolute value of the difference is not greater than a preset value, the bottle mouth is qualified.
The difference is not greater than a preset value, namely, under the condition that the bottleneck is qualified, the bottleneck can be divided into a plurality of grades, if the absolute value of the difference is smaller than the preset value, the bottleneck is qualified, if the absolute value of the difference is smaller than one tenth of the preset value, the bottleneck is a first-class bottleneck, and if the absolute value of the difference is larger than one tenth of the preset value and smaller than the preset value, the bottleneck is a second-class bottleneck.
The invention has the advantages of high speed and high accuracy for detecting the defects of the bottle mouth and can meet the requirements on the production line.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and substitutions can be made without departing from the technical principle of the present invention, and these modifications and substitutions should also be regarded as the protection scope of the present invention.

Claims (7)

1. A method for detecting defects of a bottle opening is characterized by comprising the following steps:
performing threshold segmentation and feature extraction on the bottleneck image, and extracting a template area to be established;
generating a region to be cut according to the center coordinate of the region of the template to be established and the vertical coordinate of the highest point of the outline;
cutting the region to be cut out from the bottleneck image, and performing threshold segmentation on the region to be cut out to obtain the region area;
when the bottleneck image is a complete image of the bottleneck, the area of the obtained area is used as an area standard;
subtracting the area standard from the area obtained by the bottleneck image, comparing the absolute value of the difference obtained by subtracting with a preset value, and if the absolute value of the difference is greater than the preset value, determining that the bottleneck is unqualified;
the threshold segmentation and feature extraction of the bottleneck image and the extraction of the template area to be established comprise the following steps:
performing global threshold segmentation on the bottleneck image, and extracting pixel points with gray values within a preset gray range;
performing connected region combination on pixels, and extracting a maximum area region as an image to be processed according to the shape area characteristics of the connected regions;
performing gray level closed operation on the image to be processed to be used as a template area to be established;
averaging the row coordinates and the vertical coordinates of the pixel points to obtain area center coordinates; and the point with the minimum vertical coordinate of the pixel point is the highest point of the contour.
2. The method for detecting defects of a bottle mouth as claimed in claim 1, wherein before the threshold segmentation, feature extraction and extraction of the template region to be established for the bottle mouth image, further comprising: and denoising the bottle opening image.
3. The method for defect detection of a bottle mouth as claimed in claim 1, wherein said global threshold segmentation method comprises: histogram bimodal method.
4. The method for detecting defects of bottle openings as claimed in claim 1, wherein the generating the region to be trimmed according to the center coordinates of the region to be built and the ordinate of the highest point of the contour comprises:
and generating a rectangular region to be cut by taking the central coordinate as a center, wherein the region to be cut is symmetrical by taking the bottle mouth as the center.
5. The method for detecting defects of a bottle mouth according to claim 1, wherein the threshold segmentation divides the bottle mouth image into a target area and a background area with different gray levels according to the difference of the gray levels of the bottle mouth image and the background image, selects a threshold and determines whether each pixel point in the bottle mouth image belongs to the target area or the background area to generate a corresponding binary image.
6. The method for detecting defects on a bottle mouth of a bottle according to claim 1, wherein the global threshold is implemented by calculating a gray value of a peak minus a preset gray value in the region to be cut.
7. The method of claim 1, wherein the bottleneck is qualified if the absolute value of the difference is less than a predetermined value, the bottleneck is an equal-class bottleneck if the absolute value of the difference is less than one tenth of the predetermined value, and the bottleneck is an equal-class bottleneck if the absolute value of the difference is greater than one tenth of the predetermined value and less than the predetermined value.
CN201910265598.XA2019-04-022019-04-02 A kind of defect detection method for bottle mouthActiveCN110060239B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201910265598.XACN110060239B (en)2019-04-022019-04-02 A kind of defect detection method for bottle mouth

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201910265598.XACN110060239B (en)2019-04-022019-04-02 A kind of defect detection method for bottle mouth

Publications (2)

Publication NumberPublication Date
CN110060239A CN110060239A (en)2019-07-26
CN110060239Btrue CN110060239B (en)2021-05-07

Family

ID=67318340

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201910265598.XAActiveCN110060239B (en)2019-04-022019-04-02 A kind of defect detection method for bottle mouth

Country Status (1)

CountryLink
CN (1)CN110060239B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112673380A (en)*2020-05-282021-04-16深圳市大疆创新科技有限公司Image processing method, device, movable platform and system
CN113998344B (en)*2020-07-282023-06-27北京四维图新科技股份有限公司Express box recycling method, system, server, terminal and storage medium
CN114283107A (en)*2020-09-182022-04-05强生(中国)有限公司Oral cavity detection method, oral cavity detection device and computer readable storage medium
CN112561896B (en)*2020-12-222023-08-15广州大学 A detection method, system, device and storage medium for glass bottle mouth defects
CN113610772B (en)*2021-07-162023-07-04广州大学Method, system, device and storage medium for detecting spraying code defect at bottom of pop can bottle

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US4929828A (en)*1988-02-291990-05-29Emhart Industries, Inc.Inspecting glass containers for line-over finish defects with bifurcated fiber optic bundle
CN1475795A (en)*2002-08-122004-02-18广西师范大学 Glass bottle detection method and glass bottle detection device
CN101710080A (en)*2009-12-012010-05-19湖南大学Stacking glass bottle detection method based on machine vision and transporter
CN106546605A (en)*2016-10-262017-03-29湖南大学A kind of medicated beer bottle mouth defect detection method for utilizing 4 circumferential registrations and hysteresis threshold

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102162797B (en)*2010-11-242012-07-04哈尔滨工业大学(威海)Algorithm for detecting glass bottle neck damage and bottle bottom dirt
CN105954301B (en)*2016-06-222019-08-06广东省智能制造研究所 A method of bottle mouth quality detection based on machine vision

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US4929828A (en)*1988-02-291990-05-29Emhart Industries, Inc.Inspecting glass containers for line-over finish defects with bifurcated fiber optic bundle
CN1475795A (en)*2002-08-122004-02-18广西师范大学 Glass bottle detection method and glass bottle detection device
CN101710080A (en)*2009-12-012010-05-19湖南大学Stacking glass bottle detection method based on machine vision and transporter
CN106546605A (en)*2016-10-262017-03-29湖南大学A kind of medicated beer bottle mouth defect detection method for utilizing 4 circumferential registrations and hysteresis threshold

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
一种圆形瓶口缺陷定位检测方法;韦哲等;《测控技术》;20171118;第36卷(第11期);第27-31页*
基于OpenCV的啤酒瓶口缺陷检测系统研究;郭克友等;《制造业自动化》;20140810;第36卷(第8期);第61-71页*
郭克友等.基于OpenCV的啤酒瓶口缺陷检测系统研究.《制造业自动化》.2014,第36卷(第8期),第61-71页.*

Also Published As

Publication numberPublication date
CN110060239A (en)2019-07-26

Similar Documents

PublicationPublication DateTitle
CN110060239B (en) A kind of defect detection method for bottle mouth
CN110070523B (en) A kind of foreign matter detection method for bottle bottom
CN109377485B (en)Machine vision detection method for instant noodle packaging defects
CN106404793B (en) Vision-based defect detection method for bearing seals
CN115908269B (en)Visual defect detection method, visual defect detection device, storage medium and computer equipment
CN115082683A (en)Injection molding defect detection method based on image processing
CN111179243A (en)Small-size chip crack detection method and system based on computer vision
CN115345885A (en)Method for detecting appearance quality of metal fitness equipment
CN109685760B (en)MATLAB-based SLM powder bed powder laying image convex hull depression defect detection method
CN115082419A (en)Blow-molded luggage production defect detection method
CN114581742A (en)Linearity-based connected domain clustering fusion method, device, system and medium
CN113077437B (en)Workpiece quality detection method and system
CN109378279B (en)Wafer detection method and wafer detection system
CN107490582B (en)Assembly line workpiece detection system
CN115063430B (en)Electric pipeline crack detection method based on image processing
CN112614062A (en)Bacterial colony counting method and device and computer storage medium
CN113256624A (en)Continuous casting round billet defect detection method and device, electronic equipment and readable storage medium
CN114897881B (en) A grain defect detection method based on edge features
CN112102278A (en)Metal workpiece machining surface defect detection method based on computer vision
CN113971681B (en) A belt conveyor edge detection method in complex environment
CN111414912B (en)Method, device and equipment for identifying characteristic points of butt-joint type welding seam and storage medium
CN109584212B (en)MATLAB-based SLM powder bed powder laying image scratch defect identification method
CN119379609A (en) A flange surface defect detection algorithm based on traditional image processing
CN114994072A (en) A machine vision-based detection method for end face defects of magnetic rods
CN109934817B (en) A detection method for fruit body external contour deformity

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant
TR01Transfer of patent right

Effective date of registration:20250114

Address after:Room 102, No. 7 Tengfei 1st Street, Huangpu District, Guangzhou City, Guangdong Province 510000

Patentee after:Guangdong Weihua Intelligent Technology Co.,Ltd.

Country or region after:China

Address before:No. 230, Waihuan West Road, Guangzhou University City, Guangzhou 510000

Patentee before:Guangzhou University

Country or region before:China

TR01Transfer of patent right

[8]ページ先頭

©2009-2025 Movatter.jp