WO2020248439A1 - 一种基于图像处理的皇冠盖表面缺陷在线检测方法 - Google Patents

一种基于图像处理的皇冠盖表面缺陷在线检测方法 Download PDF

Info

Publication number
WO2020248439A1
WO2020248439A1 PCT/CN2019/108953 CN2019108953W WO2020248439A1 WO 2020248439 A1 WO2020248439 A1 WO 2020248439A1 CN 2019108953 W CN2019108953 W CN 2019108953W WO 2020248439 A1 WO2020248439 A1 WO 2020248439A1
Authority
WO
WIPO (PCT)
Prior art keywords
area
image
template
threshold
segmentation
Prior art date
Application number
PCT/CN2019/108953
Other languages
English (en)
French (fr)
Inventor
崔明
仲瑶
吴燕
Original Assignee
江苏农林职业技术学院
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 江苏农林职业技术学院 filed Critical 江苏农林职业技术学院
Publication of WO2020248439A1 publication Critical patent/WO2020248439A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/95Investigating the presence of flaws or contamination characterised by the material or shape of the object to be examined

Definitions

  • the invention belongs to the technical field of image processing, and in particular relates to an online detection method for crown cap surface defects based on image processing.
  • crown caps are widely used in industries such as glass bottled beer and carbonated beverages because of their good sealing properties. According to statistics, the market demand for crown caps in my country has been 47 billion since 2008, and the annual growth rate is 2 billion, which has greatly stimulated the efficiency of bottle cap production and testing. As the world's largest market for crown caps, improving the defect detection level of crown caps is of great significance to the development of my country's crown cap industry.
  • He Xiuyuan proposed a PET bottle cap defect detection algorithm based on machine vision (2015), which can process 8 caps per minute, with a missed detection rate of less than 0.1% and a defect accuracy rate of 99%.
  • Liu Wei proposed a crown cap skirt tooth detection method based on convex hull algorithm (2016), but the detection content only involves external surface defects.
  • Zhou Wenju (2014) proposed a crown cap rotation matching and flaw detection strategy based on a sparse representation method, but this method does not have a detailed analysis of shape defects (such as lack of glue, flash).
  • CN201110048984.7 discloses an intelligent detection method for surface defects based on machine vision, but only involves the detection of defects on the outer surface of crown caps.
  • CN102192911A discloses a metal bottle cap quality detection system and method based on machine vision, but the bottle cap defect detection type is single and the defect type is different from the crown cap.
  • the main problem of the existing crown cap defect detection scheme is: the current bottle cap research algorithm is not very adaptive and cannot be applied to the special situation of the crown cap; the defect detection type of the existing crown cap defect detection method is relatively single, but It is impossible to detect all types of defects on the inner and outer surfaces of the crown cap.
  • the objective of the present invention is to provide an online method for detecting surface defects of crown caps based on image processing, which solves the problems of detection and classification of multiple types of defects on the surface of existing crown caps.
  • An online detection method for surface defects of crown caps based on image processing including the following steps:
  • Step 1 Collect the image of the inner surface of the crown cap through the image acquisition system, and perform Gaussian filtering on the collected image;
  • Step 2 Use threshold segmentation and connected area area feature analysis to extract the central area of the collected image, and use least square fitting method to fit the circular contour to the edge pixels of the area contour to realize the center positioning of the inner surface of the crown cap;
  • Step 3 According to the coordinates of the center position of the bottle cap obtained in step 2, pre-set the physical radius information of different areas for different types of bottle caps, and combine the pixel ratio parameters to realize the area division of the inner surface of the crown cap;
  • Step 4 According to the result of image segmentation in step 3, extract the image of the area of interest on the inner surface, set a fixed gray threshold to complete the image segmentation, and use the area feature analysis method to remove the noise area to realize the black spot defect detection on the inner surface of the crown cap;
  • Step 5 According to the image segmentation result of step 3, extract the image of the inner and outer ring area, use the local threshold method to complete the image segmentation, use the area feature analysis method to remove the noise area, and realize the bubble detection of the inner and outer ring area on the inner surface of the crown cap;
  • Step 6 Use the fixed threshold segmentation method to obtain the contour edge of the outer ring area, and use the least square method to circle the outer ring contour pixel points, compare the area difference between the outer ring contour area and the fitting area, and realize the defect Glue defect detection;
  • Step 7 According to the image segmentation result of step 3, extract the flash area image, and use the fixed threshold segmentation method and area feature analysis method to realize the flash sticky material defect detection;
  • Step 8 According to the image segmentation result of step 3, extract the connected areas of the skirt teeth, count the number of connected areas, calculate the angle between each connected area and the center of the bottle cap, and use the angle difference between adjacent skirt teeth to determine whether the skirt teeth are defective ;
  • Step 9 Collect an image of the outer surface of a standard bottle cap, perform Gaussian filtering on the image, and establish an offline feature template based on the edge feature information of the image;
  • Step 10 Set the template matching score, and use the feature template matching method to detect and locate the image to be tested after being processed by Gaussian filtering;
  • Step 11 Perform affine transformation on the target image according to the template matching result in Step 10, perform threshold segmentation and region comparison on the template image and target image, and use the connected region area feature analysis method to realize the external surface defect detection.
  • the image acquisition system includes an industrial area scan camera, a low-angle ring light source and an industrial computer, and the industrial area scan camera uses a sensor-triggered photographing method to complete data collection.
  • the inner surface of the crown cap is divided into a central area R1, an inner ring area R2, a middle ring area R3, an outer ring area R4, a flash area R5, and a skirt tooth area R6.
  • the method for positioning the central area R1 includes the following steps:
  • the maximum between-cluster variance method selects the k value when g(k) is maximum as the segmentation threshold
  • R represents the area of the area, that is, the number of pixels in the area, and gvalue represents the gray value
  • the least squares method is used to perform circle fitting on the edge pixels of the area.
  • P(x i , y i ) be the contour point
  • L Ri is the distance from P(x i , y i ) to the fitting circle
  • N is the image pixel
  • the total number is deduced by formula (VI) to get the center (a, b) and radius R of the fitted circle, and the center area R1 is obtained according to the detection result;
  • the physical radius information of different areas is preset according to the type of bottle cap, the pixel radius information of different areas is obtained by using the pixel ratio parameter, and the area segmentation of the inner surface of the crown cap is realized by combining the position information of the center area.
  • the black spot defect detection on the inner surface of the crown cap includes the following steps: firstly use a fixed threshold method to segment the image, then analyze the connected regions after the threshold segmentation, and finally set an appropriate area threshold , Realize the judgment of black spot defects.
  • step 5 the detection of bubble defects in the inner ring area R2 and outer ring area R4 of the inner surface of the crown cap includes the following steps:
  • T xy am xy +b ⁇ xy (VII);
  • a and b are the mean and variance coefficients, respectively, t is a fixed value, and g(x,y) is the output image; after threshold segmentation, set an appropriate area threshold, and filter out smaller areas through the connected area area feature analysis method Noise interference area, realize bubble defect detection.
  • step 6 the defect detection for lack of glue includes the following steps:
  • the flash sticky material defect detection includes the following steps: first extract the flash ring area image, then use a fixed threshold method to segment the ROI image, and finally use the area feature analysis method for the segmented connected regions Eliminate the noise interference area, realize the judgment of flash and sticky material.
  • the skirt tooth defect detection step includes the following steps:
  • step 9 the steps of the offline template establishment method are as follows:
  • threshold segmentation method is used to extract the central ring pattern area on the template image
  • the Canny method is used to detect the edge of the template image on the image of the central ring area
  • step 10 the steps of the feature template matching algorithm are as follows:
  • s is the similarity score returned by the normalized correlation function
  • A is the second-order rotation matrix
  • the matching score is closer to 1, indicating the corresponding area in the image The higher the matching degree with the template
  • the pyramid hierarchical search strategy is used to improve the efficiency of the algorithm and reduce the matching search time, and use the similarity threshold to set the matching search termination condition, and s j represents the sum of dot products accumulated to the jth element of the template. s min represents the lowest matching score.
  • the normalized dot product sum calculation method is shown in formula (XI). If s j satisfies formula (XII), the template matching score cannot reach s min . Therefore, the matching search process is in the first Stop calculation after j elements;
  • step 11 the algorithm steps are as follows:
  • H(t) is the translation matrix between the template and the target image
  • H(R) is the rotation matrix between the template and the target image
  • step S2 According to the results of step S1, set the pattern ring ROI area, segment the target image and the template image using the fixed threshold to obtain the regions of interest Ro and R t , and use the area comparison method to obtain the difference area Rd , as in formula (XIV) Shown:
  • R d (R 0 -R t )+(R t -R o ) (XIV);
  • S3 Use the connected area feature analysis method to analyze the connected area feature of the different area R, and set an appropriate area feature threshold T to realize the judgment of the outer surface defect.
  • an image processing-based on-line surface defect detection method for crown caps of the present invention collects images of the inner surface of crown caps, and uses image segmentation technology to achieve center positioning and region extraction; threshold segmentation, Image processing algorithms such as morphology processing, connected area feature analysis, area comparison, etc. realize the detection of defects on the inner surface of the bottle cap; use an automatic training learning algorithm to establish an external surface pattern template offline; collect the image of the outer surface of the crown cap, use feature template matching and affine transformation Complete the defect detection on the outer surface of the bottle cap with the area comparison method.
  • the invention can quickly detect various types of defects on the surface of crown caps online, including black spots on the inner surface, bubbles, lack of glue, flash sticky material, missing skirt teeth, missing patterns on the outer surface, and faulty images, and can reach 300 inspections per minute.
  • a bottle cap has the advantages of high defect detection accuracy and strong robustness. It can be attached to the crown cap production line to realize the defect detection and type discrimination of the crown cap.
  • Figure 1 is a schematic diagram of the detection process
  • Figure 2 is a schematic diagram of the crown cap
  • Figure 3 is a schematic diagram of black spot defect detection results
  • Figure 4 is a schematic diagram of bubble defect detection results
  • Figure 5 is a schematic diagram of the result of the lack of glue defect detection
  • Figure 6 is a schematic diagram of the detection results of flash sticky material defects
  • Figure 7 is a schematic diagram of the angle of skirt teeth
  • Figure 8 is a schematic diagram of the detection process of skirt tooth defects
  • Fig. 9 is a schematic diagram of the detection process of outer surface defects.
  • the crown cap surface defect detection process includes two parts: inner surface detection and outer surface detection.
  • the inner surface detection includes image acquisition of the inner surface, regional center positioning and black spots, lack of glue on the flash, inner and outer ring bubbles, and sticky materials. , Skirt tooth deformity and missing defect type detection.
  • External surface detection includes external surface image acquisition, regional center positioning and pattern missing, wrong image and other defect types detection.
  • the internal and external surface defect detection is divided into two stations simultaneously, and each has its own independent
  • the image acquisition and processing system, an online detection method for crown cap surface defects based on image processing includes the following steps:
  • Step 1 Collect the image of the inner surface of the crown cap through the image acquisition system, and perform Gaussian filtering on the collected image;
  • Step 2 Use threshold segmentation and connected area area feature analysis to extract the central area of the collected image, and use least square fitting method to fit the circular contour to the edge pixels of the area contour to realize the center positioning of the inner surface of the crown cap;
  • Step 3 According to the coordinates of the center position of the bottle cap obtained in step 2, pre-set the physical radius information of different areas for different types of bottle caps, and combine the pixel ratio parameters to realize the area division of the inner surface of the crown cap;
  • Step 4 According to the result of image segmentation in step 3, extract the image of the area of interest on the inner surface, set the gray threshold to complete the image segmentation, and use the area feature analysis method to remove the noise area to realize the black spot defect detection on the inner surface of the crown cap;
  • Step 5 According to the image segmentation result of step 3, extract the image of the inner and outer ring area, use the local threshold method to complete the image segmentation, use the area feature analysis method to remove the noise area, and realize the bubble detection of the inner and outer ring area on the inner surface of the crown cap;
  • Step 6 Use the fixed threshold segmentation method to obtain the contour edge of the outer ring area, and use the least square method to circle the outer ring contour pixel points, compare the area difference between the outer ring contour area and the fitting area, and realize the defect Glue defect detection;
  • Step 7 According to the image segmentation result of step 3, extract the flash area image, and use the fixed threshold segmentation method and area feature analysis method to realize the flash sticky material defect detection;
  • Step 8 According to the image segmentation result of step 3, extract the connected areas of the skirt teeth, count the number of connected areas, calculate the angle between each connected area and the center of the bottle cap, and use the angle difference between adjacent skirt teeth to determine whether the skirt teeth are defective ;
  • Step 9 Collect an image of the outer surface of a standard bottle cap, perform Gaussian filtering on the image, and establish an offline feature template based on the edge feature information of the image;
  • Step 10 Set the template matching score, and use the feature template matching method to detect and locate the image to be tested after being processed by Gaussian filtering;
  • Step 11 Perform affine transformation on the target image according to the template matching result in Step 10, perform threshold segmentation and region comparison on the template image and the target image, and use the connected region area feature analysis method to achieve external surface defect detection.
  • the image acquisition system includes an industrial area scan camera, a low-angle ring light source, and an industrial computer.
  • the industrial area scan camera uses a sensor-triggered photographing method to complete data collection.
  • the inner surface of the crown cap is divided into a central area R1, an inner ring area R2, a middle ring area R3, an outer ring area R4, a flash area R5 and a skirt tooth area R6, and a central area R1
  • the positioning method includes the following steps:
  • the maximum between-cluster variance method selects the k value when g(k) is maximum as the segmentation threshold
  • R represents the area of the area, that is, the number of pixels in the area, and gvalue represents the gray value
  • the least squares method is used to perform circle fitting on the edge pixels of the area.
  • P(x i , y i ) be the contour point
  • L Ri is the distance from P(x i , y i ) to the fitting circle
  • N is the image pixel
  • the total number is deduced by formula (VI) to get the center (a, b) and radius R of the fitted circle, and the center area R1 is obtained according to the detection result;
  • the physical radius information of different areas is preset according to the type of bottle cap, the pixel radius information of different areas is obtained by using the pixel ratio parameter, and the area segmentation of the inner surface of the crown cap is realized by combining the position information of the center area.
  • step 4 the black spot defect detection on the inner surface of the crown cap includes the following steps: first use a fixed threshold method to segment the image, and then analyze the connected areas after the threshold value segmentation, and then set an appropriate area threshold to realize the black spot defect Judgment, the test result is shown in Figure 3.
  • step 5 the bubble defect detection of the inner ring area R2 and the outer ring area R4 on the inner surface of the crown cap includes the following steps:
  • T xy am xy +b ⁇ xy (VII);
  • a and b are the mean and variance coefficients, respectively, t is a fixed value, and g(x,y) is the output image; after threshold segmentation, set an appropriate area threshold, and filter out smaller areas through the connected area area feature analysis method In the noise interference area, the bubble defect detection is realized, and the detection result is shown in Figure 4.
  • step 6 the lack of glue defect detection includes the following steps:
  • step 7 the flash and sticky material defect detection includes the following steps: first extract the image of the flash ring area, then use the fixed threshold method to segment the ROI image, and finally use the area feature analysis method to remove the noise interference area on the connected area obtained by the segmentation.
  • the judgment of flash sticky material, the test result is shown in Figure 6.
  • step 8 the skirt tooth defect detection process is shown in Figure 7, including the following steps:
  • the defect detection process on the outer surface of the crown cap includes the steps of offline template establishment, feature template matching, affine transformation, area comparison, and connected area feature analysis.
  • step 9 the steps of the offline template establishment method are as follows:
  • threshold segmentation method is used to extract the central ring pattern area on the template image
  • the Canny method is used to detect the edge of the template image on the image of the central ring area
  • step 10 the feature template matching algorithm steps are as follows:
  • s is the similarity score returned by the normalized correlation function
  • A is the second-order rotation matrix
  • the matching score is closer to 1, indicating the corresponding area in the image The higher the matching degree with the template
  • the pyramid hierarchical search strategy is used to improve the efficiency of the algorithm and reduce the matching search time, and use the similarity threshold to set the matching search termination condition, and s j represents the sum of dot products accumulated to the jth element of the template. s min represents the lowest matching score.
  • the normalized dot product sum calculation method is shown in formula (XI). If s j satisfies formula (XII), the template matching score cannot reach s min . Therefore, the matching search process is in the first Stop calculation after j elements;
  • step 11 the algorithm steps are as follows:
  • H(t) is the translation matrix between the template and the target image
  • H(R) is the rotation matrix between the template and the target image
  • step S2 According to the results of step S1, set the pattern ring ROI area, segment the target image and the template image using the fixed threshold to obtain the regions of interest Ro and R t , and use the area comparison method to obtain the difference area Rd , as in formula (XIV) Shown:
  • R d (R 0 -R t )+(R t -R o ) (XIV);
  • S3 Use the connected area feature analysis method to analyze the connected area feature of the different area R, and set an appropriate area feature threshold T to realize the judgment of the outer surface defect.

