CN112683166B - Die-cutting product size detection method - Google Patents

Die-cutting product size detection method Download PDF

Info

Publication number
CN112683166B
CN112683166B CN202011459251.8A CN202011459251A CN112683166B CN 112683166 B CN112683166 B CN 112683166B CN 202011459251 A CN202011459251 A CN 202011459251A CN 112683166 B CN112683166 B CN 112683166B
Authority
CN
China
Prior art keywords
die
detection
image
detection element
cut product
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011459251.8A
Other languages
Chinese (zh)
Other versions
CN112683166A (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.)
Hangzhou Youshitai Information Technology Co ltd
Original Assignee
Hangzhou Youshitai Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Youshitai Information Technology Co ltd filed Critical Hangzhou Youshitai Information Technology Co ltd
Priority to CN202011459251.8A priority Critical patent/CN112683166B/en
Publication of CN112683166A publication Critical patent/CN112683166A/en
Application granted granted Critical
Publication of CN112683166B publication Critical patent/CN112683166B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a die-cutting product size detection method, which comprises the following steps: (1) initializing detection element parameters and detection index parameters to be detected of the die-cut product; (2) acquiring an image containing a calibration sheet, and calculating a calibration matrix according to the image; (3) obtaining a die-cut product image to be subjected to size detection, calculating a threshold segmentation result graph of the die-cut product image, and positioning the die-cut product according to the threshold segmentation result graph; (4) updating iterative fitting detection elements according to the positioning result of the die-cutting product, the initialized detection element parameters and the calibration matrix; (5) and calculating and outputting a detection index according to the fitted detection element and the initialized detection index parameter. The online high-efficiency accurate detection of the size of the die-cut product is realized, and the extremely low poor omission factor and the extremely low false omission factor are controlled while the higher detection speed is kept.

Description

