[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN111551552A - Appearance quality detection method for circular hole punching net - Google Patents

Appearance quality detection method for circular hole punching net Download PDF

Info

Publication number
CN111551552A
CN111551552A CN202010419366.8A CN202010419366A CN111551552A CN 111551552 A CN111551552 A CN 111551552A CN 202010419366 A CN202010419366 A CN 202010419366A CN 111551552 A CN111551552 A CN 111551552A
Authority
CN
China
Prior art keywords
circle
row
line
image
column
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.)
Granted
Application number
CN202010419366.8A
Other languages
Chinese (zh)
Other versions
CN111551552B (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.)
Xiangtan University
Original Assignee
Xiangtan 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 Xiangtan University filed Critical Xiangtan University
Priority to CN202010419366.8A priority Critical patent/CN111551552B/en
Publication of CN111551552A publication Critical patent/CN111551552A/en
Application granted granted Critical
Publication of CN111551552B publication Critical patent/CN111551552B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/08Measuring arrangements characterised by the use of optical techniques for measuring diameters
    • G01B11/12Measuring arrangements characterised by the use of optical techniques for measuring diameters internal diameters
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/14Measuring arrangements characterised by the use of optical techniques for measuring distance or clearance between spaced objects or spaced apertures
    • 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/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8887Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Image Analysis (AREA)

Abstract

本发明提出一种圆孔冲孔网外观质量检测方法。本发明主要分为四个步骤:首先对待检测的圆孔冲孔网图像预处理;然后,在待检测的圆孔冲孔网图像中虚拟地设置两条水平线与第一行圆孔相交,两条垂直线与第一列圆孔相交,并逐步调整和确定这四条线的最终位置;第三,利用先验知识批量设置虚拟的上横线、下横线、左竖线及右竖线,获得各圆孔与各条虚拟线的交点;最后,判断圆孔冲孔网外观缺陷并计算各圆孔的圆心坐标及其半径、孔间距等参数。本发明优点在于通用性强,适用于各种类型的圆孔冲孔网的外观检测及参数确定,且检测速度快、精度高。

Figure 202010419366

The invention provides a method for detecting the appearance quality of a round hole punching net. The present invention is mainly divided into four steps: firstly, preprocessing the image of the circular hole punching net to be detected; A vertical line intersects the first column of circular holes, and gradually adjust and determine the final position of these four lines; third, use prior knowledge to batch set virtual upper, lower, left and right vertical lines. Obtain the intersection points of each circular hole and each virtual line; finally, judge the appearance defects of the circular hole punching net and calculate the center coordinates of each circular hole and its radius, hole spacing and other parameters. The invention has the advantages of strong versatility, is suitable for appearance detection and parameter determination of various types of round hole punching nets, and has high detection speed and high precision.

Figure 202010419366

Description

一种圆孔冲孔网的外观质量检测方法Appearance quality detection method of round hole punching net

技术领域technical field

本发明涉及一种圆孔冲孔网的外观质量的检测技术,尤其涉及圆形冲孔网中圆孔参数检测及外观缺陷检测方法。The invention relates to a detection technology for the appearance quality of a round hole punching net, in particular to a method for detecting parameters of round holes in the round hole punching net and detecting appearance defects.

背景技术Background technique

圆孔冲孔网是采用金属板材为原料,由冲压机械在金属板材上冲压若干个半径相同、水平间距相等、垂直间距相等,分布有规律的圆孔而成的。圆孔冲孔网通常以镀锌钢板、不锈钢板、铜板、铝板、镍板及合金板为原料,具有耐弯曲、抗老化、不易生锈、网面平整、光滑、坚固耐用等优点。产品主要应用于化工机械、制药设备、食品饮料机械、烟卷机械、收割机、干洗机、烫台、消音设备、制冷设备(中央空调)音箱、工艺品制作、造纸、液压配件、制药设备、滤清设备等各行各业中。The round hole punching net is made of metal plate as raw material, and punched by a punching machine on the metal plate with a number of circular holes with the same radius, equal horizontal spacing, equal vertical spacing, and regular distribution. The round hole punching mesh is usually made of galvanized steel plate, stainless steel plate, copper plate, aluminum plate, nickel plate and alloy plate. The products are mainly used in chemical machinery, pharmaceutical equipment, food and beverage machinery, cigarette rolling machinery, harvesters, dry cleaning machines, ironing tables, muffler equipment, refrigeration equipment (central air conditioning) speakers, handicraft production, papermaking, hydraulic accessories, pharmaceutical equipment, filtration equipment and other industries.

由于圆孔冲孔网结构的复杂性及机械控制系统的精度限制,圆孔冲孔网不可避免的出现各种缺陷。圆孔冲孔网的外观缺陷主要有圆孔冲孔网厚度分布不均匀,冲孔孔径、横向孔距和纵向孔距等参数不标准,冲孔环边缘残缺等。该产品表面特征是其重要性能指标的反映,这些可能的缺陷在后续使用中将导致严重的安全问题,因此,对其表面外观在线检测具有重要的现实意义。Due to the complexity of the structure of the perforated mesh and the limitation of the precision of the mechanical control system, the perforated mesh inevitably has various defects. The appearance defects of the round hole punching net mainly include uneven thickness distribution of the round hole punching net, non-standard punching hole diameter, horizontal hole spacing and vertical hole spacing and other parameters, and the edge of the punching ring is incomplete. The surface features of the product are the reflection of its important performance indicators. These possible defects will lead to serious safety problems in subsequent use. Therefore, the online inspection of its surface appearance has important practical significance.

冲孔工艺是圆孔冲孔网制造过程中的主要工艺。冲孔孔径、横向孔距、纵向孔距是关键技术指标。在冲压过程中,由于各种原因出现了盲孔距不均匀、连接孔等缺陷。这将对产品的性能和质量产生很大的影响。目前,圆孔冲孔网的参数测量和缺陷检测严重依赖于人工取样。这将对生产带来诸多负面影响和不便。首先,需要更多的劳动力,劳动强度大。其次,检查每个产品是否有缺陷十分耗时,误检率与漏检率较高。近年来,随着机器视觉技术的飞速发展,基于机器视觉的检测方法在表面缺陷检测领域得到了很好的发展和应用。在圆参数检测中广泛采用Hough变换和最小二乘法获取图像中的每个圆(即冲孔)的半径、圆心等信息,在此基础上,逐一计算冲孔之间的横向孔距和纵向孔距等参数,由于圆及圆上边缘点很多,要对图像中所有圆分析,计算量大,耗时长,难以满足监测实时性的要求。而对于采用定制模板,将待测图像与标准模板相减的方法,由于在机械冲压过程中难免会存在公差允许范围内的偏差,实际上无法得到标准的模板,给该方法的实施带来了一定的困难。The punching process is the main process in the manufacturing process of the round hole punching mesh. Punching hole diameter, horizontal hole spacing, and vertical hole spacing are the key technical indicators. In the stamping process, due to various reasons, defects such as uneven blind hole spacing and connecting holes appear. This will have a great impact on the performance and quality of the product. At present, the parameter measurement and defect detection of round hole punching nets rely heavily on manual sampling. This will bring many negative impacts and inconveniences to production. First, more labor is needed and the labor intensity is high. Second, it is time-consuming to check whether each product is defective, and the false detection rate and missed detection rate are high. In recent years, with the rapid development of machine vision technology, detection methods based on machine vision have been well developed and applied in the field of surface defect detection. Hough transform and least squares method are widely used in circle parameter detection to obtain information such as the radius and center of each circle (ie punching hole) in the image. On this basis, the horizontal hole distance and vertical hole between punching holes are calculated one by one Distance and other parameters, because there are many circles and edge points on the circle, it is necessary to analyze all circles in the image, which requires a large amount of calculation and takes a long time, and it is difficult to meet the requirements of real-time monitoring. For the method of using a custom template to subtract the image to be tested from the standard template, due to the inevitable deviation within the allowable tolerance range during the mechanical stamping process, the standard template cannot actually be obtained, which brings about the implementation of this method. certain difficulties.

