PCB hole positioning method, device, computer equipment and storage medium
By projecting four grating stripe images, the wrapping phase of the PCB hole is analyzed, and combining the three-dimensional coordinates and phase relationships, the three-dimensional coordinates of the edge points of the hole are quickly screened out, which solves the problem of slow unwrapment speed in traditional three-dimensional measurement technology and improves the positioning speed and accuracy of the PCB hole.
Patent Information
- Application Number
- CN202111166586.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2041-09-30
AI Technical Summary
Traditional three-dimensional measurement technology has slow unwrapment speed in PCB hole positioning, affecting PCB manufacturing efficiency.
By projecting four grating stripe images to the plate where the hole is to be located, collecting the reflected grating stripe images, analyzing the wrapping phase in the modulated light phase, combining the three-dimensional coordinates and phase relationships, the three-dimensional coordinates of the edge points of the hole are screened out.
The coordinate resolution speed of PCB holes is improved, and the alignment speed and accuracy of PCB holes are improved.
Smart Images

Figure CN115900537B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of PCB board processing, and in particular to a PCB hole positioning method, device, computer equipment and storage medium. Background Art
[0002] With the advancement of integrated circuit technology, demands for faster PCB (Printed Circuit Board) production speeds are increasing. During the PCB exposure process, alignment speed is a crucial factor influencing PCB manufacturing efficiency. Therefore, rapid alignment of PCB holes is crucial. Furthermore, PCB hole measurement accuracy is even more crucial. Therefore, 3D measurement technology is being used to improve measurement accuracy compared to traditional 2D measurement techniques. However, 3D measurement technology is slower than 2D measurement technology, making it an urgent issue to address.
[0003] In traditional 3D measurement technology, a series of phase-shifted grating stripes formed by a four-step phase shift method are projected onto the PCB. The phase function of the phase-shifted grating stripes is combined with another phase function obtained by other measurement methods to solve the phase wrapping and calculate the coordinates of the PCB hole.
[0004] However, the traditional 3D measurement technology has a slow unpacking speed, which makes it slow to solve the PCB hole coordinates. Summary of the Invention
[0005] Based on this, it is necessary to provide a PCB hole positioning method, device, computer equipment and storage medium that can improve the speed of solving PCB hole coordinates to address the above technical problems.
[0006] A PCB hole locating method, the method comprising: sequentially projecting four grating fringe images onto a plate where a hole to be located is located, and collecting reflected grating fringe images formed by each of the grating fringe images on the plate where the hole to be located is located; wherein the four grating fringe images include a first grating fringe image, a second grating fringe image, a third grating fringe image, and a fourth grating fringe image with different modulated lights superimposed on the same background light, the modulated lights of the first grating fringe image and the third grating fringe image are mutually opposite in number, the modulated lights of the second grating fringe image and the fourth grating fringe image are mutually opposite in number, and the third grating fringe image and the second grating fringe image are mutually opposite in number. The modulated light phases of the fringe image are respectively the sum and the difference of the two wrapped phases; based on the four reflected grating fringe images, two wrapped phases in the modulated light phases of the four reflected grating fringe images are determined; the two wrapped phases in the modulated light phases of the four reflected grating fringe images are unwrapped to obtain phase information of the plate where the hole to be positioned is located; based on the phase information of the plate where the hole to be positioned is located and the correspondence between the three-dimensional coordinates and the phases, a three-dimensional coordinate set of the plate where the hole to be positioned is located is determined; and the three-dimensional coordinates of the edge point of the hole to be positioned are screened out from the three-dimensional coordinate set of the plate where the hole to be positioned is located to determine the position of the hole to be positioned.
[0007] In one embodiment, the light intensity formula of the four reflected grating fringe images is as follows:
[0008]
[0009]
[0010]
[0011]
[0012] Among them, I′1(x,y), I′2(x,y), I′3(x,y), and I′4(x,y) are the light intensities of the four reflected grating fringe images, A′ is the intensity of the reflected background light, and B′ is the intensity of the reflected modulated light. and ψ(x,y) are the two wrapped phases in the modulated light phase of the reflected grating fringe image.
[0013] In one embodiment, unwrapping the two wrapped phases in the modulated light phases of the four reflected grating fringe images to obtain the phase information of the plate where the hole to be positioned is located includes: determining the equivalent frequency and equivalent phase of the two wrapped phases in the modulated light phases of the four reflected grating fringe images; and performing phase unwrapping on the two wrapped phases in the modulated light phases of the four reflected grating fringe images based on the equivalent frequency and the equivalent phase to obtain the phase information of the plate where the hole to be positioned is located.
[0014] In one embodiment, before determining the three-dimensional coordinate set of the plate where the hole to be positioned is located based on the phase information of the plate where the hole to be positioned is located and the correspondence between the three-dimensional coordinates and the phase, the method further includes: multiple times acquiring a test reflection grating fringe image formed by projecting a test grating fringe image onto the test plate; obtaining the three-dimensional coordinates of each feature point on the test plate and a phase value on the test reflection grating fringe image; determining the two-dimensional image coordinates of each feature point based on the three-dimensional coordinates of each feature point and the positional relationship between the acquisition device of the test reflection grating fringe image and the test plate; and determining a conversion matrix between the three-dimensional coordinates and the two-dimensional image coordinates and the phase value on the test reflection grating fringe image of each feature point using a least squares method.
[0015] In one embodiment, determining the three-dimensional coordinate set of the plate where the hole to be positioned is located based on the phase information of the plate where the hole to be positioned is located and the correspondence between the three-dimensional coordinates and the phase includes: determining a phase coordinate vector composed of the phase information and the two-dimensional image coordinates according to the phase information of the plate where the hole to be positioned is located and the two-dimensional image coordinates corresponding to the phase information; and determining a three-dimensional coordinate vector corresponding to the phase coordinate vector according to the phase coordinate vector and the transformation matrix.
[0016] In one embodiment, the step of filtering out the three-dimensional coordinates of edge points from the three-dimensional coordinate set of the plate where the hole to be positioned is located and determining the position of the hole to be positioned includes: using the NARF algorithm to extract the three-dimensional coordinates of the edge points from the three-dimensional coordinate set of the plate where the hole to be positioned is located; and determining the position of the hole to be positioned based on the three-dimensional coordinate set of the edge points.
[0017] In one embodiment, after determining the three-dimensional coordinate set of the plate where the hole to be located is located based on the phase information of the plate where the hole to be located is located and the correspondence between the three-dimensional coordinates and the phase, the method further includes: performing low-pass filtering and denoising on the three-dimensional coordinate set to remove noise from the three-dimensional coordinate set.
[0018] A PCB hole positioning device, the device comprising:
[0019] a projection acquisition module, configured to sequentially project four grating fringe images onto a plate where the hole to be positioned is located, and to acquire reflected grating fringe images formed by each of the grating fringe images on the plate where the hole to be positioned is located; wherein the four grating fringe images include a first grating fringe image, a second grating fringe image, a third grating fringe image, and a fourth grating fringe image, each of which has differently modulated light superimposed on the same background light; the modulated light of the first grating fringe image and the third grating fringe image is of opposite magnitude, the modulated light of the second grating fringe image and the fourth grating fringe image is of opposite magnitude, and the phases of the modulated light of the third grating fringe image and the second grating fringe image are respectively the sum and difference of two wrapped phases;
[0020] a phase determination module, configured to determine two wrapped phases in the modulated light phases of the four reflected grating fringe images based on the four reflected grating fringe images;
[0021] a phase unwrapping module, configured to unwrap two of the wrapped phases in the modulated light phases of the four reflected grating fringe images to obtain phase information of the plate where the hole to be positioned is located;
[0022] a three-dimensional coordinate determination module, configured to determine a three-dimensional coordinate set of the plate where the hole to be located is located based on the phase information of the plate where the hole to be located is located and a correspondence between the three-dimensional coordinates and the phase;
[0023] The PCB hole positioning module is used to filter out the three-dimensional coordinates of the edge points of the holes to be positioned from the three-dimensional coordinate set of the plate where the holes to be positioned are located, and determine the positions of the holes to be positioned.
[0024] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0025] Projecting four grating fringe images sequentially onto the plate where the hole to be positioned is located, and collecting reflected grating fringe images formed by each of the grating fringe images on the plate where the hole to be positioned is located; wherein the four grating fringe images include a first grating fringe image, a second grating fringe image, a third grating fringe image, and a fourth grating fringe image, which are formed by superimposing differently modulated lights on the same background light, the modulated lights of the first grating fringe image and the third grating fringe image are opposite in magnitude, the modulated lights of the second grating fringe image and the fourth grating fringe image are opposite in magnitude, and the phases of the modulated lights of the third grating fringe image and the second grating fringe image are the sum and difference of two wrapped phases, respectively;
[0026] Determining two wrapped phases in the modulated light phases of the four reflected grating fringe images based on the four reflected grating fringe images;
[0027] Unwrapping two of the wrapped phases in the modulated light phases of the four reflected grating fringe images to obtain phase information of the plate where the hole to be positioned is located;
[0028] Determining a three-dimensional coordinate set of the plate where the hole to be located is located based on the phase information of the plate where the hole to be located is located and the correspondence between the three-dimensional coordinates and the phase;
[0029] The three-dimensional coordinates of the edge points of the holes to be positioned are screened out from the three-dimensional coordinate set of the plate where the holes to be positioned are located, and the positions of the holes to be positioned are determined.
[0030] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0031] Projecting four grating fringe images sequentially onto the plate where the hole to be positioned is located, and collecting reflected grating fringe images formed by each of the grating fringe images on the plate where the hole to be positioned is located; wherein the four grating fringe images include a first grating fringe image, a second grating fringe image, a third grating fringe image, and a fourth grating fringe image, which are formed by superimposing differently modulated lights on the same background light, the modulated lights of the first grating fringe image and the third grating fringe image are opposite in magnitude, the modulated lights of the second grating fringe image and the fourth grating fringe image are opposite in magnitude, and the phases of the modulated lights of the third grating fringe image and the second grating fringe image are the sum and difference of two wrapped phases, respectively;
[0032] Determining two wrapped phases in the modulated light phases of the four reflected grating fringe images based on the four reflected grating fringe images;
[0033] Unwrapping two of the wrapped phases in the modulated light phases of the four reflected grating fringe images to obtain phase information of the plate where the hole to be positioned is located;
[0034] Determining a three-dimensional coordinate set of the plate where the hole to be located is located based on the phase information of the plate where the hole to be located is located and the correspondence between the three-dimensional coordinates and the phase;
[0035] The three-dimensional coordinates of the edge points of the holes to be positioned are screened out from the three-dimensional coordinate set of the plate where the holes to be positioned are located, and the positions of the holes to be positioned are determined.
[0036] The above-described PCB hole locating method, apparatus, computer device, and storage medium project four grating fringe images onto the plate where the holes to be located are located. Since the depths of different locations on the surface of the plate where the holes to be located vary due to the presence of the PCB holes, the four grating fringe images are distorted. Four deformed reflected grating fringe images corresponding to the four projected grating fringe images are then collected. Based on the four reflected grating fringe images, two wrapped phases are calculated from the modulated light phases of the four reflected grating fringe images. Phase unwrapping is then performed on the two wrapped phases to obtain phase information of the plate where the holes to be located are located, thereby obtaining phase values that correspond one-to-one to the pixels of the plate where the holes to be located are located. Because the projected grating fringe images include two wrapped phases, phase unwrapping can be achieved by projecting the four grating fringe images, improving the unwrapping speed and, in turn, the speed of solving the PCB hole coordinates. The three-dimensional coordinates corresponding to these phase information in the world coordinate system are then calculated based on the phase information of the plate where the holes to be located are located, as well as the correspondence between the three-dimensional coordinates and the phase information, resulting in a three-dimensional coordinate point cloud of the plate where the holes to be located are located. The 3D coordinates of the edge points are then filtered from the 3D coordinate point cloud of the plate where the hole to be positioned is located, thereby extracting the 3D coordinates of the hole to be positioned and determining its position. Through the method of this application, the 3D coordinates of the hole to be positioned can be determined by projecting four grating fringe images, eliminating the need to obtain another phase function through other measurement methods, thereby improving the alignment speed of PCB holes. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the following briefly introduces the drawings required for use in the embodiments or the conventional technology descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0038] Figure 1 Flowchart of a PCB hole positioning method according to one embodiment;
[0039] Figure 2 Flowchart of a PCB hole calibration method according to one embodiment;
[0040] Figure 3 Schematic diagram of the structure of a PCB hole positioning device in one embodiment;
[0041] Figure 4 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0042] To facilitate understanding of the present application, the present application will be described more fully below with reference to the accompanying drawings. The accompanying drawings provide embodiments of the present application. However, the present application may be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to make the disclosure of the present application more thorough and comprehensive.
[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application pertains. The terms used herein in the specification of this application are for the purpose of describing specific embodiments only and are not intended to limit this application.
[0044] It will be understood that the terms "first," "second," etc. used herein may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element.
[0045] It should be noted that when an element is considered to be "connected" to another element, it can be directly connected to the other element or connected to the other element through an intervening element. In addition, the "connection" in the following embodiments should be understood as "electrical connection", "communication connection", etc., if there is transmission of electrical signals or data between the connected objects.
[0046] When used herein, the singular forms "a", "an", and "the" may also include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" and the like specify the presence of stated features, integers, steps, operations, components, parts, or combinations thereof, but do not preclude the possibility of the presence or addition of one or more other features, integers, steps, operations, components, parts, or combinations thereof.
[0047] As described in the background, existing 3D measurement technologies for PCB fabrication suffer from slow production speeds. The inventors discovered that this problem arises because, in conventional 3D measurement technology, in the PCB hole alignment step during PCB fabrication, in addition to projecting a series of phase-shifted grating stripes onto the PCB board using a four-step phase shifting method to obtain the phase function of these grating stripes, another phase function, obtained by combining other measurement methods, is required to perform phase wrapping and calculate the coordinates of the PCB holes. Consequently, the speed of determining the PCB hole coordinates is slow.
[0048] Based on the above reasons, the present invention provides a PCB hole positioning method, device, computer equipment and storage medium that can improve the speed of solving PCB hole coordinates.
[0049] In one embodiment, Figure 1As shown, a PCB hole positioning method is provided, the method comprising:
[0050] Step S100 : Projecting four grating fringe images sequentially onto the plate where the hole to be positioned is located, and collecting reflected grating fringe images formed by each grating fringe image on the plate where the hole to be positioned is located.
[0051] Among them, the four grating fringe images include the first grating fringe image, the second grating fringe image, the third grating fringe image and the fourth grating fringe image, which are superimposed with different modulated lights on the same background light. The modulated lights of the first grating fringe image and the third grating fringe image are opposite to each other, the modulated lights of the second grating fringe image and the fourth grating fringe image are opposite to each other, and the modulated light phases of the third grating fringe image and the second grating fringe image are the sum and difference of the two wrapped phases, respectively.
[0052] Step S120 : determining two wrapped phases in the modulated light phases of the four reflected grating fringe images based on the four reflected grating fringe images.
[0053] Step S140 , unwrapping two wrapped phases in the modulated light phases of the four reflected grating fringe images to obtain phase information of the plate where the hole to be positioned is located.
[0054] Step S160 : determining a three-dimensional coordinate set of the plate where the hole to be located is located based on the phase information of the plate where the hole to be located is located and the correspondence between the three-dimensional coordinates and the phase.
[0055] Step S180 , filtering out the three-dimensional coordinates of the edge points of the holes to be located from the three-dimensional coordinate set of the plate where the holes to be located are located, and determining the positions of the holes to be located.
[0056] In this embodiment, four grating fringe images are projected onto the plate where the holes to be located are located. Since the depths of the PCB holes vary at different locations on the surface of the plate where the holes to be located are located, these four grating fringe images are distorted. Four distorted reflected grating fringe images corresponding to the projected four grating fringe images are then captured. Based on these four reflected grating fringe images, two wrapped phases are calculated from the modulated light phases of the four reflected grating fringe images. Phase unwrapping is then performed on these two wrapped phases to obtain phase information for the plate where the holes to be located are located, thereby obtaining phase values that correspond one-to-one to the pixels on the plate where the holes to be located are located. Because the projected grating fringe images contain two wrapped phases, phase unwrapping can be achieved by projecting these four grating fringe images, improving the unwrapping speed and, in turn, the speed of determining the PCB hole coordinates. Based on the phase information of the plate where the holes to be located are located and the correspondence between the 3D coordinates and the phase information, the 3D coordinates corresponding to these phase information in the world coordinate system are calculated, resulting in a 3D coordinate point cloud for the plate where the holes to be located are located. The 3D coordinates of the edge points are then filtered from the 3D coordinate point cloud of the plate where the hole to be positioned is located, thereby extracting the 3D coordinates of the hole to be positioned and determining its position. Through the method of this application, the 3D coordinates of the hole to be positioned can be determined by projecting four grating fringe images, eliminating the need to obtain another phase function through other measurement methods, thereby improving the alignment speed of PCB holes.
[0057] For example, the light intensity expressions of the four grating fringe images are as follows:
[0058]
[0059]
[0060]
[0061]
[0062] Among them, I1(x,y), I2(x,y), I3(x,y), and I4(x,y) are the light intensities of the four grating fringe images, A is the intensity of the background light, and B is the intensity of the modulated light. and ψ(x,y) are the two wrapped phases in the modulated light phase of the grating fringe image.
[0063] Specifically, due to the presence of the holes to be positioned, the projection depths of the grating fringe image on different areas of the flat panel vary, so the reflected grating fringe image formed on the flat panel is deformed compared to the grating fringe image. Thus, the light intensity and phase of the reflected grating fringe image are changed compared to the corresponding grating fringe image, but the relationship between the four reflected grating fringe images is the same as the relationship between the four grating fringe images. That is, the four reflected grating fringe images include a first reflected grating fringe image, a second reflected grating fringe image, a third reflected grating fringe image, and a fourth reflected grating fringe image, each of which has differently modulated light superimposed on the same background light. The modulated light of the first reflected grating fringe image and the third reflected grating fringe image is of opposite magnitude, and the modulated light of the second reflected grating fringe image and the fourth reflected grating fringe image is of opposite magnitude. The phases of the modulated light of the third reflected grating fringe image and the second reflected grating fringe image are the sum and difference of the two wrapped phases, respectively.
[0064] Specifically, a projection device is used to sequentially project four grating fringe images, and a CCD (charge coupled device) camera is used to respectively capture reflected grating fringe images formed after each grating fringe image is projected.
[0065] Exemplarily, the light intensity formula of four reflected grating fringe images is as follows:
[0066]
[0067]
[0068]
[0069]
[0070] Among them, I′1(x,y), I′2(x,y), I′3(x,y), and I′4(x,y) are the light intensities of the four reflected grating fringe images, A′ is the intensity of the reflected background light, and B′ is the intensity of the reflected modulated light. and ψ(x,y) are the two wrapped phases in the modulated light phase of the reflected grating fringe image.
[0071] In one embodiment, step S120 includes:
[0072] The two wrapped phases in the modulated light phase of the four reflected grating fringe images are calculated using the following formula:
[0073]
[0074]
[0075] in, and ψ(x, y) are the two wrapped phases in the modulated light phase of the four reflected grating fringe images, and I′1(x, y), I′2(x, y), I′3(x, y), and I′4(x, y) are the light intensities of the four reflected grating fringe images, respectively.
[0076] In one embodiment, step S140 includes:
[0077] Step S1402, determining the equivalent frequencies and equivalent phases of two wrapped phases in the modulated light phases of the four reflected grating fringe images;
[0078] Step S1404 : Based on the equivalent frequency and the equivalent phase, phase unwrapping is performed on two wrapped phases in the modulated light phases of the four reflected grating fringe images to obtain phase information of the plate where the hole to be located is located.
[0079] Exemplarily, determining the equivalent frequencies of two wrapped phases in the modulated light phases of four reflected grating fringe images includes:
[0080] The equivalent frequencies of the two wrapped phases in the modulated light phases of the four reflected grating fringe images are determined according to the following formula:
[0081]
[0082] Among them, λ eq is the equivalent frequency, λ1 and λ2 are the frequencies of the two wrapped phases in the modulated light phases of the four reflected grating fringe images.
[0083] Exemplarily, determining the equivalent phases of two wrapped phases in the modulated light phases of four reflected grating fringe images includes:
[0084] The equivalent phases of the two wrapped phases in the modulated light phases of the four reflected grating fringe images are determined according to the following formula:
[0085]
[0086] in, is the equivalent phase, and ψ(x,y) are the two wrapped phases in the modulated light phase of the four reflected grating fringe images.
[0087] Specifically, phase unwrapping using two wrapped phases to find the equivalent phase is more accurate and has better universality than directly unwrapping one wrapped phase.
[0088] Exemplarily, based on the equivalent frequency and equivalent phase, phase unwrapping is performed on two wrapped phases in the modulated light phases of the four reflected grating fringe images to obtain phase information of the plate where the hole to be located is located, including:
[0089] Phase unwrapping is performed on the two wrapped phases in the modulated light phases of the four reflected grating fringe images according to the following formula:
[0090]
[0091]
[0092] Where φ is the phase information of the plate where the hole to be located is located, is the equivalent phase of the two wrapped phases, λ eq is the equivalent frequency of the two wrapped phases, and k is the fringe order.
[0093] Specifically, the phase information of the plate where the hole to be positioned is located includes the phase value when the grating fringe image passes through a certain pixel point on the plate where the hole to be positioned is located, and the coordinate value of the pixel point. The phase information is in the form of φ(x, y), where φ is the phase value and (x, y) is the coordinate value of the corresponding pixel point.
[0094] In one embodiment, step S160 includes:
[0095] Step S1602 : determining the two-dimensional image coordinates corresponding to the phase information of the plate where the hole to be located is located.
[0096] Step S1604 : determining a phase coordinate vector consisting of the phase information and the two-dimensional image coordinates according to the phase information of the plate where the hole to be located is located and the two-dimensional image coordinates corresponding to the phase information.
[0097] For example, the phase coordinate vector Q = [1, x, y, φ, ..., x n ,y n ,φ n ] T , φ is the phase value of the feature point, x is the horizontal coordinate corresponding to φ, y is the vertical coordinate corresponding to φ, and the value of n is the preset value.
[0098] Step S1606: Determine a three-dimensional coordinate matrix corresponding to the phase coordinate vector according to the phase coordinate vector and the conversion matrix.
[0099] Specifically, step S1606 includes: substituting the phase information of the plate where the hole to be located is located and the corresponding two-dimensional image coordinates into the following formula to obtain a three-dimensional coordinate set of the plate where the hole to be located is located:
[0100] W=C×Q
[0101] in, is the three-dimensional coordinate in the world coordinate system, X w is the coordinate on the X axis in the world coordinate system, Y w is the coordinate on the Y axis in the world coordinate system, Zw is the coordinate on the Z axis in the world coordinate system, C is the conversion matrix between the three-dimensional coordinates and the two-dimensional image coordinates and phase values, Q is the vector composed of the phase values of each feature point on the plate where the hole to be located is located and the corresponding two-dimensional image coordinates, Q = [1, x, y, φ, ..., x n ,y n ,φ n ] T , φ is the phase value of the feature point, x is the horizontal coordinate corresponding to φ, y is the vertical coordinate corresponding to φ, and the value of n is the preset value.
[0102] For example, n is 3. The larger n is, the more accurate the obtained three-dimensional coordinates are, but the amount of calculation is greater. n is 3 to better balance accuracy and calculation.
[0103] Specifically, the expression of the conversion matrix C is as follows:
[0104]
[0105] Among them, C x1 C x2 …C xm 、C y1 C y2 …C ym 、C z1 C z2 …C zm are all conversion coefficients, and the value of m is the number of elements in the matrix Q composed of the phase values of each point of the hole to be located and the corresponding two-dimensional image coordinates.
[0106] In one embodiment, step S180 includes:
[0107] The NARF (normal aligned radial feature) algorithm is used to filter the 3D coordinates of the edge of the hole to be located from the 3D coordinate set of the plate where the hole is located. The 3D coordinates of the edge of the hole to be located are then used to determine the location of the hole. The NARF algorithm is a 3D feature point detection and description algorithm that can extract 3D coordinate points at the edge of a 3D point cloud.
[0108] Because the hole to be located forms a cylindrical cavity, when extracting edge points, the coordinates of the edge points of the circle formed by the upper and lower surfaces of the cylindrical cavity can be extracted. Then, based on the extracted circle coordinates, the 3D coordinate point cloud of the hole to be located can be determined, thereby determining the location of the hole to be located.
[0109] In one embodiment, Figure 2 As shown, before executing step S160, the method further includes:
[0110] Step S200 : collecting test grating fringe images multiple times and projecting them onto a test flat plate to form a test reflection grating fringe image.
[0111] Among them, the positional relationship between the collection device and the test plate is different during multiple collections.
[0112] Step S210 , obtaining the three-dimensional coordinates of each feature point on the test plate and the phase value on the test reflection grating fringe image.
[0113] For example, the Zhang Zhengyou calibration method can be used to determine the corner points of the chessboard as feature points.
[0114] Specifically, by adjusting the orientation of the calibration object or the camera, images of the calibration object are captured in different orientations. Feature points (such as checkerboard corners) are extracted from the images, and the camera is subjected to distortion correction. The least squares method is used to determine the camera's distortion coefficients and the transformation matrix in this application.
[0115] Step S220 : determining the two-dimensional image coordinates of each feature point based on the three-dimensional coordinates of each feature point and the positional relationship between the acquisition device for the reflection grating fringe image and the test plate.
[0116] Specifically, step S220 includes:
[0117] The two-dimensional image coordinates of each feature point are determined by the following formula:
[0118]
[0119] Among them, X w is the coordinate on the X axis in the world coordinate system, Y w is the coordinate on the Y axis in the world coordinate system, Z w is the coordinate on the Z axis in the world coordinate system, R is a 3*3 rotation matrix, and t is a 3*1 translation vector. f is the distance between the acquisition device and the test plate, dX is the width of the pixel in the X-axis direction of the acquisition device (such as a camera), dY is the width of the pixel in the Y-axis direction of the acquisition device, u0 is the horizontal coordinate of the pixel origin, v0 is the vertical coordinate of the pixel origin, s is the scale factor, u is the horizontal coordinate of the pixel, and v is the vertical coordinate of the pixel.
[0120] Specifically, because the two-dimensional coordinate values corresponding to three-dimensional coordinate values are unique, using this formula, the two-dimensional coordinate values obtained from the three-dimensional coordinate values have a one-to-one correspondence with their corresponding three-dimensional coordinate values. However, the three-dimensional coordinate values obtained using this formula using two-dimensional coordinate values are not unique. Therefore, this formula can only be used to obtain two-dimensional coordinate values from three-dimensional coordinate values.
[0121] For example, the three-dimensional coordinates of two points projected on the test plane from the experimental grating fringe image are (1, 2, 3) and (2, 4, 5). The corresponding two-dimensional coordinates on the test plane are (2, 3) and (4, 5). When the phase value of the experimental grating fringe image is π / 2, the corresponding point is (2, 3), and when the phase value is 5π / 2, the corresponding point is (4, 5). That is, when the phase value of the experimental grating fringe image is π / 2, the two-dimensional image coordinates it will pass through are (2, 3). Therefore, the phase value and two-dimensional image coordinates corresponding to the three-dimensional coordinates (1, 2, 3) are π / 2 and (2, 3), respectively; the phase value and two-dimensional image coordinates corresponding to (2, 4, 5) are 5π / 2 and (4, 5), respectively.
[0122] Step S230 , based on the three-dimensional coordinates, two-dimensional image coordinates and phase values of each feature point on the test reflection grating fringe image, a least squares method is used to determine the conversion matrix between the three-dimensional coordinates and the two-dimensional image coordinates and phase values.
[0123] Specifically, step S230 includes:
[0124] Substitute the three-dimensional coordinates, two-dimensional image coordinates, and phase values of each feature point on the experimental reflection grating fringe image into the following formula to obtain the conversion matrix between the three-dimensional coordinates and the two-dimensional image coordinates and phase values:
[0125] W=C×Q
[0126] in, is the three-dimensional coordinate in the world coordinate system, X w is the coordinate on the X axis in the world coordinate system, Y w is the coordinate on the Y axis in the world coordinate system, Z w is the coordinate on the Z axis in the world coordinate system, C is the conversion matrix between the three-dimensional coordinates and the two-dimensional image coordinates and phase values, Q is the vector composed of the phase value of each feature point and the corresponding two-dimensional image coordinates, Q = [1, x, y, φ, ..., x n ,y n ,φ n ] T , φ is the phase value of the feature point, x is the horizontal coordinate corresponding to φ, y is the vertical coordinate corresponding to φ, and n is the preset value.
[0127] Specifically, multiple three-dimensional coordinate value matrices W and corresponding phase coordinate vectors Q are substituted into the above formula to obtain multiple transformation matrices C. Then, a more optimized transformation matrix C is determined based on the multiple transformation matrices C and the corresponding three-dimensional coordinate value matrices W and phase coordinate vectors Q using the least squares method.
[0128] For example, suppose that the three-dimensional coordinate matrix W and the two-dimensional coordinate matrix Q are represented by numbers. Suppose that three (W, Q) points satisfying the above relationship are obtained: (1, 6), (3, 5), and (5, 7).
[0129] Then 6=1*C, 5=2*C, 7=3*C.
[0130] Using the least squares method, L(C) = [6-C] 2 +[5-2C] 2 +[7-3C] 2 ;
[0131] Using the partial differential of L(C) with respect to C, and making L(C) the smallest, we can get
[0132] So C = 2.643. That is, the transformation matrix is obtained by the least squares method.
[0133] In this embodiment, before actually determining the three-dimensional coordinate set of the plate where the hole to be located is located, camera calibration is performed on the devices that project and capture the grating fringe images. By projecting a test grating fringe image multiple times and capturing a test reflected grating fringe image, the two-dimensional coordinates of multiple feature points are determined based on their three-dimensional coordinates. Then, based on the phase values of the grating fringe image as it passes through these feature points, the least squares method is used to determine the conversion matrix between the three-dimensional coordinates and the two-dimensional image coordinates and phase values, combining the three-dimensional and two-dimensional coordinates of these feature points. The conversion matrix obtained using the least squares method also has higher accuracy. Therefore, when the three-dimensional coordinate set is actually determined later, this calibrated conversion matrix can be directly used to convert between two-dimensional coordinates, phase values, and three-dimensional coordinates, thereby obtaining the three-dimensional coordinates of the hole to be located.
[0134] In one embodiment, after executing step S160, the method further includes:
[0135] Step S300 , performing low-pass filtering and denoising on the three-dimensional coordinate set of the plane where the positioning hole is located, so as to remove noise from the three-dimensional coordinate set.
[0136] Specifically, the three-dimensional coordinate point cloud is subjected to low-pass filtering and denoising to filter out residual points and error points, retaining the valid point cloud data. The valid point cloud data is then spliced and compressed to construct a Nurbs surface, which is then subjected to high-order smoothing to obtain the three-dimensional coordinate point cloud after noise removal.
[0137] Exemplarily, Geomagic Studio (automated reverse engineering) software is used to perform low-pass filtering and denoising on the three-dimensional coordinate set, filter out residual points and error points, delete redundant data, and retain only valid point cloud data.
[0138] In this embodiment, after obtaining the three-dimensional coordinate set of the plane where the hole to be located is located, it is also necessary to perform low-pass filtering and denoising to remove noise information to obtain a more accurate three-dimensional coordinate set and improve the accuracy of solving the PCB hole coordinates.
[0139] It should be understood that although Figure 1 and Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 and Figure 2 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The order of execution of these steps or stages is not necessarily one by one, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0140] In one embodiment, Figure 3 As shown, a PCB hole positioning device is provided, including: a projection acquisition module 901, a phase determination module 902, a phase unwrapping module 903, a three-dimensional coordinate determination module 904 and a PCB hole positioning module 905, wherein:
[0141] Projection and acquisition module 901 is configured to sequentially project four grating fringe images onto the plate where the hole to be positioned is located, and to acquire the reflected grating fringe images formed by each of the grating fringe images on the plate where the hole to be positioned is located. The four grating fringe images include a first grating fringe image, a second grating fringe image, a third grating fringe image, and a fourth grating fringe image, each of which is formed by superimposing differently modulated light on the same background light. The modulated light of the first grating fringe image and the third grating fringe image is of opposite magnitude, the modulated light of the second grating fringe image and the fourth grating fringe image is of opposite magnitude, and the phases of the modulated light of the third grating fringe image and the second grating fringe image are the sum and difference of two wrapped phases, respectively.
[0142] The phase determination module 902 is configured to determine two wrapped phases in the modulated light phases of the four reflected grating fringe images based on the four reflected grating fringe images.
[0143] The phase unwrapping module 903 is configured to unwrap two of the wrapped phases in the modulated light phases of the four reflected grating fringe images to obtain phase information of the plate where the hole to be positioned is located.
[0144] The three-dimensional coordinate determination module 904 is configured to determine a three-dimensional coordinate set of the plate where the hole to be located is located based on the phase information of the plate where the hole to be located is located and the correspondence between the three-dimensional coordinates and the phase.
[0145] The PCB hole positioning module 905 is used to filter out the three-dimensional coordinates of the edge points of the holes to be positioned from the three-dimensional coordinate set of the plate where the holes to be positioned are located, and determine the positions of the holes to be positioned.
[0146] In one embodiment, the phase unwrapping module 903 further includes: an equivalent phase determination unit and a phase unwrapping unit, wherein:
[0147] The equivalent phase determining unit determines the equivalent frequency and equivalent phase of two of the wrapped phases in the modulated light phases of the four reflected grating fringe images.
[0148] The phase unwrapping unit performs phase unwrapping on two of the wrapped phases in the modulated light phases of the four reflected grating fringe images based on the equivalent frequency and the equivalent phase to obtain phase information of the plate where the hole to be positioned is located.
[0149] For the specific definition of the PCB hole positioning device, please refer to the definition of the PCB hole positioning method above, which will not be repeated here. The various modules in the above-mentioned PCB hole positioning device can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0150] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and computer program in the non-volatile storage medium to run. The network interface of the computer device is used to communicate with an external terminal via a network connection. When executed by the processor, the computer program implements a method for loading cargo onto a truck.
[0151] Those skilled in the art will understand that Figure 4The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0152] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0153] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0154] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0155] Throughout this specification, references to terms such as "some embodiments," "other embodiments," and "desired embodiments" indicate that a particular feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. Although these terms are used interchangeably throughout this specification, they do not necessarily refer to the same embodiment or example.
[0156] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0157] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A PCB hole positioning method, characterized in that: The method comprises: Projecting four grating fringe images sequentially onto the plate where the hole to be positioned is located, and collecting reflected grating fringe images formed by each of the grating fringe images on the plate where the hole to be positioned is located; wherein the four grating fringe images include a first grating fringe image, a second grating fringe image, a third grating fringe image, and a fourth grating fringe image, which are formed by superimposing differently modulated lights on the same background light, the modulated lights of the first grating fringe image and the third grating fringe image are opposite in magnitude, the modulated lights of the second grating fringe image and the fourth grating fringe image are opposite in magnitude, and the phases of the modulated lights of the third grating fringe image and the second grating fringe image are the sum and difference of two wrapped phases, respectively; Determining two wrapped phases in the modulated light phases of the four reflected grating fringe images based on the four reflected grating fringe images; Unwrapping two of the wrapped phases in the modulated light phases of the four reflected grating fringe images to obtain phase information of the plate where the hole to be positioned is located; Determining a three-dimensional coordinate set of the plate where the hole to be located is located based on the phase information of the plate where the hole to be located is located and the correspondence between the three-dimensional coordinates and the phase; The three-dimensional coordinates of the edge points of the holes to be positioned are screened out from the three-dimensional coordinate set of the plate where the holes to be positioned are located, and the positions of the holes to be positioned are determined.
2. The method according to claim 1, characterized in that The light intensity formula of the four reflected grating fringe images is as follows: Among them, I1′(x,y), I2′(x,y), I3′(x,y), and I4′(x,y) are the light intensities of the four reflected grating fringe images, A′ is the intensity of the reflected background light, and B′ is the intensity of the reflected modulated light. and ψ(x,y) are the two wrapped phases in the modulated light phase of the reflected grating fringe image.
3. The method according to claim 1, characterized in that The unwrapping of two of the wrapped phases in the modulated light phases of the four reflected grating fringe images to obtain the phase information of the plate where the hole to be positioned is located comprises: Determining the equivalent frequency and equivalent phase of two of the wrapped phases in the modulated light phases of the four reflected grating fringe images; Based on the equivalent frequency and the equivalent phase, phase unwrapping is performed on two of the wrapped phases in the modulated light phases of the four reflected grating fringe images to obtain phase information of the plate where the hole to be positioned is located.
4. The method according to any one of claims 1 to 3, characterized in that Before determining the three-dimensional coordinate set of the plate where the hole to be located is located based on the phase information of the plate where the hole to be located is located and the correspondence between the three-dimensional coordinates and the phase, the method further includes: The test grating fringe images are collected multiple times and projected onto the test flat plate to form a test reflection grating fringe image; Obtaining the three-dimensional coordinates of each feature point on the test plate and the phase value on the test reflection grating fringe image; Determining the two-dimensional image coordinates of each of the feature points based on the three-dimensional coordinates of each of the feature points and the positional relationship between the acquisition device for the test reflection grating fringe image and the test plate; Based on the three-dimensional coordinates, two-dimensional image coordinates and phase values of each feature point on the test reflection grating fringe image, the least squares method is used to determine the conversion matrix between the three-dimensional coordinates and the two-dimensional image coordinates and the phase value.
5. The method according to claim 4, characterized in that The determining of the three-dimensional coordinate set of the plate where the hole to be located is located based on the phase information of the plate where the hole to be located is located and the correspondence between the three-dimensional coordinates and the phase includes: Determining a phase coordinate vector composed of the phase information and the two-dimensional image coordinates according to the phase information of the plate where the hole to be located is located and the two-dimensional image coordinates corresponding to the phase information; A three-dimensional coordinate matrix corresponding to the phase coordinate vector is determined according to the phase coordinate vector and the conversion matrix.
6. The method according to any one of claims 1 to 3, characterized in that The step of selecting the three-dimensional coordinates of the edge point from the three-dimensional coordinate set of the plate where the hole to be located is located and determining the position of the hole to be located comprises: Using the NARF algorithm, extracting the three-dimensional coordinates of the edge points of the hole to be positioned from the three-dimensional coordinate set of the plate where the hole to be positioned is located; The position of the hole to be positioned is determined according to the three-dimensional coordinate set of the edge points of the hole to be positioned.
7. The method according to any one of claims 1 to 3, characterized in that After determining the three-dimensional coordinate set of the plate where the hole to be located is located based on the phase information of the plate where the hole to be located is located and the correspondence between the three-dimensional coordinates and the phase, the method further includes: Low-pass filtering is performed on the three-dimensional coordinate set to remove noise from the three-dimensional coordinate set.
8. A PCB hole positioning device, characterized in that: The device comprises: a projection acquisition module, configured to sequentially project four grating fringe images onto a plate where the hole to be positioned is located, and to acquire reflected grating fringe images formed by each of the grating fringe images on the plate where the hole to be positioned is located; wherein the four grating fringe images include a first grating fringe image, a second grating fringe image, a third grating fringe image, and a fourth grating fringe image, each of which has differently modulated light superimposed on the same background light, the modulated light of the first grating fringe image and the third grating fringe image being opposite in magnitude, the modulated light of the second grating fringe image and the fourth grating fringe image being opposite in magnitude, and the modulated light phases of the third grating fringe image and the second grating fringe image being the sum and difference of two wrapped phases, respectively; and a phase determination module, configured to determine, based on the four reflected grating fringe images, two wrapped phases among the modulated light phases of the four reflected grating fringe images; a phase unwrapping module, configured to unwrap two of the wrapped phases in the modulated light phases of the four reflected grating fringe images to obtain phase information of the plate where the hole to be positioned is located; a three-dimensional coordinate determination module, configured to determine a three-dimensional coordinate set of the plate where the hole to be located is located based on the phase information of the plate where the hole to be located is located and a correspondence between the three-dimensional coordinates and the phase; The PCB hole positioning module is used to filter out the three-dimensional coordinates of the edge points of the holes to be positioned from the three-dimensional coordinate set of the plate where the holes to be positioned are located, and determine the positions of the holes to be positioned.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Three-dimensional topography central perturbation composite grating projection measuring method and device
CN102589479A
Linear light source grating projection three-dimensional measurement system and method based on phase shift method
CN110672037A