Die-cutting product size detection method
Technical Field
The invention belongs to the field of image signal processing and machine vision, and particularly relates to a die-cutting product size defect detection method.
Background
The die-cut piece is a product part formed by cutting raw materials, and is mainly applied to the printed product industry at first. In recent years, with the rapid development of the electronic consumer product industry, the die-cut piece has been widely applied to electronic products, such as housings, display screens, device modules, and the like of the electronic products.
The processing technology of the die cutting piece in the electronic product is complex, the defect of the die cutting piece is often caused due to the influence of factors such as the combination of different cutters, the cutting precision of a die cutting machine, the tension of various materials in a composite product, the external environment and the like during processing, and the die cutting piece with the defect is often unqualified in the whole electronic product, so that the greater loss is brought. Therefore, accurate and efficient detection of the defects of the die-cut piece is particularly important.
At present, the defect detection of the die-cut piece mainly adopts a manual defect off-line spot inspection method. The manual detection selects a product test sample through sampling, size defect judgment is carried out by means of a measuring instrument, and surface defect judgment is carried out through human eyes. The method mainly has the following defects: (1) the offline sampling detection causes low product participation rate and easy omission detection; (2) the labor cost is high, extra damage is easily introduced in the measuring process, the detection result is easily influenced by artificial subjective experience and state, and misjudgment occurs; (3) the human eyes are easy to fatigue, the detection efficiency is low, and the requirement of mass production cannot be supported; (4) the detection data is not easy to store, and the backtracking analysis of historical data is not supported. Meanwhile, the off-line detection leads to disjointing with the whole production link, an additional quality detection link is needed, the continuity and integrity of production are damaged, and secondly, the speed of manual detection is far slower than the production speed of an upstream machine, so that only sampling test can be adopted, and all production targets cannot be completely covered.
Therefore, research using a machine instead of manual detection is continuously being conducted. In foreign countries, as early as the eighties of the last century, machine vision-based inspection techniques and corresponding machine vision systems have been widely used in industrial and manufacturing inspection, and a large number of mature industrial inspection solutions and vision inspection systems have been proposed.
In China, with the arrival of the 'industrial 4.0' era, automatic and intelligent detection becomes a necessary development trend in the aspect of industrial detection. At present, a method for carrying out related industrial detection by using a machine vision technology is also developed in China, digital image data of a detection target is obtained by using image acquisition equipment, and the obtained detection target data is identified, analyzed and detected by means of an image processing technology. Compared with traditional manual detection, the method has the characteristics of high precision, non-contact, high efficiency, high reliability and the like, can effectively reduce the rejection rate of industrial production, and ensures the quality of products under the requirement of mass production. However, the field of die-cutting piece defect detection is focused on, the automatic detection of the die-cutting piece defects at home and abroad at present has no mature targeted scheme, and particularly, an automatic high-precision detection method capable of judging the size defects is still in a blank state.
Disclosure of Invention
Aiming at the problems, the invention provides an efficient and accurate die-cutting product size detection method, which realizes the on-line detection of the die-cutting product size, and controls extremely low poor omission factor and false detection rate while keeping higher detection speed.
The technical scheme provided by the invention is as follows:
a die-cut product dimension detection method comprises the following steps:
(1) initializing detection element parameters and detection index parameters to be detected of the die-cut product;
(2) acquiring an image containing a calibration sheet, and calculating a calibration matrix according to the image;
(3) obtaining a die-cut product image to be subjected to size detection, calculating a threshold segmentation result graph of the die-cut product image, and positioning the die-cut product according to the threshold segmentation result graph;
(4) updating iterative fitting detection elements according to the positioning result of the die-cutting product, the initialized detection element parameters and the calibration matrix;
(5) and calculating and outputting a detection index according to the fitted detection element and the initialized detection index parameter.
Compared with the prior art, the invention has the beneficial effects that:
the invention provides a die-cutting product size detection method, which comprises the steps of obtaining an image containing a calibration sheet and calculating a calibration matrix; then obtaining a die-cutting product image to be subjected to size detection, calculating a threshold segmentation result graph of the die-cutting product image, and positioning the die-cutting product according to the threshold segmentation result graph; and finally, calculating and outputting detection indexes by combining the detection index parameters with initialization after the iterative fitting detection elements are updated according to the positioning result of the die-cut product, the initialized detection element parameters and the calibration matrix.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flow chart of a die-cut product dimension detection method provided by an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the detailed description and specific examples, while indicating the scope of the invention, are intended for purposes of illustration only and are not intended to limit the scope of the invention.
Fig. 1 is a flow chart of a die-cut product dimension detection method provided by an embodiment of the invention. As shown in fig. 1, the die-cut product size detection method provided by the embodiment comprises the following steps:
step 1, initializing detection element parameters and detection index parameters to be detected of the die-cut product.
The initial detection element parameters are related parameters representing the detection elements, and the detection elements comprise circles, circular arcs and straight lines, wherein the circles and the circular arcs are represented by parameter circle centers and radiuses, and the straight lines are represented by parameter starting point coordinates and parameter ending point coordinates;
the initialized detection index parameters are index parameters for judging the detection result, including error parameters.
And 2, acquiring an image containing a calibration sheet, and calculating a calibration matrix according to the image.
The calibration sheet is used for determining a calibration matrix, and the specific process for calculating the calibration matrix is as follows:
(2-1) acquiring an image containing a calibration sheet, performing threshold segmentation on the image to obtain a threshold segmentation result graph, and acquiring pixel point sets of all calibration nodes on the calibration sheet according to the threshold segmentation result graph;
and (2-2) calculating the image space gravity center corresponding to each calibration node according to the pixel point set, and fitting and determining a calibration matrix by adopting a minimum least square method according to the image space gravity center of each calibration node and the real space relative coordinate corresponding to each calibration node, wherein the calibration matrix can convert the image space coordinate into the real space coordinate.
In the embodiment, an image containing 49 calibration circles is selected, and after threshold segmentation is carried out on the image, a pixel point set Vi of 49 circles in a fixed slice is obtained; then calculating the space center of gravity (center of circle) Ci of 49 circular calibration sheets according to the pixel point set Vi; and finally, according to Ci and the corresponding real space relative coordinate Ri, fitting a calibration matrix according to a least square method, wherein the calibration matrix F can convert the image space coordinate into the real space coordinate.
Figure BDA0002830749650000041
And 3, acquiring a die-cut product image to be subjected to size detection, calculating a threshold segmentation result graph of the die-cut product image, and positioning the die-cut product according to the threshold segmentation result graph.
In this embodiment, the specific process of threshold segmentation is as follows:
(a) setting an initial threshold segmentation parameter as T ∈ [0,255 ];
(b) thresholding the image according to a thresholding parameter T, for a point with (x, y) image coordinates, the segmentation result B (x, y) follows the following expression:
Figure BDA0002830749650000051
wherein g (x, y) represents a gray value, and a threshold segmentation result graph B is obtained according to the segmentation result B (x, y);
(c) observing the threshold segmentation result graph B and adjusting the threshold segmentation parameter T, if the die-cutting workpiece and the backing material are white, namely the pixel value is 255, increasing the threshold segmentation parameter T, and returning to the step (B); if the die-cut workpiece and the backing material are black, namely the pixel value is 0, reducing the threshold segmentation parameter T, and returning to the step (b); if the die-cut workpiece part is black and the base material part is white, the adjustment is stopped.
The specific process of positioning the die-cut product according to the threshold segmentation result graph comprises the following steps:
(3-1) carrying out edge detection on the threshold segmentation result graph to obtain a workpiece closed contour set, and solving an external matrix for each workpiece closed contour based on the workpiece closed contour set to form an external rectangle set;
and (3-2) statistically analyzing blocks in a new image contained in each external rectangle according to the external rectangle set and the workpiece closed contour set to form a sub-image corresponding to each external matrix, so as to realize the positioning of the die-cut product.
In this embodiment, a region growing algorithm may be adopted to perform edge detection on the new threshold segmentation result graph to obtain a closed contour of the workpiece; a workpiece closed contour set is then constructed based on the edge detection results, denoted as V ═ V1, V2, V3, …, where Vi is the closed point set for the ith contour.
In an embodiment, the obtained circumscribed rectangle set is denoted by B ═ B1, B2, B3, …, where the ith circumscribed rectangle Bi corresponds to the closed point set Vi of the ith contour, and the vertex coordinates of the top left corner and the bottom right corner of the circumscribed rectangle Bi are (x1, y1, x2, y2), which should satisfy:
x1=min{xp|p∈Vi}
y1=min{yp|p∈Vi}
x2=max{xp|p∈Vi}
y2=max{yp|p∈Vi}
wherein min {. cndot } and max {. cndot } represent process functions for finding the maximum value, p is the contour point index, xp,ypCoordinates representing contour points;
in the embodiment, the sub-image I corresponding to each external matrix is counted and constructed according to the following formulanew,iThe subimage is a positioning result graph of the die-cut product;
Inew,i={g(x,y)|x∈[x1,x2],y∈[y1,y2]}
wherein, Inew,iRepresents the sub-image corresponding to the ith bounding matrix, where g (x, y) represents the pixel value at the new image (x, y) location.
And 4, updating iterative fitting detection elements according to the positioning result of the die-cut product, the initialized detection element parameters and the calibration matrix.
The specific process is as follows:
(4-1) analyzing the initialized detection element parameters to obtain a detection element set based on a real coordinate system; wherein, the detection element set comprises a circle, an arc and a straight line.
And (4-2) converting the detection element set based on the real coordinate system into a detection element parameter set based on the image coordinate system according to the inverse matrix of the calibration matrix.
(4-3) acquiring a search rectangular frame of the detection element for each detection element in the detection element parameter set based on the image coordinate system.
In this embodiment, the search rectangle for obtaining the detection element is performed by classification, and the specific process is as follows:
(4-3-1) when the detection element is a circle, obtaining a search rectangular frame Boxi ═ of the circle center ci ═ (xi, yi) and the radius ri, (x1, y1, x2, y 2):
x1=xi-ri-d,y1=yi-ri-d
x2=xi+ri+d,y2=yi+ri+d
(4-3-2) when the detection element is a circular arc, obtaining the rectangular frame searching process of the detection element in the same way as the circle;
(4-3-3) when the detection element is a straight line, acquiring a search rectangular frame Boxi ═ of the detection element (x1, y1, x2, y2) from a start point coordinate s ═ of the straight line (xs, ys) and an end point coordinate e ═ of the straight line (xe, ye):
x1=min{xe-d,xs-d},y1=min{ye-d,ys-d}
x2=max{xe+d,xs+d},y2=max{ye+d,ys+d}
wherein, (x1, y1) represents the vertex coordinate of the upper left corner of the rectangular box Boxi, (x2, y2) represents the vertex coordinate of the lower right corner of the rectangular box Boxi, and d represents the search margin;
(4-3-4) traversing the search rectangle box Boxi of all the straight lines, and calculating the intersection ratio IoU between the two, wherein the calculation formula is as follows:
Figure BDA0002830749650000071
wherein, BoxaAnd BoxbSearch rectangular boxes of a straight line a and a straight line b respectively;
then merging two straight lines with the intersection ratio IoU larger than a threshold q to generate a composite double line, wherein the composite double line comprises all parameters held by the original straight lines a and b, and the corresponding search rectangular frame is marked asBoxab=Boxa∪Boxb
And (4-4) acquiring an interested area in the positioning result graph of the die cutting image according to the search matrix frame, and converting the interested area into a gradient graph.
The region of Interest (Area of Interest) is the region of Interest, and in this embodiment, refers to the workpiece to be measured. The process of converting the region of interest into the gradient map is as follows:
the Sobel gradient value G (x, y) and gradient direction D (x, y) corresponding to an arbitrary image coordinate (x, y) in the region of interest are:
Figure BDA0002830749650000081
Figure BDA0002830749650000082
wherein, SobeliFor the optimized Sobel operator, 8 are respectively:
Figure BDA0002830749650000083
Figure BDA0002830749650000084
Figure BDA0002830749650000085
Figure BDA0002830749650000086
block (x, y) is a matrix consisting of (x, y) and its neighborhood pixels, i.e.:
Figure BDA0002830749650000087
operator denotes the image convolution operation.
And (4-5) screening gradient points according to the gradient map, constructing a candidate point set according to the gradient points, and performing iterative fine fitting according to the candidate point set and the detection elements to obtain fitted detection elements.
In this embodiment, the process of screening gradient points to construct a candidate point set by a gradient map is as follows:
gradmax=max{GAoI}
Vgrad={(x,y)|G(x,y)≥kgradmax+b,(x,y)∈IAoI}
wherein G isAoIRepresenting a gradient map, max {. cndot } representing taking the maximum value, gradmaxDenotes the maximum gradient point, k is the screening coefficient, b is the screening bias, G (x, y) denotes the gradient value of the location (x, y), VgradRepresenting a set of candidate points.
The fine fitting process is also classified, and the specific process of iterative fine fitting according to the candidate point set and the detection element is as follows:
(4-5-1) when the detection element is a circle with a circle center ci ═ x, yi) and a circle radius ri, calculating a candidate point set VgradError set D of relative circle center distance relative to radiusgradThe specific calculation formula is as follows:
Figure BDA0002830749650000091
for error set Dgrad1The middle error values are sorted in ascending order, and candidate points corresponding to at least 40% of the first error values are taken to form a new candidate point set Vreduced1
According to the new candidate point set Vreduced1Fitting a new circle by adopting a least square method, iterating the step (4-5-1) by using the new circle, and iterating until a final circle center (x0, y0) and a radius r0 are obtained;
(4-5-2) when the detection element is a circular arc, the iterative fine fitting process is the same as that of a circle.
(4-5-3) the detection element is a start point coordinate s ═ xs, ys and an end point coordinate e ═ xe, ye) and calculating a candidate point set VgradSet of distances D to straight linesgrad2The specific calculation formula is as follows:
Figure BDA0002830749650000092
wherein a is ye-ys, B is xs-xe, C is xeys-yexs;
distance set Dgrad2Candidate points corresponding to the distance of at least 40 percent form a new candidate point set Vreduced2Fitting a straight line by adopting a least square method, wherein the general formula is A 'x + B' y + C ═ 0, repeating the step (4-5-3), and iterating until a final straight line equation and a corresponding point set V are obtainedfinal
(4-5-4) the detection element comprises two pairs of start point coordinates
Figure BDA0002830749650000093
And end point coordinates
Figure BDA0002830749650000094
Composite double line of (3), calculating a candidate point set VgradSet of differences D between distances to two straight linesgrad3The specific calculation formula is as follows:
Figure BDA0002830749650000095
wherein
Figure BDA0002830749650000096
Obtained from mathematical analysis, Dgrad3The middle numerical value should be distributed like double-Gaussian double peaks, and the distance value D between the centers of the double peaks is calculated by simple numerical value clustering1And D2According to D1And D2Re-screening candidate point set ViThe following are:
Figure BDA0002830749650000101
according to the selected candidate point set ViFurther fitting the straight line L according to the least square method1And L2
And 5, calculating and outputting a detection index according to the fitted detection element and the initialized detection index parameter.
The parameters of the detection element, namely the circle center and the radius of the detection element circle, and the coordinates of the starting point and the end point of the straight line are obtained after the fitting detection element is obtained. Because the die-cut products can be decomposed into the detection elements to be represented, the die-cut product size can be obtained by combining the detection element parameters on the basis of the detection element parameters.
After the size of the die-cutting product is obtained, the detection index of the detected size of the die-cutting product can be calculated according to the given detection index parameters, and the judgment of the detection result is realized.
The above-mentioned embodiments are intended to illustrate the technical solutions and advantages of the present invention, and it should be understood that the above-mentioned embodiments are only the most preferred embodiments of the present invention, and are not intended to limit the present invention, and any modifications, additions, equivalents, etc. made within the scope of the principles of the present invention should be included in the scope of the present invention.