Landscapes

  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

一种基于图像处理的皇冠盖表面缺陷在线检测方法,采集皇冠盖内表面图像,并利用图像分割技术实现中心定位和区域提取;利用阈值分割、形态学处理、连通区域特征分析、区域比较等图像处理算法实现瓶盖内表面缺陷检测;采用自动训练学习算法离线建立皇冠盖外表面图案模板;采集皇冠盖外表面图像,利用特征模板匹配、仿射变换和区域比较法完成瓶盖外表面缺陷检测。该方法能够在线快速检测皇冠盖表面多种类型缺陷,可达到每分钟检测300个瓶盖,具有缺陷检测准确率高、鲁棒性强等优点,能够附加在皇冠盖生产线上,实现皇冠盖的缺陷检测和类型判别。

Description

一种基于图像处理的皇冠盖表面缺陷在线检测方法 技术领域
本发明属于图像处理技术领域,具体涉及一种基于图像处理的皇冠盖表面缺陷在线检测方法。
背景技术
随着我国智能制造产业的快速发展,机器视觉和图像处理技术成为产品后工序检测主要手段之一。皇冠盖因其良好的密封性能而广泛应用于玻璃瓶装的啤酒和碳酸饮料等行业中。据统计我国从2008年开始皇冠盖的市场需求为470亿个,而且每年以20亿个增长,这也大大刺激了瓶盖生产与检测的效率。作为世界最大的皇冠盖需求市场,提升皇冠盖的缺陷检测水平对于我国皇冠盖产业的发展具有十分重要的意义。
自1981年美国制作了第一台皇冠盖机,在皇冠盖应用和生产激增的情况下,各国都致力于改善和发展皇冠盖自动检测技术,当前国内关于瓶盖检测技术已经取得了一定的进展。
何修远提出了一种基于机器视觉的PET瓶盖缺陷检测算法(2015年),每分钟可以处理8个瓶盖,漏检率低于0.1%,缺陷准确率达到99%。刘伟提出了一种基于凸包算法的皇冠盖裙齿检测方法(2018年),但检测内容只涉及外表面缺陷。周文炬(2014)提出了一种基于稀疏表示方法的皇冠盖旋转匹配和瑕疵检测策略,但是该方法对于形状缺陷(如缺胶、飞边)没有详细的分析。
CN201110048984.7公开了一种基于机器视觉的表面瑕疵的智能检测方法,但只涉及皇冠盖外表面缺陷检测。CN102192911A公开了一种基于机器视觉的金属瓶盖质量检测***和方法,但瓶盖缺陷检测类型单一且缺陷类型与皇冠盖不同。
综上所述,现有皇冠盖缺陷检测方案主要问题在于:当前瓶盖研究算法自适应不强,不能适用于皇冠盖的特殊情况;已有的皇冠盖缺陷检测方法缺陷检测类型较为单一,还无法实现皇冠盖内外表面所有缺陷类型的检测。
发明内容
发明目的:本发明的目的在于提供一种基于图像处理的皇冠盖表面缺陷在线检测方法,解决了现有皇冠盖表面多类型缺陷检测和分类问题。
技术方案:为实现上述目的,本发明提供如下技术方案:
一种基于图像处理的皇冠盖表面缺陷在线检测方法,包括如下步骤:
步骤1:通过图像采集***采集皇冠瓶盖内表面图像,并对采集到的图像进行高斯滤波处理;
步骤2:对采集图像利用阈值分割和连通区域面积特征分析法提取中心区域,对区域轮廓边缘像素点采用最小二乘拟合法拟合圆形轮廓,实现皇冠盖内表面中心定位;
步骤3:根据步骤2得到的瓶盖中心位置坐标,针对不同类型瓶盖预先设置不同区域的物理半径信息,结合像素比参数,实现皇冠盖内表面的区域分割;
步骤4:根据步骤3图像分割结果,提取内表面感兴趣区域图像,设置固定灰度阈值完成图像分割,并利用面积特征分析法祛除噪声区域,实现皇冠盖内表面的黑点缺陷检测;
步骤5:根据步骤3图像分割结果,提取内外环区域图像,采用局部阈值法完成图像分割,利用面积特征分析法祛除噪声区域,实现皇冠盖内表面的内外环区域气泡检测;
步骤6:对采集图像利用固定阈值分割法获得外环区域轮廓边缘,并利用最小二乘法对外环轮廓像素点进行圆拟合,比较外环轮廓区域与拟合区域之间的区域差,实现缺胶缺陷检测;
步骤7:根据步骤3图像分割结果,提取飞边区域图像,利用固定阈值分割法和面积特征分析法实现飞边粘料缺陷检测;
步骤8:根据步骤3图像分割结果,提取裙齿连通区域,统计连通区域的个数,计算各连通区域与瓶盖中心的夹角,利用相邻裙齿的夹角差判断裙齿有无缺陷;
步骤9:采集标准瓶盖外表面图像,并对图像进行高斯滤波处理,根据图像边缘特征信息建立离线特征模板;
步骤10:设置模板匹配分值,对待测图像经高斯滤波处理后利用特征模板匹配法进行检测定位;
步骤11:根据步骤10模板匹配结果,对目标图像进行仿射变换,分别对模板图像和目标图像进行阈值分割和区域比较,并利用连通区域面积特征分析法实 现外表面缺陷检测。
进一步地,步骤1中,所述的图像采集***包括工业面阵相机、低角度环形光源和工控机,所述的工业面阵相机采用传感器触发拍照方式完成数据采集。
进一步地,步骤2和步骤3中,所述的皇冠盖内表面分为中心区域R1、内环区域R2、中环区域R3、外环区域R4、飞边区域R5和裙齿区域R6,所述的中心区域R1定位方法包括如下步骤:
首先采用基于最大类方差法对图像进行阈值分割,设图像大小为M×N,灰度值为i的像素数为n i,则不同灰度级的概率为
Figure PCTCN2019108953-appb-000001
利用灰度阈值k将图像进行二值化得到区域C 1和C 2,它们的均值分别为u 1和u 2,概率分别为P 1(k)和P 2(k),则:
Figure PCTCN2019108953-appb-000002
Figure PCTCN2019108953-appb-000003
其中0<k<255,整幅图像的均值u为:u=P 1(k)u 1+P 2(k)u 2  (III);
目标函数为:g(k)=P 1(k)(u 1-u) 2+P 2(k)(u 2-u) 2  (IV);
最大类间方差法选择满足g(k)最大时的k值作为分割阈值;
然后提取面积最大的连通区域为中心区域,如式(V)所示:
Figure PCTCN2019108953-appb-000004
其中R表示区域的面积,即区域中像素个数,gvalue表示灰度值;
最后利用最小二乘法对区域边缘像素点进行圆拟合,设P(x i,y i)为轮廓点,L Ri为P(x i,y i)到拟合圆的距离,N为图像像素总数,经过公式(VI)推导,得到拟合圆的圆心(a,b)和半径R,根据检测结果得到中心区域R1;
Figure PCTCN2019108953-appb-000005
根据瓶盖类型预先设置不同区域的物理半径信息,利用像素比参数获取不同区域的像素半径信息,结合中心区域位置信息实现皇冠盖内表面的区域分割。
进一步地,步骤4中,所述的皇冠盖内表面的黑点缺陷检测包括如下步骤:首先利用固定阈值法对图像进行分割,然后对阈值分割后的连通区域进行分析,最后设置合适的面积阈值,实现黑点缺陷的判断。
进一步地,步骤5中,所述的皇冠盖内表面的内环区域R2和外环区域R4气泡缺陷检测包括如下步骤:
首先利用局部动态阈值法完成图像分割,其中局部阈值的设置方法如式(VII)、式(VIII)所示:
T xy=am xy+bσ xy  (VII);
Figure PCTCN2019108953-appb-000006
其中a和b分别为均值和方差系数,t为固定值,g(x,y)为输出图像;经过阈值分割后,设置合适的面积阈值,通过连通区域面积特征分析法滤除面积较小的噪声干扰区域,实现气泡缺陷检测。
进一步地,步骤6中,所述的缺胶缺陷检测包括如下步骤:
6.1)首先利用阈值分割和连通区域面积特征分析法提取外环边缘连通区域w1;
6.2)然后利用最小二乘法对外环区域边缘圆拟合,得到拟合外环边缘连通区域w2;
6.3)最后计算拟合外环区域和外环区域之差,得到差异区域df,如式(IX)所示,并利用连通区域面积特征分析法过滤噪声干扰区域,实现缺胶判断:df=w2-w1  (IX)。
进一步地,步骤7中,所述的飞边粘料缺陷检测包括如下步骤:首先提取飞边环形区域图像,然后利用固定阈值法对ROI图像分割,最后对分割得到的连通区域采用面积特征分析方法祛除噪声干扰区域,实现飞边粘料的判断。
进一步地,步骤8中,所述的裙齿缺陷检测步骤包括如下步骤:
8.1)根据步骤3图像分割结果提取裙齿区域图像,并对ROI提取图像进行阈值分割和连通区域特征分析,通过设置合适的面积阈值提取裙齿区域;
8.2)根据裙齿区域计算裙齿个数num,0<num<22,若num<21则存在裙齿缺失缺陷,结束检测;
8.3)若裙齿个数正常,根据裙齿中心位置计算各裙齿中心与瓶盖中心的角度,并计算相邻裙齿的角度差θ;
8.4)设置裙齿角度差阈值θ T,当θ满足条件|θ|>θ T时,瓶盖存在裙齿畸形缺陷。
进一步地,步骤9中,所述的离线模板建立方法步骤如下:
首先对模板图像采用阈值分割法、区域填充法、面积特征滤波法和最小二乘拟合法提取中心环形图案区域;
然后对中心环形区域图像利用Canny法检测模板图像边缘;
最后提取边缘点的位置和梯度信息建立特征模板;
进一步地,步骤10中,所述的特征模板匹配算法步骤如下:
10.1)为了得到精确的匹配位置,首先对模板进行仿射变换,去除仿射变换中的平移部分;
10.2)然后计算模板变换后边缘点梯度向量与图像中对应边缘点梯度向量的点积之和,并对计算结果进行归一化,设(r i,c i)、(t i,u i)、(r,c)、(v r,c,w r,c)为图像中第i个像素的行列位置信息,模板边缘点集p i=(r i,c i) T对应的边缘梯度向量为d i=(t i,u i) T,目标图像边缘点集(r,c)对应的边缘梯度向量为e r,c=(v r,c,w r,c) T;待搜索点q=(r,c) T处的相似度函数计算方法如式(X)所示:
Figure PCTCN2019108953-appb-000007
其中s为归一化相关函数返回的相似度分值,d' i=(A -1) Td i得出,A为二阶旋转矩阵,匹配分值越接近于1,说明图像中对应区域与模板之间的匹配度越高;
10.3)最后,采用金字塔分层搜索策略以提高算法效率和降低匹配搜索时间,并利用相似度阈值设定匹配搜索终止条件,以s j表示累计到模板的第j个元素时的点积总和,s min表示最低匹配分值,归一化点积和计算方法如式(XI)所示,如果s j满足式(XII),则模板匹配分数不可能达到s min,因此,匹配搜索过程在第j个元素后停止计算;
Figure PCTCN2019108953-appb-000008
s j<s min-1+j/n(XII)。
设置模板匹配分值为0.9,若模板匹配未成功,则存在错图缺陷。
步骤11中,算法步骤如下:
S1:根据模板匹配计算模板与目标图像之间的仿射矩阵,利用仿射变换将目标图像调整为与模板相同的方向,仿射变换矩阵如式(XIII)所示,
H=H(t)·H(R)(XIII);
其中H(t)为模板与目标图像之间的平移矩阵,H(R)为模板与目标图像之间的旋转矩阵。
S2:根据S1步骤结果,设置图案环形ROI区域,利用固定法阈值分别对目标图像和模板图像分割得到感兴趣区域R o和R t,利用区域比较法获取差异区域R d,如式(XIV)所示:
R d=(R 0-R t)+(R t-R o)  (XIV);
S3:利用连通区域特征分析法对差异区域R连通区域特征分析,设置合适的面积特征阈值T,实现外表面缺陷的判断。
有益效果:与现有技术相比,本发明的一种基于图像处理的皇冠盖表面缺陷在线检测方法,采集皇冠盖内表面图像,并利用图像分割技术实现中心定位和区域提取;利用阈值分割、形态学处理、连通区域特征分析、区域比较等图像处理算法实现瓶盖内表面缺陷检测;采用自动训练学习算法离线建立外表面图案模板; 采集皇冠盖外表面图像,利用特征模板匹配、仿射变换和区域比较法完成瓶盖外表面的缺陷检测。本发明能够在线快速检测皇冠盖表面多种类型缺陷,包括内表面黑点、气泡、缺胶、飞边粘料、裙齿畸形缺失和外表面图案缺失和错图缺陷,可达到每分钟检测300个瓶盖,具有缺陷检测准确率高、鲁棒性强等优点,能够附加在皇冠盖生产线上,实现皇冠盖的缺陷检测和类型判别。
附图说明
图1为检测流程示意图;
图2为皇冠瓶盖示意图;
图3为黑点缺陷检测结果示意图;
图4为气泡缺陷检测结果示意图;
图5为缺胶缺陷检测结果示意图;
图6为飞边粘料缺陷检测结果示意图;
图7为裙齿夹角示意图;
图8为裙齿缺陷检测过程示意图;
图9为外表面缺陷检测过程示意图。
具体实施方式
为了更好地理解本发明专利的内容,下面结合附图和具体实施例来进一步说明本发明的技术方案。
如图1所示,皇冠盖表面缺陷检测流程包括内表面检测和外表面检测两部分,内表面检测包括内表面图像采集、区域中心定位和黑点、飞边缺胶、内外环气泡、粘料、裙齿畸形缺失等缺陷类型检测,外表面检测包括外表面图像采集、区域中心定位和图案缺失、错图等缺陷类型检测,内外表面缺陷检测分为两个工位同时进行,且分别拥有独立的图像采集与处理***,一种基于图像处理的皇冠盖表面缺陷在线检测方法,包括如下步骤:
步骤1:通过图像采集***采集皇冠瓶盖内表面图像,并对采集图像进行高斯滤波处理;
步骤2:对采集图像利用阈值分割和连通区域面积特征分析法提取中心区域,对区域轮廓边缘像素点采用最小二乘拟合法拟合圆形轮廓,实现皇冠盖内表面中心定位;
步骤3:根据步骤2得到的瓶盖中心位置坐标,针对不同类型瓶盖预先设置不同区域的物理半径信息,结合像素比参数,实现皇冠盖内表面的区域分割;
步骤4:根据步骤3图像分割结果,提取内表面感兴趣区域图像,设置灰度阈值完成图像分割,并利用面积特征分析法祛除噪声区域,实现皇冠盖内表面的黑点缺陷检测;
步骤5:根据步骤3图像分割结果,提取内外环区域图像,采用局部阈值法完成图像分割,利用面积特征分析法祛除噪声区域,实现皇冠盖内表面的内外环区域气泡检测;
步骤6:对采集图像利用固定阈值分割法获得外环区域轮廓边缘,并利用最小二乘法对外环轮廓像素点进行圆拟合,比较外环轮廓区域与拟合区域之间的区域差,实现缺胶缺陷检测;
步骤7:根据步骤3图像分割结果,提取飞边区域图像,利用固定阈值分割法和面积特征分析法实现飞边粘料缺陷检测;
步骤8:根据步骤3图像分割结果,提取裙齿连通区域,统计连通区域的个数,计算各连通区域与瓶盖中心的夹角,利用相邻裙齿的夹角差判断裙齿有无缺陷;
步骤9:采集标准瓶盖外表面图像,并对图像进行高斯滤波处理,根据图像边缘特征信息建立离线特征模板;
步骤10:设置模板匹配分值,对待测图像经高斯滤波处理后利用特征模板匹配法进行检测定位;
步骤11:根据步骤10模板匹配结果,对目标图像进行仿射变换,分别对模板图像和目标图像进行阈值分割和区域比较,并利用连通区域面积特征分析法实现外表面缺陷检测。
步骤1中,图像采集***包括工业面阵相机、低角度环形光源和工控机,工业面阵相机采用传感器触发拍照方式完成数据采集。
如图2所示,步骤2和步骤3中,皇冠盖内表面分为中心区域R1、内环区域R2、中环区域R3、外环区域R4、飞边区域R5和裙齿区域R6,中心区域R1定位方法包括如下步骤:
首先采用基于最大类方差法对图像进行阈值分割,设图像大小为M×N,灰 度值为i的像素数为n i,则不同灰度级的概率为
Figure PCTCN2019108953-appb-000009
利用灰度阈值k将图像进行二值化得到区域C 1和C 2,它们的均值分别为u 1和u 2,概率分别为P 1(k)和P 2(k),则:
Figure PCTCN2019108953-appb-000010
Figure PCTCN2019108953-appb-000011
其中0<k<255,整幅图像的均值u为:u=P 1(k)u 1+P 2(k)u 2  (III);
目标函数为:g(k)=P 1(k)(u 1-u) 2+P 2(k)(u 2-u) 2  (IV);
最大类间方差法选择满足g(k)最大时的k值作为分割阈值;
然后提取面积最大的连通区域为中心区域,如式(V)所示:
Figure PCTCN2019108953-appb-000012
其中R表示区域的面积,即区域中像素个数,gvalue表示灰度值;
最后利用最小二乘法对区域边缘像素点进行圆拟合,设P(x i,y i)为轮廓点,L Ri为P(x i,y i)到拟合圆的距离,N为图像像素总数,经过公式(VI)推导,得到拟合圆的圆心(a,b)和半径R,根据检测结果得到中心区域R1;
Figure PCTCN2019108953-appb-000013
根据瓶盖类型预先设置不同区域的物理半径信息,利用像素比参数获取不同区域的像素半径信息,结合中心区域位置信息实现皇冠盖内表面的区域分割。
步骤4中,皇冠盖内表面的黑点缺陷检测包括如下步骤:首先利用固定阈值法对图像进行分割,然后对阈值分割后的连通区域进行分析,随后设置合适的面积阈值,实现黑点缺陷的判断,检测结果如图3所示。
步骤5中,皇冠盖内表面的内环区域R2和外环区域R4气泡缺陷检测包括如下步骤:
首先利用局部动态阈值法完成图像分割,其中局部阈值的设置方法如式(VII)、式(VIII)所示:
T xy=am xy+bσ xy  (VII);
Figure PCTCN2019108953-appb-000014
其中a和b分别为均值和方差系数,t为固定值,g(x,y)为输出图像;经过阈值分割后,设置合适的面积阈值,通过连通区域面积特征分析法滤除面积较小的噪声干扰区域,实现气泡缺陷检测,检测结果如图4所示。
步骤6中,缺胶缺陷检测包括如下步骤:
6.1)首先利用阈值分割和连通区域面积特征分析法提取外环边缘连通区域w1;
6.2)然后利用最小二乘法对外环区域边缘圆拟合,得到拟合外环边缘连通区域w2;
6.3)最后计算拟合外环区域和外环区域之差,得到差异区域df,如式(IX)所示,并利用连通区域面积特征分析法过滤噪声干扰区域,实现缺胶判断,检测结果如图5所示
df=w2-w1  (IX)。
步骤7中,飞边粘料缺陷检测包括如下步骤:首先提取飞边环形区域图像,然后利用固定阈值法对ROI图像分割,最后对分割得到的连通区域采用面积特征分析方法祛除噪声干扰区域,实现飞边粘料的判断,检测结果如图6所示。
步骤8中,裙齿缺陷检测流程如图7所示,包括如下步骤:
8.1)根据步骤3图像分割结果提取裙齿区域图像,并对ROI提取图像进行阈值分割和连通区域特征分析,通过设置合适的面积阈值提取裙齿区域;
8.2)根据裙齿区域计算裙齿个数num,0<num<22,若num<21则存在裙齿缺失缺陷,结束检测;
8.3)若裙齿个数正常,根据裙齿中心位置计算各裙齿中心与瓶盖中心的角 度,检测结果如图8所示,并计算相邻裙齿的角度差θ。
8.4)设置裙齿角度差阈值θ T,当θ满足条件|θ|>θ T时,瓶盖存在裙齿畸形缺陷。
如图9所示,皇冠盖外表面缺陷检测流程包括离线模板建立、特征模板匹配、仿射变换、区域比较和连通区域特征分析等步骤。
步骤9中,离线模板建立方法步骤如下:
首先对模板图像采用阈值分割法、区域填充法、面积特征滤波法和最小二乘拟合法提取中心环形图案区域;
然后对中心环形区域图像利用Canny法检测模板图像边缘;
最后提取边缘点的位置和梯度信息建立特征模板;
步骤10中,特征模板匹配算法步骤如下:
10.1)为了得到精确的匹配位置,首先对模板进行仿射变换,去除仿射变换中的平移部分;
10.2)然后计算模板变换后边缘点梯度向量与图像中对应边缘点梯度向量的点积之和,并对计算结果进行归一化,设(r i,c i)、(t i,u i)、(r,c)、(v r,c,w r,c)为图像中第i个像素的行列位置信息,模板边缘点集p i=(r i,c i) T对应的边缘梯度向量为d i=(t i,u i) T,目标图像边缘点集(r,c)对应的边缘梯度向量为e r,c=(v r,c,w r,c) T;待搜索点q=(r,c) T处的相似度函数计算方法如式(X)所示:
Figure PCTCN2019108953-appb-000015
其中s为归一化相关函数返回的相似度分值,d' i=(A -1) Td i得出,A为二阶旋转矩阵,匹配分值越接近于1,说明图像中对应区域与模板之间的匹配度越高;
10.3)最后,采用金字塔分层搜索策略以提高算法效率和降低匹配搜索时间,并利用相似度阈值设定匹配搜索终止条件,以s j表示累计到模板的第j个元素时的点积总和,s min表示最低匹配分值,归一化点积和计算方法如式(XI)所示,如果s j满足式(XII),则模板匹配分数不可能达到s min,因此,匹配搜索过程在 第j个元素后停止计算;
Figure PCTCN2019108953-appb-000016
s j<s min-1+j/n  (XII)。
设置模板匹配分值为0.9,若模板匹配未成功,则存在错图缺陷。
步骤11中,算法步骤如下:
S1:根据模板匹配计算模板与目标图像之间的仿射矩阵,利用仿射变换将目标图像调整为与模板相同的方向,仿射变换矩阵如式(XIII)所示,
H=H(t)·H(R)  (XIII);
其中H(t)为模板与目标图像之间的平移矩阵,H(R)为模板与目标图像之间的旋转矩阵。
S2:根据S1步骤结果,设置图案环形ROI区域,利用固定法阈值分别对目标图像和模板图像分割得到感兴趣区域R o和R t,利用区域比较法获取差异区域R d,如式(XIV)所示:
R d=(R 0-R t)+(R t-R o)  (XIV);
S3:利用连通区域特征分析法对差异区域R连通区域特征分析,设置合适的面积特征阈值T,实现外表面缺陷的判断。
以上仅是本发明的优选实施方式,应当指出:对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对各实施位置进行调整,这些调整也应视为本发明的保护范围。

