CN110933926B - Automatic correction method for angle of suction nozzle element of chip mounter based on angular point detection - Google Patents

Automatic correction method for angle of suction nozzle element of chip mounter based on angular point detection Download PDF

Info

Publication number
CN110933926B
CN110933926B CN201911109072.9A CN201911109072A CN110933926B CN 110933926 B CN110933926 B CN 110933926B CN 201911109072 A CN201911109072 A CN 201911109072A CN 110933926 B CN110933926 B CN 110933926B
Authority
CN
China
Prior art keywords
corner
image
line segments
angle
circumscribed rectangle
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
CN201911109072.9A
Other languages
Chinese (zh)
Other versions
CN110933926A (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.)
Zhejiang University of Technology ZJUT
Original Assignee
Zhejiang University of Technology ZJUT
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 Zhejiang University of Technology ZJUT filed Critical Zhejiang University of Technology ZJUT
Priority to CN201911109072.9A priority Critical patent/CN110933926B/en
Publication of CN110933926A publication Critical patent/CN110933926A/en
Application granted granted Critical
Publication of CN110933926B publication Critical patent/CN110933926B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05KPRINTED CIRCUITS; CASINGS OR CONSTRUCTIONAL DETAILS OF ELECTRIC APPARATUS; MANUFACTURE OF ASSEMBLAGES OF ELECTRICAL COMPONENTS
    • H05K13/00Apparatus or processes specially adapted for manufacturing or adjusting assemblages of electric components
    • H05K13/02Feeding of components
    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05KPRINTED CIRCUITS; CASINGS OR CONSTRUCTIONAL DETAILS OF ELECTRIC APPARATUS; MANUFACTURE OF ASSEMBLAGES OF ELECTRICAL COMPONENTS
    • H05K13/00Apparatus or processes specially adapted for manufacturing or adjusting assemblages of electric components
    • H05K13/08Monitoring manufacture of assemblages
    • H05K13/081Integration of optical monitoring devices in assembly lines; Processes using optical monitoring devices specially adapted for controlling devices or machines in assembly lines
    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05KPRINTED CIRCUITS; CASINGS OR CONSTRUCTIONAL DETAILS OF ELECTRIC APPARATUS; MANUFACTURE OF ASSEMBLAGES OF ELECTRICAL COMPONENTS
    • H05K13/00Apparatus or processes specially adapted for manufacturing or adjusting assemblages of electric components
    • H05K13/08Monitoring manufacture of assemblages
    • H05K13/086Supply management, e.g. supply of components or of substrates