Claims (9)

1. A method for detecting the size of a die-cut product is characterized by comprising the following steps:
(1) initializing detection element parameters and detection index parameters to be detected of the die-cut product;
(2) acquiring an image containing a calibration sheet, and calculating a calibration matrix according to the image;
(3) obtaining a die-cut product image to be subjected to size detection, calculating a threshold segmentation result graph of the die-cut product image, and positioning the die-cut product according to the threshold segmentation result graph;
(4) updating iterative fitting detection elements according to the positioning result of the die-cutting product, the initialized detection element parameters and the calibration matrix, wherein the iterative fitting detection elements comprise:
(4-1) analyzing the initialized detection element parameters to obtain a detection element set based on a real coordinate system;
(4-2) converting the detection element set based on the real coordinate system into a detection element parameter set based on the image coordinate system according to the inverse matrix of the calibration matrix;
(4-3) acquiring a search rectangular frame of the detection element for each detection element in the detection element parameter set based on the image coordinate system;
(4-4) acquiring an interested area in the positioning result graph of the die cutting image according to the search matrix frame, and converting the interested area into a gradient graph;
(4-5) screening gradient points according to the gradient map, constructing a candidate point set according to the gradient points, and performing iterative fine fitting according to the candidate point set and the detection elements to obtain fitted detection elements;
(5) and calculating and outputting a detection index according to the fitted detection element and the initialized detection index parameter.
2. The die-cut product size detecting method according to claim 1, wherein the specific process of the step (2) is as follows:
(2-1) acquiring an image containing a calibration sheet, performing threshold segmentation on the image to obtain a threshold segmentation result graph, and acquiring pixel point sets of all calibration nodes on the calibration sheet according to the threshold segmentation result graph;
and (2-2) calculating the image space gravity center corresponding to each calibration node according to the pixel point set, and determining a calibration matrix by adopting least square fitting according to the image space gravity center of each calibration node and the real space relative coordinate corresponding to each calibration node, wherein the calibration matrix can convert the image space coordinate into the real space coordinate.
3. The die-cut product size detection method according to claim 1 or 2, characterized in that the threshold segmentation is performed by the following specific processes:
(a) setting an initial threshold segmentation parameter as T ∈ [0,255 ];
(b) thresholding the image according to a thresholding parameter T, for a point with (x, y) image coordinates, the segmentation result B (x, y) follows the following expression:
Figure FDA0003567147870000021
wherein g (x, y) represents a gray value, and a threshold segmentation result graph B is obtained according to the segmentation result B (x, y);
(c) observing the threshold segmentation result graph B and adjusting the threshold segmentation parameter T, if the die-cutting workpiece and the backing material are white, namely the pixel value is 255, increasing the threshold segmentation parameter T, and returning to the step (B); if the die-cut workpiece and the backing material are black, namely the pixel value is 0, reducing the threshold segmentation parameter T, and returning to the step (b); if the die-cut workpiece part is black and the base material part is white, the adjustment is stopped.
4. The die-cut product size detecting method according to claim 1 or 2, wherein the specific process of positioning the die-cut product according to the threshold segmentation result map in the step (3) is as follows:
(3-1) carrying out edge detection on the threshold segmentation result graph to obtain a workpiece closed contour set, and solving an external matrix for each workpiece closed contour based on the workpiece closed contour set to form an external rectangle set;
and (3-2) statistically analyzing blocks in a new image contained in each external rectangle according to the external rectangle set and the workpiece closed contour set to form a sub-image corresponding to each external matrix, so as to realize the positioning of the die-cut product.
5. The die-cut product size detection method according to claim 4, wherein in the step (3-1), the new threshold segmentation result graph is subjected to edge detection by using a region growing algorithm to obtain a workpiece closed contour;
in step (3-1), the circumscribed rectangle set is denoted as B ═ B1, B2, B3, …, where the ith circumscribed rectangle Bi corresponds to the closed point set Vi of the ith contour, and the vertex coordinates of the top left corner and the bottom right corner of the circumscribed rectangle Bi are (x1, y1, x2, y2), which should satisfy:
x1=min{xp|p∈Vi}
y1=min{yp|p∈Vi}
x2=max{xp|p∈Vi}
y2=max{yp|p∈Vi}
wherein min {. cndot } and max {. cndot } represent process functions for finding the maximum value, p is the contour point index, xp,ypCoordinates representing contour points;
in the step (3-2), the subimage I corresponding to each external matrix is counted and constructed according to the following formulanew,iThe subimage is a positioning result graph of the die-cut product;
Inew,i={g(x,y)|x∈[x1,x2],y∈[y1,y2]}
wherein, Inew,iRepresents the sub-image corresponding to the ith bounding matrix, where g (x, y) represents the pixel value at the new image (x, y) location.
6. The die-cut product size detecting method according to claim 1, wherein the specific process of the step (4-3) is as follows:
(4-3-1) when the detection element is a circle, obtaining a search rectangular frame Boxi ═ of the circle center ci ═ (xi, yi) and the radius ri, (x1, y1, x2, y2) of the detection element:
x1=xi-ri-d,y1=yi-ri-d
x2=xi+ri+d,y2=yi+ri+d
(4-3-2) when the detection element is a circular arc, the process of obtaining the search rectangular frame of the detection element is the same as that of the circle;
(4-3-3) when the detection element is a straight line, acquiring a search rectangular frame Boxi ═ of the detection element (x1, y1, x2, y2) from a start point coordinate s ═ of the straight line (xs, ys) and an end point coordinate e ═ of the straight line (xe, ye):
x1=min{xe-d,xs-d},y1=min{ye-d,ys-d}
x2=max{xe+d,xs+d},y2=max{ye+d,ys+d}
wherein, (x1, y1) represents the vertex coordinate of the upper left corner of the rectangular box Boxi, (x2, y2) represents the vertex coordinate of the lower right corner of the rectangular box Boxi, and d represents the search margin;
(4-3-4) traversing the search rectangle box Boxi of all the straight lines, and calculating the intersection ratio IoU between the two, wherein the calculation formula is as follows:
Figure FDA0003567147870000041
wherein, BoxaAnd BoxbSearch rectangular boxes of a straight line a and a straight line b respectively;
merging two straight lines with the intersection ratio IoU being larger than a threshold value q to generate a composite double line, wherein the composite double line comprises all parameters held by the original straight lines a and b, and the corresponding search rectangular Box is marked as Boxab=Boxa∪Boxb
7. The die-cut product size detecting method according to claim 1, wherein in the step (4-4), the step of converting the region of interest into the gradient map comprises:
the Sobel gradient value G (x, y) and gradient direction D (x, y) corresponding to an arbitrary image coordinate (x, y) in the region of interest are:
Figure FDA0003567147870000042
Figure FDA0003567147870000043
wherein SobeliFor the optimized Sobel operator, 8 are respectively:
Figure FDA0003567147870000044
Figure FDA0003567147870000051
Figure FDA0003567147870000052
Figure FDA0003567147870000053
block (x, y) is a matrix consisting of (x, y) and its neighborhood pixels, i.e.:
Figure FDA0003567147870000054
operator denotes the image convolution operation.
8. The die-cut product size detection method of claim 1, wherein in step (4-5), the process of screening the gradient points to construct the candidate point set by the gradient map comprises:
gradmax=max{GAoI}
Vgrad={(x,y)|G(x,y)≥kgradmax+b,(x,y)∈IAoI}
wherein G isAoIRepresenting a gradient map, max {. cndot } representing taking the maximum value, gradmaxDenotes the maximum gradient point, k is the screening coefficient, b is the screening bias, G (x, y) denotes the gradient value of the location (x, y), VgradRepresenting a set of candidate points.
9. The die-cut product size detection method according to claim 1, wherein in the step (4-5), the iterative fine fitting process according to the candidate point set and the detector element comprises:
(4-5-1) when the detection element is a circle with a circle center ci ═ x, yi) and a circle radius ri, calculating a candidate point set VgradError set D of relative circle center distance relative to radiusgradThe specific calculation formula is as follows:
Figure FDA0003567147870000055
for error set Dgrad1The middle error values are sorted in ascending order, and candidate points corresponding to at least 40% of the first error values are taken to form a new candidate point set Vreduced1
According to the new candidate point set Vreduced1Fitting a new circle by adopting a least square method, iterating the step (4-5-1) by using the new circle, and iterating until a final circle center (x0, y0) and a radius r0 are obtained;
(4-5-2) when the detection element is a circular arc, the iterative fine fitting process is the same as that of a circle;
(4-5-3) calculating a candidate point set V by using a straight line having a start point coordinate s ═ xs, ys and an end point coordinate e ═ xe, ye as detection elementsgradSet of distances to straight lines Dgrad2The specific calculation formula is as follows:
Figure FDA0003567147870000061
wherein a is ye-ys, B is xs-xe, C is xeys-yexs;
distance set Dgrad2Candidate points corresponding to the distance of at least 40 percent form a new candidate point set Vreduced2Fitting a straight line by adopting a least square method, wherein the general formula is A 'x + B' y + C ═ 0, repeating the step (4-5-3), and iterating until a final straight line equation and a corresponding point set V are obtainedfinal
(4-5-4) the detecting element is composed of two pairs of starting point coordinates
Figure FDA0003567147870000062
And end point coordinates
Figure FDA0003567147870000063
Composite double line of (3), calculating a candidate point set VgradSet of differences D between distances to two straight linesgrad3The specific calculation formula is as follows:
Figure FDA0003567147870000064
wherein
Figure FDA0003567147870000065
Obtained from mathematical analysis, Dgrad3The middle numerical value should be distributed like double-Gaussian double peaks, and the distance value D between the centers of the double peaks is calculated by simple numerical value clustering1And D2According to D1And D2Re-screening candidate point set ViThe following are:
Figure FDA0003567147870000066
according to the selected candidate point set ViFurther fitting the straight line L according to the least square method1And L2
CN202011459251.8A 2020-12-11 2020-12-11 Die-cutting product size detection method Active CN112683166B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011459251.8A CN112683166B (en) 2020-12-11 2020-12-11 Die-cutting product size detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011459251.8A CN112683166B (en) 2020-12-11 2020-12-11 Die-cutting product size detection method

