Optical Measurement Method for Printed Circuit Boards
By using optical measurement methods in printed circuit board measurement, the images are segmented and processed to obtain the edges and thickness of the solder pads, the problems of insufficient measurement precision and complex system in the prior art are solved, and a high-precision and low-complexity measurement method is realized.
Patent Information
- Application Number
- CN202111091300.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-16
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2041-09-16
AI Technical Summary
The prior art requires multiple shots and pictures to be taken when measuring printed circuit boards, which increases the complexity of the system and makes it difficult to achieve the precision of taking one complete image at a time.
The optical measurement method performed by the processor is used to capture images of the printed circuit board, segment images according to the etch pattern, accumulate and differential pixel brightness values to obtain edge coordinates of the solder pads, and calculate the thickness of the solder pads by structured light projection, and compare the sample images to correct pattern offset.
It realizes printed circuit board images that can achieve measurement precision without connecting to pictures, simplifies system control, reduces material costs, and improves measurement accuracy.
Smart Images

Figure CN113870201B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of precision measurement of printed circuit boards, and particularly to an optical measurement method for printed circuit boards. Background Art
[0002] Current measurement devices all use optical systems with small angles to obtain sufficient resolution. Therefore, if a printed circuit board is to be measured, it usually needs to be photographed several times and then the images are stitched together one by one to form a complete printed circuit board image. However, because it involves the displacement of the mechanism and image stitching, precise mechanism positioning and software image stitching program judgment are required, which increases the complexity of the system. If a complete printed circuit board image is to be taken at one time, there will be a situation of insufficient precision. Therefore, it becomes very important to provide a printed circuit board measurement method that can achieve measurement precision without image stitching. Summary of the Invention
[0003] The object of the present invention is to provide an optical measurement method for printed circuit boards to achieve the purpose of a printed circuit board that can achieve measurement precision without image stitching.
[0004] To achieve the above object, the present invention discloses an optical measurement method for printed circuit boards, which is executed by a processor. The optical measurement method includes capturing a first test image of the printed circuit board; dividing the first test image according to a plurality of etched patterns on the printed circuit board to form a plurality of test sub-images, wherein each test sub-image includes a sub-etched pattern, and the sub-etched pattern includes a plurality of pads and wires respectively located between each pad to connect each pad; accumulating the pixel brightness values of each pixel in the short side direction of each test sub-image to obtain a plurality of first total pixel brightness values; differentiating the first total pixel brightness values to obtain the horizontal axis pixel coordinates of the upper and lower edges of each pad; dividing each test sub-image according to the number of pads to form a plurality of first pad images; accumulating the pixel brightness values of each pixel in the long side direction of each first pad image to obtain a plurality of second total pixel brightness values; and differentiating the second total pixel brightness values to obtain the vertical axis pixel coordinates of the left and right edges of each pad.
[0005] Preferably, the above optical measurement method further includes: comparing the first test image of the printed circuit board with the sample image of the sample circuit board to correct the coordinate offset, rotation offset angle and pattern scaling ratio of the etched pattern.
[0006] Preferably, the step of comparing the first image to be measured of the printed circuit board with the sample image of the sample circuit board to correct the coordinate offset, rotation offset angle, and pattern scaling ratio of the etching pattern further includes: capturing the diagonal pixel coordinates of the etching pattern in the first image to be measured and the diagonal pixel coordinates of the etching pattern in the sample image to calculate the coordinate offset, rotation offset angle, and pattern scaling ratio of the etching pattern in the first image to be measured; and correcting the coordinate offset, rotation offset angle, and pattern scaling ratio of the etching pattern in the first image to be measured.
[0007] Preferably, the above optical measurement method further includes: capturing a second image to be measured of the printed circuit board projected by structured light at a projection angle, wherein the structured light is projected on each pad; dividing the second image to be measured according to the number of pads to form a plurality of second pad images; dividing each second pad image according to the vertical pixel coordinates of the left edge and the right edge of each pad to form a left sub-image, a pad sub-image, and a right sub-image; respectively accumulating the pixel brightness values of each pixel of the left sub-image, the pad sub-image, and the right sub-image of each second pad image in the short side direction of the sub-image to be measured to obtain a left total pixel brightness value, a pad total pixel brightness value, and a right total pixel brightness value; respectively differentiating the left total pixel brightness value, the pad total pixel brightness value, and the right total pixel brightness value to obtain the horizontal axis pixel coordinates of the upper edge and the lower edge of the structured light projected on the left sub-image, the pad sub-image, and the right sub-image; averaging the horizontal axis pixel coordinates of the upper edge and the lower edge of the structured light projected on the left sub-image and the right sub-image to obtain a first average pixel coordinate; averaging the horizontal axis pixel coordinates of the upper edge and the lower edge of the structured light projected on the pad sub-image to obtain a second average pixel coordinate; and calculating the thickness of each pad according to the difference between the first average pixel coordinate and the second average pixel coordinate and the projection angle of the structured light.
[0008] Preferably, the step of differentiating the first total pixel brightness value to obtain the horizontal axis pixel coordinates of the upper edge and the lower edge of each pad further includes: calculating a plurality of slope values after differentiating the first total pixel brightness value; selecting a maximum slope value and a minimum slope value among the slope values; and respectively selecting the horizontal axis pixel coordinates corresponding to the maximum slope value and the horizontal axis pixel coordinates corresponding to the minimum slope value as the horizontal axis pixel coordinates of the upper edge and the lower edge of each pad.
[0009] Preferably, the step of differentiating the second total pixel brightness value to obtain the vertical axis pixel coordinates of the left edge and the right edge of each pad further includes: calculating a plurality of slope values after differentiating the second total pixel brightness value; selecting a maximum slope value and a minimum slope value among the slope values; and respectively selecting the vertical axis pixel coordinates corresponding to the maximum slope value and the vertical axis pixel coordinates corresponding to the minimum slope value as the vertical axis pixel coordinates of the left edge and the right edge of each pad.
[0010] Preferably, the steps of respectively differentiating the left total pixel brightness value, the pad total pixel brightness value, and the right total pixel brightness value to obtain the horizontal-axis pixel coordinates of the upper and lower edges of the structured light projected onto the left sub-image, the pad sub-image, and the right sub-image further include: respectively calculating a plurality of slope values after differentiating the left total pixel brightness value, the pad total pixel brightness value, and the right total pixel brightness value; respectively selecting a maximum slope value and a minimum slope value among the slope values; and respectively selecting the horizontal-axis pixel coordinates corresponding to the maximum slope value and the horizontal-axis pixel coordinates corresponding to the minimum slope value as the horizontal-axis pixel coordinates of the upper and lower edges of the structured light projected onto the left sub-image, the pad sub-image, and the right sub-image.
[0011] The present invention also discloses another optical measurement method for a printed circuit board, which is executed by a processor. The optical measurement method includes: capturing a first test image of the printed circuit board; dividing the first test image into a plurality of first pad images according to the number of pads in a plurality of etching patterns on the printed circuit board, where each etching pattern includes a plurality of pads and a wire located between the pads to connect the pads; accumulating the pixel brightness values of each pixel of each first pad image in the short-side direction of each etching pattern to obtain a plurality of first total pixel brightness values; differentiating the first total pixel brightness values to obtain the horizontal-axis pixel coordinates of the upper and lower edges of each pad; accumulating the pixel brightness values of each pixel of each first pad image in the long-side direction of each etching pattern to obtain a plurality of second total pixel brightness values; and differentiating the second total pixel brightness values to obtain the vertical-axis pixel coordinates of the left and right edges of each pad.
[0012] Preferably, the above optical measurement method further includes: comparing the first test image of the printed circuit board with a sample image of a sample circuit board to correct the coordinate offset, rotation offset angle, and pattern scaling ratio of the etching pattern.
[0013] Preferably, the steps of comparing the first test image of the printed circuit board with the sample image of the sample circuit board to correct the coordinate offset, rotation offset angle, and pattern scaling ratio of the etching pattern further include: capturing the diagonal pixel coordinates of the etching pattern in the first test image and the diagonal pixel coordinates of the etching pattern in the sample image to calculate the coordinate offset, rotation offset angle, and pattern scaling ratio of the etching pattern in the first test image; and correcting the coordinate offset, rotation offset angle, and pattern scaling ratio of the etching pattern in the first test image.
[0014] Preferably, the above optical measurement method further includes: capturing a second image to be measured projected onto the printed circuit board by structured light at a projection angle, where the structured light is projected onto each pad; dividing the second image to be measured into a plurality of second pad images according to the number of pads; dividing each second pad image according to the vertical pixel coordinates of the left and right edges of each pad to form a left sub-image, a pad sub-image, and a right sub-image; respectively accumulating the pixel brightness values of each pixel of the left sub-image, the pad sub-image, and the right sub-image of each second pad image in the short side direction of each etching pattern to obtain a left total pixel brightness value, a pad total pixel brightness value, and a right total pixel brightness value; respectively differentiating the left total pixel brightness value, the pad total pixel brightness value, and the right total pixel brightness value to obtain the horizontal axis pixel coordinates of the upper and lower edges of the structured light projected onto the left sub-image, the pad sub-image, and the right sub-image; averaging the horizontal axis pixel coordinates of the upper and lower edges of the structured light projected onto the left sub-image and the right sub-image to obtain a first average pixel coordinate; averaging the horizontal axis pixel coordinates of the upper and lower edges of the structured light projected onto the pad sub-image to obtain a second average pixel coordinate; and calculating the thickness of each pad according to the difference between the first average pixel coordinate and the second average pixel coordinate and the projection angle of the structured light.
[0015] Preferably, the step of differentiating the first total pixel brightness value to obtain the horizontal axis pixel coordinates of the upper and lower edges of each pad further includes: calculating a plurality of slope values after differentiating the first total pixel brightness value; selecting a maximum slope value and a minimum slope value among the slope values; and respectively selecting the horizontal axis pixel coordinates corresponding to the maximum slope value and the horizontal axis pixel coordinates corresponding to the minimum slope value as the horizontal axis pixel coordinates of the upper and lower edges of each pad.
[0016] Preferably, the step of differentiating the second total pixel brightness value to obtain the vertical axis pixel coordinates of the left and right edges of each pad further includes: calculating a plurality of slope values after differentiating the second total pixel brightness value; selecting a maximum slope value and a minimum slope value among the slope values; and respectively selecting the vertical axis pixel coordinates corresponding to the maximum slope value and the vertical axis pixel coordinates corresponding to the minimum slope value as the vertical axis pixel coordinates of the left and right edges of each pad.
[0017] Preferably, the step of respectively differentiating the left total pixel brightness value, the pad total pixel brightness value, and the right total pixel brightness value to obtain the horizontal axis pixel coordinates of the upper and lower edges of the structured light projected onto the left sub-image, the pad sub-image, and the right sub-image further includes: respectively calculating a plurality of slope values after differentiating the left total pixel brightness value, the pad total pixel brightness value, and the right total pixel brightness value; respectively selecting a maximum slope value and a minimum slope value among the slope values; and respectively selecting the horizontal axis pixel coordinates corresponding to the maximum slope value and the horizontal axis pixel coordinates corresponding to the minimum slope value as the horizontal axis pixel coordinates of the upper and lower edges of the structured light projected onto the left sub-image, the pad sub-image, and the right sub-image.
[0018] Compared with the prior art, due to the adoption of the image characteristics of the printed circuit board and the correction of the optical lens in the present invention, the accuracy of obtaining a complete image of a single printed circuit board meets the requirements. At the same time, there is no need to consider complex controls such as multiple movements, positioning, image acquisition, and image splicing, which simplifies the system and makes maintenance relatively easy. Meanwhile, the material cost is also reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a system block diagram of the optical measurement method for a printed circuit board provided by the first embodiment of the present invention;
[0020] Figure 2 It is the first - part flowchart of the optical measurement method for a printed circuit board provided by the second embodiment of the present invention;
[0021] Figure 3 It is the first sub - flowchart of the optical measurement method for a printed circuit board provided by the second embodiment of the present invention;
[0022] Figure 4 It is Figure 3 a schematic diagram of comparing the image to be measured;
[0023] Figure 5 It is Figure 2 a schematic diagram of segmenting the image to be measured;
[0024] Figure 6 It is Figure 2 a schematic diagram of accumulating the pixel brightness values of the sub - images to be measured;
[0025] Figure 7 It is the second sub - flowchart of the optical measurement method for a printed circuit board provided by the second embodiment of the present invention;
[0026] Figure 8 It is Figure 7 a schematic diagram of differentiating the pixel brightness values;
[0027] Figure 9 It is Figure 2 a schematic diagram of segmenting the sub - images to be measured;
[0028] Figure 10 It is Figure 2 a schematic diagram of accumulating the pixel brightness values of the pad images;
[0029] Figure 11 It is the third sub - flowchart of the optical measurement method for a printed circuit board provided by the second embodiment of the present invention;
[0030] Figure 12 It is Figure 10 a schematic diagram of differentiating the pixel brightness values;
[0031] Figure 13 The second part of the flowchart of the optical measurement method for a printed circuit board provided by the second embodiment of the present invention;
[0032] Figure 14 is Figure 13 A schematic diagram of the structured light projected onto the printed circuit board;
[0033] Figure 15 is Figure 13 A schematic diagram of the segmented image to be measured;
[0034] Figure 16 is Figure 13 A schematic diagram of the segmented pad image;
[0035] Figure 17 is Figure 13 A schematic diagram of accumulating the pixel brightness values of the left sub-image, the pad sub-image, and the right sub-image;
[0036] Figure 18 The fourth sub-flowchart of the optical measurement method for a printed circuit board provided by the second embodiment of the present invention;
[0037] Figure 19 A schematic diagram of calculating the pad thickness provided by the second embodiment of the present invention;
[0038] Figure 20 The first part of the flowchart of the optical measurement method for a printed circuit board provided by the third embodiment of the present invention; and
[0039] Figure 21 The second part of the flowchart of the optical measurement method for a printed circuit board provided by the third embodiment of the present invention.
[0040]
Symbol Explanation
[0041] 1. Optical measurement system
[0042] 2. Processor
[0043] 3. Storage device
[0044] 4. Camera
[0045] 5. Structured light device
[0046] 6. Printed circuit board
[0047] 7. Sample circuit board
[0048] 61. First image to be measured
[0049] 62. Etching pattern
[0050] 63. Pad
[0051] 64. Conductor
[0052] 71. Sample Image
[0053] 72. Etching Pattern
[0054] 81. Second Image to be Measured
[0055] 91. First Average Pixel Coordinate
[0056] 92. Second Average Pixel Coordinate
[0057] 611. Sub - image to be Measured
[0058] 612. First Pad Image
[0059] 621. Sub - etching Pattern
[0060] 631. Upper Edge
[0061] 632. Lower Edge
[0062] 633. Left Edge
[0063] 634. Right Edge
[0064] 812. Second Pad Image
[0065] 813. Left Sub - image
[0066] 814. Pad Sub - image
[0067] 815. Right Sub - image
[0068] 823. Total Pixel Luminance Value of Left
[0069] 824. Total Pixel Luminance Value of Pad
[0070] 825. Total Pixel Luminance Value of Right
[0071] 831. Upper Edge
[0072] 832. Lower Edge
[0073] θ. Projection Angle
[0074] D. Difference
[0075] H. Short - side Direction
[0076] T. Thickness
[0077] V. Long - side Direction Detailed Implementation Manner
[0078] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only for explaining the present invention and not for limiting the present invention. In addition, it should be noted that for the convenience of description, only the parts related to the present invention rather than all the structures are shown in the drawings.
[0079] Please refer to Figure 1 As shown, it is a system block diagram of an optical measurement method for a printed circuit board provided by the first embodiment of the present invention. The optical measurement method for the printed circuit board can be executed by an optical measurement system 1, which includes a processor 2, a storage device 3, a camera 4, and a structured light device 5 (including an infrared transmitter and an infrared receiver), wherein the processor 2 is connected to the storage device 3, the camera 4, and the structured light device 5. Specifically, the instructions for the optical measurement method of the printed circuit board are stored in the storage device 3, and the processor 2 reads the instructions to execute the optical measurement method of the printed circuit board.
[0080] Please refer to Figure 2 As shown, it is the first part of the flowchart of the optical measurement method for a printed circuit board provided by the second embodiment of the present invention. The steps for the processor 2 to execute the optical measurement method for the printed circuit board include the following: S1: Capture a first test image of the printed circuit board; S3: Compare the first test image of the printed circuit board with the sample image of the sample circuit board to correct the coordinate offset, rotation offset angle, and pattern scaling ratio of multiple etching patterns; S5: Segment the first test image based on multiple etching patterns on the printed circuit board to form multiple test sub-images, where each test sub-image includes a sub-etching pattern, and the sub-etching pattern includes multiple pads and a wire located between the pads to connect the pads; S7: Accumulate the pixel brightness values of each pixel of each test sub-image in the short side direction of the test sub-image to obtain multiple first total pixel brightness values; S9: Differentiate the first total pixel brightness values to obtain the horizontal axis pixel coordinates of an upper edge and a lower edge of each pad; S11: Segment each test sub-image based on the number of pads to form multiple first pad images; S13: Accumulate the pixel brightness values of each pixel of each first pad image in the long side direction of the test sub-image to obtain multiple second total pixel brightness values; and S15: Differentiate the second total pixel brightness values to obtain the vertical axis pixel coordinates of a left edge and a right edge of each pad.
[0081] In step S1, the processor 2 captures the first test image 61 of the printed circuit board 6 through the camera 4, where the first test image 61 is composed of multiple pixels, and each pixel has a pixel coordinate.
[0082] Please refer to Figure 3As shown, step S3 further includes the following steps: S311: Extract the diagonal pixel coordinates (x1’, y1’), (x2’, y2’), (x3’, y3’), (x4’, y4’) of multiple etching patterns 62 in the first image to be measured 61 of the printed circuit board and the diagonal pixel coordinates (x1, y1), (x2, y2), (x3, y3), (x4, y4) of multiple etching patterns 72 in the sample image 71 to calculate the coordinate offset, rotation offset angle, and pattern scaling ratio of the etching pattern 62 in the first image to be measured 61 of the printed circuit board; and S313: Correct the coordinate offset, rotation offset angle, and pattern scaling ratio of the etching pattern 62 in the first image to be measured 61 of the printed circuit board. Specifically, the sample circuit board 7 and its sample image 71 are a public version before production and testing. By comparing the sample image 71 of the sample circuit board 7, the first image to be measured 61 of the printed circuit board 6 can be corrected so that the error is within the allowable error value, which is beneficial for production and testing. First, as Figure 4 As shown, step S311 is to compare the pixel coordinates of two pairs of diagonals of the etching pattern 62 in the first image to be measured 61 of the printed circuit board 6 with the pixel coordinates of two pairs of diagonals of the etching pattern 72 in the sample image 71 of the sample circuit board 7 to find the differences in the pixel coordinates of the respective positions, the distances and offsets of the diagonal pixel coordinates, and then calculate the coordinate offset, rotation offset angle, and pattern scaling ratio of the etching pattern 62 in the first image to be measured 61 relative to the etching pattern 72 in the sample image 71. Next, step S313 is to correct the coordinate offset, rotation offset angle, and pattern scaling ratio of the etching pattern 62 in the first image to be measured 61 so that the offset error, angle error, and scaling ratio error are within the allowable error value. In addition, it should be noted that those skilled in the art can set the allowable error value according to actual needs, and the present invention is not limited thereto.
[0083] In step S5, the processor 2 divides the image to be measured 61 according to the etching pattern 61 on the printed circuit board 6 to form a plurality of sub-images to be measured 611, where each sub-image to be measured 611 includes a sub-etching pattern 621, and the sub-etching pattern 621 includes a plurality of pads 63 and a wire 64 located between the pads 63 to connect the pads 63, as Figure 5 shown.
[0084] In step S7, the processor 2 accumulates the pixel brightness values of each pixel in the short side direction H of each sub-image to be measured 611 to obtain a plurality of first total pixel brightness values, as Figure 6 shown.
[0085] Please refer to Figure 7 As shown, step S9 further includes the following steps: S91: Calculate a plurality of slope values after differentiating the plurality of first total pixel brightness values; as Figure 8As shown. S93: Select a maximum slope value and a minimum slope value from multiple slope values, and S95: Select the horizontal axis pixel coordinates corresponding to the maximum slope value and the horizontal axis pixel coordinates corresponding to the minimum slope value respectively as the horizontal axis pixel coordinates of the upper edge 631 and the lower edge 632 of each pad 63. First, step S91 is to calculate the difference between the first total pixel brightness value of the latter pixel coordinate and the first total pixel brightness value of the former pixel coordinate, that is, the slope value. Then, step S93 is to find the maximum difference and the minimum difference respectively in sequence. Finally, step S95 is to find the horizontal axis pixel coordinates corresponding to each two adjacent maximum differences and minimum differences as the horizontal axis pixel coordinates of the upper edge 631 and the lower edge 632 of each pad 63, that is, the horizontal axis pixel coordinates of the upper boundary and the lower boundary of each pad 63.
[0086] In step S11, the processor 2 divides each sub-image 611 to be measured according to the number of pads 63 to become a plurality of first pad images 612, as Figure 9 shown. Among them Figure 9 only one first pad image 612 is taken as an example, and the other first pad images 612 are similar.
[0087] In step S13, the processor 2 accumulates the pixel brightness values of each pixel of each first pad image 612 in the long side direction V of each sub-image 611 to be measured to obtain a plurality of second total pixel brightness values, as Figure 10 shown. Among them Figure 10 only the accumulation Figure 9 of the pixel brightness values of each pixel of the first pad image 612 is taken as an example, and the accumulation of the pixel brightness values of each pixel of the other first pad images 612 is similar.
[0088] Please refer to Figure 11 shown, step S15 further includes the following steps: S151: Calculate a plurality of slope values after differentiating a plurality of second total pixel brightness values; S153: Select a maximum slope value and a minimum slope value from the plurality of slope values, as Figure 12 shown; and S155: Select the vertical axis pixel coordinates corresponding to the maximum slope value and the vertical axis pixel coordinates corresponding to the minimum slope value respectively as the vertical axis pixel coordinates of the left edge 633 and the right edge 634 of each pad 63. First, step S151 is to calculate the difference between the second total pixel brightness value of the latter pixel coordinate and the second total pixel brightness value of the former pixel coordinate, that is, the slope value, as Figure 12 shown. Then, step S153 is to find the maximum difference and the minimum difference respectively in sequence. Finally, step S155 is to find the vertical axis pixel coordinates corresponding to each two adjacent maximum differences and minimum differences as the vertical axis pixel coordinates of the left edge 633 and the right edge 634 of each pad 63, that is, the vertical axis pixel coordinates of the left boundary and the right boundary of each pad 63.
[0089] Please refer to Figure 13 shown in the following figure, which is the second part of the flowchart of the optical measurement method of the printed circuit board provided by the second embodiment of the present invention. The steps for the processor 2 to execute the optical measurement method of the printed circuit board further include the following: S17: Capture a second image to be measured projected onto the printed circuit board at a projection angle by a structured light, where the structured light is projected onto each pad; S19: Divide the second image to be measured into multiple second pad images according to the number of pads; S21: Divide each second pad image according to the vertical pixel coordinates of the left edge and the right edge of each pad to form a left sub-image, a pad sub-image, and a right sub-image; S23: Accumulate the pixel brightness values of each pixel of the left sub-image, the pad sub-image, and the right sub-image of each second pad image in the short side direction of each sub-image to be measured to obtain a left total pixel brightness value, a pad total pixel brightness value, and a right total pixel brightness value; S25: Differentiate the left total pixel brightness value, the pad total pixel brightness value, and the right total pixel brightness value respectively to obtain the horizontal pixel coordinates of an upper edge and a lower edge of the structured light projected onto the left sub-image, the pad sub-image, and the right sub-image; S27: Average the horizontal pixel coordinates of the upper edge and the lower edge of the structured light projected onto the left sub-image and the right sub-image to obtain a first average pixel coordinate; S29: Average the horizontal pixel coordinates of the upper edge and the lower edge of the structured light projected onto the pad sub-image to obtain a second average pixel coordinate; and S31: Calculate the thickness of each pad according to the difference between the first average pixel coordinate and the second average pixel coordinate and the projection angle of the structured light.
[0090] In step S17, the processor 2 emits a structured light through the structured light device 5 and projects it onto the printed circuit board 6 at a projection angle θ to form a second image to be measured 81, or captures the second image to be measured 81 of the printed circuit board 6 through the camera 4, as Figure 14 shown. And the structured light is projected onto each pad 63. In addition, the second image to be measured 81 is composed of multiple pixels, and each pixel has a pixel coordinate
[0091] In step S19, the processor 2 divides the second image to be measured 81 into multiple second pad images 812 according to the number of pads 63, as Figure 15 shown. Wherein Figure 15 only one second pad image 812 is taken as an example, and the other second pad images 812 are similar.
[0092] In step S21, the processor 2 divides each second pad image 812 according to the vertical pixel coordinates of the left edge 633 and the right edge 634 of each pad 63 to form a left sub-image 813, a pad sub-image 814, and a right sub-image 815, as Figure 16 shown. Wherein Figure 16 only the division Figure 15As an example of the second pad image 812, the segmentation of the remaining second pad images 812 is similar.
[0093] In step S23, the processor 2 accumulates the pixel brightness values of each pixel of the left sub-image 813, the pad sub-image 814, and the right sub-image 815 of each second pad image 812 in the short side direction H of each sub-image 611 to be measured to obtain a left total pixel brightness value 823, a pad total pixel brightness value 824, and a right total pixel brightness value 825, as Figure 17 shown. Among them Figure 17 only taking the accumulation of Figure 16 the pixel brightness values of each pixel of the left sub-image 813, the pad sub-image 814, and the right sub-image 815 of the second pad image 812 as an example, the accumulation of the pixel brightness values of each pixel of the left sub-image 813, the pad sub-image 814, and the right sub-image 815 of the remaining second pad images 812 is similar.
[0094] Please refer to Figure 18 shown, step S25 further includes the following steps: S251: Calculate the multiple slope values after differentiating the left total pixel brightness value 823, the pad total pixel brightness value 824, and the right total pixel brightness value 825 respectively; S253: Select a maximum slope value and a minimum slope value from the multiple slope values respectively; and S255: Select the horizontal axis pixel coordinates corresponding to the maximum slope value and the horizontal axis pixel coordinates corresponding to the minimum slope value as the horizontal axis pixel coordinates of the upper edge and the lower edge of the structured light projected onto the left sub-image, the pad sub-image, and the right sub-image. First, step S251 is to calculate the difference between the second total pixel brightness value of the subsequent pixel coordinate and the second total pixel brightness value of the previous pixel coordinate on the left sub-image 813, the pad sub-image 814, and the right sub-image 815 respectively, that is, the slope value. Then, step S253 is to sequentially find the maximum difference and the minimum difference on the left sub-image 813, the pad sub-image 814, and the right sub-image 815 respectively. Finally, step S255 is to find the horizontal axis pixel coordinates corresponding to the maximum difference and the minimum difference as the horizontal axis pixel coordinates of the upper edge 831 and the lower edge 832 of the structured light projected onto the left sub-image 813, the pad sub-image 814, and the right sub-image 815, that is, the horizontal axis pixel coordinates of the upper boundary and the lower boundary of the structured light projected onto the left sub-image 813, the pad sub-image 814, and the right sub-image 815.
[0095] In step S27, after the processor 2 calculates the horizontal axis pixel coordinates of the upper edge 831 and the lower edge 832 of the structured light projected onto the left sub-image 813 and the horizontal axis pixel coordinates of the upper edge 831 and the lower edge 832 of the structured light projected onto the right sub-image 815 respectively, the processor 2 averages the horizontal axis pixel coordinates of the upper edge 831 and the lower edge 832 of the structured light projected onto the left sub-image 813 and the horizontal axis pixel coordinates of the upper edge 831 and the lower edge 832 of the structured light projected onto the right sub-image 815 to obtain a first average pixel coordinate 91.
[0096] In step S29, after the processor 2 calculates the horizontal axis pixel coordinates of the upper edge 831 and the lower edge 832 of the structured light projected onto the solder pad sub-image 814, the processor 2 averages the horizontal axis pixel coordinates of the upper edge 831 and the lower edge 832 of the structured light projected onto the solder pad sub-image 814 to obtain a second average pixel coordinate 92.
[0097] In step S31, the processor 2 calculates the thickness T of each solder pad 63 according to the difference D between the first average pixel coordinate 91 and the second average pixel coordinate 92 and the projection angle θ of the structured light, and uses the tangent theorem tanθ in trigonometric functions, as Figure 19 shown. Additionally, please refer to Figure 20 and 21As shown, the steps and sequence of the optical measurement method of the printed circuit board provided by the third embodiment of the present invention are substantially the same as those of the optical measurement method of the printed circuit board provided by the second embodiment, and the difference from the steps of the optical measurement method of the printed circuit board of the second embodiment lies in that: step S5’ (dividing the first image to be measured into a plurality of first pad images according to the number of pads in a plurality of etching patterns on the printed circuit board, where each etching pattern includes a plurality of pads and a wire located between the pads to connect the pads) replaces steps S5 and S11 in the second embodiment, step S7’ (accumulating the pixel brightness values of each pixel of each first pad image in a short side direction of each etching pattern to obtain a plurality of first total pixel brightness values) replaces step S7 in the second embodiment, step S13’ (accumulating the pixel brightness values of each pixel of each first pad image in a long side direction of each etching pattern to obtain a plurality of second total pixel brightness values) replaces step S13 in the second embodiment, and step S23’ (accumulating the pixel brightness values of each pixel of the left sub-image, the pad sub-image, and the right sub-image of each second pad image in the short side direction of each etching pattern to obtain a left total pixel brightness value, a pad total pixel brightness value, and a right total pixel brightness value) replaces step S23 in the second embodiment. Specifically, the optical measurement method of the printed circuit board in the second embodiment first divides the first image to be measured into a plurality of sub-images to be measured according to the etching pattern, and then divides each sub-image to be measured into a plurality of first pad images according to the number of pads, while the optical measurement method of the printed circuit board in the third embodiment directly divides the first image to be measured into a plurality of first pad images according to the number of pads in the etching pattern. In addition, functions such as capturing, comparing, dividing, accumulating, differentiating, etc. mentioned in the optical measurement method of the printed circuit board provided by the third embodiment of the present invention are similar or the same as those in the optical measurement method of the printed circuit board provided by the second embodiment of the present invention, so they will not be elaborated here.
[0098] In summary, through the optical measurement method of the printed circuit board provided by the present invention, a measurement method of the printed circuit board that can achieve the measurement precision without splicing images, it is possible to measure the boundary and coordinates of each pad in the printed circuit board and the distance between the pads, so that the accuracy of taking only one complete printed circuit board image at a time meets the requirements. At the same time, there is no need to consider complex controls such as multiple movements, positioning, imaging, and splicing, which makes the system simpler and easier to maintain, and also reduces the material cost.
[0099] Although the present invention has been disclosed as above with embodiments, it is not intended to limit the present invention. Those with ordinary knowledge in the technical field to which the present invention pertains can make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to that defined by the appended patent application scope.
[0100] Note that the above are only the preferred embodiments of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein. Various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments only. Without departing from the concept of the present invention, more other equivalent embodiments can be included, and the scope of the invention is determined by the scope of the appended claims.
Claims
1. An optical measurement method for a printed circuit board, executed by a processor, characterized in that, Including: Capturing a first image to be measured of the printed circuit board; Dividing the first image to be measured according to a plurality of etching patterns on the printed circuit board to form a plurality of sub-images to be measured, wherein each sub-image to be measured includes a sub-etching pattern, and the sub-etching pattern includes a plurality of pads and a wire located between the pads to connect the pads; Accumulating the pixel brightness values of each pixel of each sub-image to be measured in a short side direction of the sub-image to be measured to obtain a plurality of first total pixel brightness values; Differentiating the first total pixel brightness values to obtain the horizontal axis pixel coordinates of an upper edge and a lower edge of each pad; Dividing each sub-image to be measured according to the number of pads to form a plurality of first pad images; Accumulating the pixel brightness values of each pixel of each first pad image in a long side direction of the sub-image to be measured to obtain a plurality of second total pixel brightness values; And Differentiating the second total pixel brightness values to obtain the vertical axis pixel coordinates of a left edge and a right edge of each pad.
2. The optical measurement method according to claim 1, characterized in that, Further including: Comparing the first image to be measured of the printed circuit board with a sample image of a sample circuit board to correct a coordinate offset, a rotation offset angle, and a pattern scaling ratio of the etching pattern.
3. The optical measurement method according to claim 2, characterized in that, The step of comparing the first image to be measured of the printed circuit board with the sample image of the sample circuit board to correct the coordinate offset, the rotation offset angle, and the pattern scaling ratio of the etching pattern further includes: Capturing the diagonal pixel coordinates of the etching pattern in the first image to be measured and the diagonal pixel coordinates of the etching pattern in the sample image to calculate the coordinate offset, the rotation offset angle, and the pattern scaling ratio of the etching pattern in the first image to be measured; and Correcting the coordinate offset, the rotation offset angle, and the pattern scaling ratio of the etching pattern in the first image to be measured.
4. The optical measurement method according to claim 1, characterized in that, Further including: Capturing a second image to be measured projected onto the printed circuit board by a structured light at a projection angle, wherein the structured light is projected onto each pad; Dividing the second image to be measured according to the number of pads to form a plurality of second pad images; Dividing each second pad image according to the vertical axis pixel coordinates of the left edge and the right edge of each pad to form a left sub-image, a pad sub-image, and a right sub-image; Accumulating the pixel brightness values of each pixel of the left sub-image, the pad sub-image, and the right sub-image of each second pad image in the short side direction of the sub-image to be measured to obtain a left total pixel brightness value, a pad total pixel brightness value, and a right total pixel brightness value; Differentiating the left total pixel brightness value, the pad total pixel brightness value, and the right total pixel brightness value respectively to obtain the horizontal axis pixel coordinates of an upper edge and a lower edge of the structured light projected onto the left sub-image, the pad sub-image, and the right sub-image; Averaging the horizontal axis pixel coordinates of the upper edge and the lower edge of the structured light projected onto the left sub-image and the right sub-image to obtain a first average pixel coordinate.
5. The optical measurement method according to claim 1, characterized in that, The step of differentiating the first total pixel brightness values to obtain the horizontal axis pixel coordinates of the upper edge and the lower edge of each pad further includes: Calculate a plurality of slope values after differentiating the first total pixel brightness value; Select a maximum slope value and a minimum slope value among the slope values; and Respectively select a horizontal axis pixel coordinate corresponding to the maximum slope value and a horizontal axis pixel coordinate corresponding to the minimum slope value as the horizontal axis pixel coordinates of the upper edge and the lower edge of each of the pads.
6. The optical measurement method according to claim 1, characterized in that, The step of differentiating the second total pixel brightness value to obtain the vertical axis pixel coordinates of the left edge and the right edge of each of the pads further includes: Calculate a plurality of slope values after differentiating the second total pixel brightness value; Select a maximum slope value and a minimum slope value among the slope values; and Respectively select a vertical axis pixel coordinate corresponding to the maximum slope value and a vertical axis pixel coordinate corresponding to the minimum slope value as the vertical axis pixel coordinates of the left edge and the right edge of each of the pads.
7. The optical measurement method according to claim 4, characterized in that, The step of respectively differentiating the left total pixel brightness value, the pad total pixel brightness value, and the right total pixel brightness value to obtain the horizontal axis pixel coordinates of the upper edge and the lower edge of the structured light projected onto the left sub-image, the pad sub-image, and the right sub-image further includes: Respectively calculate a plurality of slope values after differentiating the left total pixel brightness value, the pad total pixel brightness value, and the right total pixel brightness value; Respectively select a maximum slope value and a minimum slope value among the slope values; and Respectively select a horizontal axis pixel coordinate corresponding to the maximum slope value and a horizontal axis pixel coordinate corresponding to the minimum slope value as the horizontal axis pixel coordinates of the upper edge and the lower edge of the structured light projected onto the left sub-image, the pad sub-image, and the right sub-image.
8. An optical measurement method for a printed circuit board, executed by a processor, characterized in that, Includes: Capture a first test image of the printed circuit board; Divide the first test image into a plurality of first pad images according to the number of pads in a plurality of etched patterns on the printed circuit board, wherein each of the etched patterns includes a plurality of pads and a wire located between the pads to connect the pads; Accumulate the pixel brightness values of each pixel of each of the first pad images in a short side direction of each of the etched patterns to obtain a plurality of first total pixel brightness values; Differentiate the first total pixel brightness value to obtain the horizontal axis pixel coordinates of an upper edge and a lower edge of each of the pads; Accumulate the pixel brightness values of each pixel of each of the first pad images in a long side direction of each of the etched patterns to obtain a plurality of second total pixel brightness values; And Differentiate the second total pixel brightness value to obtain the vertical axis pixel coordinates of a left edge and a right edge of each of the pads.
9. The optical measurement method according to claim 8, characterized in that, Further includes: Compare the first test image of the printed circuit board with a sample image of a sample circuit board to correct a coordinate offset, a rotation offset angle, and a pattern scaling ratio of the etched pattern.
10. The optical measurement method according to claim 9, characterized in that, The step of comparing the first test image of the printed circuit board with the sample image of the sample circuit board to correct the coordinate offset, the rotation offset angle, and the pattern scaling ratio of the etched pattern further includes: Extract the diagonal pixel coordinates of the etching pattern in the first image to be measured and the diagonal pixel coordinates of the etching pattern in the sample image to calculate the coordinate offset, the rotation offset angle, and the pattern scaling ratio of the etching pattern in the first image to be measured; and Correct the coordinate offset, the rotation offset angle, and the pattern scaling ratio of the etching pattern in the first image to be measured.
11. The optical measurement method according to claim 8, characterized in that, Further comprising: Extract a second image to be measured projected onto the printed circuit board by a structured light at a projection angle, wherein the structured light is projected onto each of the pads; Divide the second image to be measured according to the number of the pads to form a plurality of second pad images; Divide each of the second pad images according to the vertical axis pixel coordinates of the left edge and the right edge of each of the pads to form a left sub-image, a pad sub-image, and a right sub-image; Accumulate the pixel brightness values of each pixel of the left sub-image, the pad sub-image, and the right sub-image of each of the second pad images in the short side direction of each of the etching patterns to obtain a left total pixel brightness value, a pad total pixel brightness value, and a right total pixel brightness value; Differentiate the left total pixel brightness value, the pad total pixel brightness value, and the right total pixel brightness value respectively to obtain the horizontal axis pixel coordinates of an upper edge and a lower edge of the structured light projected onto the left sub-image, the pad sub-image, and the right sub-image; Average the horizontal axis pixel coordinates of the upper edge and the lower edge of the structured light projected onto the left sub-image and the right sub-image to obtain a first average pixel coordinate; Average the horizontal axis pixel coordinates of the upper edge and the lower edge of the structured light projected onto the pad sub-image to obtain a second average pixel coordinate; And Calculate the thickness of each of the pads according to the difference between the first average pixel coordinate and the second average pixel coordinate and the projection angle of the structured light.
12. The optical measurement method according to claim 8, characterized in that, The step of differentiating the first total pixel brightness value to obtain the horizontal axis pixel coordinates of the upper edge and the lower edge of each of the pads further comprises: Calculate a plurality of slope values after differentiating the first total pixel brightness value; Select a maximum slope value and a minimum slope value among the slope values; and Select the horizontal axis pixel coordinates corresponding to the maximum slope value and the horizontal axis pixel coordinates corresponding to the minimum slope value respectively as the horizontal axis pixel coordinates of the upper edge and the lower edge of each of the pads.
13. The optical measurement method according to claim 8, characterized in that, The step of differentiating the second total pixel brightness value to obtain the vertical axis pixel coordinates of the left edge and the right edge of each of the pads further comprises: Calculate a plurality of slope values after differentiating the second total pixel brightness value; Select a maximum slope value and a minimum slope value among the slope values; and Select the vertical axis pixel coordinates corresponding to the maximum slope value and the vertical axis pixel coordinates corresponding to the minimum slope value respectively as the vertical axis pixel coordinates of the left edge and the right edge of each of the pads.
14. The optical measurement method according to claim 11, characterized in that, The step of differentiating the left total pixel brightness value, the pad total pixel brightness value, and the right total pixel brightness value respectively to obtain the horizontal axis pixel coordinates of the upper edge and the lower edge of the structured light projected onto the left sub-image, the pad sub-image, and the right sub-image further comprises: Calculate multiple slope values after differentiating the left total pixel brightness value, the pad total pixel brightness value, and the right total pixel brightness value respectively; Select a maximum slope value and a minimum slope value from the slope values respectively; and Select the horizontal axis pixel coordinates corresponding to the maximum slope value and the horizontal axis pixel coordinates corresponding to the minimum slope value respectively as the horizontal axis pixel coordinates of the upper edge and the lower edge where the structured light is projected onto the left sub-image, the pad sub-image, and the right sub-image.
Citation Information
Patent Citations
Circuit board etching edge detection and etching factor measurement method
CN101266135A
Circuit board welding quality detection method and device
CN110473165A