发明内容SUMMARY OF THE INVENTION

针对上述问题,本发明提出一种圆孔冲孔网外观缺陷自动检测方法,该方法利用四根线(两条横线与两条竖线)得出每个圆上的八个边缘点,用少量的交点计算圆孔的圆心坐标及其半径、孔间距等参数。该方法能代替人工抽检,实现高速、高精度的圆孔冲孔板质量检测,使圆孔冲孔网满足外观合格标准。本发明通过高精度工业CCD相机获取圆孔冲孔网区域图像,具体内容如下:In view of the above-mentioned problems, the present invention proposes an automatic detection method for the appearance defects of a circular hole punching net, which uses four lines (two horizontal lines and two vertical lines) to obtain eight edge points on each circle, and uses four lines (two horizontal lines and two vertical lines). A small number of intersection points are used to calculate the coordinates of the center of the circular hole and its radius, hole spacing and other parameters. The method can replace manual sampling inspection, realize high-speed and high-precision quality inspection of round-hole punching plates, and make round-hole punching nets meet the appearance qualification standards. The present invention obtains the image of the circular hole punching mesh area through a high-precision industrial CCD camera, and the specific content is as follows:

S100.对大小为(m,n)的圆孔冲孔网图像预处理;S100. Preprocess the image of the hole punching mesh whose size is (m, n);

S200.虚拟设置初始横线H11、H21与竖线Z11、Z21,逐步调整初始虚拟线位置并得到圆孔冲孔网图像中圆孔与虚拟线的最终相交点;S200. Virtually set initial horizontal lines H 11 , H 21 and vertical lines Z 11 , Z 21 , gradually adjust the position of the initial virtual line and obtain the final intersection point of the circular hole and the virtual line in the circular hole punching mesh image;

S300.批量设置虚拟上横线H1p、下横线H2p、左竖线Z1q和右竖线Z2q,并得到圆孔冲孔网图像中圆孔与批量设定虚拟线H1p、H2p、Z1q、Z2q的相交点,其中,p为圆孔冲孔网图像中第p行圆,q为圆孔冲孔网图像中第q列圆,H1p表示第p行上横线,H2p表示第p行下横线,Z1q表示第q列左竖线,Z2q表示第q列右竖线;S300. Set the virtual upper horizontal line H 1p , the lower horizontal line H 2p , the left vertical line Z 1q and the right vertical line Z 2q in batches, and obtain the circular holes in the image of the circular hole punching net and the virtual lines H 1p and H that are set in batches The intersection point of 2p , Z 1q and Z 2q , where p is the circle in the p-th row in the perforated mesh image, q is the circle in the q-th column in the perforated mesh image, and H 1p represents the horizontal line on the p-th row , H 2p represents the lower horizontal line of the pth row, Z 1q represents the left vertical line of the qth column, and Z 2q represents the right vertical line of the qth column;

S400.判断圆孔的外观缺陷,并利用少量交点计算各个圆孔的圆心坐标、半径、横向孔距和纵向孔距等尺寸参数。本发明具有如下优点:S400. Determine the appearance defects of the circular holes, and use a small number of intersections to calculate the dimensional parameters such as the coordinates of the circle center, the radius, the horizontal hole spacing and the vertical hole spacing of each circular hole. The present invention has the following advantages:

1、本发明通用性强,适用于各种类型的圆孔冲孔网的外观检测;1. The present invention has strong versatility and is suitable for the appearance inspection of various types of round hole punching nets;

2、本发明不局限于对每个圆单独检测,而是利用圆孔上的少量点计算出各个圆孔的半径及其圆心、圆孔与圆孔之间的间距等参数,即使机械加工存在允许范围内的公差,也能适用,且速度快、精度高。2. The present invention is not limited to the individual detection of each circle, but uses a small number of points on the circular hole to calculate the radius of each circular hole and its center, the distance between the circular hole and the circular hole and other parameters, even if machining exists. Tolerances within the allowable range can also be applied, with high speed and high precision.

附图说明Description of drawings

图1是本发明的方法流程图;Fig. 1 is the method flow chart of the present invention;

图2是圆孔冲孔网孔距说明图;Fig. 2 is the explanatory diagram of the hole distance of round hole punching;

图3是圆孔冲孔网横向孔距说明图;Fig. 3 is an explanatory diagram of the horizontal hole distance of the circular hole punching net;

图4是圆孔冲孔网纵向孔距说明图;Fig. 4 is an explanatory diagram of the longitudinal hole distance of the circular hole punching net;

图5是圆孔冲孔网左边宽说明图;Figure 5 is an illustration of the left width of the round hole punching net;

图6是圆孔冲孔网右边宽说明图;Figure 6 is an illustration of the width of the right side of the round hole punching net;

图7为初始横竖线定位图;Fig. 7 is the initial horizontal and vertical line positioning diagram;

图8是虚拟横竖线与圆相交图;Fig. 8 is a virtual horizontal and vertical line intersecting a circle;

图9是虚拟横竖线与圆相交的坐标图。FIG. 9 is a coordinate diagram where a virtual horizontal and vertical line intersects a circle.

具体实施方式Detailed ways

实施本发明,以豪辉精密仪器有限公司生产的圆孔冲孔网质量检测为例进行说明。该圆孔冲孔网主要应用于干洗机、烫台、消音设备、音箱等设备;外观检测主要包括各个圆孔的参数(半径、圆心等)、横向孔距以及纵向孔距等;在检测开始之前,输入待检测圆孔冲孔网的型号CX161及其相关的先验参数,包括总宽d6=160.003mm、右边宽d4=11.171mm、左边宽d5=24.099mm、横向孔距d2=2.597mm、纵向孔距d3=1.493mm、孔径d1=1.965mm,如图2、图3、图4、图5、图6所示。The implementation of the present invention will be described by taking the quality inspection of the round hole punching net produced by Haohui Precision Instrument Co., Ltd. as an example. The round hole punching mesh is mainly used in dry cleaning machines, ironing tables, noise reduction equipment, speakers and other equipment; the appearance inspection mainly includes the parameters of each round hole (radius, center, etc.), horizontal hole distance and vertical hole distance, etc.; Before, input the model CX161 of the round hole punching mesh to be tested and its related a priori parameters, including the total width d 6 =160.003mm, the right width d 4 =11.171mm, the left width d 5 =24.099mm, the horizontal hole distance d 2 = 2.597mm, the longitudinal hole distance d 3 =1.493mm, and the hole diameter d 1 =1.965mm, as shown in Figure 2, Figure 3, Figure 4, Figure 5, and Figure 6.

将上述世界坐标系下的参数换算成图像坐标系中,标定的目的是确定被测对象的实际尺寸与相机采集图像中像素数目的量化对应关系,以便将图像距离和被测对象的真实距离对应起来,实现参数的实际测试需要。本发明实施时,采用了标准件成像法对上述坐标系的变换进行标定。具体标定过程为:Converting the parameters in the above world coordinate system into the image coordinate system, the purpose of calibration is to determine the quantitative correspondence between the actual size of the measured object and the number of pixels in the image captured by the camera, so that the image distance corresponds to the true distance of the measured object. Up, the actual testing of the implementation parameters is required. When the present invention is implemented, the standard part imaging method is used to calibrate the transformation of the above coordinate system. The specific calibration process is as follows:

①将标定板5.6*5.6mm,精度1um的水平放置在测量系统载物台上,确保标定板边与相机成像屏幕的坐标轴平行;①Place the calibration plate 5.6*5.6mm with a precision of 1um on the stage of the measurement system, and ensure that the edge of the calibration plate is parallel to the coordinate axis of the camera imaging screen;