Claims (10)

  1. 一种基于图像处理的皇冠盖表面缺陷在线检测方法,其特征在于,包括如下步骤:
    步骤1:通过图像采集***采集皇冠瓶盖内表面图像,并对采集图像进行高斯滤波处理;
    步骤2:对采集图像利用阈值分割和连通区域面积特征分析法提取中心区域,对中心区域轮廓边缘像素点采用最小二乘拟合法拟合圆形轮廓,实现皇冠盖内表面中心定位;
    步骤3:根据步骤2得到的瓶盖中心位置坐标,针对不同类型瓶盖预先设置不同区域的物理半径信息,结合像素比参数,实现皇冠盖内表面的区域分割;
    步骤4:根据步骤3图像分割结果,提取内表面感兴趣区域图像,设置固定灰度阈值完成图像分割,并利用连通区域面积特征分析法祛除噪声区域,实现皇冠盖内表面的黑点缺陷检测;
    步骤5:根据步骤3图像分割结果,提取内外环区域图像,采用局部阈值法完成图像分割,利用连通区域面积特征分析法祛除噪声区域,实现皇冠盖内表面的内外环区域气泡检测;
    步骤6:对采集图像利用固定阈值分割法获得外环区域轮廓边缘,并利用最小二乘法对外环轮廓像素点进行圆拟合,比较外环轮廓区域与拟合区域之差,实现缺胶缺陷检测;
    步骤7:根据步骤3图像分割结果,提取飞边区域图像,利用固定阈值分割法和面积特征分析法实现飞边粘料缺陷检测;
    步骤8:根据步骤3图像分割结果,提取裙齿连通区域,统计连通区域个数,并计算各连通区域与瓶盖中心的夹角,利用相邻裙齿的夹角差判断裙齿有无缺陷;
    步骤9:采集标准瓶盖外表面图像,并对图像进行高斯滤波处理,根据图像边缘特征信息建立离线特征模板;
    步骤10:设置模板匹配分值,对待测图像经高斯滤波处理后利用特征模板匹配法进行检测定位;
    步骤11:根据步骤10模板匹配结果,对目标图像进行仿射变换,分别对模板图像和目标图像进行阈值分割和区域比较,并利用连通区域面积特征分析法实现外表面缺陷检测。
  2. 根据权利要求1所述的一种基于图像处理的皇冠盖表面缺陷在线检测方法,其特征在于:步骤1中,所述的图像采集***包括工业面阵相机、低角度环形光源和工控机,所述的工业面阵相机采用传感器触发拍照方式完成图像采集。
  3. 根据权利要求1所述的一种基于图像处理的皇冠盖表面缺陷在线检测方法,其特征在于:步骤2和步骤3中,所述的皇冠盖内表面分为中心区域R1、内环区域R2、中环区域R3、外环区域R4、飞边区域R5和裙齿区域R6,所述的中心区域R1定位方法包括如下步骤:
    首先采用基于最大类方差法对图像进行阈值分割,设图像大小为M×N,灰度值为i的像素数为n i,则不同灰度级的概率为
    Figure PCTCN2019108953-appb-100001
    利用灰度阈值k将图像进行二值化得到区域C 1和C 2,它们的均值分别为u 1和u 2,概率分别为P 1(k)和P 2(k),则:
    Figure PCTCN2019108953-appb-100002
    Figure PCTCN2019108953-appb-100003
    其中0<k<255,整幅图像的均值u为:u=P 1(k)u 1+P 2(k)u 2 (III);
    目标函数为:g(k)=P 1(k)(u 1-u) 2+P 2(k)(u 2-u) 2 (IV);
    最大类间方差法选择满足g(k)最大时的k值作为分割阈值;
    然后提取面积最大的连通区域为中心区域,如式(V)所示:
    Figure PCTCN2019108953-appb-100004
    其中R表示区域的面积,即区域中像素个数,gvalue表示灰度值;
    最后利用最小二乘法对区域边缘像素点进行圆拟合,设P(x i,y i)为轮廓点,L Ri为P(x i,y i)到拟合圆的距离,N为图像像素总数,经过公式(VI)推导,得到拟合圆的圆心(a,b)和半径R,根据检测结果得到中心区域R1;
    Figure PCTCN2019108953-appb-100005
    根据瓶盖类型预先设置不同区域的物理半径信息,利用像素比参数获取不同区域的像素半径信息,结合中心区域位置信息实现皇冠盖内表面的区域分割。
  4. 根据权利要求3所述的一种基于图像处理的皇冠盖表面缺陷在线检测方法,其特征在于:步骤4中,所述的皇冠盖内表面黑点缺陷检测包括如下步骤:首先利用固定阈值法对图像进行分割,然后对阈值分割后的连通区域进行分析,随后设置合适的面积阈值,实现黑点缺陷的判断。
  5. 根据权利要求4所述的一种基于图像处理的皇冠盖表面缺陷在线检测方法,其特征在于:步骤5中,所述的皇冠盖内表面内环区域R2和外环区域R4气泡缺陷检测包括如下步骤:
    首先利用局部动态阈值法完成图像分割,其中局部阈值的设置方法如式(VII)、式(VIII)所示:
    T xy=am xy+bσ xy (VII);
    Figure PCTCN2019108953-appb-100006
    其中a和b分别为均值和方差系数,t为固定值,g(x,y)为输出图像;经过阈值分割后,设置合适的面积阈值,通过连通区域面积特征分析法滤除面积较小的噪声干扰区域,实现气泡缺陷检测。
  6. 根据权利要求5所述的一种基于图像处理的皇冠盖表面缺陷在线检测方法,其特征在于:步骤6中,所述的缺胶缺陷检测包括如下步骤:
    6.1)首先利用阈值分割和连通区域面积特征分析法提取外环边缘连通区域w1;
    6.2)然后利用最小二乘法对外环区域边缘圆拟合,得到拟合外环边缘连通区域w2;
    6.3)最后计算拟合外环区域和外环区域之差,得到差异区域df,如式(IX) 所示,并利用连通区域面积特征分析法过滤噪声干扰区域,实现缺胶判断:df=w2-w1(IX)。
  7. 根据权利要求6所述的一种基于图像处理的皇冠盖表面缺陷在线检测方法,其特征在于:步骤7中,所述的飞边粘料缺陷检测包括如下步骤:首先提取飞边环形区域图像,然后利用固定阈值法对ROI图像分割,最后对分割得到的连通区域采用面积特征分析方法祛除噪声干扰区域,实现飞边粘料的判断。
  8. 根据权利要求7所述的一种基于图像处理的皇冠盖表面缺陷在线检测方法,其特征在于:步骤8中,所述的裙齿缺陷检测步骤包括如下步骤:
    8.1)根据步骤3图像分割结果提取裙齿区域图像,并对ROI提取图像进行阈值分割和连通区域特征分析,通过设置合适的面积阈值提取裙齿区域;
    8.2)根据裙齿区域计算裙齿个数num,0<num<22,若num<21则存在裙齿缺失缺陷,结束检测;
    8.3)若裙齿个数正常,根据裙齿中心位置计算各裙齿中心与瓶盖中心的角度,并计算相邻裙齿的角度差θ;
    8.4)设置裙齿角度差阈值θ T,当θ满足条件|θ|>θ T时,瓶盖存在裙齿畸形缺陷。
  9. 根据权利要求8所述的一种基于图像处理的皇冠盖表面缺陷在线检测方法,其特征在于:步骤9中,所述的离线模板建立方法步骤如下:
    首先对模板图像采用阈值分割法、区域填充法、面积特征滤波法和最小二乘拟合法提取中心环形图案区域;
    然后对中心环形区域图像利用Canny法检测模板图像边缘;
    最后提取边缘点的位置和梯度信息建立特征模板;
  10. 根据权利要求9所述的一种基于图像处理的皇冠盖表面缺陷在线检测方法,其特征在于:步骤10中,所述的特征模板匹配算法步骤如下:
    10.1)为了得到精确的匹配位置,首先对模板进行仿射变换,去除仿射变换中的平移部分;
    10.2)然后计算模板变换后边缘点梯度向量与图像中对应边缘点梯度向量的点积之和,并对计算结果进行归一化,设(r i,c i)、(t i,u i)、(r,c)、(v r,c,w r,c)为图 像中第i个像素的行列位置信息,模板边缘点集p i=(r i,c i) T对应的边缘梯度向量为d i=(t i,u i) T,目标图像边缘点集(r,c)对应的边缘梯度向量为e r,c=(v r,c,w r,c) T;待搜索点q=(r,c) T处的相似度函数计算方法如式(X)所示:
    Figure PCTCN2019108953-appb-100007
    其中s为归一化相关函数返回的相似度分值,d' i=(A -1) Td i得出,A为二阶旋转矩阵,匹配分值越接近于1,说明图像中对应区域与模板之间的匹配度越高;
    10.3)最后,采用金字塔分层搜索策略以提高算法效率和降低匹配搜索时间,并利用相似度阈值设定匹配搜索终止条件,以s j表示累计到模板的第j个元素时的点积总和,s min表示最低匹配分值,归一化点积和计算方法如式(XI)所示,如果s j满足式(XII),则模板匹配分数不可能达到s min,因此,匹配搜索过程在第j个元素后停止计算;
    Figure PCTCN2019108953-appb-100008
    s j<s min-1+j/n(XII)。
    设置模板匹配分值为0.9,若模板匹配未成功,则皇冠盖外表面存在错图缺陷。
    步骤11中,算法步骤如下:
    S1:根据模板匹配计算模板与目标图像之间的仿射矩阵,利用仿射变换将目标图像调整为与模板相同的方向,仿射变换矩阵如式(XIII)所示,
    H=H(t)·H(R) (XIII);
    其中H(t)为模板与目标图像之间的平移矩阵,H(R)为模板与目标图像之间的旋转矩阵。
    S2:根据S1步骤结果,设置图案环形ROI区域,利用固定法阈值分别对目标图像和模板图像分割得到感兴趣区域R o和R t,利用区域比较法获取差异区域R d,如式(XIV)所示:
    R d=(R 0-R t)+(R t-R o) (XIV);
    S3:利用连通区域特征分析法对差异区域R连通区域特征分析,设置合适的面积特征阈值T,实现外表面缺陷的判断。
