CN114998334A - Workpiece through hole position calibration method and detection device - Google Patents

Workpiece through hole position calibration method and detection device Download PDF

Info

Publication number
CN114998334A
CN114998334A CN202210919808.4A CN202210919808A CN114998334A CN 114998334 A CN114998334 A CN 114998334A CN 202210919808 A CN202210919808 A CN 202210919808A CN 114998334 A CN114998334 A CN 114998334A
Authority
CN
China
Prior art keywords
workpiece
point
image
dot matrix
points
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210919808.4A
Other languages
Chinese (zh)
Other versions
CN114998334B (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.)
Suzhou HYC Technology Co Ltd
Original Assignee
Suzhou HYC 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 Suzhou HYC Technology Co Ltd filed Critical Suzhou HYC Technology Co Ltd
Priority to CN202210919808.4A priority Critical patent/CN114998334B/en
Publication of CN114998334A publication Critical patent/CN114998334A/en
Priority to PCT/CN2022/135933 priority patent/WO2024027058A1/en
Application granted granted Critical
Publication of CN114998334B publication Critical patent/CN114998334B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/80Geometric correction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30141Printed circuit board [PCB]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30244Camera pose
    • 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

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The invention provides a workpiece through hole position calibration method and a detection device, wherein the calibration method comprises the following steps: controlling the carrying platform to move, shooting a workpiece arranged on the carrying platform through a camera to obtain a workpiece image, wherein the workpiece image comprises a through hole array on the surface of the workpiece, converting the through hole array into a point array, and calculating to obtain coordinate information of each point to obtain a workpiece dot matrix image; fitting a horizontal row point set in the workpiece dot matrix image to obtain a horizontal straight line, fitting a vertical column point set in the workpiece dot matrix image to obtain a vertical straight line, and obtaining the intersection point of the horizontal straight line and the vertical straight line; acquiring a preset standard dot matrix image, and calculating the coordinate offset of the intersection point and the corresponding position point in the standard dot matrix image; and correcting the coordinates of each point of the workpiece dot matrix image dot matrix based on the coordinate offset, comparing the coordinates with the coordinates of the points of the standard dot matrix image, checking bad points, eliminating process errors possibly existing in a single point, and improving the accuracy and precision of point position error judgment.

Description