②采集标定板图像,识别出标定板上左右标记圆,上下标记圆,求取上下标记圆和左右标记圆心之间像素值;② Collect the image of the calibration plate, identify the left and right mark circles, the upper and lower mark circles on the calibration plate, and obtain the pixel value between the upper and lower mark circles and the center of the left and right mark circles;

③用上下和左右标记圆的实际距离分别除以两者之间的像素值,获得在固定焦距和固定物距条件下的像素当量。为提高检测精度,像素当量保留了12位小数,相机X轴像素方向上当量为0.003826796100mm,Y轴方向上像素当量为0.003827779593mm。③ Divide the actual distance of the up and down and left and right marked circles by the pixel value between them to obtain the pixel equivalent under the condition of fixed focal length and fixed object distance. In order to improve the detection accuracy, 12 decimal places are reserved for the pixel equivalent. The pixel equivalent in the X-axis direction of the camera is 0.003826796100mm, and the pixel equivalent in the Y-axis direction is 0.003827779593mm.

根据以上标定的世界坐标系与图像坐标系的变换关系,将上述世界坐标系下的参数换算成图像坐标系,得到总宽d6′、右边宽d5′、左边宽d4′、横向孔距d2′、纵向孔距d3′、孔径d1′。According to the transformation relationship between the world coordinate system and the image coordinate system calibrated above, the parameters in the world coordinate system are converted into the image coordinate system, and the total width d 6 ′, the right width d 5 ′, the left width d 4 ′, and the horizontal hole are obtained. Distance d 2 ', longitudinal hole distance d 3 ', hole diameter d 1 '.

将圆孔冲孔网水平放置于皮带输送带上,从左至右以固定速度进入检测工作站。检测工作站中,高精度工业CCD相机垂直向下,采用顶部环形光源照明,获取圆孔冲孔网图像。结合图2,本发明具体实现步骤如下:Place the round hole punching net horizontally on the belt conveyor, and enter the inspection station at a fixed speed from left to right. In the inspection workstation, the high-precision industrial CCD camera is vertically downward, and the top ring light source is used for illumination to obtain the image of the round hole punching net. In conjunction with Fig. 2, the concrete realization steps of the present invention are as follows:

S100.对大小为(m,n)的圆孔冲孔网图像预处理:S100. Preprocess the image of the hole punching mesh with size (m, n):

S110.使用中值滤波滤除噪声,使用Otsu算法获取阈值,对图像进行二值化处理。S110. Use median filtering to filter out noise, use Otsu algorithm to obtain a threshold, and perform binarization processing on the image.

S200.在圆孔冲孔网图像中,虚拟地设置初始横线与竖线,逐步调整初始虚拟线位置并得到圆孔冲孔网图像中圆孔与虚拟线的最终相交点:S200. In the image of the hole punching net, virtually set initial horizontal and vertical lines, gradually adjust the position of the initial virtual line, and obtain the final intersection point of the hole and the virtual line in the picture of the hole punching net:

S210.在图像中虚拟设置两条水平线和两条垂直线,分别记为上横线H11和下横线H21,左竖线Z11和右竖线Z21,其中,H11和H21与第一行圆相交,Z11和Z21与第一列圆相交,上横线H11的初始纵坐标为yy01,下横线H21的初始纵坐标为yy11,左竖线Z11的初始横坐标为xx01,右竖线Z21的初始横坐标为xx11,如图7所示;S210. Virtually set two horizontal lines and two vertical lines in the image, denoted as upper horizontal line H 11 and lower horizontal line H 21 , left vertical line Z 11 and right vertical line Z 21 , wherein H 11 and H 21 It intersects with the circle in the first row, Z 11 and Z 21 intersect with the circle in the first column, the initial ordinate of the upper horizontal line H 11 is yy 01 , the initial ordinate of the lower horizontal line H 21 is yy 11 , and the left vertical line Z 11 The initial abscissa is xx 01 , and the initial abscissa of the right vertical line Z 21 is xx 11 , as shown in Figure 7;

S220.令t=1,k=1,g=0,h=0,e=0,对于纵坐标为yy01的上横线H11,执行S230确定其最终位置yy01lastS220. Let t=1, k=1, g=0, h=0, e=0, for the upper horizontal line H 11 whose ordinate is yy 01 , execute S230 to determine its final position yy 01last ;

S230.对于图像中的纵坐标为yy的水平线,从左往右搜索,获取此水平线与圆相交的像素坐标点:S230. For the horizontal line whose vertical coordinate is yy in the image, search from left to right to obtain the pixel coordinate point where this horizontal line intersects the circle:

f1=I(i+1,yy)-I(i,yy) i∈[1,m) (1)f 1 =I(i+1,yy)-I(i,yy) i∈[1,m) (1)

Figure BDA0002496356940000031
Figure BDA0002496356940000031

其中,I(i,yy)为图像在位置(i,yy)处的像素值,p为圆孔冲孔网图像中第p行圆,q为圆孔冲孔网图像中第q列圆;Ht(xtpq)为水平线满足f1>0时的第p行q列的横坐标值;Ht(ytpq)为水平线满足f1>0时的第p行q列的纵坐标值;Ck(xkpq)为水平线满足f1<0时的第p行q列的横坐标值;Ck(ykpq)为水平线满足f1<0时的第p行q列的纵坐标值;Among them, I(i, yy) is the pixel value of the image at position (i, yy), p is the circle in the p-th row in the perforated screen image, and q is the circle in the q-th column in the perforated screen image; H t (x tpq ) is the abscissa value of the p-th row and q column when the horizontal line satisfies f 1 >0; H t (y tpq ) is the ordinate value of the p-th row and q column when the horizontal line satisfies f 1 >0; C k (x kpq ) is the abscissa value of the p-th row and q column when the horizontal line satisfies f 1 <0; C k (y kpq ) is the ordinate value of the p-th row and q column when the horizontal line satisfies f 1 <0;

若h=0且g=0,执行S231;If h=0 and g=0, execute S231;

若h=0且g=1,则g=g+1,执行S231;If h=0 and g=1, then g=g+1, and execute S231;

若h=0且g=3,执行S231;If h=0 and g=3, execute S231;

若h=1,执行S322;If h=1, execute S322;

若h=2,执行S323;If h=2, execute S323;

S231.计算Ht-Ck的均值,即:

Figure BDA0002496356940000041
其中N为该行圆的数量;S231. Calculate the mean value of H t -C k , namely:
Figure BDA0002496356940000041
where N is the number of circles in the row;

若g=0,则执行步骤S232;If g=0, execute step S232;

若g=2,则执行步骤S233;If g=2, execute step S233;

若g=3,则执行步骤S234;If g=3, execute step S234;

S232.g=g+1,yy=yy+1,若g=1,则执行S230,否则执行S233;S232.g=g+1, yy=yy+1, if g=1, execute S230, otherwise execute S233;

S233.ct=bt2-bt0,g=g+1,bt3=bt2S233.c t =b t2 -b t0 , g=g+1, b t3 =b t2 ;

S234.若t=1且ct>0表示水平线处于第p行圆的上半周,则执行以下操作:S234. If t=1 and c t >0, it means that the horizontal line is in the upper half of the circle in the p-th row, then perform the following operations:

Figure BDA0002496356940000042
且e<r,则yy=yy+1,e=e+1,执行S230;like
Figure BDA0002496356940000042
And e<r, then yy=yy+1, e=e+1, and execute S230;

Figure BDA0002496356940000043
且e<r,则该行圆的最终位置为yy,即yylast=yy;like
Figure BDA0002496356940000043
And e<r, the final position of the circle is yy, that is, yy last = yy;

