CN103529053B - Bottle mouth defect detection method - Google Patents
Bottle mouth defect detection method Download PDFInfo
- Publication number
- CN103529053B CN103529053B CN201310452499.5A CN201310452499A CN103529053B CN 103529053 B CN103529053 B CN 103529053B CN 201310452499 A CN201310452499 A CN 201310452499A CN 103529053 B CN103529053 B CN 103529053B
- Authority
- CN
- China
- Prior art keywords
- area
- detection
- ring
- white
- 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
Links
Landscapes
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
Abstract
本发明公开了一种瓶口缺陷检测方法,包括:S1、对所述瓶口进行检测区域划分,分为第一内环、第二内环、评估环、密封环和内密封环区域,并对各区域进行检测;S2、将各检测结果汇总,输出对瓶口的综合检测结果,若所有检测项结果均为正常,则输出该瓶口检测正常,否则输出该瓶口检测异常。本发明提出的瓶口缺陷检测方法,检测速度快、精度高、性能稳定、调试方便,适用于高速自动化流水线上对瓶口缺陷的长时间实时不间断检测。
The invention discloses a bottle mouth defect detection method, comprising: S1. Dividing the inspection area of the bottle mouth into a first inner ring, a second inner ring, an evaluation ring, a sealing ring and an inner sealing ring area, and Detect each area; S2. Summarize the detection results and output the comprehensive detection results for the bottle mouth. If all the detection items are normal, output the bottle mouth detection is normal, otherwise output the bottle mouth detection abnormality. The bottle mouth defect detection method proposed by the invention has fast detection speed, high precision, stable performance and convenient debugging, and is suitable for long-term real-time uninterrupted detection of bottle mouth defects on a high-speed automatic assembly line.
Description
技术领域technical field
本发明涉及工业自动化检测技术领域,特别涉及一种瓶口缺陷检测方法。The invention relates to the technical field of industrial automatic detection, in particular to a method for detecting a defect in a bottle mouth.
背景技术Background technique
目前,我国的食品安全管理体系快速推进,民众对于食品安全的关注程度愈加增强,欧洲的HACCP标准和我国的GB4927-91标准均对啤酒瓶空瓶的检测提出了严格的要求。在现有的啤酒、饮料和药品的生产过程中,都要求灌装容器满足相应的质量标准,生产每一步均需要进行检查,当不合格瓶流入市场,不但消费者可能会受到伤害,对于产品生产厂家其经济和声誉亦会受到损害。目前啤酒瓶空瓶检测主要依靠人工检测的方法实现,但是人工检测存在以下几个缺点:(1)检测速度慢,效率低下。近些年我国以啤酒为代表的玻璃品饮品的产量快速增加,啤酒产量自2002年以来一直稳居世界首位,啤酒生产线速度国内也快速增加到两万四到四万瓶每小时,国外最快速度超过七万瓶每小时。这样的速度下依靠人工进行检测已经难以实现;(2)随着近些年人力成本的快速增加,人工检测变得愈加昂贵;(3)人检工作需要人员量大,但该工作枯燥、强度大,愿意从事该工作的年轻人越来越少,导致企业招工难;(4)由于受到人员疲劳、情绪等影响,人检后的酒瓶质量和质量一致性均较差,难以满足日益提高的质量要求。所以,采用自动化方法对玻璃瓶空瓶进行检测的玻璃瓶空瓶验瓶机正在国内外被快速推广使用。At present, my country's food safety management system is advancing rapidly, and people are paying more and more attention to food safety. The European HACCP standard and my country's GB4927-91 standard both put forward strict requirements for the detection of empty beer bottles. In the existing production process of beer, beverages and pharmaceuticals, the filling containers are required to meet the corresponding quality standards. Every step of production needs to be inspected. When unqualified bottles enter the market, not only consumers may be harmed, but also for the products. The manufacturer's economy and reputation will also be damaged. At present, the detection of empty beer bottles mainly relies on manual detection, but manual detection has the following disadvantages: (1) The detection speed is slow and the efficiency is low. In recent years, the output of glass drinks represented by beer in my country has increased rapidly. Beer output has been ranking first in the world since 2002. The speed of beer production lines in China has also increased rapidly to 240,000 to 40,000 bottles per hour, the fastest abroad. The speed exceeds 70,000 bottles per hour. It is difficult to rely on manual inspection at such a speed; (2) With the rapid increase of labor costs in recent years, manual inspection has become more and more expensive; (3) Human inspection requires a large number of personnel, but the work is boring and intensive. There are fewer and fewer young people who are willing to engage in this work, which makes it difficult for enterprises to recruit workers; (4) Due to the influence of personnel fatigue and emotions, the quality and quality consistency of wine bottles after human inspection are poor, and it is difficult to meet the increasing quality requirements. Therefore, the glass bottle empty bottle inspection machine that uses automatic methods to detect glass bottle empty bottles is being rapidly promoted and used at home and abroad.
国外的玻璃瓶空瓶验瓶机已经有一些成功的案例,其产品在欧美地区拥有广泛的客户群,但进口验瓶机用于国内啤酒生产企业存在如下的问题:(1)价格昂贵,供货周期长,我国啤酒年产量和生产线数量均居世界首位,但高昂的价格和维护成本却非大部分企业所能承受的,且一般前期供货和售后维修周期均较长;(2)标准不同,进口验瓶机大多基于欧洲检测标准设计算法和参数,与我国的国家标准存在不相符合的情况,给啤酒生产厂商带来困扰;(3)瓶源不同,我国的啤酒瓶大于80%为回收瓶,20%为新瓶,而在欧洲比例相反。我国的新瓶生产一般为多家玻璃瓶厂同时生产,新瓶质量、外形也各有差异。回收瓶多为多次使用,瓶体磕损、划伤、裂纹较为严重。在这种情况下若采用进口验瓶机则失去了对国内瓶源以及各生产商质量要求的灵活性,往往无法满足国内啤酒生产商的需求,使进口验瓶机出现“水土不服”的情况。所以,研究和大力发展具有完全自主知识产权的自有品牌验瓶机设备对于提升我国自有核心技术的掌控和科技创新能力具有重要意义,对我国食品饮料行业卫生安全的提升具有实际价值。There have been some successful cases of foreign glass bottle inspection machines for empty bottles, and their products have a wide customer base in Europe and the United States. However, imported bottle inspection machines have the following problems when used in domestic beer production enterprises: (1) The price is expensive and the supply The delivery cycle is long. my country's annual beer production and number of production lines rank first in the world, but the high price and maintenance costs are not affordable for most companies, and the general pre-supply and after-sales maintenance cycles are long; (2) standard Different, most of the imported bottle inspection machines design algorithms and parameters based on European testing standards, which are inconsistent with my country's national standards, which brings troubles to beer manufacturers; (3) The bottle sources are different, and more than 80% of my country's beer bottles For recycled bottles, 20% are new bottles, while in Europe the ratio is reversed. The production of new bottles in my country is generally produced by multiple glass bottle factories at the same time, and the quality and shape of new bottles are also different. Recycled bottles are mostly used for many times, and the bottle body is seriously damaged, scratched and cracked. In this case, if the imported bottle inspection machine is used, it will lose the flexibility of domestic bottle sources and the quality requirements of various manufacturers, and often cannot meet the needs of domestic beer manufacturers, so that the imported bottle inspection machine will appear "acclimatized". . Therefore, the research and vigorous development of self-owned brand bottle inspection machine equipment with completely independent intellectual property rights is of great significance for improving the control of my country's own core technology and technological innovation capabilities, and has practical value for the improvement of hygiene and safety in my country's food and beverage industry.
作为玻璃瓶空瓶检测的重要环节,瓶口检测被啤酒生产厂商极为看重,当瓶口破损严重时,可能会对饮用者造成伤害,而即使微小的缺损,也会由于漏气导致酒在运输储存过程中快速变质,所以瓶口检测要求具有很高的精度。另一方面,由于瓶口缺陷的瓶子一般为废弃瓶,所以大多啤酒生产厂商将瓶口检测不合格的瓶子直接剔除击碎,而如侧壁、瓶底等环节检测不合格的瓶子则回洗瓶机再次清洗后回到链道再进行空瓶检测。所以要求瓶口检测的误剔除率必须很低,否则大量合格瓶被误剔除击碎会造成啤酒生产企业可观的经济损失。As an important part of glass bottle empty bottle detection, bottle mouth inspection is highly valued by beer manufacturers. When the bottle mouth is seriously damaged, it may cause harm to drinkers, and even a small defect will cause the wine to be damaged during transportation due to air leakage. Rapid deterioration during storage, so bottle mouth detection requires high precision. On the other hand, since bottles with defective mouths are generally discarded bottles, most beer manufacturers directly reject and crush bottles that fail the inspection of the mouth of the bottle, and wash back the bottles that fail the inspection of the side wall and bottom of the bottle. After the bottle machine is cleaned again, it returns to the chain channel and then performs empty bottle detection. Therefore, it is required that the false rejection rate of bottle mouth detection must be very low, otherwise a large number of qualified bottles will be mistakenly rejected and crushed, which will cause considerable economic losses for beer production enterprises.
目前针对瓶口检测的研究工作已经在一些高校进行。但是由于验瓶机产品要求高速、稳定、高精度、适应性强、便于工程师调试等诸多实际要求,在玻璃瓶瓶口检测的算法设计过程中需要权衡上述各种因素,特别是速度和稳定性方面的要求,开发适合于工业化推广的玻璃瓶空瓶瓶口检测算法。At present, research work on bottle mouth detection has been carried out in some universities. However, due to many practical requirements such as high speed, stability, high precision, strong adaptability, and easy debugging by engineers, the bottle inspection machine needs to weigh the above factors, especially speed and stability, in the algorithm design process of glass bottle mouth detection. In order to meet the requirements of the field, develop a glass bottle empty bottle mouth detection algorithm suitable for industrialization.
发明内容Contents of the invention
(一)要解决的技术问题(1) Technical problems to be solved
本发明要解决的技术问题是:如何提供一种高速高精度瓶口缺陷检测方法,用于解决现有的高速玻璃瓶灌装自动化生产流水线上空瓶瓶口缺陷检测方法的速度慢、精度低和稳定性差的问题。The technical problem to be solved by the present invention is: how to provide a high-speed and high-precision bottle mouth defect detection method, which is used to solve the problems of slow speed, low precision and problems of the existing high-speed glass bottle filling automatic production line empty bottle bottle mouth defect detection method. The problem of poor stability.
(二)技术方案(2) Technical solution
为解决上述问题,本发明提供一种瓶口缺陷检测方法,包括:S1、对所述瓶口进行检测区域划分,分为第一内环、第二内环、评估环、密封环和内密封环区域,并对各区域进行检测;S2、将各检测结果汇总,输出对瓶口的综合检测结果,若所有检测项结果均为正常,则输出该瓶口检测正常,否则输出该瓶口检测异常。In order to solve the above problems, the present invention provides a method for detecting defects in the bottle mouth, including: S1. Divide the detection area of the bottle mouth into a first inner ring, a second inner ring, an evaluation ring, a sealing ring and an inner sealing ring Ring area, and detect each area; S2. Summarize the test results and output the comprehensive test results for the bottle mouth. If the results of all the test items are normal, then output the bottle mouth detection is normal, otherwise output the bottle mouth detection abnormal.
优选地,在所述步骤S1中采用并行计算机制同时对所述第一内环、第二内环、评估环、密封环和内密封环区域进行检测,各项检测并行完成。Preferably, in the step S1, a parallel computing mechanism is used to simultaneously detect the first inner ring, the second inner ring, the evaluation ring, the sealing ring and the inner sealing ring area, and each inspection is completed in parallel.
优选地,对所述第一内环区域进行检测包括:S111、对所述第一内环区域滤波后进行二值化操作,正常区域为黑色,异常区域为白色;S112、对所述白色区域进行连通域分析,当最大连通域面积大于给定阈值时,则返回第一内环检测异常,否则返回第一内环检测正常。Preferably, detecting the first inner ring area includes: S111, performing a binarization operation on the first inner ring area after filtering, the normal area is black, and the abnormal area is white; S112, the white area Carry out connected domain analysis, when the maximum connected domain area is greater than a given threshold, return the first inner ring detection abnormality, otherwise return the first inner ring detection normal.
优选地,对所述评估环区域进行检测包括:S131、将所述评估环区域滤波后进行二值化处理,正常区域为黑色,异常区域为白色,然后进行极坐标展开;S132、沿所述评估环径向方向观察每列像素的白色像素个数,若某列白色像素个数超过给定范围,则标记该列为不合格;S133、若检测到某列不合格,则错误值增加,反之若合格则错误值减少,若错误值峰值超过给定阈值,则输出不合格,若输出为不合格,则返回评估环检测异常,否则返回评估环检测正常。Preferably, detecting the evaluation ring area includes: S131, performing binarization after filtering the evaluation ring area, making the normal area black and the abnormal area white, and then performing polar coordinate expansion; S132, along the Observe the number of white pixels in each column of pixels in the radial direction of the evaluation ring. If the number of white pixels in a certain column exceeds a given range, mark the column as unqualified; S133. If a certain column is detected to be unqualified, the error value increases. On the contrary, if it is qualified, the error value will decrease. If the peak value of the error value exceeds the given threshold, the output is unqualified. If the output is unqualified, the evaluation loop will return to detect abnormality, otherwise the evaluation loop will be returned to detect normal.
优选地,对所述密封环区域进行检测包括:S141、将所述密封环区域滤波后进行二值化处理,正常区域为黑色,异常区域为白色,然后进行极坐标展开;S142、沿密封环径向方向观察每列像素的白色像素个数,若某列白像素个数低于给定值,则标记该列为不合格;S143、若检测到某列不合格,则错误值增加,反之若合格则错误值减少,若错误值峰值超过给定阈值,则输出不合格,若输出为不合格,则返回密封环检测异常,否则返回密封环检测正常。Preferably, detecting the seal ring area includes: S141, filtering the seal ring area and performing binarization processing, making the normal area black and the abnormal area white, and then performing polar coordinate expansion; S142, along the seal ring Observe the number of white pixels in each column of pixels in the radial direction, if the number of white pixels in a certain column is lower than a given value, then mark this column as unqualified; S143, if a certain column is detected as unqualified, the error value increases, otherwise If it is qualified, the error value will decrease. If the peak value of the error value exceeds the given threshold, the output will be unqualified. If the output is unqualified, it will return the seal ring detection exception, otherwise it will return the seal ring detection normal.
优选地,对所述内密封环区域进行检测包括:S151、将内密封环区域滤波后利用灰度阈值对该区域进行图像分割,小于该阈值区域设置灰度为黑色,作为背景区域,大于该阈值区域灰度不变,作为前景区域;S152、将前景区域求平均值后加上灰度偏置后作为阈值,将前景区域进行二值化处理,小于该阈值的设为黑色,大于该阈值的设为白色;S153、将白色区域进行开运算,去除细小条纹和小块虚假区域的影响;S154、计算白色区域的连通域信息,设定连通域面积、宽度和高度等检测项的上下限,至少存在一个连通域所有信息同时在限定范围内时返回内密封环异常,否则返回内密封环正常。Preferably, detecting the inner sealing ring area includes: S151. After filtering the inner sealing ring area, segment the image of the area using a grayscale threshold, set the grayscale to black for the area smaller than the threshold value, and use it as a background area. The grayscale of the threshold area remains unchanged, and is used as the foreground area; S152, after averaging the foreground area and adding a gray scale offset, it is used as a threshold, and the foreground area is binarized. Set the white area to white; S153, open the white area to remove the influence of small stripes and small false areas; S154, calculate the connected domain information of the white area, and set the upper and lower limits of the connected domain area, width and height and other detection items , when there is at least one connected domain and all the information is within the limited range at the same time, it will return the inner sealing ring exception, otherwise it will return the inner sealing ring normal.
(三)有益效果(3) Beneficial effects
本发明提出的瓶口缺陷检测方法,检测速度快、精度高、性能稳定、调试方便,适用于高速自动化流水线上对瓶口缺陷的长时间实时不间断检测。The bottle mouth defect detection method proposed by the invention has fast detection speed, high precision, stable performance and convenient debugging, and is suitable for long-term real-time uninterrupted detection of bottle mouth defects on a high-speed automatic assembly line.
附图说明Description of drawings
图1为依照本发明一种实施方式的瓶口缺陷检测方法的流程示意图;Fig. 1 is a schematic flow chart of a method for detecting defects at a bottle finish according to an embodiment of the present invention;
图2为依照本发明一种实施方式的瓶口检测图像示意图;Fig. 2 is a schematic diagram of a bottle mouth detection image according to an embodiment of the present invention;
图3为依照本发明一种实施方式的瓶口检测图像采集系统示意图。Fig. 3 is a schematic diagram of an image acquisition system for bottle finish detection according to an embodiment of the present invention.
具体实施方式Detailed ways
下面结合附图和实施例,对本发明的具体实施方式作进一步详细描述。以下实施例用于说明本发明,但不用来限制本发明的范围。The specific implementation manners of the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
本发明提供了一种瓶口缺陷检测方法,包括:The invention provides a method for detecting a bottle mouth defect, comprising:
S1、对瓶口进行检测区域划分,采用并行计算机制同时第一内环、第二内环、评估环、密封环和内密封环等区域进行检测;S1. Divide the detection area of the bottle mouth, and use the parallel computer mechanism to simultaneously detect the first inner ring, the second inner ring, the evaluation ring, the sealing ring and the inner sealing ring;
S2、将各检测结果汇总,最终输出对瓶口的综合检测结果,若存在不少于1项检测项输出异常,则检测结果为异常,否则检测结果为正常。S2. Summarize the test results, and finally output the comprehensive test result for the bottle mouth. If there is no less than one test item with abnormal output, the test result is abnormal, otherwise the test result is normal.
其中,所述步骤S1中的采用并行计算机制同时第一内环、第二内环、评估环、密封环和内密封环等区域进行检测,各检测项并行完成,各项在检测过程中没有耦合关系,其具体流程为:Wherein, in the step S1, the first inner ring, the second inner ring, the evaluation ring, the sealing ring and the inner sealing ring etc. are tested at the same time by adopting a parallel computer mechanism, and each detection item is completed in parallel, and each item is not detected during the detection process. Coupling relationship, the specific process is:
S11、第一内环检测,首先对区域滤波、二值化操作,正常区域为黑色,异常区域为白色,然后对白色区域进行连通域分析,若最大面积超过阈值,则返回第一内环检测异常,否则返回第一内环检测正常;S11, the first inner ring detection, first filter and binarize the area, the normal area is black, the abnormal area is white, and then the connected domain analysis is performed on the white area, if the maximum area exceeds the threshold, return to the first inner ring detection Abnormal, otherwise return the first inner loop detection is normal;
S12、第二内环检测,其检测流程与第一内环检测相同;S12. The second inner ring detection, the detection process of which is the same as that of the first inner ring detection;
S13、评估环检测,首先对区域滤波、二值化操作,正常区域为黑色,异常区域为白色,然后沿评估环径向方向对每列像素的白色像素个数进行统计,当某列的白色像素个数在正常范围以外时,标记该列为不合格,若加权不合格列超过给定阈值,则返回评估环检测异常,否则返回评估环检测正常;S13, evaluation ring detection, first perform region filtering and binarization operations, normal regions are black, abnormal regions are white, and then the number of white pixels in each column of pixels is counted along the radial direction of the evaluation ring, when a column of white pixels When the number of pixels is outside the normal range, mark the column as unqualified. If the weighted unqualified column exceeds a given threshold, return the evaluation ring to detect abnormality, otherwise return to the evaluation ring to detect normal;
S14、密封环检测,首先对区域滤波、二值化操作,正常区域为黑色,异常区域为白色,然后沿密封环径向方向对每列像素的白色像素个数进行统计,若某列白色像素个数小于给定值,则标记该列不合格,若加权不合格列超过给定阈值,则返回密封环检测异常,否则返回密封环检测正常;S14. Sealing ring detection, first perform region filtering and binarization operations, the normal region is black, and the abnormal region is white, and then the number of white pixels in each column of pixels is counted along the radial direction of the sealing ring, if a column of white pixels If the number is less than the given value, mark the column as unqualified. If the weighted unqualified column exceeds the given threshold, return the seal ring detection exception, otherwise return the seal ring detection normal;
S15、内密封环检测,首先对分为灰度值不变的前景区域和为黑色的背景区域。然后进行二值化处理,小于阈值的设为黑色,即背景区域,大于阈值的设为白色,第三将白色区域进行开运算,第四计算白色区域的连通域信息,设定连通域面积、宽度和高度等检测项的上下限,至少存在一个连通域所有信息同时在限定范围内时返回内密封环异常,否则返回内密封环正常。S15 , the detection of the inner sealing ring is first divided into a foreground area with a constant gray value and a black background area. Then carry out binarization processing, the ones smaller than the threshold are set as black, that is, the background area, and the ones larger than the threshold are set as white, the third is to open the white area, and the fourth is to calculate the connected domain information of the white area, and set the connected domain area, For the upper and lower limits of detection items such as width and height, if there is at least one connected domain and all information is within the limit at the same time, it will return the inner seal ring as abnormal, otherwise it will return the inner seal ring as normal.
本实施例中提出的瓶口缺陷检测方法的流程如图1所示。所拍摄的图像和各检测区域标记如图2所示。其中外侧圆形亮环为密封环,内侧圆形亮环为内密封环,第一内环在密封环和内密封环之间,第二内环在内密封环以内,密封环向内外延展一定宽度后的区域为评估环。瓶口图像的采集系统如图3所示,其中环形的LED光源2倾斜照射瓶体3中的瓶口,光线经瓶口表面反射后进入CCD相机1。当瓶口表面光滑完整时,图像为完整规范的亮环形状,而当瓶口表面缺损时,图像的亮环出现断开或附有大块白斑现象。The process flow of the bottle mouth defect detection method proposed in this embodiment is shown in FIG. 1 . The captured images and the marks of each detection area are shown in Figure 2. Wherein the outer circular bright ring is the sealing ring, the inner circular bright ring is the inner sealing ring, the first inner ring is between the sealing ring and the inner sealing ring, the second inner ring is inside the inner sealing ring, and the sealing ring extends outward and outward for a certain amount. The area after the width is the evaluation ring. The acquisition system of the bottle mouth image is shown in Figure 3, in which the ring-shaped LED light source 2 obliquely illuminates the bottle mouth in the bottle body 3, and the light enters the CCD camera 1 after being reflected by the surface of the bottle mouth. When the surface of the bottle mouth is smooth and complete, the image is in the shape of a complete and standardized bright ring, while when the surface of the bottle mouth is defective, the bright ring of the image appears to be disconnected or accompanied by large white spots.
检测的主要步骤包括:The main steps of detection include:
S11.第一内环检测。当瓶口存在较大缺口或磨口时,会在第一内环区域出现较大面积的白斑,第一内环区域的检测即主要针对上述缺陷进行检测。其检测方法为:S11. First inner loop detection. When there is a large gap or grinding in the mouth of the bottle, a large area of white spots will appear in the first inner ring area, and the detection of the first inner ring area is mainly for the detection of the above defects. Its detection method is:
S111、对第一内环区域滤波后进行二值化操作,使正常区域呈黑色,异常区域呈白色;S111. Perform a binarization operation after filtering the first inner ring area, so that the normal area is black and the abnormal area is white;
S112、对白色区域进行连通域分析,当最大连通域面积大于给定阈值时,则返回第一内环检测异常,否则返回第一内环检测正常;S112. Perform connected domain analysis on the white area, and when the largest connected domain area is greater than a given threshold, return the first inner ring detection abnormality, otherwise return the first inner ring detection normal;
S12.第二内环检测。当有较大异物堵塞在瓶口,则可能在第二内环区域出现较大面积的白斑。第二内环区域的检测即主要针对上述缺陷进行检测。其检测方法与第一内环检测相同,在此不再赘述。S12. The second inner ring detection. When there is a large foreign matter blocking the bottle mouth, a large area of white spots may appear in the second inner ring area. The detection of the second inner ring area is mainly to detect the above-mentioned defects. The detection method is the same as that of the first inner ring detection, and will not be repeated here.
S13.评估环检测。当瓶口存在缺损时,会出现密封环断开的情况,若存在磨口时,会出现密封环周围出现较大白斑的情况。评估环区域的检测即主要针对上述缺陷进行检测。其检测方法为:S13. Evaluation ring detection. When there is a defect in the bottle mouth, the sealing ring will be broken. If there is a grinding mouth, there will be a large white spot around the sealing ring. The detection of the evaluation ring area is mainly aimed at the detection of the above-mentioned defects. Its detection method is:
S131、将评估环区域滤波后进行二值化处理,然后进行极坐标展开;S131. Perform binarization after filtering the evaluation ring area, and then perform polar coordinate expansion;
S132、沿评估环径向方向观察每列像素的白色像素个数,若某列白色像素个数超过给定范围,则标记该列为不合格;S132. Observe the number of white pixels in each row of pixels along the radial direction of the evaluation ring. If the number of white pixels in a row exceeds a given range, mark the row as unqualified;
S133、若检测到某列不合格,则错误值增加,反之若合格则错误值降低。若错误值峰值超过给定阈值,则输出不合格。S133. If it is detected that a certain column is unqualified, the error value is increased; otherwise, if it is qualified, the error value is decreased. If the error value peak exceeds the given threshold, the output fails.
若输出为不合格,则返回评估环检测异常,否则返回评估环检测正常。If the output is unqualified, return the evaluation loop detection exception, otherwise return the evaluation loop detection normal.
S14.密封环检测。当瓶口存在缺损时,密封环会断开,密封环检测即针对该种缺陷进行检测,也是各检测项中最重要的一项,其检测方法为:S14. Sealing ring detection. When there is a defect in the bottle mouth, the sealing ring will be broken. The sealing ring detection is to detect this kind of defect, and it is also the most important item among the various detection items. The detection method is:
S141、将密封环区域滤波后进行二值化处理,然后进行极坐标展开;S141. Perform binarization processing after filtering the sealing ring area, and then perform polar coordinate expansion;
S142、沿密封环径向方向观察每列像素的白色像素个数,若某列白像素个数低于给定值,则标记该列为不合格。;S142. Observing the number of white pixels in each row of pixels along the radial direction of the sealing ring, if the number of white pixels in a row is lower than a given value, mark the row as unqualified. ;
S143、若检测到某列不合格,则错误值增加,反之若合格则错误值降低,若错误值峰值超过给定阈值,则输出不合格。S143. If a column is detected to be unqualified, the error value is increased; otherwise, if it is detected to be qualified, the error value is decreased; if the peak value of the error value exceeds a given threshold, the output is unqualified.
若输出为不合格,则返回密封环检测异常,否则返回密封环检测正常。If the output is unqualified, it will return that the seal ring detection is abnormal, otherwise it will return that the seal ring detection is normal.
S15.内密封环检测。当瓶口内沿出现破损时,会出现内密封环出现白斑,但是由于瓶口内沿的形状各异,导致内密封环成像各异,其亮度、宽度和纹理各不相同,这就增加了检测的难度,内密封环的检测方法为:S15. Inner sealing ring detection. When the inner edge of the bottle mouth is damaged, there will be white spots on the inner sealing ring, but due to the different shapes of the inner edge of the bottle mouth, the imaging of the inner sealing ring is different, and its brightness, width and texture are different, which increases the detection. Difficulty, the detection method of the inner sealing ring is:
S151、将内密封环区域滤波后利用灰度阈值对该区域进行图像分割,小于该阈值区域设置灰度为黑色,作为背景区域;大于该阈值区域灰度不变,作为前景区域;S151. After filtering the area of the inner sealing ring, use the gray threshold to segment the image of the area, set the gray level to black in the area smaller than the threshold, and use it as the background area; the gray level in the area greater than the threshold remains unchanged, and use it as the foreground area;
S152、将前景区域求平均值后加上灰度偏置后作为阈值,将前景区域进行二值化处理,小于该阈值的设为黑色,大于该阈值的设为白色;S152. Taking the average value of the foreground area and adding the gray scale offset as the threshold value, and performing binarization processing on the foreground area, setting the foreground area as black, and setting the value greater than the threshold as white;
S153、将白色区域进行开运算,去除细小条纹和小块虚假区域的影响;S153. Perform an open operation on the white area to remove the influence of small stripes and small false areas;
S154、计算白色区域的连通域信息,设定连通域面积、宽度和高度等检测项的上下限,至少存在一个连通域所有信息同时在限定范围内时返回内密封环异常,否则返回内密封环正常。S154. Calculate the connected domain information of the white area, set the upper and lower limits of the connected domain area, width and height and other detection items. If there is at least one connected domain and all the information is within the limited range at the same time, return the inner seal ring exception, otherwise return the inner seal ring normal.
S2.检测结果汇总。将各检测项的检测结果进行综合后输出最终的结果,若所有定位项和检测项结果均为正常,则输出该瓶口检测正常,否则输出该瓶口检测异常。S2. Summary of test results. After the detection results of each detection item are synthesized, the final result is output. If the results of all positioning items and detection items are normal, the output of the bottle mouth detection is normal, otherwise, the output of the bottle mouth detection is abnormal.
综上所述,本发明具有以下几点优势:In summary, the present invention has the following advantages:
1.检测速度快。在算法层面,各个检测项完全独立,因此在程序编制时可采用多线程并行计算。当采集图像为640×480像素,在I5CPU的计算机上进行运算,每幅图像的运算时间在14ms以内,该速度可以满足目前世界上最快的啤酒生产线的需要。1. Fast detection speed. At the algorithm level, each detection item is completely independent, so multi-thread parallel computing can be used in programming. When the collected image is 640×480 pixels, and the calculation is performed on the I5CPU computer, the calculation time of each image is within 14ms, which can meet the needs of the fastest beer production line in the world.
2.检测精度高,误检率低。利用本方法可以准确检出瓶口5mm2的缺损。同时能够有效抵抗干扰,误检率不高于0.1%。2. High detection accuracy and low false detection rate. The method can accurately detect the 5mm 2 defect of the bottle mouth. At the same time, it can effectively resist interference, and the false detection rate is not higher than 0.1%.
3.性能稳定。本算法生成的检测程序运行过程中内存占用和吞吐量小,且在参数设置不合理或非瓶口图像输入时不会造成运行错误。因此长时间运行难以出现死机、内存耗尽等运行异常情况发生。3. Stable performance. The detection program generated by this algorithm has small memory usage and throughput during operation, and will not cause operation errors when the parameter settings are unreasonable or non-bottleneck image input. Therefore, it is difficult to cause abnormal operation such as crash and memory exhaustion during long-term operation.
4.工程师调试方便,对工程师的要求较低。检测结果对除精度阈值外的参数不敏感;同时需设定的参数直观易懂,参数设定可以通过简单分析图像得到调整方向。因此理论水平和经验不太高的工程师也可胜任现场调试工作。4. It is convenient for engineers to debug, and the requirements for engineers are relatively low. The detection results are not sensitive to parameters other than the accuracy threshold; at the same time, the parameters to be set are intuitive and easy to understand, and the parameter setting can be adjusted by simply analyzing the image. Therefore, engineers with low theoretical level and experience can also be competent for on-site debugging.
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明技术原理的前提下,还可以做出若干改进和替换,这些改进和替换也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention, it should be pointed out that for those of ordinary skill in the art, without departing from the technical principle of the present invention, some improvements and replacements can also be made, these improvements and replacements It should also be regarded as the protection scope of the present invention.
Claims (5)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310452499.5A CN103529053B (en) | 2013-09-27 | 2013-09-27 | Bottle mouth defect detection method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310452499.5A CN103529053B (en) | 2013-09-27 | 2013-09-27 | Bottle mouth defect detection method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN103529053A CN103529053A (en) | 2014-01-22 |
| CN103529053B true CN103529053B (en) | 2015-12-02 |
Family
ID=49931239
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201310452499.5A Active CN103529053B (en) | 2013-09-27 | 2013-09-27 | Bottle mouth defect detection method |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN103529053B (en) |
Families Citing this family (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105241888B (en) * | 2015-09-25 | 2018-11-02 | 上海金啤包装检测科技有限公司 | A kind of detection method and detection device of bottle mouth defect |
| CN105717123A (en) * | 2015-10-29 | 2016-06-29 | 山东明佳科技有限公司 | Method and equipment for comprehensively detecting defect of blank support rings for PET (polyethylene terephthalate) bottles |
| CN107282460B (en) * | 2016-11-14 | 2019-03-01 | 燕京啤酒(桂林漓泉)股份有限公司 | Beer packaging production scene bottle checker operates normally effect evaluation method |
| CN106846294B (en) * | 2016-12-16 | 2020-11-27 | 深圳市海科瑞科技有限公司 | Visual detection method, device and equipment |
| CN110431405B (en) * | 2017-02-06 | 2022-06-14 | 东洋玻璃株式会社 | Inspection device for glass bottles |
| CN107472601A (en) * | 2017-09-01 | 2017-12-15 | 广西德保新贝侬酒厂有限公司 | A kind of alcoholic workshop lamp checking device |
| CN109063708B (en) * | 2018-06-21 | 2022-10-28 | 歌尔股份有限公司 | Industrial image feature identification method and system based on contour extraction |
| CN109297984B (en) * | 2018-11-13 | 2021-02-19 | 正大天晴药业集团股份有限公司 | Bubble cap packaging defect detection method, device and equipment |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1050768A (en) * | 1989-10-06 | 1991-04-17 | 埃尔帕特朗尼股份公司 | Devices for checking the mouth of bottles or the like |
| JP2000321214A (en) * | 1999-05-10 | 2000-11-24 | Kawasaki Steel Corp | Defect detection method and apparatus |
| CN101063662A (en) * | 2007-05-15 | 2007-10-31 | 广州市万世德包装机械有限公司 | Method for detecting empty bottle bottom defect and device for detecting empty bottle bottom defect based on DSP |
| CN103257144A (en) * | 2013-05-15 | 2013-08-21 | 华南理工大学 | Plastic bottleneck excess material detecting method and device based on machine vision |
| CN103308523A (en) * | 2013-05-28 | 2013-09-18 | 清华大学 | Method for detecting multi-scale bottleneck defects, and device for achieving method |
-
2013
- 2013-09-27 CN CN201310452499.5A patent/CN103529053B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1050768A (en) * | 1989-10-06 | 1991-04-17 | 埃尔帕特朗尼股份公司 | Devices for checking the mouth of bottles or the like |
| JP2000321214A (en) * | 1999-05-10 | 2000-11-24 | Kawasaki Steel Corp | Defect detection method and apparatus |
| CN101063662A (en) * | 2007-05-15 | 2007-10-31 | 广州市万世德包装机械有限公司 | Method for detecting empty bottle bottom defect and device for detecting empty bottle bottom defect based on DSP |
| CN103257144A (en) * | 2013-05-15 | 2013-08-21 | 华南理工大学 | Plastic bottleneck excess material detecting method and device based on machine vision |
| CN103308523A (en) * | 2013-05-28 | 2013-09-18 | 清华大学 | Method for detecting multi-scale bottleneck defects, and device for achieving method |
Non-Patent Citations (1)
| Title |
|---|
| 《基于机器视觉的啤酒瓶瓶口检测系统的研究》;张田田;《中国优秀硕士学位论文全文数据库信息科技辑》;20111231(第S1期);第44页4.4节第2-3段,第55页5.4节第1段,第18页第3段,50页第2段,第55页第1-2段,47-49页 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN103529053A (en) | 2014-01-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN103529053B (en) | Bottle mouth defect detection method | |
| CN101936915B (en) | Method for detecting dirt on central region of bottom of beer bottle | |
| CN102162797B (en) | Algorithm for detecting glass bottle neck damage and bottle bottom dirt | |
| CN205436353U (en) | Bearing sorting machine | |
| CN106052792B (en) | A method and device for liquid level detection of PET bottles based on machine vision | |
| US10309908B2 (en) | Light field illumination container inspection system | |
| CN105954301B (en) | A method of bottle mouth quality detection based on machine vision | |
| CN207036727U (en) | Medicine bottle open defect on-line detecting system | |
| CN102519972A (en) | Detection method of PET bottle cap and liquid level | |
| CN101526484A (en) | Bearing defect detecting technique based on embedded-type machine vision | |
| CN107664644B (en) | A device and method for automatic detection of object appearance based on machine vision | |
| CN104417788A (en) | Small-sized packing horizontal sealing detection method and small-sized packing horizontal sealing detection system having quality tracing function | |
| CN103308523A (en) | Method for detecting multi-scale bottleneck defects, and device for achieving method | |
| CN106841212A (en) | A kind of bottle mouth defect detection method based on local PCA and BP neural network | |
| TWM334411U (en) | Automatic test and efficiency real-time monitoring apparatus of production line | |
| CN104550051A (en) | Empty bottle sorting system for glass bottle | |
| CN105478364A (en) | Defective product detection and classification method and system | |
| Fu et al. | Medicine glass bottle defect detection based on machine vision | |
| CN103523491B (en) | Bottleneck localization method | |
| JPH04128635A (en) | Method and device for inspection | |
| CN102024143A (en) | Method for tracking and identifying medicinal liquid impurity images on high-speed medicament production line | |
| CN202256178U (en) | Defect detection equipment for bottle cap inner pad based on machine vision | |
| TW201617605A (en) | Defect inspection method and apparatus thereof | |
| CN105241888B (en) | A kind of detection method and detection device of bottle mouth defect | |
| Yang et al. | Design of drug and wine bottlecap defect detection system based on machine vision |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant | ||
| CP01 | Change in the name or title of a patent holder |
Address after: 100084 Beijing Haidian District Tsinghua Yuan 100084-82 mailbox Co-patentee after: SHANDONG MINGJIA TECHNOLOGY CO., LTD. Patentee after: Tsinghua University Address before: 100084 Beijing Haidian District Tsinghua Yuan 100084-82 mailbox Co-patentee before: Shandong Mingjia Package Inspection Technology Co., Ltd. Patentee before: Tsinghua University |
|
| CP01 | Change in the name or title of a patent holder |