Workpiece through hole position calibration method and detection device
Technical Field
The invention relates to the technical field of visual detection, in particular to a workpiece through hole position calibration method and a detection device.
Background
With the development of the electronic information industry, the requirement for refinement of the PCB industry is higher and higher. At present, the precision of the PCB board has been developed to a level of 0.1mm minimum aperture, 0.5mm minimum aperture pitch, or even higher. Drilling is an important link in PCB manufacturing, the existing through hole method is complex and low in accuracy, and errors caused by single points are difficult to eliminate, so that how to accurately detect the PCB drilling position becomes an important link for ensuring the product quality.
Disclosure of Invention
The invention aims to provide a workpiece through hole position calibration method and a detection device.
The invention provides a workpiece through hole position calibration method, which comprises the following steps:
controlling the movement of a carrying platform, shooting a workpiece arranged on the carrying platform by a line scanning camera to obtain a workpiece image, wherein the workpiece image comprises a through hole array on the surface of the workpiece, processing the workpiece image to convert the through hole array into a point array, and calculating to obtain coordinate information of each point to obtain a workpiece dot matrix image;
fitting a horizontal row point set in the workpiece dot matrix image to obtain a horizontal straight line, fitting a vertical column point set in the workpiece dot matrix image to obtain a vertical straight line, and acquiring the intersection point of the horizontal straight line and the vertical straight line;
acquiring a preset standard dot matrix image, wherein the standard dot matrix image comprises preset coordinate position information of corresponding points of all through holes, and calculating and acquiring coordinate offset of the intersection points and the corresponding position points in the standard dot matrix image;
and correcting the coordinates of each point of the workpiece dot matrix image dot matrix based on the coordinate offset, comparing the coordinates with the standard dot matrix image points, and checking defective points.
As a further improvement of the present invention, the fitting a horizontal row point set in the workpiece dot matrix image to obtain a horizontal straight line, and fitting a vertical column point set in the workpiece dot matrix image to obtain a vertical straight line, and obtaining an intersection point of the horizontal straight line and the vertical straight line specifically includes:
selecting the upper left corner area in the workpiece dot matrix image as a detection area;
fitting a transverse row point set positioned in the first row above the detection area to obtain a transverse straight line, and fitting a longitudinal row point set positioned in the first column on the left side in the detection area to obtain a longitudinal straight line;
and acquiring the intersection point of the transverse straight line and the longitudinal straight line.
As a further improvement of the present invention, the fitting a horizontal row point set located in a first row above in the detection area to obtain the horizontal straight line, and fitting a vertical column point set located in a first column on the left side in the detection area to obtain the vertical straight line specifically include:
generating a transverse mask image covering a first transverse row point set in the workpiece dot matrix image detection area, and generating a longitudinal mask image covering a first left longitudinal row point set in the workpiece dot matrix image detection area;
masking points in the workpiece dot matrix image detection area through the transverse mask image and the longitudinal mask image respectively, and selecting a point set in the transverse mask image and a point set in the longitudinal mask image respectively to obtain a transverse dot diagram and a longitudinal dot diagram;
and respectively fitting point sets in the transverse point diagram and the longitudinal point diagram to obtain the transverse straight line and the longitudinal straight line.
As a further improvement of the present invention, the generating a horizontal mask image covering a horizontal row point set of a first row in the workpiece dot matrix image detection area, and generating a vertical mask image covering a vertical column point set of a first column on the left side in the workpiece dot matrix image detection area specifically include:
expanding points in the workpiece dot matrix image detection area by a first pixel point in the transverse direction and a second pixel point in the longitudinal direction to obtain a transverse expansion image, wherein the transverse expansion image comprises a plurality of rectangles with long edges extending transversely, the first pixel point is larger than half of the pixel distance between two adjacent points in the transverse direction, and the second pixel point is smaller than half of the pixel distance between two adjacent points in the longitudinal direction;
longitudinally expanding the points in the detection area by a third pixel point number and transversely expanding the points by a fourth pixel point number to obtain a longitudinally expanded image, wherein the longitudinally expanded image comprises a plurality of rectangles with long edges extending longitudinally, the third pixel point number is larger than half of the pixel distance between two longitudinally adjacent points, and the fourth pixel point number is smaller than half of the pixel distance between two transversely adjacent points;
selecting a transverse rectangle positioned at the uppermost end in the transverse expansion image to obtain a transverse mask image;
and selecting a longitudinal rectangle positioned at the leftmost end from the longitudinal expansion image to obtain a longitudinal mask image.
As a further improvement of the present invention, the fitting a horizontal row point set located in the first row above the detection area to obtain the horizontal straight line, and fitting a vertical column point set located in the first column on the left side in the detection area to obtain the vertical straight line further includes:
fitting the point set in the transverse point diagram by a least square method to obtain the transverse straight line;
and fitting the point set in the longitudinal point diagram by a least square method to obtain the longitudinal straight line.
As a further improvement of the present invention, the calculating and obtaining the coordinate offset of the intersection point and the corresponding position point in the standard dot matrix image specifically includes:
selecting the upper left corner point of the standard dot matrix image as a standard point,
in the coordinate system, a coordinate offset amount between the standard point coordinates and the intersection point coordinates is calculated.
As a further improvement of the invention, the method also comprises the following steps:
detecting and acquiring a deflection angle between a camera and a carrier;
and performing graying processing and thresholding processing on the workpiece image detection area to convert the through hole array into a point array, calculating to obtain coordinate information of each point, and calibrating the point coordinates of the workpiece dot matrix image based on the deflection angle to obtain the workpiece dot matrix image.
As a further improvement of the present invention, the calculating to obtain coordinate information of each point specifically includes:
using the starting position of the stage movement as the origin of coordinates: (x 0 ,y 0 ) Establishing a coordinate system by taking the movement direction of the platform deck as an X-axis direction and taking the direction which is vertical to the movement direction of the platform deck on the plane of the platform deck as a Y-axis direction, calculating coordinate information of each point in the lattice image of the workpiece in the coordinate system, and expressing the coordinate of any point in the lattice image of the workpiece as (A), (B) and (C)x 1 ,y 1 )。
As a further improvement of the present invention, the calibrating the point coordinates of the workpiece dot matrix image based on the deflection angle to obtain the workpiece dot matrix image specifically includes:
calculating to obtain coordinate information of each point, calibrating the point coordinates of the workpiece dot matrix image based on the deflection angle to obtain a workpiece dot matrix image, wherein for any point (a)x 1 ,y 1 ) Calculating a point after calibration by a calibration equation (x 2 ,y 2 ) The calibration formula is:
Figure 97470DEST_PATH_IMAGE001
wherein ,θ b is a point (x 0 ,y 0 ) And points (a)x 1 ,y 1 ) The angle between the connecting line and the X axis.
As a further improvement of the present invention, the detecting and acquiring a deflection angle between the camera and the stage specifically includes:
controlling a camera and a carrying platform to relatively move in a translation mode along the X axis direction, and respectively obtaining images at two opposite ends of a calibration plate arranged on the carrying platform to obtain a first calibration image and a second calibration image, wherein the first calibration image and the second calibration image respectively comprise a plurality of mark symbols positioned at two ends of the calibration plate;
detecting and calculating deflection angles of the first calibration image and the second calibration image relative to the X-axis direction based on the first calibration image and the second calibration image inner mark symbols respectively to obtain a first deflection angle and a second deflection angle;
and calculating a deflection angle between the camera and the carrier by calculating a difference between the first deflection angle and the second deflection angle to obtain the deflection angle between the camera and the carrier.
The present invention also provides a detection apparatus comprising:
the system comprises a carrying platform, a camera, a motion control module, an image processing module and a bad point checking module;
the motion control module is configured to control the camera and the stage to move in relative translation;
the camera is configured to shoot a workpiece arranged on the carrying platform to obtain a workpiece image, the workpiece image comprises a through hole array on the surface of the workpiece, the workpiece image is processed to convert the through hole array into a point array, and coordinate information of each point is obtained through calculation to obtain a workpiece dot matrix image;
the image processing module is configured to fit a horizontal row point set in the workpiece dot matrix image to obtain a horizontal straight line, fit a vertical column point set in the workpiece dot matrix image to obtain a vertical straight line, and obtain an intersection point of the horizontal straight line and the vertical straight line; acquiring a preset standard dot matrix image, wherein the standard dot matrix image comprises preset coordinate position information of corresponding points of each through hole, calculating and acquiring coordinate offset of the intersection point and the corresponding position point in the standard dot matrix image, and correcting coordinates of each point of the workpiece dot matrix image dot matrix based on the coordinate offset;
and the defective point detection module is configured to compare the workpiece dot matrix image with the standard dot matrix image points and detect the defective points.
The beneficial effects of the invention are: according to the method, a horizontal straight line and a longitudinal straight line are obtained by fitting a horizontal row point set and a longitudinal column point set in the workpiece dot matrix image, and the intersection point of the horizontal straight line and the longitudinal straight line is used as a judgment point for comparison with a subsequent standard dot matrix image, so that process errors possibly existing in a single point are eliminated, and the accuracy and precision of point position error judgment are improved. In addition, in some embodiments of the present invention, a deflection angle between the camera lens and the stage is calculated first, and the workpiece dot matrix image is corrected based on the deflection angle, so that the accuracy of the determination can be further improved.
Drawings
Fig. 1 is a schematic view of a detection apparatus according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating a method for calibrating a position of a workpiece via according to an embodiment of the invention.
Fig. 3 is a workpiece image captured in one embodiment of the present invention.
Fig. 4 is an enlarged image of the upper left corner region of fig. 3.
FIG. 5 is a workpiece dot matrix image in accordance with an embodiment of the present invention.
Fig. 6 is a flowchart illustrating a specific step Sa of the workpiece through hole position calibration method according to an embodiment of the present invention.
Fig. 7 is a flowchart illustrating a specific step Sa1 of the workpiece through hole position calibration method according to an embodiment of the present invention.
Fig. 8 is a flowchart illustrating a step S2 of the method for calibrating the position of the workpiece through hole according to an embodiment of the present invention.
Fig. 9 is a flowchart illustrating a step S22 of the method for calibrating the position of the through hole of the workpiece according to an embodiment of the present invention.
Fig. 10 is a flowchart illustrating a step S221 of a workpiece through hole position calibration method according to an embodiment of the invention.
FIG. 11 is a laterally expanded image in accordance with an embodiment of the present invention.
FIG. 12 is a longitudinal expansion image in one embodiment of the present invention.
FIG. 13 is a lateral mask image in accordance with one embodiment of the present invention.
FIG. 14 is a vertical mask image in accordance with one embodiment of the present invention.
Fig. 15 is a lateral spot diagram in an embodiment of the present invention.
Fig. 16 is a longitudinal point diagram in an embodiment of the present invention.
FIG. 17 shows a horizontal line and a vertical line fitted together in accordance with an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail and completely with reference to the following detailed description of the invention and the accompanying drawings. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
For convenience in explanation, the description herein uses terms indicating relative spatial positions, such as "upper," "lower," "rear," "front," and the like, to describe one element or feature's relationship to another element or feature as illustrated in the figures. The term spatially relative position may encompass different orientations of the device in use or operation in addition to the orientation depicted in the figures. For example, if the device in the figures is turned over, elements described as "below" or "above" other elements or features would then be oriented "below" or "above" the other elements or features. Thus, the exemplary term "below" can encompass both a spatial orientation of below and above.
The embodiment provides a method for calibrating the position of a through hole of a workpiece, wherein the workpiece is a workpiece such as a circuit board and the like with a through hole with a micron-sized size, and the method compares the position coordinate of the through hole with a standard position coordinate to finish detection and calibration. For the sake of understanding, in the present embodiment, the method is described with reference to a specific detecting apparatus 1 and a circuit board as a workpiece to be detected. As shown in fig. 1, the detection apparatus 1 includes a camera 11 and a stage 12, the camera 11 includes an area-array camera 111 and a line-scan camera 112, the two cameras share a camera lens 113 with a field of view of 1.68mm × 1.41mm, the stage 12 has a size larger than 400mm × 400mm, and the stage 12 can move along an axis direction of a plane X, Y to photograph a workpiece placed thereon under the camera lens 113. The outline of the detected circuit board is a rectangle with the length of 800mm and the width of 600mm, the effective detection area of the surface of the circuit board is a rectangle with the length of 680mm and the width of 420mm, 24 rectangular punching areas are arranged in the effective detection area, 16129 through holes are arranged in each punching area, and the total number of the through holes is 387096.
As shown in fig. 2, the workpiece through-hole position calibration method includes the steps of:
s1: the movement of the carrier 12 is controlled, a workpiece placed on the carrier 12 is shot by the line scanning camera 112 to obtain a workpiece image, the workpiece image comprises a through hole array on the surface of the workpiece, the workpiece image is processed to convert the through hole array into a point array, and coordinate information of each point is obtained through calculation to obtain a workpiece dot matrix image.
S2: fitting a horizontal row point set in the workpiece dot matrix image to obtain a horizontal straight line, fitting a vertical column point set in the workpiece dot matrix image to obtain a vertical straight line, and obtaining the intersection point of the horizontal straight line and the vertical straight line.
S3: and acquiring a preset standard dot matrix image, wherein the standard dot matrix image comprises preset coordinate position information of corresponding points of each through hole, and acquiring coordinate offset of the intersection points and the corresponding position points in the standard dot matrix image.
S4: and correcting the coordinates of each point of the workpiece dot matrix image dot matrix based on the coordinate offset, comparing the coordinates with the standard dot matrix image points, and checking defective points.
In step S1, processing the workpiece image to convert the via array to a dot array includes:
and carrying out graying processing and thresholding processing on the workpiece image detection area to convert the through hole array into a point array.
In the present embodiment, as shown in fig. 3, for the workpiece image captured by the line-scan camera 112, as shown in fig. 4, the upper left corner region of the workpiece image is selected as the detection region, and is enlarged, and as shown in fig. 5, the workpiece image detection region is subjected to the graying processing and the thresholding processing, and the workpiece dot matrix image is obtained. The calibration image is preprocessed to facilitate subsequent dot matrix image identification and detection, and the related specific preprocessing algorithm can refer to the existing algorithm and is not described herein again.
In step S1, the step of obtaining coordinate information of each point in the workpiece dot matrix image by calculation specifically includes:
using the initial position of the stage 12 as the origin of coordinates: (x 0 ,y 0 ) Establishing a coordinate system by taking the moving direction of the stage 12 as an X-axis direction and taking the direction perpendicular to the moving direction of the stage 12 on the plane of the stage 12 as a Y-axis direction, calculating coordinate information of each point in the workpiece dot matrix image in the coordinate system, and expressing the coordinate of any point in the workpiece dot matrix image as (A), (B) and (C)x 1 ,y 1 )。
The coordinate positioning of each point in the workpiece dot matrix image, that is, the coordinate positioning of each through hole in the workpiece image, can be completed through step S1.
Further, as shown in fig. 6, in some embodiments of the present invention, further includes a step Sa, which specifically includes:
sa 1: detecting and acquiring deflection angle between camera 11 and stage 12θ a
Sa 2: and performing graying processing and thresholding processing on the workpiece image detection area to convert the through hole array into a point array, calculating to obtain coordinate information of each point, and calibrating the point coordinates of the workpiece dot matrix image based on the deflection angle to obtain the workpiece dot matrix image.
Since absolute parallelism between the camera lens 113 and the stage 12 is difficult to achieve and there is always a certain angular difference, coordinates of each point of the workpiece image are calibrated based on the angle between the camera lens 113 and the stage 12 in step Sa.
As shown in fig. 7, in the present embodiment, the step Sa1 specifically includes the following steps of detecting the acquired yaw angle by using a calibration board:
sa 11: controlling the camera 11 and the stage 12 to perform relative translational motion along the X axis, and respectively obtaining images at two opposite ends of a calibration plate disposed on the stage 12 to obtain a first calibration image and a second calibration image, where the first calibration image and the second calibration image respectively include a plurality of mark symbols located at two ends of the calibration plate.
Sa 12: detecting and calculating the deflection angles of the first calibration image and the second calibration image relative to the X-axis direction based on the key points of the mark symbols in the first calibration image and the second calibration image respectively to obtain a first deflection angleθ 1 And a second deflection angleθ 2
Sa 13: for the first deflection angleθ 1 And a second deflection angleθ 2 Calculating the deflection angle between the camera 11 and the stage 12 by subtracting to obtain the deflection angleθ a
Step Sa2 specifically includes:
calculating to obtain coordinate information of each point, calibrating the point coordinates of the workpiece dot matrix image based on the deflection angle to obtain the workpiece dot matrix image, wherein, for any point: (x 1 ,y 1 ) Calculating a point after calibration by a calibration equation (x 2 ,y 2 ) The calibration formula is:
Figure 889976DEST_PATH_IMAGE001
wherein ,θ b is a point (x 0 ,y 0 ) And points (a)x 1 ,y 1 ) The angle between the connecting line and the X axis.
Based on the deflection angle between the camera 11 and the stage 12θ a The coordinates of each point are calibrated to eliminate the influence of a deflection angle between the camera 11 and the stage 12 caused by installation deviation, so that the accuracy of subsequent detection is improved.
In other embodiments of the present invention, a person skilled in the art can also obtain the deflection angle between the camera lens 113 and the stage 12 by other conventional techniques, and this is only exemplified by a simpler and highly accurate method.
As shown in fig. 8, in step S2, it specifically includes:
s21: and selecting the upper left corner area in the workpiece dot matrix image as a detection area.
S22: and fitting a first horizontal row point set positioned above the detection area to obtain a horizontal straight line, and fitting a first vertical column point set positioned on the left side of the detection area to obtain a vertical straight line.
S23: and acquiring the intersection point of the transverse straight line and the longitudinal straight line.
In step S21, with continued reference to fig. 5, the upper left corner region in the workpiece dot matrix image is selected as the detection region, and in the present embodiment, a point located at the upper left corner is used as the determination point for determining the offset amount, so the upper left corner region in the workpiece dot matrix image is selected as the detection region. In another embodiment, another point may be selected as the determination point for determining the shift amount, and in this case, the position of the detection region in the workpiece dot-matrix image may be adjusted accordingly.
As shown in fig. 9, in step S22, it specifically includes:
s221: and generating a transverse mask image covering a first transverse row point set in the workpiece dot matrix image detection area, and generating a longitudinal mask image covering a first left longitudinal column point set in the workpiece dot matrix image detection area.
S222: and respectively carrying out mask processing on points in the detection area of the workpiece dot matrix image through the transverse mask image and the longitudinal mask image, and respectively selecting a point set in the transverse mask image and a point set in the longitudinal mask image to obtain a transverse dot diagram and a longitudinal dot diagram.
S223: and fitting the point sets in the transverse point diagram by a least square method to obtain a transverse straight line, and fitting the point sets in the longitudinal point diagram by a least square method to obtain a longitudinal straight line.
Further, as shown in fig. 10, in step S221, it specifically includes:
s2211: and expanding the points in the workpiece dot matrix image detection area by the first pixel points in the transverse direction and the second pixel points in the longitudinal direction to obtain a transverse expansion image, wherein the transverse expansion image comprises a plurality of rectangles with long edges extending transversely, the first pixel points are larger than half of the pixel distance between two transverse adjacent points, and the second pixel points are smaller than half of the pixel distance between two longitudinal adjacent points.
Here, the minimum number of pixel points of the lateral expansion is limited to ensure that a communication region is formed between the pixel lateral directions. The pixel points are longitudinally expanded, the width of the generated mask can be improved, so that the mask can cover all the points in the first transverse row point set, the number of the longitudinally expanded maximum pixel points is limited, communication between the points in different rows is avoided, and accordingly follow-up inaccurate identification of the rectangular region is caused.
In the present embodiment, as shown in fig. 11, the dots are expanded by 15 pixels in the horizontal direction and 2 pixels in the vertical direction, respectively, to obtain a horizontally expanded image.
S2212: and longitudinally expanding the points in the detection area by a third pixel point number and transversely expanding a fourth pixel point number to obtain a longitudinally expanded image, wherein the longitudinally expanded image comprises a plurality of rectangles with long edges extending longitudinally, the third pixel point number is larger than half of the pixel distance between two longitudinally adjacent points, and the fourth pixel point number is smaller than half of the pixel distance between two transversely adjacent points.
In the present embodiment, as shown in fig. 12, the dots are expanded vertically by 15 pixels and horizontally by 2 pixels to obtain vertically expanded images.
S2213: and selecting a transverse rectangle positioned at the uppermost end in the transverse expansion image to obtain a transverse mask image.
In the present embodiment, as shown in fig. 13, a lateral mask image is used.
S2214: and selecting a longitudinal rectangle positioned at the leftmost end in the longitudinal expansion image to obtain a longitudinal mask image.
In the present embodiment, as shown in fig. 14, a vertical mask image is shown.
In summary, the horizontal mask image and the vertical mask image are generated through steps S2111 to S2214, and the mask image is generated by using the method of performing expansion processing on the dots, so that the method can be adaptive to different dot matrix images, the accuracy is high, and the method steps are simple and easy to implement.
It is understood that the above steps are method steps performed based on the point at the upper left corner as the determination point, and when other points are selected as the determination points, rectangles at different positions can be selected as the mask image based on the position of the determination point.
In addition to the above-mentioned methods, in step S221, the mask image may be obtained in other manners, for example, a fixed region in the image may be always divided into mask regions based on the shooting object, or the mask regions may be manually divided, and then the same region may be automatically selected as the mask region. In addition, referring to the foregoing manner, the step of selecting the mask region may be omitted by directly defining the points in a fixed-size region in the workpiece dot matrix image as the point set for fitting the straight line. Compared with the method provided in the present embodiment, the above method has simpler steps, but is difficult to adapt to different dot matrix images for automation, and may have more errors.
As shown in fig. 15 and 16, in step S222, the separated point sets are obtained from the mask image, and as shown in fig. 17, the point sets are fitted by the least square method to obtain corresponding straight lines. In other embodiments of the present invention, a common line fitting algorithm, such as gradient descent, may also be used to fit the point set.
In conclusion, in step S2, a horizontal line and a vertical line are obtained by fitting a horizontal row point set and a vertical column point set, and the intersection point is used as a determination point of the subsequent standard dot matrix image, so that the accuracy and precision of the determination are improved. Specifically, in the dotting process, a certain error exists in the position of each point, so that compared with the situation that one point is directly selected as a judgment point and the intersection point of the fitting straight line is taken as the judgment point, the error possibly existing in a single point can be eliminated, and the situation that the calibration of all points is invalid due to the fact that just one point with a large error is selected as the judgment point is avoided.
In step S3, it specifically includes:
acquiring a preset standard dot matrix image, and selecting an upper left corner point of the standard dot matrix image as a standard point; in the coordinate system, the coordinate offset between the standard point coordinates and the intersection point coordinates is calculated.
And a point array corresponding to the through holes of the workpiece is arranged in the standard dot matrix image, and the positions of the points are standard positions of the through holes in the workpiece according to the design.
In the present embodiment, since the point at the upper left corner of the workpiece dot matrix image is used as the determination point, the upper left corner is selected as the standard point in the standard dot matrix image. In another embodiment, when the difference is selected and determined, a point at a different position in the standard dot matrix image may be selected as the standard point.
In step S4, the coordinates of all the points are corrected using the amount of deviation between the standard point and the determination point as the amount of deviation of all the points, and the corrected points are compared with the coordinates of each point in the standard workpiece image, thereby inspecting defective points whose positions are deviated.
The offset obtained based on the intersection point detection of the fitted straight line is high in accuracy, and the offset is directly applied to all points, so that the operation speed of algorithm steps can be greatly increased, each point does not need to be corrected, and the efficiency is higher.
In the present embodiment, the deviation value of defective dot determination is 20 μm, that is, when the deviation distance between a dot in the workpiece dot matrix image and the corresponding dot in the standard dot matrix image exceeds 20 μm, it is determined as a defective dot. In other embodiments, the deviation criterion may be specifically adjusted according to the actual size of the through-hole in the workpiece.
Furthermore, for bad points, the rechecking can be carried out manually, so that the accuracy of detection is improved.
In summary, the invention fits a horizontal row point set and a longitudinal column point set in the workpiece dot matrix image to obtain a horizontal straight line and a longitudinal straight line, and uses the intersection point as a judgment point for comparing with a subsequent standard dot matrix image, thereby eliminating the possible process error of a single point and improving the accuracy and precision of the judgment of the point position error. In addition, in some embodiments of the present invention, the method further includes calculating a deflection angle between the camera lens 113 and the stage 12, and correcting the workpiece dot matrix image based on the deflection angle, so as to further improve the accuracy of the determination.
As shown in fig. 1, the present invention also provides a detection apparatus 1, comprising:
the system comprises a carrier 12, a camera 11, a motion control module, an image processing module and a bad point inspection module;
the motion control module is configured to control the camera 11 and the stage 12 to move in relative translation;
the camera 11 is configured to photograph a workpiece placed on the stage 12 to obtain a workpiece image, where the workpiece image includes a through hole array on the surface of the workpiece, process the workpiece image to convert the through hole array into a dot array, and calculate to obtain coordinate information of each point to obtain a workpiece dot matrix image;
the image processing module is configured to fit a horizontal row point set in the workpiece dot matrix image to obtain a horizontal straight line, fit a vertical column point set in the workpiece dot matrix image to obtain a vertical straight line, and obtain an intersection point of the horizontal straight line and the vertical straight line; acquiring a preset standard dot matrix image, wherein the standard dot matrix image comprises preset coordinate position information of corresponding points of all through holes, calculating and acquiring coordinate offset of the intersection points and the corresponding position points in the standard dot matrix image, and correcting coordinates of all points of the dot matrix of the workpiece dot matrix image based on the coordinate offset;
the bad point detection module is configured for comparing the workpiece dot matrix image with the standard dot matrix image points and detecting the bad points.
It should be understood that although the present description refers to embodiments, not every embodiment contains only a single technical solution, and such description is for clarity only, and those skilled in the art should make the description as a whole, and the technical solutions in the embodiments can also be combined appropriately to form other embodiments understood by those skilled in the art.
The above-listed detailed description is only a specific description of a possible embodiment of the present invention and is not intended to limit the scope of the present invention, and equivalent embodiments or modifications made without departing from the technical spirit of the present invention are included in the scope of the present invention.