Landscapes

  • Engineering & Computer Science (AREA)
  • Manufacturing & Machinery (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Operations Research (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses an automatic correction method of angles of suction nozzle elements of a chip mounter based on angular point detection, which comprises the following steps: acquiring a gray scale image of the element; intercepting the gray level image; extracting angular points of the intercepted image; removing corner points with pixel values larger than a threshold value from the extracted corner points; based on the angular points left after removal, screening an angular point set of which the area of the minimum circumscribed rectangle is smaller than a threshold value; acquiring a region image of a minimum circumscribed rectangle formed by the corner set and amplifying the region image; performing canny edge detection on the preprocessed area image and extracting to obtain a plurality of line segments; screening at least one pair of mutually parallel line segments and at least one line segment vertical to the mutually parallel line segments from the extracted line segments; and calculating to obtain the rotation angle according to the screened line segments. The invention overcomes the influence of environmental illumination and improves the precision of element angle correction.

Description

Automatic correction method for angle of suction nozzle element of chip mounter based on angular point detection
Technical Field
The application belongs to the technical field of visual inspection, and particularly relates to an automatic correction method for angles of suction nozzle elements of a chip mounter based on angular point detection.
Background
Under the trend of rapid development of industrial automation, the requirement of a modern production mode that the mass production of products and the configuration process are complicated cannot be met by means of traditional manual operation. Visual inspection technology based on digital image processing technology gradually replaces manual inspection technology, and is widely applied to the field of industrial manufacturing.
The angle of a component needs to be corrected by the feeder of the chip mounter, and in the prior art, angle information is obtained through contour detection and Hough line detection, but the problem of interference caused by light reflection on the metal surface of a suction nozzle under the influence of illumination cannot be solved; in the prior art, the chip angle is obtained based on the frequency domain characteristics, and the interference of the illumination intensity is reduced by collecting the sequencing combination of the low-frequency information and the high-frequency information of the image, but the influence of reflected light cannot be effectively solved. Therefore, there is a high necessity for a method of correcting the angle of the element, which can overcome the above-mentioned interference and is well applicable to mass production.
Disclosure of Invention
The application aims to provide an automatic correction method for the angle of a suction nozzle element of a chip mounter based on angular point detection, so that the influence of environmental illumination is overcome, and the accuracy of correction of the angle of the element is improved.
In order to achieve the purpose, the technical scheme adopted by the application is as follows:
an automatic correction method for chip mounter suction nozzle component angles based on angular point detection comprises the following steps:
step 1: acquiring a gray scale image of the element;
step 2: intercepting the gray level image according to a preset intercepting area;
and step 3: performing corner extraction on the intercepted image by adopting Shi Tomasi algorithm;
and 4, step 4: removing corner points with pixel values larger than a threshold value from the extracted corner points;
and 5: based on the angular points left after the removal in the step 4, screening an angular point set of which the area of the minimum external rectangle is smaller than a threshold value;
step 6: acquiring a region image of a minimum circumscribed rectangle formed by the corner set, and amplifying the region image by adopting a cubic spline interpolation method;
and 7: preprocessing the area image amplified in the step 6;
and 8: canny edge detection is carried out on the preprocessed image, linear detection is carried out by adopting probability Hough transformation, and a plurality of line segments are extracted;
and step 9: screening at least one pair of mutually parallel line segments and at least one line segment vertical to the mutually parallel line segments from the extracted line segments;
step 10: judging whether a line segment with the angle consistent with the angle of the minimum circumscribed rectangle obtained by screening in the step 5 exists in two mutually perpendicular line segments, and if so, taking the angle of the minimum circumscribed rectangle as the rotation angle of the element; if the line segment does not exist, the rotation angle is obtained through calculation according to the screened line segment.
Preferably, the intercepting the grayscale image according to a preset intercepting region includes:
if the element is a rectangle with a length d and a width w;
the preset intercepting area is a rectangle, the length of the rectangle is alpha multiplied by d, the width of the rectangle is alpha multiplied by w, and alpha is a preset multiple;
when the gray image is subjected to region clipping, the center of the gray image is taken as the center of the clipping region, the long side of the gray image is taken as the length of the clipping region, and the short side of the gray image is taken as the width of the clipping region for clipping.
Preferably, the performing corner extraction on the intercepted image by using the Shi Tomasi algorithm includes:
step 3.1: assuming that the gray value of the pixel point (x, y) in the image is I (x, y), the pixel change E (x, y) of the pixel point (x, y) moving (u, v) in each direction of the local small window W (x, y) is:
Figure GDA0002749351190000021
wherein ω isu,vIs a weighting function;
step 3.2: performing Taylor expansion on I (x + u, y + v) to obtain:
i(x+u,y+v)=I(x,y)+uIx+vIy+O(u2,v2)
wherein Ix,IyIs a first order gray scale gradient;
expanding Taylor to obtain a relation, ignoring the second and above terms, and obtaining the relation in E (x, y):
Figure GDA0002749351190000022
step 3.3: the matrix M is set as follows, and λ1,λ2Two eigenvalues of the matrix M:
Figure GDA0002749351190000031
if λ1,λ2Satisfy lambda1≥λ2And lambda2≥kλ2maxIf yes, the pixel point (x, y) is a strong angular point; otherwise, the pixel point (x, y) is not a strong angular point; wherein λ2maxIs the maximum value of the smaller characteristic values of all the pixel points, and k isAn intermediate parameter.
Preferably, the screening, based on the corner points remaining after the removing in step 4, the set of corner points whose area of the minimum circumscribed rectangle is smaller than the threshold includes:
step 5.1: generating a corner set P based on the corner points left after the removal in the step 4, wherein the size of the corner set P is n;
step 5.2: if the area of the minimum circumscribed rectangle of the corner point set P is greater than 1.2 times the actual area of the current element, setting the cycle number i to be 0, and executing step 5.3; otherwise, taking the corner set P as a final corner set and finishing the screening step;
step 5.3: copying the corner point set P to obtain a corner point set Pt, deleting the ith corner point in the corner point set Pt, and obtaining a minimum circumscribed rectangle by using the remaining corner points in the corner point set Pt;
step 5.4: if i < n, i ═ i +1, and step 5.3 is re-executed; otherwise, selecting a minimum circumscribed rectangle Rm with the smallest area from the obtained n minimum circumscribed rectangles, wherein the minimum circumscribed rectangle Rm corresponds to the corner point set Pm;
step 5.5: judging the relation between the area of the minimum circumscribed rectangle Rm and the actual area of the element, if the area of the minimum circumscribed rectangle Rm is smaller than 0.9 times of the actual area of the element, taking the corner point set Pm as a corner point set P, and executing the step 5.2 again; otherwise, executing step 5.6;
step 5.6: taking the longer side of the minimum circumscribed rectangle Rm as the length and the shorter side as the width, and if the length of the minimum circumscribed rectangle Rm is larger than 1.2 times the length of the element, executing a step 5.7; otherwise, executing step 5.10;
step 5.7: establishing coordinates by taking the length of the minimum circumscribed rectangle Rm as a y axis and the width as an x axis, and acquiring two corner points with the maximum and minimum y axis coordinates, wherein the y coordinate of the corner point with the maximum y axis coordinate is ymax, and the y coordinate of the corner point with the minimum y axis coordinate is ymin;
step 5.8: acquiring the number c1 of corner points of the minimum circumscribed rectangle Rm within the range of y-axis coordinates of ymin to (ymax + ymin)/2, and acquiring the number c2 of corner points of the minimum circumscribed rectangle Rm within the range of y-axis coordinates of (ymax + ymin)/2 to ymax;
step 5.9: if c1 is larger than c2, deleting the corner points corresponding to the ymax in the y-axis coordinate in the corner point set Pm, taking the residual corner points after deletion as the corner point set P, and re-executing the step 5.2; otherwise, deleting the corner points corresponding to the ymin in the y-axis coordinate in the corner point set Pm, taking the residual corner points after deletion as the corner point set P, and re-executing the step 5.2;
step 5.10: if the width of the minimum circumscribed rectangle Rm is larger than 1.2 times the width of the element, executing step 5.11; otherwise, the angular point set Pm is used as a final angular point set and the screening step is ended;
step 5.11: establishing coordinates by taking the length of the minimum circumscribed rectangle Rm as a y-axis and the width as an x-axis, and acquiring two corner points with the maximum and minimum x-axis coordinates, wherein the x-coordinate of the corner point with the maximum x-axis coordinate is xmax, and the x-coordinate of the corner point with the minimum x-axis coordinate is xmin;
step 5.12: acquiring the number c3 of corner points of the minimum circumscribed rectangle Rm within the range of x-axis coordinates of xmin to (xmax + xmin)/2, and acquiring the number c4 of corner points of the minimum circumscribed rectangle Rm within the range of x-axis coordinates of (xmax + xmin)/2 to xmax;
step 5.13: if c3 is larger than c4, deleting the corner point corresponding to the x-axis coordinate xmax in the corner point set Pm, taking the residual corner point after deletion as the corner point set P, and re-executing the step 5.2; otherwise, deleting the corner point corresponding to the x-axis coordinate xmin in the corner point set Pm, taking the corner point left after deletion as the corner point set P, and re-executing the step 5.2.
Preferably, the preprocessing the enlarged region image includes:
processing the amplified region image by a histogram equalization method to obtain a first image;
performing median filtering on the first image by adopting a 5 multiplied by 5 window to obtain a second image;
and performing Gaussian filtering on the second image by adopting a 7 multiplied by 7 window to obtain a preprocessed image.
Preferably, the screening out at least one pair of mutually parallel line segments and at least one line segment perpendicular to the mutually parallel line segments from the extracted line segments includes:
step 9.1: calculating the angle of each line segment as:
Figure GDA0002749351190000041
wherein (x)1,y1)、(x2,y2) Two different points on the line segment;
step 9.2: sequencing all line segments according to the sequence of the angles from small to large, and selecting the line segments with the angle difference between two adjacent line segments less than 3 degrees;
step 9.3: traversing all the line segments from large to small according to the angle, judging whether the line segments which are vertical to the line segments found in the step 9.2 exist or not, and if so, obtaining the line segments which meet the conditions; otherwise, the segment closest to the perpendicular to the segment found in step 9.2 is selected.
Preferably, the determining the length and width of the element according to the longest distance between the two sets of parallel lines to obtain the rotation angle includes:
step 10.1: counting the numbers c1 and c2 of line segments corresponding to two angles r1 and r2 which are perpendicular to each other respectively;
step 10.2: if c1 is greater than or equal to 2 and c2 is greater than or equal to 2, executing step 10.3; otherwise, executing step 10.4;
step 10.3: calculating the maximum distances d1 and d2 between all parallel line segments corresponding to the two angles r1 and r2 respectively; and if d1< d2, the rotation angle of the element is r 1; otherwise the rotation angle of the element is r 2;
step 10.4: if c1 is greater than or equal to 2 and c2 is equal to 1, then step 10.5 is executed; otherwise, executing step 10.6;
step 10.5: calculating the maximum distance d1 between all parallel line segments corresponding to the angle r1, and calculating the maximum distance l1 from two ends of a line segment with the angle r2 to a line segment with the angle r 1; and if d1< l1, the rotation angle of the element is r 2; otherwise the rotation angle of the element is r 1;
step 10.6: if c2 is greater than or equal to 2 and c1 is equal to 1, then step 10.7 is executed; otherwise, ending the rotation angle calculation step;
step 10.7: calculating the maximum distance d2 between all parallel line segments corresponding to the angle r2, and calculating the maximum distance l2 from two ends of a line segment with the angle r1 to a line segment with the angle r 2; and if d2< l2, the rotation angle of the element is r 1; otherwise the rotation angle of the element is r 2.
Compared with the prior art, the automatic correction method for the angle of the suction nozzle element of the chip mounter based on angular point detection has the following beneficial effects: on the one hand, the influence of the illumination intensity in the picture can be reduced by calculating the angle of the patch through the angular point, the condition that straight lines on two sides of the patch cannot be detected is avoided, and the rotation angle is rapidly acquired. On the other hand, the angle is judged through the detected straight line, so that the inclination deviation of the minimum circumscribed rectangle formed by the angular points can be compensated, and the accurate angle can be obtained.
Drawings
Fig. 1 is a flowchart of an automatic correction method for angles of suction nozzle components of a chip mounter based on angular point detection according to the present application;
FIG. 2 is a flow chart of the present application for screening a collection of corners;
FIG. 3 is a schematic view of a gray scale image obtained when the device is in a first state;
fig. 4 is a schematic diagram of a minimum circumscribed rectangle obtained by performing corner point screening on the gray-scale image of fig. 3;
FIG. 5 is a schematic view of a gray scale image obtained when the device is in a second state;
fig. 6 is a schematic diagram of a minimum circumscribed rectangle obtained by performing corner point screening on the gray-scale image of fig. 5;
FIG. 7 is a schematic view of a grayscale image obtained when the device is in a third state;
fig. 8 is a schematic diagram of a minimum circumscribed rectangle obtained by performing corner point screening on the grayscale image of fig. 7;
fig. 9 is a flowchart of calculating the rotation angle of the element according to the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
As shown in fig. 1, in one embodiment, an automatic correction method for an angle of a suction nozzle component of a chip mounter based on angular point detection is provided, and is applied to a vision system of the chip mounter to accurately correct the angle of the suction nozzle component.
The automatic correction method for the angle of the suction nozzle component of the chip mounter based on the angular point detection comprises the following steps:
step 1: a grayscale image of the element is acquired.
When acquiring a gray image of a component, the gray image is usually acquired by an industrial camera, and in order to facilitate the matching of the industrial camera and a chip mounter, the industrial camera is mounted on the chip mounter, and the component is sucked by a suction nozzle of a working head on the chip mounter and is moved to a visual center of the industrial camera.
Step 2: and intercepting the gray level image according to a preset intercepting region.
In this embodiment, an Opencv function is used to capture an image of a designated area, and since the top surface of the patch element in a flat state is generally rectangular, when performing area capture, if the element is rectangular with a length d and a width w (meaning that the top surface of the element in a flat state or the shooting surface of the industrial camera is rectangular); the predetermined cut-out area is a rectangle, and the length of the rectangle is α × d, the width of the rectangle is α × w, and α is a predetermined multiple.
When the gray image is subjected to region clipping, the center of the gray image is taken as the center of the clipping region, the long side of the gray image is taken as the length of the clipping region, and the short side of the gray image is taken as the width of the clipping region for clipping.
Since the working head will move the element to the center of the image, centering the image center on the capture area reduces the likelihood of the active area being captured, and the capture area has a length and width that is preferably 2 times the maximum patch length and width to ensure that all the active area is captured. The present embodiment sets the length and width of the cut-out region to 1/3 of the length and width of the grayscale image according to the focal length of the industrial camera.
And step 3: and performing corner extraction on the intercepted image by adopting Shi Tomasi algorithm.
Step 3.1: assuming that the gray value of the pixel point (x, y) in the image is I (x, y), the pixel change E (x, y) of the pixel point (x, y) moving (u, v) in each direction of the local small window W (x, y) is:
Figure GDA0002749351190000071
wherein ω isu,vIs a weighting function;
step 3.2: performing Taylor expansion on I (x + u, y + v) to obtain:
I(x+u,y+v)=I(x,y)+uIx+vIy+O(u2,v2)
wherein Ix,IyIs a first order gray scale gradient;
expanding Taylor to obtain a relation, ignoring the second and above terms, and obtaining the relation in E (x, y):
Figure GDA0002749351190000072
step 3.3: the matrix M is set as follows, and λ1,λ2Two eigenvalues of the matrix M:
Figure GDA0002749351190000073
if λ1,λ2Satisfy lambda1≥λ2And lambda2≥kλ2maxThen, thenThe pixel point (x, y) is a strong angular point; otherwise, the pixel point (x, y) is not a strong angular point; wherein λ2maxIs the maximum value in the smaller characteristic values of all the pixel points, and k is an intermediate parameter.
And 4, step 4: and removing corner points with pixel values larger than a threshold value from the extracted corner points.
According to the distribution characteristics of the obtained gray scale image pixel values of the elements, the threshold value is set to be 160 in the embodiment, so that the corner points reflecting light out of the high-brightness area are effectively removed, and the influence of the reflected light is avoided.
And 5: and (4) screening the corner point set with the area of the minimum circumscribed rectangle smaller than the threshold value based on the corner points left after the removal in the step (4).
Since the outline of the nozzle is circular and the outline of the chip (component) is rectangular, it is proposed to assume that the corner points extracted by the Shi Tomasi algorithm are mostly concentrated on the chip. Under this assumption, if there are corner points far away from the chip, the minimum circumscribed rectangle area formed by the corner points is far larger than the area of the chip. When the corner points far away from the chip are deleted, the area of the minimum circumscribed rectangle formed by the remaining corner points is reduced and is close to the area of the chip.
According to the above assumption, an elimination method may be adopted to select a corner set meeting the conditions, and since the corner distribution is relatively complex, as shown in fig. 2, the specific steps of screening the corner set provided in this embodiment are as follows:
step 5.1: generating a corner set P based on the corner points left after the removal in the step 4, wherein the size of the corner set P is n;
step 5.2: if the area of the minimum circumscribed rectangle of the corner point set P is greater than 1.2 times the actual area of the current element, setting the cycle number i to be 0, and executing step 5.3; otherwise, taking the corner set P as a final corner set and finishing the screening step;
step 5.3: copying the corner point set P to obtain a corner point set Pt, deleting the ith corner point in the corner point set Pt, and obtaining a minimum circumscribed rectangle by using the remaining corner points in the corner point set Pt;
step 5.4: if i < n, i ═ i +1, and step 5.3 is re-executed; otherwise, selecting a minimum circumscribed rectangle Rm with the smallest area from the obtained n minimum circumscribed rectangles, wherein the minimum circumscribed rectangle Rm corresponds to the corner point set Pm;
step 5.5: judging the relation between the area of the minimum circumscribed rectangle Rm and the actual area of the element, if the area of the minimum circumscribed rectangle Rm is smaller than 0.9 times of the actual area of the element, taking the corner point set Pm as a corner point set P, and executing the step 5.2 again; otherwise, executing step 5.6;
step 5.6: taking the longer side of the minimum circumscribed rectangle Rm as the length and the shorter side as the width, and if the length of the minimum circumscribed rectangle Rm is larger than 1.2 times the length of the element, executing a step 5.7; otherwise, executing step 5.10;
step 5.7: establishing coordinates by taking the length of the minimum circumscribed rectangle Rm as a y axis and the width as an x axis, and acquiring two corner points with the maximum and minimum y axis coordinates, wherein the y coordinate of the corner point with the maximum y axis coordinate is ymax, and the y coordinate of the corner point with the minimum y axis coordinate is ymin;
step 5.8: acquiring the number c1 of corner points of the minimum circumscribed rectangle Rm within the range of y-axis coordinates of ymin to (ymax + ymin)/2, and acquiring the number c2 of corner points of the minimum circumscribed rectangle Rm within the range of y-axis coordinates of (ymax + ymin)/2 to ymax;
step 5.9: if c1 is larger than c2, deleting the corner points corresponding to the ymax in the y-axis coordinate in the corner point set Pm, taking the residual corner points after deletion as the corner point set P, and re-executing the step 5.2; otherwise, deleting the corner points corresponding to the ymin in the y-axis coordinate in the corner point set Pm, taking the residual corner points after deletion as the corner point set P, and re-executing the step 5.2;
step 5.10: if the width of the minimum circumscribed rectangle Rm is larger than 1.2 times the width of the element, executing step 5.11; otherwise, the angular point set Pm is used as a final angular point set and the screening step is ended;
step 5.11: establishing coordinates by taking the length of the minimum circumscribed rectangle Rm as a y-axis and the width as an x-axis, and acquiring two corner points with the maximum and minimum x-axis coordinates, wherein the x-coordinate of the corner point with the maximum x-axis coordinate is xmax, and the x-coordinate of the corner point with the minimum x-axis coordinate is xmin;
step 5.12: acquiring the number c3 of corner points of the minimum circumscribed rectangle Rm within the range of x-axis coordinates of xmin to (xmax + xmin)/2, and acquiring the number c4 of corner points of the minimum circumscribed rectangle Rm within the range of x-axis coordinates of (xmax + xmin)/2 to xmax;
step 5.13: if c3 is larger than c4, deleting the corner point corresponding to the x-axis coordinate xmax in the corner point set Pm, taking the residual corner point after deletion as the corner point set P, and re-executing the step 5.2; otherwise, deleting the corner point corresponding to the x-axis coordinate xmin in the corner point set Pm, taking the corner point left after deletion as the corner point set P, and re-executing the step 5.2.
In the step of screening the corner point set provided by this embodiment, in steps 5.3 to 5.5, since the redundant corner points are located at the periphery of the element, deleting the redundant corner points can significantly reduce the area, and the corner point set of the area where the element is located can be quickly obtained by the deleting method, so as to avoid the influence of the redundant corner points on the subsequent calculation of the rotation angle.
However, if there are two corner points with positions very close to the redundant corner points, the redundant corner points cannot be effectively deleted only by adopting the method of steps 5.3 to 5.5, so the embodiment proposes the method of steps 5.6 to 5.13, and takes four edge corner points as one side of a rectangle with the size of the element shape, and compares the number of the corner points in the rectangular area. Because the angular points of the intercepted area image are basically distributed on the element, the angular points on the periphery are mainly formed due to the illumination shadow and the circular suction nozzle head, the circular angular points are few, and the angular points formed by the illumination shadow are removed by the threshold processing of the step 4, so that the area with more angular points contained in the rectangular area is the area where the element is located, and the angular points corresponding to the area with less angular points are deleted. The corner set screening method provided by the embodiment can reasonably remove the adjacent corner points on the periphery of the element.
The image processing effect graphs after the three groups of corner points are screened are shown in fig. 3-8, and it can be seen from the graphs that the minimum circumscribed rectangle corresponding to the corner point set obtained by the screening method of the embodiment reasonably fits the area where the element is located, and the precision range of the calculated rotation angle is within 1 °.
Step 6: and acquiring a region image of a minimum circumscribed rectangle formed by the corner set, and amplifying the region image by adopting a cubic spline interpolation method.
The cubic spline interpolation method can reduce the edge blur, and performs length and width equal proportion amplification during amplification, so as to prevent the situation that the error of the calculated rotation angle is large due to the fact that the length and the width are not amplified in proportion. Meanwhile, due to the influence of parameters of Hough line detection, different degrees of amplification are performed on elements with different sizes, so that the amplified graph is close to the size of the image obtained by the step 2.
And 7: and (6) preprocessing the area image amplified in the step 6.
The preprocessing generally performs denoising and filtering on the image, and the preprocessing steps provided in this embodiment are as follows:
and processing the amplified region image by a histogram equalization method to obtain a first image.
Since the histogram equalization process brings obvious noise, in order to reduce noise, a 5 × 5 window is adopted for performing median filtering on the first image, so as to reduce salt and pepper noise, and obtain a second image.
And further performing Gaussian filtering on the second image by adopting a 7 multiplied by 7 window to smooth the image to obtain the image after the preprocessing.
And 8: and (4) performing canny edge detection on the preprocessed image, performing straight line detection by adopting probability Hough transform, and extracting to obtain a plurality of line segments.
And step 9: at least one pair of mutually parallel line segments and at least one line segment perpendicular to the mutually parallel line segments are screened out from the extracted line segments.
Step 9.1: calculating the angle of each line segment as:
Figure GDA0002749351190000101
wherein (x)1,y1)、(x2,y2) Two different points on the line segment;
step 9.2: sequencing all line segments according to the sequence of the angles from small to large, and selecting the line segments with the angle difference between two adjacent line segments less than 3 degrees;
step 9.3: traversing all the line segments from large to small according to the angle, judging whether the line segments which are vertical to the line segments found in the step 9.2 exist or not, and if so, obtaining the line segments which meet the conditions; otherwise, the segment closest to the perpendicular to the segment found in step 9.2 is selected.
Step 10: judging whether a line segment with the angle consistent with the angle of the minimum circumscribed rectangle obtained by screening in the step 5 exists in two mutually perpendicular line segments, and if so, taking the angle of the minimum circumscribed rectangle as the rotation angle of the element; if the line segment does not exist, the rotation angle is obtained through calculation according to the screened line segment. The present embodiment obtains the angle of the minimum bounding rectangle using the function cvinvoke.
As shown in fig. 9, the step of calculating the rotation angle according to the line segment screened in step 9 includes:
step 10.1: counting the numbers c1 and c2 of line segments corresponding to two angles r1 and r2 which are perpendicular to each other respectively;
step 10.2: if c1 is greater than or equal to 2 and c2 is greater than or equal to 2, executing step 10.3; otherwise, executing step 10.4;
step 10.3: calculating the maximum distances d1 and d2 between all parallel line segments corresponding to the two angles r1 and r2 respectively; and if d1< d2, the rotation angle of the element is r 1; otherwise the rotation angle of the element is r 2;
step 10.4: if c1 is greater than or equal to 2 and c2 is equal to 1, then step 10.5 is executed; otherwise, executing step 10.6;
step 10.5: calculating the maximum distance d1 between all parallel line segments corresponding to the angle r1, and calculating the maximum distance l1 from two ends of a line segment with the angle r2 to a line segment with the angle r 1; and if d1< l1, the rotation angle of the element is r 2; otherwise the rotation angle of the element is r 1;
step 10.6: if c2 is greater than or equal to 2 and c1 is equal to 1, then step 10.7 is executed; otherwise, ending the rotation angle calculation step;
step 10.7: calculating the maximum distance d2 between all parallel line segments corresponding to the angle r2, and calculating the maximum distance l2 from two ends of a line segment with the angle r1 to a line segment with the angle r 2; and if d2< l2, the rotation angle of the element is r 1; otherwise the rotation angle of the element is r 2.
If the line segment obtained in step 9 has a plurality of parallel lines and a plurality of vertical lines (at least two), respectively calculating the maximum distance between the two types of parallel lines, comparing the two maximum distances, wherein the line segment with the larger distance is wider, and the line segment with the shorter distance is longer, and further obtaining the rotation angle, namely the angle corresponding to the line segment with the longer distance.
If at least two parallel lines exist and only one line segment is vertical to the parallel lines, the maximum distance between the parallel lines and the maximum distance between two end points of any parallel line segment and the line segment vertical to the parallel lines are calculated, and compared with the two maximum distances, the line segment with the larger distance is wider, and the line segment with the shorter distance is longer, so that the rotation angle is obtained.
Considering the problem that the edges cannot be completely detected by Hough line detection, the line segment corresponding to the length and the width of the rectangle is judged by calculating the maximum distance from the end point of the line segment to the line. The method can calculate the rotation angle more effectively, reduce the influence caused by incomplete linear detection due to illumination and improve the accuracy of correcting the element position.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (7)