Figure BDA0002496356940000044
且e>r,则判断该行圆有缺陷圆;like
Figure BDA0002496356940000044
And e>r, then it is judged that this row of circles has a defective circle;

若t=1且ct<0,则yy01=yy01-10,执行S220;If t=1 and c t <0, then yy 01 =yy 01 -10, and execute S220;

若t=2且ct<0表示水平线处于第p行圆的下半周,则执行如下操作:If t=2 and c t < 0, it means that the horizontal line is in the lower half of the circle in the p-th row, then perform the following operations:

Figure BDA0002496356940000045
且e<r,则yy=yy-1,e=e+1,执行S230;like
Figure BDA0002496356940000045
And e<r, then yy=yy-1, e=e+1, and execute S230;

Figure BDA0002496356940000046
且e<r,则该行圆的最终位置为yy,即yylast=yy;like
Figure BDA0002496356940000046
And e<r, the final position of the circle is yy, that is, yy last = yy;

Figure BDA0002496356940000047
且e>r,则判断该行圆有缺陷圆;like
Figure BDA0002496356940000047
And e>r, then it is judged that this row of circles has a defective circle;

若t=2且ct>0,则yy11=yy11+10,执行S240;If t=2 and c t >0, then yy 11 =yy 11 +10, and execute S240;

其中,

Figure BDA0002496356940000048
in,
Figure BDA0002496356940000048

若t=1且k=1,则yy01last=yylast;若t=2且k=2,则yy11last=yylastIf t=1 and k=1, then yy 01last =yy last ; if t=2 and k=2, then yy 11last =yy last ;

若t=2且k=2,则执行S250,否则执行S240;If t=2 and k=2, execute S250, otherwise execute S240;

S240.令t=2,k=2,g=0,h=0,e=0,对于纵坐标为yy11的下横线H21,执行S230确定其最终位置yy11lastS240. Let t=2, k=2, g=0, h=0, e=0, for the lower horizontal line H 21 whose ordinate is yy 11 , execute S230 to determine its final position yy 11last ;

S250.令t=3,k=3,g=0,h=0,e=0,对于横坐标为xx01的左竖线Z11,执行S260确定其最终位置xx01lastS250. Let t=3, k=3, g=0, h=0, e=0, for the left vertical line Z 11 whose abscissa is xx 01 , execute S260 to determine its final position xx 01last ;

S260.对于图像中的横坐标为xx的垂直线,从上往下搜索,获取此垂直线与圆相交的像素坐标点:S260. For the vertical line whose abscissa is xx in the image, search from top to bottom to obtain the pixel coordinate point where this vertical line intersects the circle:

f2=I(xx,j+1)-I(xx,j) j∈[1,n) (3)f 2 =I(xx,j+1)-I(xx,j) j∈[1,n) (3)

Figure BDA0002496356940000051
Figure BDA0002496356940000051

其中,I(xx,j)为图像在位置(xx,j)处的像素值,p为圆孔冲孔网图像中第p行圆,q为圆孔冲孔网图像中第q列圆;Ht(xtpq)为垂直线满足f2>0时的第p行q列的横坐标值;Ht(ytpq)为垂直线满足f2>0时的第p行q列的纵坐标值;Ck(xkpq)为垂直线满足f2<0时的第p行q列的横坐标值;Ck(ykpq)为垂直线满足f2<0时的第p行q列的纵坐标值;Among them, I(xx, j) is the pixel value of the image at the position (xx, j), p is the p-th row circle in the circular hole punching mesh image, and q is the q-th column circle in the circular hole punching mesh image; H t (x tpq ) is the abscissa value of the p-th row and q column when the vertical line satisfies f 2 >0; H t (y tpq ) is the ordinate value of the p-th row and q column when the vertical line satisfies f 2 >0 value; C k (x kpq ) is the abscissa value of the p-th row q column when the vertical line satisfies f 2 <0; C k (y kpq ) is the p-th row q column when the vertical line satisfies f 2 <0 ordinate value;

若h=0且g=0,执行S261;If h=0 and g=0, execute S261;

若h=0且g=1,则g=g+1,执行S261;If h=0 and g=1, then g=g+1, and execute S261;

若h=0且g=3,执行S261;If h=0 and g=3, execute S261;

若h=1,执行S324;If h=1, execute S324;

若h=2,执行S400;If h=2, execute S400;

S261.计算Ht-Ck的均值,即:

Figure BDA0002496356940000052
其中M为该列圆的数量,S261. Calculate the mean value of Ht - Ck , namely:
Figure BDA0002496356940000052
where M is the number of circles in the column,

若g=0,则执行步骤S262;If g=0, go to step S262;

若g=2;则执行步骤S263;If g=2; then execute step S263;

若g=3,则执行步骤S264;If g=3, execute step S264;

S262.g=g+1,xx=xx+1,若g=1,则执行S260,否则执行S263;S262.g=g+1, xx=xx+1, if g=1, execute S260, otherwise execute S263;

S263.ct=bt2-bt0,g=g+1,bt3=bt2S263.c t =b t2 -b t0 , g=g+1, b t3 =b t2 ;

S264.若t=3且ct>0表示水平线处于第q列圆的左半周,则执行以下操作:S264. If t=3 and c t >0 means that the horizontal line is in the left half of the circle in the qth column, perform the following operations:

Figure BDA0002496356940000053
且e<r,则xx=xx+1,e=e+1,执行S260;like
Figure BDA0002496356940000053
And e<r, then xx=xx+1, e=e+1, and execute S260;

Figure BDA0002496356940000054
且e<r,则该列圆的最终位置为xx,即xxlast=xx;like
Figure BDA0002496356940000054
And e<r, then the final position of this column of circles is xx, that is, xx last =xx;

Figure BDA0002496356940000055
且e>r,则判断该列圆有缺陷圆;like
Figure BDA0002496356940000055
And e>r, then it is judged that this column of circles has defective circles;

若t=3且ct<0,则xx01=xx01-10,执行S250;If t=3 and c t <0, then xx 01 =xx 01 -10, and execute S250;

若t=4且ct<0表示水平线处于第q列圆的右半周,则执行如下操作:If t=4 and c t < 0, the horizontal line is in the right half of the circle in the qth column, then perform the following operations:

Figure BDA0002496356940000056
且e<r,则xx=xx-1,e=e+1,执行S260;like
Figure BDA0002496356940000056
And e<r, then xx=xx-1, e=e+1, execute S260;

Figure BDA0002496356940000057
且e<r,则该列圆的最终位置为yy,即xxlast=xx;like
Figure BDA0002496356940000057
And e<r, then the final position of this column of circles is yy, that is, xx last =xx;

Figure BDA0002496356940000058
且e>r,则判断该列圆有缺陷圆;like
Figure BDA0002496356940000058
And e>r, then it is judged that this column of circles has defective circles;

若t=4且ct>0,则xx11=xx11+10,执行S270;If t=4 and c t >0, then xx 11 =xx 11 +10, and execute S270;

其中,

Figure BDA0002496356940000059
in,
Figure BDA0002496356940000059

若t=3且k=3,则xx01last=xxlast;若t=4且k=4,则xx11last=xxlastIf t=3 and k=3, then xx 01last =xx last ; if t=4 and k=4, then xx 11last =xx last ;

若t=4且k=4,则执行S300,否则执行S270;If t=4 and k=4, execute S300, otherwise execute S270;

S270.令t=4,k=4,g=0,h=0,e=0,对于横坐标为xx11的右竖线Z21,执行S260确定其最终位置xx11lastS270. Let t=4, k=4, g=0, h=0, e=0, for the right vertical line Z 21 whose abscissa is xx 11 , perform S260 to determine its final position xx 11last .