Publications (2)

Publication Number Publication Date
CN112683166A CN112683166A (en) 2021-04-20
CN112683166B true CN112683166B (en) 2022-05-31

Family

ID=75449199

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011459251.8A Active CN112683166B (en) 2020-12-11 2020-12-11 Die-cutting product size detection method

Country Status (1)

Country Link
CN (1) CN112683166B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116543002B (en) * 2023-07-06 2023-11-21 广州市易鸿智能装备有限公司 Automatic detection method, device and system for products
CN116963395B (en) * 2023-07-20 2024-02-06 嘉丰盛精密电子科技(孝感)有限公司 Method for preparing flexible circuit board for circular knife die cutting

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101915573B (en) * 2010-08-04 2012-12-12 中国科学院自动化研究所 Positioning measurement method based on key point detection of marker
CN103047943B (en) * 2012-12-31 2016-04-06 吉林大学 Based on the door skin geomery detection method of single projection coded structured light
CN103292701B (en) * 2013-06-24 2015-09-16 哈尔滨工业大学 The online dimension measurement method of accurate device based on machine vision
CN109300162B (en) * 2018-08-17 2021-08-03 浙江工业大学 Multi-line laser radar and camera combined calibration method based on refined radar scanning edge points
CN110238849B (en) * 2019-06-13 2021-11-12 深圳市汇川技术股份有限公司 Robot hand-eye calibration method and device