1. An automatic correction method for chip mounter suction nozzle component angles based on angular point detection is characterized in that the automatic correction method for chip mounter suction nozzle component angles based on angular point detection comprises the following steps:
step 1: acquiring a gray scale image of the element;
step 2: intercepting the gray level image according to a preset intercepting area;
and step 3: performing corner extraction on the intercepted image by adopting Shi Tomasi algorithm;
and 4, step 4: removing corner points with pixel values larger than a threshold value from the extracted corner points;
and 5: based on the angular points left after the removal in the step 4, screening an angular point set of which the area of the minimum external rectangle is smaller than a threshold value;
step 6: acquiring a region image of a minimum circumscribed rectangle formed by the corner set, and amplifying the region image by adopting a cubic spline interpolation method;
and 7: preprocessing the area image amplified in the step 6;
and 8: canny edge detection is carried out on the preprocessed image, linear detection is carried out by adopting probability Hough transformation, and a plurality of line segments are extracted;
and step 9: screening at least one pair of mutually parallel line segments and at least one line segment vertical to the mutually parallel line segments from the extracted line segments;
step 10: judging whether a line segment with the angle consistent with the angle of the minimum circumscribed rectangle obtained by screening in the step 5 exists in two mutually perpendicular line segments, and if so, taking the angle of the minimum circumscribed rectangle as the rotation angle of the element; if the line segment does not exist, the rotation angle is obtained through calculation according to the screened line segment.
2. The method for automatically correcting the angle of the suction nozzle component of the chip mounter based on the angular point detection as claimed in claim 1, wherein the intercepting the grayscale image according to a preset intercepting region comprises:
if the element is a rectangle with a length d and a width w;
the preset intercepting area is a rectangle, the length of the rectangle is alpha multiplied by d, the width of the rectangle is alpha multiplied by w, and alpha is a preset multiple;
when the gray image is subjected to region clipping, the center of the gray image is taken as the center of the clipping region, the long side of the gray image is taken as the length of the clipping region, and the short side of the gray image is taken as the width of the clipping region for clipping.
3. The method for automatically correcting the angles of the components of the suction nozzle of the chip mounter based on the angular point detection as claimed in claim 1, wherein the step of performing angular point extraction on the image obtained by intercepting by using a Shi Tomasi algorithm comprises the steps of:
step 3.1: assuming that the gray value of the pixel point (x, y) in the image is I (x, y), the pixel change E (x, y) of the pixel point (x, y) moving (u, v) in each direction of the local small window W (x, y) is:
Figure FDA0002749351180000021
wherein ω isu,vIs a weighting function;
step 3.2: performing Taylor expansion on I (x + u, y + v) to obtain:
I(x+u,y+v)=I(x,y)+uIx+vIy+O(u2,v2)
wherein Ix,IyIs a first order gray scale gradient;
expanding Taylor to obtain a relation, ignoring the second and above terms, and obtaining the relation in E (x, y):
Figure FDA0002749351180000022
step 3.3: the matrix M is set as follows, and λ1,λ2Two eigenvalues of the matrix M:
Figure FDA0002749351180000023
if λ1,λ2Satisfy lambda1≥λ2And lambda2≥kλ2maxIf yes, the pixel point (x, y) is a strong angular point; otherwise, the pixel point (x, y) is not a strong angular point; wherein λ2maxIs the maximum value in the smaller characteristic values of all the pixel points, and k is an intermediate parameter.
4. The method for automatically correcting the angles of the components of the suction nozzle of the chip mounter based on the angular point detection as claimed in claim 1, wherein the step of screening the set of angular points with the area of the smallest circumscribed rectangle smaller than the threshold value based on the angular points remaining after the removal in step 4 comprises:
step 5.1: generating a corner set P based on the corner points left after the removal in the step 4, wherein the size of the corner set P is n;
step 5.2: if the area of the minimum circumscribed rectangle of the corner point set P is greater than 1.2 times the actual area of the current element, setting the cycle number i to be 0, and executing step 5.3; otherwise, taking the corner set P as a final corner set and finishing the screening step;
step 5.3: copying the corner point set P to obtain a corner point set Pt, deleting the ith corner point in the corner point set Pt, and obtaining a minimum circumscribed rectangle by using the remaining corner points in the corner point set Pt;
step 5.4: if i < n, i ═ i +1, and step 5.3 is re-executed; otherwise, selecting a minimum circumscribed rectangle Rm with the smallest area from the obtained n minimum circumscribed rectangles, wherein the minimum circumscribed rectangle Rm corresponds to the corner point set Pm;
step 5.5: judging the relation between the area of the minimum circumscribed rectangle Rm and the actual area of the element, if the area of the minimum circumscribed rectangle Rm is smaller than 0.9 times of the actual area of the element, taking the corner point set Pm as a corner point set P, and executing the step 5.2 again; otherwise, executing step 5.6;
step 5.6: taking the longer side of the minimum circumscribed rectangle Rm as the length and the shorter side as the width, and if the length of the minimum circumscribed rectangle Rm is larger than 1.2 times the length of the element, executing a step 5.7; otherwise, executing step 5.10;
step 5.7: establishing coordinates by taking the length of the minimum circumscribed rectangle Rm as a y axis and the width as an x axis, and acquiring two corner points with the maximum and minimum y axis coordinates, wherein the y coordinate of the corner point with the maximum y axis coordinate is ymax, and the y coordinate of the corner point with the minimum y axis coordinate is ymin;
step 5.8: acquiring the number c1 of corner points of the minimum circumscribed rectangle Rm within the range of y-axis coordinates of ymin to (ymax + ymin)/2, and acquiring the number c2 of corner points of the minimum circumscribed rectangle Rm within the range of y-axis coordinates of (ymax + ymin)/2 to ymax;
step 5.9: if c1 is larger than c2, deleting the corner points corresponding to the ymax in the y-axis coordinate in the corner point set Pm, taking the residual corner points after deletion as the corner point set P, and re-executing the step 5.2; otherwise, deleting the corner points corresponding to the ymin in the y-axis coordinate in the corner point set Pm, taking the residual corner points after deletion as the corner point set P, and re-executing the step 5.2;
step 5.10: if the width of the minimum circumscribed rectangle Rm is larger than 1.2 times the width of the element, executing step 5.11; otherwise, the angular point set Pm is used as a final angular point set and the screening step is ended;
step 5.11: establishing coordinates by taking the length of the minimum circumscribed rectangle Rm as a y-axis and the width as an x-axis, and acquiring two corner points with the maximum and minimum x-axis coordinates, wherein the x-coordinate of the corner point with the maximum x-axis coordinate is xmax, and the x-coordinate of the corner point with the minimum x-axis coordinate is xmin;
step 5.12: acquiring the number c3 of corner points of the minimum circumscribed rectangle Rm within the range of x-axis coordinates of xmin to (xmax + xmin)/2, and acquiring the number c4 of corner points of the minimum circumscribed rectangle Rm within the range of x-axis coordinates of (xmax + xmin)/2 to xmax;
step 5.13: if c3 is larger than c4, deleting the corner point corresponding to the x-axis coordinate xmax in the corner point set Pm, taking the residual corner point after deletion as the corner point set P, and re-executing the step 5.2; otherwise, deleting the corner point corresponding to the x-axis coordinate xmin in the corner point set Pm, taking the corner point left after deletion as the corner point set P, and re-executing the step 5.2.
5. The method for automatically correcting the angles of the components of the suction nozzle of the chip mounter based on the angular point detection as claimed in claim 1, wherein the preprocessing the enlarged area image comprises:
processing the amplified region image by a histogram equalization method to obtain a first image;
performing median filtering on the first image by adopting a 5 multiplied by 5 window to obtain a second image;
and performing Gaussian filtering on the second image by adopting a 7 multiplied by 7 window to obtain a preprocessed image.
6. The method for automatically correcting the angle of a suction nozzle component of a chip mounter based on angular point detection as set forth in claim 1, wherein the step of screening out at least one pair of mutually parallel line segments and at least one line segment perpendicular to the mutually parallel line segments from the extracted line segments comprises the steps of:
step 9.1: calculating the angle of each line segment as:
Figure FDA0002749351180000041
wherein (x)1,y1)、(x2,y2) Two different points on the line segment;
step 9.2: sequencing all line segments according to the sequence of the angles from small to large, and selecting the line segments with the angle difference between two adjacent line segments less than 3 degrees;
step 9.3: traversing all the line segments from large to small according to the angle, judging whether the line segments which are vertical to the line segments found in the step 9.2 exist or not, and if so, obtaining the line segments which meet the conditions; otherwise, the segment closest to the perpendicular to the segment found in step 9.2 is selected.
7. The method for automatically correcting the angle of a component of a suction nozzle of a chip mounter based on angular point detection as claimed in claim 6, wherein said determining the length and width of the component according to the longest distance between two sets of parallel lines to obtain the rotation angle comprises:
step 10.1: counting the numbers c1 and c2 of line segments corresponding to two angles r1 and r2 which are perpendicular to each other respectively;
step 10.2: if c1 is greater than or equal to 2 and c2 is greater than or equal to 2, executing step 10.3; otherwise, executing step 10.4;
step 10.3: calculating the maximum distances d1 and d2 between all parallel line segments corresponding to the two angles r1 and r2 respectively; and if d1< d2, the rotation angle of the element is r 1; otherwise the rotation angle of the element is r 2;
step 10.4: if c1 is greater than or equal to 2 and c2 is equal to 1, then step 10.5 is executed; otherwise, executing step 10.6;
step 10.5: calculating the maximum distance d1 between all parallel line segments corresponding to the angle r1, and calculating the maximum distance l1 from two ends of a line segment with the angle r2 to a line segment with the angle r 1; and if d1< l1, the rotation angle of the element is r 2; otherwise the rotation angle of the element is r 1;
step 10.6: if c2 is greater than or equal to 2 and c1 is equal to 1, then step 10.7 is executed; otherwise, ending the rotation angle calculation step;
step 10.7: calculating the maximum distance d2 between all parallel line segments corresponding to the angle r2, and calculating the maximum distance l2 from two ends of a line segment with the angle r1 to a line segment with the angle r 2; and if d2< l2, the rotation angle of the element is r 1; otherwise the rotation angle of the element is r 2.
CN201911109072.9A 2019-11-13 2019-11-13 Automatic correction method for angle of suction nozzle element of chip mounter based on angular point detection Active CN110933926B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911109072.9A CN110933926B (en) 2019-11-13 2019-11-13 Automatic correction method for angle of suction nozzle element of chip mounter based on angular point detection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911109072.9A CN110933926B (en) 2019-11-13 2019-11-13 Automatic correction method for angle of suction nozzle element of chip mounter based on angular point detection