S300.批量设置虚拟上横线H1p、下横线H2p、左竖线Z1q和右竖线Z2q,并得到圆孔冲孔网图像中圆孔与批量设定虚拟线H1p、H2p、Z1q、Z2q的交点,其中,p为圆孔冲孔网图像中第p行圆,q为圆孔冲孔网图像中第q列圆,H1p表示第p行上横线,H2p表示第p行下横线,Z1q表示第q列左竖线,Z2q表示第q列右竖线,如图8所示,具体方法如下:S300. Set the virtual upper horizontal line H 1p , the lower horizontal line H 2p , the left vertical line Z 1q and the right vertical line Z 2q in batches, and obtain the circular holes in the image of the circular hole punching net and the virtual lines H 1p and H that are set in batches 2p , Z 1q , Z 2q intersection, where p is the circle in the p-th row in the perforated mesh image, q is the circle in the q-th column in the perforated mesh image, H 1p represents the upper horizontal line on the p-th row, H 2p represents the lower horizontal line of the pth row, Z 1q represents the left vertical line of the qth column, and Z 2q represents the right vertical line of the qth column, as shown in Figure 8. The specific method is as follows:

S310.上横线H11以最终确定的yy01last为起始纵坐标,每间隔d3′批量设置虚拟上横线,即:S310. The upper horizontal line H 11 takes the finally determined yy 01last as the starting ordinate, and sets virtual upper horizontal lines in batches at every interval d 3 ', namely:

yy0p=yy01last+(p-1)*d′3; (5)yy 0p =yy 01last +(p-1)*d′ 3 ; (5)

下横线H21以最终确定的yy11last为起始纵坐标,每间隔d3′批量设置虚拟下横线,即:The lower horizontal line H 21 takes the finally determined yy 11last as the starting ordinate, and sets virtual lower horizontal lines in batches at every interval d 3 ′, namely:

yy1p=yy11last+(p-1)*d′3; (6)yy 1p =yy 11last +(p-1)*d′ 3 ; (6)

左竖线Z11以最终确定的xx01last为起始横坐标,每间隔d2′批量设置虚拟左竖线,即:The left vertical line Z 11 takes the finally determined xx 01last as the starting abscissa, and sets virtual left vertical lines in batches at every interval d 2 ', namely:

xx0q=xx01last+(q-1)*d′2; (7)xx 0q =xx 01last + (q-1)*d′ 2 ; (7)

右竖线Z21以最终确定的xx11last为起始横坐标,每间隔d2′批量设置虚拟右竖线,即:The right vertical line Z 21 takes the finally determined xx 11last as the starting abscissa, and sets virtual right vertical lines in batches at every interval d 2 ', namely:

xx1q=xx11last+(q-1)*d′2; (8)xx 1q =xx 11last +(q-1)*d′ 2 ; (8)

其中,p为圆孔冲孔网图像中第p行圆,q为圆孔冲孔网图像中第q列圆;Among them, p is the circle in the p-th row in the image of the circular hole punching net, and q is the circle in the q-th column in the picture of the circular hole punching net;

S320.计算批量设定的虚拟线H1p、H2p、Z1q、Z2q与圆孔冲孔网图像中圆孔的交点,具体方法如下:S320. Calculate the intersection points of the virtual lines H 1p , H 2p , Z 1q , and Z 2q set in batches and the holes in the hole punching mesh image, and the specific methods are as follows:

S321.对于任意上横线H1p,令t=1,k=1,yy=yy0p,h=1,执行S230,获取其与圆孔冲孔网图像中圆孔的交点H1(x1pq,y1pq)、C1(x1pq,y1pq);S321. For any upper horizontal line H 1p , set t=1, k=1, yy=yy 0p , h=1, execute S230, and obtain the intersection point H 1 (x 1pq , y 1pq ), C 1 (x 1pq , y 1pq );

S322.对于任意下横线H2p,令t=2,k=2,yy=yy1p,h=2,执行S230,获取其与圆孔冲孔网图像中圆孔的交点H2(x2pq,y2pq)、C2(x2pq,y2pq);S322. For any lower horizontal line H 2p , set t=2, k=2, yy=yy 1p , h=2, execute S230, and obtain the intersection point H 2 (x 2pq , y 2pq ), C 2 (x 2pq , y 2pq );

S323.对于任意左竖线Z1q,令t=3,k=3,xx=xx0q,h=1,执行S260,获取其与圆孔冲孔网图像中圆孔的交点H3(x3pq,y3pq)、C3(x3pq,y3pq);S323. For any left vertical line Z 1q , let t=3, k=3, xx=xx 0q , h=1, execute S260 to obtain the intersection point H 3 (x 3pq , y 3pq ), C 3 (x 3pq , y 3pq );

S324.对于任意右竖线Z2q,令t=4,k=4,xx=xx1q,h=2,执行S260,获取其与圆孔冲孔网图像中圆孔的交点H4(x4pq,y4pq)、C4(x4pq,y4pq)。S324. For any right vertical line Z 2q , let t=4, k=4, xx=xx 1q , h=2, execute S260 to obtain the intersection point H 4 (x 4pq , y 4pq ), C 4 (x 4pq , y 4pq ).

S400.判断圆孔的外观缺陷,并利用少量交点计算各个圆孔的圆心坐标、半径、横向孔距和纵向孔距等尺寸参数:S400. Judge the appearance defects of round holes, and use a small number of intersection points to calculate the dimensional parameters such as the center coordinates, radius, horizontal hole spacing and vertical hole spacing of each round hole:

S410.计算坐标差值,具体操作如下:S410. Calculate the coordinate difference, and the specific operations are as follows:

u1=H1(x1pq)-H1(x1p(q-1));v1=H3(y3pq)-H3(y3(p-1)q); (9)u 1 =H 1 (x 1pq )-H 1 (x 1p(q-1) ); v 1 =H 3 (y 3pq )-H 3 (y 3(p-1)q ); (9)

u2=C1(x1pq)-C1(x1p(q-1));v2=C3(y3pq)-C3(y3(p-1)q); (10)u 2 =C 1 (x 1pq )-C 1 (x 1p(q-1) ); v 2 =C 3 (y 3pq )-C 3 (y 3(p-1)q ); (10)

u3=H2(x2pq)-H2(x2p(q-1));v3=H4(y4pq)-H4(y4(p-1)q); (11)u 3 =H 2 (x 2pq )-H 2 (x 2p(q-1) ); v 3 =H 4 (y 4pq )-H 4 (y 4(p-1)q ); (11)

u4=C2(x2pq)-C2(x2p(q-1));v4=C4(y4pq)-C4(y4(p-1)q); (12)u 4 =C 2 (x 2pq )-C 2 (x 2p(q-1) ); v 4 =C 4 (y 4pq )-C 4 (y 4(p-1)q ); (12)

u5=H1(x1pq)-C1(x1p(q-1));v5=H3(y3pq)-C3(y3(p-1)q);(13)u 5 =H 1 (x 1pq )-C 1 (x 1p(q-1) ); v 5 =H 3 (y 3pq )-C 3 (y 3(p-1)q ); (13)

u6=H2(x2pq)-C2(x2p(q-1));v6=H4(y4pq)-C4(y4(p-1)q); (14)u 6 =H 2 (x 2pq )-C 2 (x 2p(q-1) ); v 6 =H 4 (y 4pq )-C 4 (y 4(p-1)q ); (14)

S420.判断圆孔的外观缺陷,具体操作如下:S420. Determine the appearance defect of the round hole, and the specific operations are as follows:

设置阈值T=15,执行如下操作:Set the threshold T=15, and perform the following operations:

u′1=u1(w1+1)-u1(w1);v′1=v1(s1+1)-v1(s1); (15)u' 1 =u 1 (w 1 +1)-u 1 (w 1 ); v' 1 =v 1 (s 1 +1)-v 1 (s 1 ); (15)