Claims (11)

1. A method for calibrating a position of a workpiece through hole, comprising the steps of:
controlling the movement of a carrying platform, shooting a workpiece arranged on the carrying platform by a line scanning camera to obtain a workpiece image, wherein the workpiece image comprises a through hole array on the surface of the workpiece, processing the workpiece image to convert the through hole array into a point array, and calculating to obtain coordinate information of each point to obtain a workpiece dot matrix image;
fitting a horizontal row point set in the workpiece dot matrix image to obtain a horizontal straight line, fitting a vertical column point set in the workpiece dot matrix image to obtain a vertical straight line, and acquiring the intersection point of the horizontal straight line and the vertical straight line;
acquiring a preset standard dot matrix image, wherein the standard dot matrix image comprises preset coordinate position information of corresponding points of all through holes, and calculating and acquiring coordinate offset of the intersection points and the corresponding position points in the standard dot matrix image;
and correcting the coordinates of each point of the workpiece dot matrix image dot matrix based on the coordinate offset, comparing the coordinates with the standard dot matrix image points, and checking defective points.
2. The method for calibrating a position of a through hole in a workpiece according to claim 1, wherein the fitting a set of points in a horizontal row in the workpiece dot matrix image to obtain a horizontal line, and the fitting a set of points in a vertical column in the workpiece dot matrix image to obtain a vertical line, and obtaining an intersection point of the horizontal line and the vertical line specifically comprises:
selecting the upper left corner area in the workpiece dot matrix image as a detection area;
fitting a transverse row point set positioned in the first row above the detection area to obtain a transverse straight line, and fitting a longitudinal row point set positioned in the first column on the left side in the detection area to obtain a longitudinal straight line;
and acquiring the intersection point of the transverse straight line and the longitudinal straight line.
3. The method for calibrating the position of the workpiece through hole according to claim 2, wherein the fitting of the set of horizontal row points in the first upper row in the inspection area to obtain the horizontal straight line and the fitting of the set of vertical column points in the first left column in the inspection area to obtain the vertical straight line specifically comprises:
generating a transverse mask image covering a first transverse row point set in the workpiece dot matrix image detection area, and generating a longitudinal mask image covering a first left longitudinal column point set in the workpiece dot matrix image detection area;
masking points in the workpiece dot matrix image detection area through the transverse mask image and the longitudinal mask image respectively, and selecting a point set in the transverse mask image and a point set in the longitudinal mask image respectively to obtain a transverse dot diagram and a longitudinal dot diagram;
and respectively fitting point sets in the transverse point diagram and the longitudinal point diagram to obtain the transverse straight line and the longitudinal straight line.
4. The method for calibrating a through-hole position of a workpiece according to claim 3, wherein the generating a horizontal mask image covering a horizontal row of a first row of a detection area of the workpiece dot matrix image and generating a vertical mask image covering a vertical column of a first column on the left side of the detection area of the workpiece dot matrix image comprises:
expanding points in the workpiece dot matrix image detection area by a first pixel point in the transverse direction and a second pixel point in the longitudinal direction to obtain a transverse expansion image, wherein the transverse expansion image comprises a plurality of rectangles with long edges extending transversely, the first pixel point is larger than half of the pixel distance between two adjacent points in the transverse direction, and the second pixel point is smaller than half of the pixel distance between two adjacent points in the longitudinal direction;
longitudinally expanding points in the detection area by a third pixel point number and transversely expanding a fourth pixel point number to obtain a longitudinally expanded image, wherein the longitudinally expanded image comprises a plurality of rectangles with long edges extending longitudinally, the third pixel point number is larger than half of the pixel distance between two longitudinally adjacent points, and the fourth pixel point number is smaller than half of the pixel distance between two transversely adjacent points;
selecting a transverse rectangle positioned at the uppermost end in the transverse expansion image to obtain a transverse mask image;
and selecting a longitudinal rectangle positioned at the leftmost end from the longitudinal expansion image to obtain a longitudinal mask image.
5. The method for calibrating the position of the workpiece through hole according to claim 3, wherein the fitting of the point sets in the transverse point diagram and the longitudinal point diagram to obtain the transverse straight line and the longitudinal straight line respectively comprises:
fitting the point set in the transverse point diagram by a least square method to obtain the transverse straight line;
and fitting the point set in the longitudinal point diagram by a least square method to obtain the longitudinal straight line.
6. The method of calibrating a position of a workpiece via according to claim 1, further comprising the steps of:
detecting and acquiring a deflection angle between a camera and a carrier;
and carrying out graying processing and thresholding processing on the workpiece image detection area, converting the through hole array into a point array, calculating to obtain coordinate information of each point, and calibrating the point coordinates of the workpiece dot matrix image based on the deflection angle to obtain the workpiece dot matrix image.
7. The method for calibrating the position of the through hole of the workpiece according to claim 6, wherein the calculating to obtain the coordinate information of each point comprises:
using the starting position of the stage movement as the origin of coordinates: (x 0 ,y 0 ) With the carrierEstablishing a coordinate system by taking the moving direction as the X-axis direction and the direction which is vertical to the moving direction of the carrying platform on the plane of the carrying platform as the Y-axis direction, calculating the coordinate information of each point in the lattice image of the workpiece in the coordinate system, and expressing the coordinate of any point in the lattice image of the workpiece as (A), (B) and (C)x 1 ,y 1 )。
8. The method for calibrating the position of the through hole in the workpiece according to claim 7, wherein the calibrating the coordinates of the points of the dot matrix image of the workpiece based on the deflection angle to obtain the dot matrix image of the workpiece specifically comprises:
calculating to obtain coordinate information of each point, calibrating the point coordinates of the workpiece dot matrix image based on the deflection angle to obtain a workpiece dot matrix image, wherein for any point (a)x 1 ,y 1 ) Calculating and obtaining a point after calibration by a calibration formula (x 2 ,y 2 ) The calibration formula is:
Figure 943661DEST_PATH_IMAGE001
wherein ,θ a is the angle of deflection between the camera and the stage,θ b is a point ofx 0 ,y 0 ) And points (x 1 ,y 1 ) The angle between the connecting line and the X axis.
9. The method for calibrating the position of the through hole in the workpiece according to claim 7, wherein the step of calculating and obtaining the coordinate offset between the intersection point and the corresponding position point in the standard dot matrix image specifically comprises:
selecting the upper left corner of the standard dot matrix image as a standard point,
in the coordinate system, a coordinate offset amount between the standard point coordinates and the intersection point coordinates is calculated.
10. The method for calibrating the position of the through hole in the workpiece according to claim 7, wherein the detecting and acquiring a deflection angle between the camera and the carrier specifically comprises:
controlling a camera and a carrier to move in a relative translation mode along an X axial direction, and respectively obtaining images at two opposite ends of a calibration plate arranged on the carrier to obtain a first calibration image and a second calibration image, wherein the first calibration image and the second calibration image respectively comprise a plurality of mark symbols positioned at two ends of the calibration plate;
detecting and calculating deflection angles of the first calibration image and the second calibration image relative to the X-axis direction based on the first calibration image and the second calibration image inner mark symbols respectively to obtain a first deflection angle and a second deflection angle;
and calculating a deflection angle between the camera and the carrier by calculating a difference between the first deflection angle and the second deflection angle to obtain the deflection angle between the camera and the carrier.
11. A detection device, comprising:
the system comprises a carrying platform, a camera, a motion control module, an image processing module and a bad point checking module;
the motion control module is configured to control the camera and the stage to move in relative translation;
the camera is configured to shoot a workpiece arranged on the carrying platform to obtain a workpiece image, the workpiece image comprises a through hole array on the surface of the workpiece, the workpiece image is processed to convert the through hole array into a point array, and coordinate information of each point is obtained through calculation to obtain a workpiece dot matrix image;
the image processing module is configured to fit a horizontal row point set in the workpiece dot matrix image to obtain a horizontal straight line, fit a vertical column point set in the workpiece dot matrix image to obtain a vertical straight line, and obtain an intersection point of the horizontal straight line and the vertical straight line; acquiring a preset standard dot matrix image, wherein the standard dot matrix image comprises preset coordinate position information of corresponding points of all through holes, calculating and acquiring coordinate offset of the intersection points and the corresponding position points in the standard dot matrix image, and correcting coordinates of all points of the workpiece dot matrix image dot matrix based on the coordinate offset;
and the defective point detection module is configured to compare the workpiece dot matrix image with the standard dot matrix image points and detect the defective points.
CN202210919808.4A 2022-08-02 2022-08-02 Workpiece through hole position calibration method and detection device Active CN114998334B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210919808.4A CN114998334B (en) 2022-08-02 2022-08-02 Workpiece through hole position calibration method and detection device
PCT/CN2022/135933 WO2024027058A1 (en) 2022-08-02 2022-12-01 Calibration method for through hole positions of workpiece, and detection apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210919808.4A CN114998334B (en) 2022-08-02 2022-08-02 Workpiece through hole position calibration method and detection device