Publications (2)

Publication Number Publication Date
CN110933926A CN110933926A (en) 2020-03-27
CN110933926B true CN110933926B (en) 2021-04-06

Family

ID=69852936

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911109072.9A Active CN110933926B (en) 2019-11-13 2019-11-13 Automatic correction method for angle of suction nozzle element of chip mounter based on angular point detection

Country Status (1)

Country Link
CN (1) CN110933926B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110992326B (en) * 2019-11-27 2022-08-09 江苏理工学院 QFN chip pin image rapid inclination correction method
CN111462153B (en) * 2020-04-30 2023-05-19 柳州智视科技有限公司 Corner feature extraction method based on image contour Freeman chain code
CN113221926B (en) * 2021-06-23 2022-08-02 华南师范大学 Line segment extraction method based on angular point optimization
CN113568979B (en) * 2021-08-07 2022-08-23 九江嘉远科技有限公司 Suction nozzle detection counting method, system, equipment and storage medium
CN116993725B (en) * 2023-09-26 2023-11-28 深圳市普能达电子有限公司 Intelligent patch information processing system of flexible circuit board
CN117183380B (en) * 2023-11-08 2024-02-27 南通林德安全设备科技有限公司 Control system of automatic edge banding device for mask edge

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101840736B (en) * 2010-05-07 2012-11-21 中国科学院自动化研究所 Device and method for mounting optical glass under vision guide
CN105307472B (en) * 2015-12-03 2018-10-09 苏州鑫铭电子科技有限公司 The method for correcting position of self-correcting chip mounter suction nozzle structure and more suction nozzle chip mounters
US10915998B2 (en) * 2016-12-21 2021-02-09 Huawei Technologies Co., Ltd. Image processing method and device
CN106980851B (en) * 2017-03-21 2020-02-14 浙江华睿科技有限公司 Method and device for positioning data matrix DM code