u′2=u2(w1+1)-u1(w1);v′2=v2(s1+1)-v2(s1); (16)u' 2 =u 2 (w 1 +1)-u 1 (w 1 ); v' 2 =v 2 (s 1 +1)-v 2 (s 1 ); (16)

u′3=u3(w1+1)-u3(w1);v′3=v3(s1+1)-v3(s1); (17)u' 3 =u 3 (w 1 +1)-u 3 (w 1 ); v' 3 =v 3 (s 1 +1)-v 3 (s 1 ); (17)

u′4=u4(w1+1)-u4(w1);v′4=v4(s1+1)-v4(s1); (18)u' 4 =u 4 (w 1 +1)-u 4 (w 1 ); v' 4 =v 4 (s 1 +1)-v 4 (s 1 ); (18)

u′5=u5(w2+1)-u5(w2);v′5=v5(s2+1)-v5(s2); (19)u' 5 =u 5 (w 2 +1)-u 5 (w 2 ); v' 5 =v 5 (s 2 +1)-v 5 (s 2 ); (19)

u′6=u6(w2+1)-u6(w2);v′6=v6(s2+1)-v6(s2); (20)u' 6 =u 6 (w 2 +1)-u 6 (w 2 ); v' 6 =v 6 (s 2 +1)-v 6 (s 2 ); (20)

其中,w1∈[1,max(q)-1),w2∈[1,max(q)-2),s1∈[1,max(p)-1),s2∈[1,max(p)-2);p为圆孔冲孔网图像中第p行圆,q为圆孔冲孔网图像中第q列圆;where w 1 ∈ [1, max(q)-1), w 2 ∈ [1, max(q)-2), s 1 ∈ [1, max(p)-1), s 2 ∈ [1, max(p)-2); p is the circle in the p-th row in the image of the circular hole punching net, and q is the circle in the q-th column in the picture of the circular hole punching net;

Figure BDA0002496356940000077
则圆孔存在外观缺陷;like
Figure BDA0002496356940000077
The round hole has appearance defects;

S430.计算圆心坐标及半径,具体操作如下:S430. Calculate the coordinates and radius of the center of the circle, and the specific operations are as follows:

在H1、H2、H3、H4、C1、C2、C3、C4八点中选取三点H3(x3pq,y3pq)、H4(x4pq,y4pq)、C1(x1pq,y1pq);Select three points H 3 (x 3pq , y 3pq ), H 4 ( x 4pq , y 4pq ), H 4 ( x 4pq , y 4pq ) , C 1 (x 1pq , y 1pq );

令A(x0,y0)=H3(x3pq,y3pq)、B(x1,y1)=H4(x4pq,y4pq)、C(x2,y2)=C1(x1pq,y1pq)Let A(x 0 , y 0 )=H 3 (x 3pq , y 3pq ), B(x 1 , y 1 )=H 4 (x 4pq , y 4pq ), C(x 2 , y 2 )=C 1 (x 1pq , y 1pq )

圆心记为(xc,yc),半径为r,The center of the circle is (x c , y c ), the radius is r,

Figure BDA0002496356940000071
Figure BDA0002496356940000071

Figure BDA0002496356940000072
Figure BDA0002496356940000072

Figure BDA0002496356940000073
Figure BDA0002496356940000073

其中,in,

Figure BDA0002496356940000074
Figure BDA0002496356940000074

Figure BDA0002496356940000075
Figure BDA0002496356940000075

S440.计算横向孔距和纵向孔距,S440. Calculate the horizontal and vertical hole spacing,

横向孔距:

Figure BDA0002496356940000076
Lateral hole spacing:
Figure BDA0002496356940000076

纵向孔距:

Figure BDA0002496356940000081
Longitudinal hole spacing:
Figure BDA0002496356940000081

其中,(p,q)为圆孔冲孔网图像中第p行第q列圆,即p行上的从左往右第q个圆或第q列上的从上往下第p个圆;Among them, (p, q) is the circle in the p-th row and the q-th column in the perforated mesh image, that is, the q-th circle from left to right on the p-row or the p-th circle from top to bottom on the q-th column. ;

S450.根据标定的世界坐标系与图像坐标系的变换关系,将在图像坐标系下计算的参数换算成世界坐标系,得到世界坐标系下圆孔冲孔网图像中各个圆孔的圆心坐标、半径、横向孔距和纵向孔距等尺寸参数;S450. According to the transformation relationship between the calibrated world coordinate system and the image coordinate system, convert the parameters calculated in the image coordinate system into the world coordinate system, and obtain the circle center coordinates, Dimensional parameters such as radius, horizontal hole spacing and vertical hole spacing;

S460.将世界坐标系下圆孔冲孔网图像中各个圆孔的圆心坐标、半径、横向孔距和纵向孔距与工厂标准的圆心坐标、半径、横向孔距和纵向孔距进行比较,检测圆孔是否符合标准。S460. Compare the center coordinate, radius, horizontal hole spacing and vertical hole spacing of each circular hole in the image of the circular hole punching net in the world coordinate system with the factory standard center coordinate, radius, horizontal hole spacing and vertical hole spacing, and detect Whether the round hole meets the standard.

Claims (3)