Publications (2)

Publication Number Publication Date
CN114998334A true CN114998334A (en) 2022-09-02
CN114998334B CN114998334B (en) 2023-05-26

Family

ID=83020920

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210919808.4A Active CN114998334B (en) 2022-08-02 2022-08-02 Workpiece through hole position calibration method and detection device

Country Status (2)

Country Link
CN (1) CN114998334B (en)
WO (1) WO2024027058A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115690383A (en) * 2022-11-02 2023-02-03 广州市市政工程试验检测有限公司 Calibration parameter obtaining method of image acquisition device and drilling imaging method
WO2024027058A1 (en) * 2022-08-02 2024-02-08 苏州华兴源创科技股份有限公司 Calibration method for through hole positions of workpiece, and detection apparatus

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101277456A (en) * 2007-03-28 2008-10-01 安奇逻辑股份有限公司 Method and device for detecting chromatic aberration in imaging device
CN109556515A (en) * 2018-11-26 2019-04-02 深圳市万相源科技有限公司 A kind of systematic error calibration method, system and equipment based on machine vision

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7363456B2 (en) * 2019-12-20 2023-10-18 大同特殊鋼株式会社 Calibration device for three-dimensional shape measurement
CN111452038B (en) * 2020-03-03 2021-08-24 重庆大学 High-precision workpiece assembly and assembly method thereof
CN112720458B (en) * 2020-12-04 2022-08-12 上海航天设备制造总厂有限公司 System and method for online real-time correction of robot tool coordinate system
CN114998334B (en) * 2022-08-02 2023-05-26 苏州华兴源创科技股份有限公司 Workpiece through hole position calibration method and detection device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101277456A (en) * 2007-03-28 2008-10-01 安奇逻辑股份有限公司 Method and device for detecting chromatic aberration in imaging device
CN109556515A (en) * 2018-11-26 2019-04-02 深圳市万相源科技有限公司 A kind of systematic error calibration method, system and equipment based on machine vision

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024027058A1 (en) * 2022-08-02 2024-02-08 苏州华兴源创科技股份有限公司 Calibration method for through hole positions of workpiece, and detection apparatus
CN115690383A (en) * 2022-11-02 2023-02-03 广州市市政工程试验检测有限公司 Calibration parameter obtaining method of image acquisition device and drilling imaging method
CN115690383B (en) * 2022-11-02 2023-12-05 广州市市政工程试验检测有限公司 Calibration parameter acquisition method of image acquisition device and borehole imaging method