Also Published As

Publication number Publication date
CN110933926A (en) 2020-03-27

Similar Documents

Publication Publication Date Title
CN110933926B (en) Automatic correction method for angle of suction nozzle element of chip mounter based on angular point detection
CN110992326B (en) QFN chip pin image rapid inclination correction method
CN108921176B (en) Pointer instrument positioning and identifying method based on machine vision
CN109242853B (en) PCB defect intelligent detection method based on image processing
CN106981077B (en) Infrared image and visible light image registration method based on DCE and LSS
CN103914827B (en) The visible detection method of weather strip for automobile profile defects
CN112164050B (en) Method and device for detecting surface defects of products on production line and storage medium
CN115096206B (en) High-precision part size measurement method based on machine vision
WO2017088637A1 (en) Method and apparatus for locating image edge in natural background
CN113077437B (en) Workpiece quality detection method and system
CN111932490B (en) Visual system grabbing information extraction method for industrial robot
CN115018846B (en) AI intelligent camera-based multi-target crack defect detection method and device
CN110688871A (en) Edge detection method based on bar code identification
CN117291924B (en) Main machine power supply appearance quality detection method based on machine vision
CN114972575A (en) Linear fitting algorithm based on contour edge
CN115439523A (en) Method and equipment for detecting pin size of semiconductor device and storage medium
TWI383690B (en) Method for image processing
CN113763279A (en) Accurate correction processing method for image with rectangular frame
WO2024016686A1 (en) Corner detection method and apparatus
JP7435840B2 (en) Image processing method, device and storage medium
CN115511966B (en) Element identification positioning method and system based on corner detection and storage medium
CN111178111A (en) Two-dimensional code detection method, electronic device, storage medium and system
CN112923852B (en) SD card position detection method based on dynamic angular point positioning
CN110956200A (en) Tire pattern similarity detection method
CN114140426B (en) Inclination correction algorithm for printing carbon line image of humidity sensor ceramic substrate

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