1. A method for detecting the appearance quality of a circular hole punched net at least comprises the following steps:
s100, preprocessing a round hole punching net image with the size of (m, n);
s200, virtually setting an initial transverse line H11、H21And vertical line Z11、Z21Gradually adjusting the position of the initial virtual line and obtaining the final intersection point of the circular hole and the virtual line in the circular hole punching net image;
s300, setting virtual upper transverse lines H in batches1pLower horizontal line H2pLeft vertical line Z1qAnd right vertical line Z2qAnd obtaining the round holes in the round hole punching net image and the batch set virtual line H1p、H2p、Z1q、Z2qThe point of intersection of (a) with (b),
H1(x1pq,y1pq)、H2(x2pq,y2pq)、H3(x3pq,y3pq)、H4(x4pq,y4pq)
C1(x1pq,y1pq)、C2(x2pq,y2pq)、C3(x3pq,y3pq)、C4(x4pq,y4pq)
wherein p is the p-th row circle in the circular hole punching net image, q is the q-th row circle in the circular hole punching net image, H1pDenotes the upper transverse line corresponding to the circle of the p-th row, H2pIndicates the lower horizontal line, Z, corresponding to the p-th row circle1qIndicates the left vertical line, Z, corresponding to the q-th column circle2qA right vertical line corresponding to the q-th column circle;
s400, judging the appearance defects of the round holes, and calculating the size parameters of the round holes, such as circle center coordinates, radius, transverse hole distance, longitudinal hole distance and the like by using a small number of intersection points.
2. The method for detecting the appearance quality of the circular hole punched net according to claim 1, wherein an initial transverse line H is set virtually11、H21And vertical line Z11、Z21Step S200 is a process of gradually adjusting the position of the initial virtual line and obtaining a final intersection point of the circular hole and the virtual line in the image to be measured, and at least includes the following steps:
s210, virtually setting two horizontal lines and two vertical lines in the image, and respectively marking the horizontal lines and the vertical lines as upper horizontal lines H11And a lower transverse line H21Left vertical line Z11And right sideVertical line Z21, wherein ,H11 and H21Intersecting the first row of circles, Z11 and Z21Intersecting the first row of circles at an upper transverse line H11Has an initial ordinate of yy01Lower horizontal line H21Has an initial ordinate of yy11Left vertical line Z11Has an initial abscissa of xx01Right vertical line Z21Has an initial abscissa of xx11
S220. let t be 1, k be 1, g be 0, h be 0, e be 0, yy for ordinate01Upper transverse line H of11And executing S230 to determine the final position yy thereof01last
S230, searching a horizontal line with yy ordinate in the image from left to right, and acquiring a pixel coordinate point of the intersection of the horizontal line and the circle:
f1=I(i+1,yy)-I(i,yy) i∈[1,m) (1)
Figure FDA0002496356930000011
wherein I (I, yy) is the pixel value of the image at the position (I, yy), p is the p-th row circle in the round hole punching net image, and q is the q-th column circle in the round hole punching net image; ht(xtpq) Satisfy f for the horizontal line1>The abscissa value of the p-th row at 0 and the q-th column; ht(ytpq) Satisfy f for the horizontal line1>The ordinate value of the p-th row at 0 and q-th column; ck(xkpq) Satisfy f for the horizontal line1<The abscissa value of the p-th row at 0 and the q-th column; ck(ykpq) Satisfy f for the horizontal line1<The ordinate value of the p-th row at 0 and q-th column;
if h is 0 and g is 0, performing S231;
if h is 0 and g is 1, g is g +1, S231 is performed;
if h is 0 and g is 3, performing S231;
if h is 1, executing S322;
if h is 2, performing S323;
s231. calculating Ht-CkI.e.:
Figure FDA0002496356930000021
where N is the number of the row of circles,
if g is equal to 0, go to step S232;
if g is 2, go to step S233;
if g is 3, go to step S234;
s232.g ═ g +1, yy ═ yy +1, if g ═ 1, then S230 is performed, otherwise S233 is performed;
S233.ct=bt2-bt0,g=g+1,bt3=bt2
s234, if t is 1 and ct>0 indicates that the horizontal line is in the upper half of the p-th row circle, the following is performed:
if it is
Figure FDA0002496356930000022
And e<r, then yy +1, e +1, perform S230;
if it is
Figure FDA0002496356930000023
And e<r, then the final position of the row of circles is yy, i.e., yylast=yy;
If it is
Figure FDA0002496356930000024
And e>r, judging that the row circle has a defective circle;
if t is 1 and ct<0, then yy01=yy01-10, performing S220;
if t is 2 and ct<0 indicates that the horizontal line is in the lower half of the p-th row circle, the following is performed:
if it is
Figure FDA0002496356930000025
And e<r, then yy-1, e-e +1, perform S230;
if it is
Figure FDA0002496356930000026
And e<r, then the final position of the row of circles is yy, i.e., yylast=yy;
If it is
Figure FDA0002496356930000027
And e>r, judging that the row circle has a defective circle;
if t is 2 and ct>0, then yy11=yy11+10, go to S240;
wherein ,
Figure FDA0002496356930000028
d′1is a circular hole standard aperture known a priori;
if t is 1 and k is 1, yy01last=yylast(ii) a If t is 2 and k is 2, yy11last=yylast
If t is 2 and k is 2, performing S250, otherwise performing S240;
s240. let t be 2, k be 2, g be 0, h be 0, e be 0, yy for ordinate11Lower transverse line H21And executing S230 to determine the final position yy thereof11last
S250. let t be 3, k be 3, g be 0, h be 0, e be 0, and xx for the abscissa01Left vertical line Z of11Go to step S260 to determine its final position xx01last
S260, searching a vertical line with the abscissa xx in the image from top to bottom, and acquiring a pixel coordinate point of the intersection of the vertical line and a circle:
f2=I(xx,j+1)-I(xx,j) j∈[1,n) (3)
Figure FDA0002496356930000029
wherein I (xx, j) is a pixel value of the image at the position (xx, j), p is a p-th row circle in the round hole punching net image, and q is a q-th column circle in the round hole punching net image; ht(xtpq) Satisfy f for the vertical line2>The abscissa value of the p-th row at 0 and the q-th column; ht(ytpq) Satisfy f for the vertical line2>The ordinate value of the p-th row at 0 and q-th column; ck(xkpq) Satisfy f for the vertical line2<The abscissa value of the p-th row at 0 and the q-th column; ck(ykpq) Satisfy f for the vertical line2<The ordinate value of the p-th row at 0 and q-th column;
if h is 0 and g is 0, perform S261;
if h is 0 and g is 1, then g is g +1, go to S261;
if h is 0 and g is 3, perform S261;
if h is 1, performing S324;
if h is 2, executing S400;
s261. calculate Ht-CkI.e.:
Figure FDA0002496356930000031
where M is the number of circles in the column,
if g is equal to 0, go to step S262;
if g is 2, go to step S263;
if g is 3, go to step S264;
s262, g +1, xx +1, if g +1, then S260 is executed, otherwise S263 is executed;
S263.ct=bt2-bt0,g=g+1,bt3=bt2
s264. if t is 3 and ct>0 indicates that the horizontal line is in the left half of the q-th column circle, the following operations are performed:
if it is
Figure FDA0002496356930000032
And e<r, then xx +1, e +1, go to S260;
if it is
Figure FDA0002496356930000033
And e<r, the final position of the row of circles is xx, namely xxlast=xx;
If it is
Figure FDA0002496356930000034
And e>r, judging that the row of circles has a defective circle;
if t is 3 and ct<0, then xx01=xx01-10, performing S250;
if t is 4 and ct<0 indicates that the horizontal line is in the right half of the q-th column circle, the following is performed:
if it is
Figure FDA0002496356930000035
And e<r, then xx-1, e-e +1, go to S260;
if it is
Figure FDA0002496356930000036
And e<r, then the final position of the column of circles is yy, i.e., xxlast=xx;
If it is
Figure FDA0002496356930000037
And e>r, judging that the row of circles has a defective circle;
if t is 4 and ct>0, then xx11=xx11+10, go to S270;
wherein ,
Figure FDA0002496356930000038
d′1is a circular hole standard aperture known a priori;
if t is 3 and k is 3, xx01last=xxlast(ii) a If t is 4 and k is 4, xx11last=xxlast
If t is 4 and k is 4, performing S300, otherwise performing S270;
s270, let t be 4, k be 4, g be 0, h be 0, e be 0, and xx for the abscissa11Right vertical line Z of21Go to step S260 to determine its final position xx11last
3. The method for detecting the appearance quality of the circular hole punching net according to claim 1, wherein the method for detecting the appearance defects of the circular holes is characterized by comprising the following steps of detecting the appearance defects of the circular holes and calculating the dimensional parameters such as the center coordinates, the radius, the transverse hole spacing, the longitudinal hole spacing and the like of the circular hole punching net by using a small number of intersection points, wherein the step S400 at least comprises the following steps:
s410, calculating the coordinate difference value,
u1=H1(x1pq)-H1(x1p(q-1));v1=H3(y3pq)-H3(y3(p-1)q); (9)
u2=C1(x1pq)-C1(x1p(q-1));v2=C3(y3pq)-C3(y3(p-1)q); (10)
u3=H2(x2pq)-H2(x2p(q-1));v3=H4(y4pq)-H4(y4(p-1)q); (11)
u4=C2(x2pq)-C2(x2p(q-1));v4=C4(y4pq)-C4(y4(p-1)q); (12)
u5=H1(x1pq)-C1(x1p(q-1));v5=H3(y3pq)-C3(y3(p-1)q); (13)
u6=H2(x2pq)-C2(x2p(q-1));v6=H4(y4pq)-C4(y4(p-1)q); (14)
s420, judging the defects of the round hole,
u′1=u1(w1+1)-u1(w1);v′1=v1(s1+1)-v1(s1); (15)
u′2=u2(w1+1)-u1(w1);v′2=v2(s1+1)-v2(s1); (16)
u′3=u3(w1+1)-u3(w1);v′3=v3(s1+1)-v3(s1); (17)
u′4=u4(w1+1)-u4(w1);v′4=v4(s1+1)-v4(s1); (18)
u′5=u5(w2+1)-u5(w2);v′5=v5(s2+1)-v5(s2); (19)
u′6=u6(w2+1)-u6(w2);v′6=v6(s2+1)-v6(s2); (20)
wherein ,w1∈[1,max(q)-1),w2∈[1,max(q)-2),s1∈[1,max(p)-1),s2∈ [1, max (p) -2 ], p is the p-th row circle in the circular hole punching mesh image, q is the q-th row circle in the circular hole punching mesh image;
if it is
Figure FDA0002496356930000046
Then the round hole has appearance defects, wherein T is a threshold value;
s430, calculating the coordinates and the radius of the circle center,
at H1、H2、H3、H4、C1、C2、C3、C4Selecting three points H from the eight points3(x3pq,y3pq)、H4(x4pq,y4pq)、C1(x1pq,y1pq);
Let A (x)0,y0)=H3(x3pq,y3pq)、B(x1,y1)=H4(x4pq,y4pq)、C(x2,y2)=C1(x1pq,y1pq)
The circle center is marked as (x)c,yc) Radius ofr,
Figure FDA0002496356930000041
Figure FDA0002496356930000042
Figure FDA0002496356930000043
wherein ,
Figure FDA0002496356930000044
Figure FDA0002496356930000045
s440, calculating the transverse pitch and the longitudinal pitch,
transverse pitch:
Figure FDA0002496356930000051
longitudinal pitch:
Figure FDA0002496356930000052
wherein, (p, q) is the qth row and qth column of circles in the round hole punching net image, namely the qth circle from left to right in the row p or the qth circle from top to bottom in the row q;
s450, converting parameters calculated under the image coordinate system into the world coordinate system according to the conversion relation between the calibrated world coordinate system and the image coordinate system to obtain dimensional parameters such as circle center coordinates, radiuses, transverse hole distances, longitudinal hole distances and the like of all round holes in the round hole punching net image under the world coordinate system;
and S460, comparing the circle center coordinate, the radius, the transverse pitch and the longitudinal pitch of each round hole in the round hole punching net image in the world coordinate system with the circle center coordinate, the radius, the transverse pitch and the longitudinal pitch of the factory standard, and detecting whether the round holes meet the standard.
CN202010419366.8A 2020-05-18 2020-05-18 A method for detecting the appearance quality of round hole punching net Active CN111551552B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010419366.8A CN111551552B (en) 2020-05-18 2020-05-18 A method for detecting the appearance quality of round hole punching net

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010419366.8A CN111551552B (en) 2020-05-18 2020-05-18 A method for detecting the appearance quality of round hole punching net