PCT/CN2019/108953 2019-06-11 2019-09-29 一种基于图像处理的皇冠盖表面缺陷在线检测方法 WO2020248439A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910501977.4 2019-06-11
CN201910501977.4A CN110220917B (zh) 2019-06-11 2019-06-11 一种基于图像处理的皇冠盖表面缺陷在线检测方法

Publications (1)

Publication Number Publication Date
WO2020248439A1 true WO2020248439A1 (zh) 2020-12-17

Family

ID=67816364

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/108953 WO2020248439A1 (zh) 2019-06-11 2019-09-29 一种基于图像处理的皇冠盖表面缺陷在线检测方法

Country Status (2)

Country Link
CN (1) CN110220917B (zh)
WO (1) WO2020248439A1 (zh)

Cited By (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113298725A (zh) * 2021-04-23 2021-08-24 杭州晟冠科技有限公司 一种轮船图标图像叠加误差的纠正方法
CN113358739A (zh) * 2021-06-30 2021-09-07 常州工学院 一种基于双目图像融合技术的磁粉探伤检测装置
CN113449659A (zh) * 2021-07-05 2021-09-28 淮阴工学院 一种车道线的检测方法
CN113592845A (zh) * 2021-08-10 2021-11-02 深圳市华汉伟业科技有限公司 一种电池涂布的缺陷检测方法及装置、存储介质
CN113706455A (zh) * 2021-07-14 2021-11-26 青海黄河上游水电开发有限责任公司 一种330kV电缆瓷瓶套管的破损快速检测方法
CN113838006A (zh) * 2021-09-06 2021-12-24 苏州坤厚自动化科技有限公司 一种基于halcon的检测圆桩的设计方法
CN114022418A (zh) * 2021-10-19 2022-02-08 上海电机学院 一种锂电池极片缺陷检测方法及***
CN114022410A (zh) * 2021-10-09 2022-02-08 湖北工业大学 一种油茶果破壳后的壳籽智能化分选方法
CN114187269A (zh) * 2021-12-07 2022-03-15 北京工业大学 小零器件表面缺陷边缘快速检测方法
CN114298968A (zh) * 2021-11-15 2022-04-08 河南中烟工业有限责任公司 批量运动烟支计数方法
CN114332063A (zh) * 2022-01-04 2022-04-12 合肥工业大学 一种基于背景差分的线束顺序检测方法
CN114332069A (zh) * 2022-01-05 2022-04-12 合肥工业大学 一种基于机器视觉的接插件检测方法及装置
CN114354631A (zh) * 2022-01-12 2022-04-15 绍兴职业技术学院 一种基于视觉的阀门毛坯表面缺陷检测方法
CN114705686A (zh) * 2022-03-21 2022-07-05 佛山科学技术学院 圆柱锅表面缺陷检测方法、***、控制器及工控机
CN114926441A (zh) * 2022-05-26 2022-08-19 昆山缔微致精密电子有限公司 一种注塑件加工成型的缺陷检测方法及***
CN114965181A (zh) * 2022-05-25 2022-08-30 中南大学 一种基于瞬变电磁检测图像的防渗屏障渗漏区域快速自动定位方法
CN116823756A (zh) * 2023-06-25 2023-09-29 江苏永康机械有限公司 一种桩腿焊缝缺陷检测方法
CN117437634A (zh) * 2023-12-21 2024-01-23 中国医学科学院北京协和医院 一种尿沉渣检测影像有形部分的识别分割方法
CN117474923A (zh) * 2023-12-27 2024-01-30 苏州镁伽科技有限公司 膜片图像的处理方法和膜片缺陷检测方法及其***
CN117495862A (zh) * 2024-01-03 2024-02-02 深圳家红齿科技术有限公司 一种义齿耐磨性检测装置
CN117522863A (zh) * 2023-12-29 2024-02-06 临沂天耀箱包有限公司 基于图像特征的集成箱体质量检测方法
CN117576089A (zh) * 2024-01-15 2024-02-20 山东恒力源精密机械制造有限公司 一种活塞环缺陷检测方法及***
CN117576107A (zh) * 2024-01-17 2024-02-20 中数智科(杭州)科技有限公司 基于图像匹配和配准的列车底部零部件的松动检测方法
CN117649412A (zh) * 2024-01-30 2024-03-05 山东海天七彩建材有限公司 一种铝材表面质量的检测方法
CN117723491A (zh) * 2024-02-07 2024-03-19 宁德时代新能源科技股份有限公司 电芯防爆阀的检测***及检测方法
CN117764992A (zh) * 2024-02-22 2024-03-26 山东乔泰管业科技有限公司 基于图像处理的塑料管材质量检测方法
CN117788464A (zh) * 2024-02-26 2024-03-29 卡松科技股份有限公司 一种工业齿轮油杂质视觉检测方法
CN118134062A (zh) * 2024-05-08 2024-06-04 裕耀东展(南通)智能装备有限公司 数控机床铸件质量追踪***
CN118229680A (zh) * 2024-05-22 2024-06-21 陕西右任故里茯砖茶股份有限公司 基于图像处理的茯砖茶发花缺陷检测方法及***
CN118247331A (zh) * 2024-05-20 2024-06-25 长春理工大学 一种基于图像识别的零件尺寸自动检测方法及***

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110220917B (zh) * 2019-06-11 2021-09-07 江苏农林职业技术学院 一种基于图像处理的皇冠盖表面缺陷在线检测方法
CN111007441B (zh) * 2019-12-16 2022-12-02 深圳市振邦智能科技股份有限公司 一种电解电容极性检测方法及检测***
CN111415378B (zh) * 2020-02-27 2023-11-24 湖南大学 用于汽车玻璃检测的图像配准方法及汽车玻璃检测方法
CN111951222B (zh) * 2020-07-15 2024-04-19 广东交通职业技术学院 一种瓶盖齿牙计数检测方法、***、装置和存储介质
CN111896556B (zh) * 2020-08-04 2021-05-28 湖南大学 一种基于机器视觉的玻璃瓶底缺陷检测方法及***
CN112085709B (zh) * 2020-08-19 2024-03-22 浙江华睿科技股份有限公司 一种图像对比方法及设备
CN112577967B (zh) * 2021-01-06 2023-05-16 河南理工大学 医药安瓿瓶头部外观质量检测方法
CN113298776B (zh) * 2021-05-21 2023-01-24 佛山职业技术学院 一种金属闭式水泵叶轮外观缺陷检测方法
CN113777033A (zh) * 2021-08-18 2021-12-10 长沙长泰机器人有限公司 一种基于机器视觉的生条缺陷检测方法和装置
CN113920118B (zh) * 2021-12-14 2022-03-15 武汉卓久玻璃制品有限公司 基于图像处理的中空玻璃间隔条缺胶检测方法
CN114354491A (zh) * 2021-12-30 2022-04-15 苏州精创光学仪器有限公司 一种基于机器视觉的dcb陶瓷基板缺陷检测方法
CN114972157A (zh) * 2022-01-10 2022-08-30 华为技术有限公司 边缘缺陷检测方法、装置及存储介质
CN116307300B (zh) * 2023-05-23 2023-08-08 四川都得利管业有限公司 一种塑胶管道的生产工艺优化方法及***
CN117664984B (zh) * 2023-12-01 2024-07-05 上海宝柏新材料股份有限公司 一种缺陷检测方法、装置、***及存储介质
CN117974601B (zh) * 2024-02-01 2024-06-28 广东工业大学 基于模板匹配的硅片表面缺陷检测方法及***

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005035546A (ja) * 2003-07-15 2005-02-10 Kirin Brewery Co Ltd 王冠打栓不良検査装置
CN103606169A (zh) * 2013-12-04 2014-02-26 天津普达软件技术有限公司 一种检测瓶盖缺陷的方法
CN104700423A (zh) * 2015-03-27 2015-06-10 四川索牌科技股份有限公司 一种瓶盖检测方法和装置
CN105784713A (zh) * 2016-03-11 2016-07-20 南京理工大学 基于机器视觉的密封圈表面缺陷检测方法
CN107228860A (zh) * 2017-06-28 2017-10-03 北京因时机器人科技有限公司 一种基于图像旋转周期特性的齿轮缺陷检测方法
CN110220917A (zh) * 2019-06-11 2019-09-10 江苏农林职业技术学院 一种基于图像处理的皇冠盖表面缺陷在线检测方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01145555A (ja) * 1987-12-01 1989-06-07 Nippon Taisanbin Kogyo Kk 光学的検査装置
CN103606167B (zh) * 2013-12-04 2016-08-31 天津普达软件技术有限公司 一种用于缺陷检测的瓶盖图像外轮廓确定方法
CN103604808B (zh) * 2013-12-04 2016-03-02 天津普达软件技术有限公司 一种瓶盖缺陷视觉检测方法
CN108982508B (zh) * 2018-05-23 2020-11-24 江苏农林职业技术学院 一种基于特征模板匹配和深度学习的塑封体ic芯片缺陷检测方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005035546A (ja) * 2003-07-15 2005-02-10 Kirin Brewery Co Ltd 王冠打栓不良検査装置
CN103606169A (zh) * 2013-12-04 2014-02-26 天津普达软件技术有限公司 一种检测瓶盖缺陷的方法
CN104700423A (zh) * 2015-03-27 2015-06-10 四川索牌科技股份有限公司 一种瓶盖检测方法和装置
CN105784713A (zh) * 2016-03-11 2016-07-20 南京理工大学 基于机器视觉的密封圈表面缺陷检测方法
CN107228860A (zh) * 2017-06-28 2017-10-03 北京因时机器人科技有限公司 一种基于图像旋转周期特性的齿轮缺陷检测方法
CN110220917A (zh) * 2019-06-11 2019-09-10 江苏农林职业技术学院 一种基于图像处理的皇冠盖表面缺陷在线检测方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HE, XIUYUAN: "Research on Online PET Bottle Defect Detection Based on Machine Vision Technology", INFORMATION & TECHNOLOGY, CHINA MASTER’S THESES FULL-TEXT DATABASE, no. 11, 15 November 2015 (2015-11-15), ISSN: 1674-0246, DOI: 20200215121248A *

Cited By (45)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113298725A (zh) * 2021-04-23 2021-08-24 杭州晟冠科技有限公司 一种轮船图标图像叠加误差的纠正方法
CN113358739A (zh) * 2021-06-30 2021-09-07 常州工学院 一种基于双目图像融合技术的磁粉探伤检测装置
CN113449659B (zh) * 2021-07-05 2024-04-23 淮阴工学院 一种车道线的检测方法
CN113449659A (zh) * 2021-07-05 2021-09-28 淮阴工学院 一种车道线的检测方法
CN113706455A (zh) * 2021-07-14 2021-11-26 青海黄河上游水电开发有限责任公司 一种330kV电缆瓷瓶套管的破损快速检测方法
CN113706455B (zh) * 2021-07-14 2024-03-29 青海黄河上游水电开发有限责任公司 一种330kV电缆瓷瓶套管的破损快速检测方法
CN113592845A (zh) * 2021-08-10 2021-11-02 深圳市华汉伟业科技有限公司 一种电池涂布的缺陷检测方法及装置、存储介质
CN113838006A (zh) * 2021-09-06 2021-12-24 苏州坤厚自动化科技有限公司 一种基于halcon的检测圆桩的设计方法
CN114022410A (zh) * 2021-10-09 2022-02-08 湖北工业大学 一种油茶果破壳后的壳籽智能化分选方法
CN114022418A (zh) * 2021-10-19 2022-02-08 上海电机学院 一种锂电池极片缺陷检测方法及***
CN114298968A (zh) * 2021-11-15 2022-04-08 河南中烟工业有限责任公司 批量运动烟支计数方法
CN114298968B (zh) * 2021-11-15 2024-03-22 河南中烟工业有限责任公司 批量运动烟支计数方法
CN114187269B (zh) * 2021-12-07 2024-04-05 北京工业大学 小零器件表面缺陷边缘快速检测方法
CN114187269A (zh) * 2021-12-07 2022-03-15 北京工业大学 小零器件表面缺陷边缘快速检测方法
CN114332063A (zh) * 2022-01-04 2022-04-12 合肥工业大学 一种基于背景差分的线束顺序检测方法
CN114332069B (zh) * 2022-01-05 2024-02-20 合肥工业大学 一种基于机器视觉的接插件检测方法及装置
CN114332069A (zh) * 2022-01-05 2022-04-12 合肥工业大学 一种基于机器视觉的接插件检测方法及装置
CN114354631A (zh) * 2022-01-12 2022-04-15 绍兴职业技术学院 一种基于视觉的阀门毛坯表面缺陷检测方法
CN114705686A (zh) * 2022-03-21 2022-07-05 佛山科学技术学院 圆柱锅表面缺陷检测方法、***、控制器及工控机
CN114965181B (zh) * 2022-05-25 2024-05-14 中南大学 一种基于瞬变电磁检测图像的防渗屏障渗漏区域快速自动定位方法
CN114965181A (zh) * 2022-05-25 2022-08-30 中南大学 一种基于瞬变电磁检测图像的防渗屏障渗漏区域快速自动定位方法
CN114926441A (zh) * 2022-05-26 2022-08-19 昆山缔微致精密电子有限公司 一种注塑件加工成型的缺陷检测方法及***
CN116823756A (zh) * 2023-06-25 2023-09-29 江苏永康机械有限公司 一种桩腿焊缝缺陷检测方法
CN117437634A (zh) * 2023-12-21 2024-01-23 中国医学科学院北京协和医院 一种尿沉渣检测影像有形部分的识别分割方法
CN117437634B (zh) * 2023-12-21 2024-03-08 中国医学科学院北京协和医院 一种尿沉渣检测影像有形部分的识别分割方法
CN117474923B (zh) * 2023-12-27 2024-03-19 苏州镁伽科技有限公司 膜片图像的处理方法和膜片缺陷检测方法及其***
CN117474923A (zh) * 2023-12-27 2024-01-30 苏州镁伽科技有限公司 膜片图像的处理方法和膜片缺陷检测方法及其***
CN117522863B (zh) * 2023-12-29 2024-03-29 临沂天耀箱包有限公司 基于图像特征的集成箱体质量检测方法
CN117522863A (zh) * 2023-12-29 2024-02-06 临沂天耀箱包有限公司 基于图像特征的集成箱体质量检测方法
CN117495862B (zh) * 2024-01-03 2024-03-12 深圳家红齿科技术有限公司 一种义齿耐磨性检测装置
CN117495862A (zh) * 2024-01-03 2024-02-02 深圳家红齿科技术有限公司 一种义齿耐磨性检测装置
CN117576089B (zh) * 2024-01-15 2024-03-22 山东恒力源精密机械制造有限公司 一种活塞环缺陷检测方法及***
CN117576089A (zh) * 2024-01-15 2024-02-20 山东恒力源精密机械制造有限公司 一种活塞环缺陷检测方法及***
CN117576107A (zh) * 2024-01-17 2024-02-20 中数智科(杭州)科技有限公司 基于图像匹配和配准的列车底部零部件的松动检测方法
CN117576107B (zh) * 2024-01-17 2024-03-29 中数智科(杭州)科技有限公司 基于图像匹配和配准的列车底部零部件的松动检测方法
CN117649412B (zh) * 2024-01-30 2024-04-09 山东海天七彩建材有限公司 一种铝材表面质量的检测方法
CN117649412A (zh) * 2024-01-30 2024-03-05 山东海天七彩建材有限公司 一种铝材表面质量的检测方法
CN117723491A (zh) * 2024-02-07 2024-03-19 宁德时代新能源科技股份有限公司 电芯防爆阀的检测***及检测方法
CN117764992A (zh) * 2024-02-22 2024-03-26 山东乔泰管业科技有限公司 基于图像处理的塑料管材质量检测方法
CN117764992B (zh) * 2024-02-22 2024-04-30 山东乔泰管业科技有限公司 基于图像处理的塑料管材质量检测方法
CN117788464A (zh) * 2024-02-26 2024-03-29 卡松科技股份有限公司 一种工业齿轮油杂质视觉检测方法
CN117788464B (zh) * 2024-02-26 2024-04-30 卡松科技股份有限公司 一种工业齿轮油杂质视觉检测方法
CN118134062A (zh) * 2024-05-08 2024-06-04 裕耀东展(南通)智能装备有限公司 数控机床铸件质量追踪***
CN118247331A (zh) * 2024-05-20 2024-06-25 长春理工大学 一种基于图像识别的零件尺寸自动检测方法及***
CN118229680A (zh) * 2024-05-22 2024-06-21 陕西右任故里茯砖茶股份有限公司 基于图像处理的茯砖茶发花缺陷检测方法及***

Also Published As

Publication number Publication date
CN110220917B (zh) 2021-09-07
CN110220917A (zh) 2019-09-10

Similar Documents

Publication Publication Date Title
WO2020248439A1 (zh) 一种基于图像处理的皇冠盖表面缺陷在线检测方法
CN108982508B (zh) 一种基于特征模板匹配和深度学习的塑封体ic芯片缺陷检测方法
CN111292305B (zh) 一种改进型yolo-v3的金属加工表面缺陷检测方法
CN105067638B (zh) 基于机器视觉的轮胎胎膜表面字符缺陷检测方法
CN109141232B (zh) 一种基于机器视觉的盘类铸件在线检测方法
CN110163853B (zh) 一种边缘缺陷的检测方法
CN107203990B (zh) 一种基于模板匹配与图像质量评估的标贴破损检测方法
CN108776140B (zh) 一种基于机器视觉的印刷品瑕疵检测方法及***
CN105334219B (zh) 一种残差分析动态阈值分割的瓶口缺陷检测方法
CN108389179B (zh) 一种基于机器视觉的罐盖表面缺陷检测方法
CN109900711A (zh) 基于机器视觉的工件缺陷检测方法
CN107966454A (zh) 一种基于fpga的端塞缺陷检测装置及检测方法
CN110108712A (zh) 多功能视觉缺陷检测***
CN113109348B (zh) 一种基于机器视觉的桨影移印缺陷识别方法
CN102305798A (zh) 基于机器视觉的玻璃缺陷的检测与分类方法
CN111667475B (zh) 一种基于机器视觉的大枣分级检测方法
CN106780526A (zh) 一种铁氧体圆片表面裂痕识别方法
CN106290392A (zh) 一种小微轴承表面凹痕缺陷在线检测方法及其***
CN105403147A (zh) 一种基于嵌入式的瓶胚检测***和检测方法
CN109540925B (zh) 基于差影法与局部方差测量算子的复杂瓷砖表面缺陷检测方法
CN103226106A (zh) 基于机器视觉的轴承防尘盖品质监测***
CN113177924A (zh) 一种工业流水线产品瑕疵检测方法
CN107490583A (zh) 一种基于机器视觉的夹片缺陷检测方法
CN106097368A (zh) 一种单板裂缝的识别方法
CN106599890A (zh) 变电站巡检机器人数字式仪表识别算法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19932833

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19932833

Country of ref document: EP

Kind code of ref document: A1