Also Published As

Publication number Publication date
CN112683166A (en) 2021-04-20

Similar Documents

Publication Publication Date Title
CN111062915B (en) Real-time steel pipe defect detection method based on improved YOLOv3 model
CN109580630B (en) Visual inspection method for defects of mechanical parts
US20180253836A1 (en) Method for automated detection of defects in cast wheel products
CN112683166B (en) Die-cutting product size detection method
CN111402226A (en) Surface defect detection method based on cascade convolution neural network
CN107622277B (en) Bayesian classifier-based complex curved surface defect classification method
CN114140679A (en) Defect fusion method, device, recognition system and storage medium
CN110286124A (en) Refractory brick measuring system based on machine vision
CN110751604A (en) Machine vision-based steel pipe weld defect online detection method
CN111815555A (en) Metal additive manufacturing image detection method and device combining anti-neural network with local binary
CN115620061A (en) Hardware part defect detection method and system based on image recognition technology
CN115656182A (en) Sheet material point cloud defect detection method based on tensor voting principal component analysis
CN111402236A (en) Hot-rolled strip steel surface defect grading method based on image gray value
CN115035092A (en) Image-based bottle detection method, device, equipment and storage medium
CN117576100B (en) Surface defect grading detection and evaluation method for FPC connector
Zhou et al. An adaptive clustering method detecting the surface defects on linear guide rails
CN116539619B (en) Product defect detection method, system, device and storage medium
CN112683902B (en) Die-cutting product surface defect online detection method based on template
CN112200766A (en) Industrial product surface defect detection method based on area-associated neural network
CN115393290A (en) Edge defect detection method, device and equipment
Si et al. Deep learning-based defect detection for hot-rolled strip steel
CN113222880A (en) Analytical detection method
CN110021027B (en) Edge cutting point calculation method based on binocular vision
CN110717899A (en) Online visual detection method for bead explosion defects of transparent filter rod
DEMIRCIOGLU et al. METAL SURFACE TEXTURE CLASSIFICATION WITH GABOR FILTER BANKS AND XAI.

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