Publications (2)

Publication Number Publication Date
CN111551552A true CN111551552A (en) 2020-08-18
CN111551552B CN111551552B (en) 2023-06-13

Family

ID=72002001

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010419366.8A Active CN111551552B (en) 2020-05-18 2020-05-18 A method for detecting the appearance quality of round hole punching net

Country Status (1)

Country Link
CN (1) CN111551552B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118628497A (en) * 2024-08-14 2024-09-10 浙江金桥铜业科技有限公司 A visually assisted copper wire soft connection detection method and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008015029A (en) * 2006-07-03 2008-01-24 Sharp Corp Display device
US20100141755A1 (en) * 2008-12-05 2010-06-10 Tokyo Electron Limited Substrate inspection method, substrate inspection system and storage medium
CN104122265A (en) * 2013-04-28 2014-10-29 郑州大学 Method and system for checking screw hole thread missing of metal plate
CN104457577A (en) * 2014-12-19 2015-03-25 上海工业自动化仪表研究院 Machine-vision-oriented non-contact type workpiece positioning and measuring method
CN106623493A (en) * 2016-12-31 2017-05-10 湖南文理学院 Detection method for continuous punching of steel band
CN107797517A (en) * 2017-09-30 2018-03-13 湖南文理学院 The method and system detected using realizing of Robot Vision steel band punching processing
CN107907063A (en) * 2017-11-14 2018-04-13 湖南文理学院 A kind of the steel band punching processing detecting system and method for view-based access control model measurement
CN109990711A (en) * 2019-04-25 2019-07-09 湘潭大学 Appearance quality detection method of punched nickel-plated steel strip

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008015029A (en) * 2006-07-03 2008-01-24 Sharp Corp Display device
US20100141755A1 (en) * 2008-12-05 2010-06-10 Tokyo Electron Limited Substrate inspection method, substrate inspection system and storage medium
CN104122265A (en) * 2013-04-28 2014-10-29 郑州大学 Method and system for checking screw hole thread missing of metal plate
CN104457577A (en) * 2014-12-19 2015-03-25 上海工业自动化仪表研究院 Machine-vision-oriented non-contact type workpiece positioning and measuring method
CN106623493A (en) * 2016-12-31 2017-05-10 湖南文理学院 Detection method for continuous punching of steel band
CN107797517A (en) * 2017-09-30 2018-03-13 湖南文理学院 The method and system detected using realizing of Robot Vision steel band punching processing
CN107907063A (en) * 2017-11-14 2018-04-13 湖南文理学院 A kind of the steel band punching processing detecting system and method for view-based access control model measurement
CN109990711A (en) * 2019-04-25 2019-07-09 湘潭大学 Appearance quality detection method of punched nickel-plated steel strip

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
周强等: "基于极坐标计盒维数的圆形通孔缺陷检测", 《陕西科技大学学报(自然科学版)》 *
钱斌等: "基于亚像素边缘检测的高精度圆孔参数测量方法研究", 《上海航天》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118628497A (en) * 2024-08-14 2024-09-10 浙江金桥铜业科技有限公司 A visually assisted copper wire soft connection detection method and system

Also Published As

Publication number Publication date
CN111551552B (en) 2023-06-13

Similar Documents

Publication Publication Date Title
US11132786B2 (en) Board defect filtering method based on defect list and circuit layout image and device thereof and computer-readable recording medium
CN109840900B (en) A fault online detection system and detection method applied to intelligent manufacturing workshops
CN111537517A (en) An unmanned intelligent stamping defect identification method
CN105783723B (en) Precision die surface processing accuracy detection device and method based on machine vision
CN106934800B (en) Metal plate strip surface defect detection method and device based on YOLO9000 network
CN114943739B (en) A kind of aluminum tube quality detection method
CN109990711B (en) Appearance quality detection method of punched nickel-plated steel strip
CN108596880A (en) Weld defect feature extraction based on image procossing and welding quality analysis method
CN113325001B (en) Automatic distinguishing and detecting equipment and method for appearance flaws on surface of copper foil
CN111982916A (en) Welding seam surface defect detection method and system based on machine vision
CN114047123A (en) Method and system for detecting production defects of integrated board
CN102914545A (en) Gear defect detection method and system based on computer vision
CN117649404A (en) Medicine packaging box quality detection method and system based on image data analysis
WO2007062563A1 (en) On-line automatic inspection method for detecting surface flaws of steel during the pretreatment of the ship steel
CN114387233A (en) A method and system for sand mold defect detection based on machine vision
CN108257171A (en) Car radar assembling aperture detection method based on light vision
CN108470349A (en) A kind of milli machine part dimension measurement screening technique under movement background
CN118898620A (en) A method for detecting surface defects of workpieces based on visual recognition
CN115345876B (en) Bolt thread defect detection method based on ultrasonic image
CN113012098A (en) Iron tower angle steel punching defect detection method based on BP neural network
CN111551552B (en) A method for detecting the appearance quality of round hole punching net
CN112683166B (en) Die-cutting product size detection method
CN117455917B (en) Establishment of false alarm library of etched lead frame and false alarm on-line judging and screening method
CN116448764A (en) An automatic crack detection method for fatigue test of aircraft structure
CN113793321A (en) Casting surface defect dynamic detection method and device based on machine vision

Legal Events

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