Also Published As

Publication number Publication date
WO2024027058A1 (en) 2024-02-08
CN114998334B (en) 2023-05-26

Similar Documents

Publication Publication Date Title
CN114998334B (en) Workpiece through hole position calibration method and detection device
CN113240674B (en) Coplanarity detection method based on three-dimensional point cloud and two-dimensional image fusion
EP1666185B1 (en) Laser processing machine and method with image acquisition and processing means
EP1062853B1 (en) Component recognizing method and apparatus
CN108562250B (en) Keyboard keycap flatness rapid measurement method and device based on structured light imaging
KR100857257B1 (en) Screen printer and image sensor position alignment method
TW201801603A (en) Apparatus and method for calibrating machining position
CN105783711B (en) Three-dimensional scanner correction system and correction method thereof
KR20130124313A (en) Screen printing device and screen printing method
US6665424B1 (en) Automatic inspection of print quality using an elastic model
EP0132122B1 (en) Apparatus for inspecting mask for use in manufacturing large scale integrated circuits
JP5545737B2 (en) Component mounter and image processing method
JP5457665B2 (en) Electronic component mounting device
JP4405009B2 (en) Calibration method of inspection machine with line sensor camera
CN111309271B (en) Machine vision-based double-color printer detection method
US10849261B2 (en) Surface mounter and method of correcting recognition error
CN115661256A (en) Method for calculating deflection angle between camera and carrying platform, calibration plate and detection device
CN116612071A (en) Accurate positioning method for large-format PCB panel with repeated elements
JP5136108B2 (en) 3D shape measuring method and 3D shape measuring apparatus
JP2007033040A (en) Method and device for calibrating optical head part in three-dimensional shape measuring instrument by optical cutting method
JP5572247B2 (en) Image distortion correction method
KR20110007033A (en) Drawing device, recording medium and drawing method
JPH07183697A (en) Electronic component mounting apparatus
JP4860366B2 (en) Surface mount equipment
KR20220058740A (en) System and Method for calibration of robot based on a scanning

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