A PCB board processing method and system based on CCD self-positioning

Through the PCB board processing method based on CCD self-positioning, the problem of insufficient processing accuracy of PCB boards in the prior art is solved, and high-precision processing of PCB boards of different specifications and models is achieved, and the accuracy of identification and processing is improved.

CN118765043BActive Publication Date: 2025-02-28HANGZHOU BOHAN MICROELECTRONICS TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411073907.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2025-02-28
Estimated Expiration
2044-08-07

AI Technical Summary

Technical Problem

The existing PCB board processing methods are insufficient in processing accuracy, especially when dealing with PCB boards of various specifications and models, the accuracy will further decrease.

Method used

The PCB board processing method based on CCD is adopted to collect and pre-process the PCB board to be processed through CCD, identify the board specifications and models, obtain the processing template images, cut them into several processing point images, perform feature extraction, obtain the position information of the processing point, and process them according to the position information and processing parameters.

Benefits of technology

It can ensure processing accuracy when processing PCB boards of different specifications and models, improve the grayscale dynamic range and contrast of PCB board images, enhance the shadowed area, and improve the recognition accuracy and processing accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The present invention discloses a PCB board processing method and system based on CCD self-positioning, comprising the following steps: using CCD to perform image acquisition and image preprocessing on a PCB board to be processed, and obtaining a preprocessed PCB board image; identifying the preprocessed PCB board image, and obtaining the specification and model of the PCB board to be processed, and obtaining the corresponding PCB board processing template image according to the currently input processing type and the specification and model of the PCB board to be processed; cutting the preprocessed PCB board image according to the PCB board processing template image, and obtaining a plurality of processing point images; performing feature extraction on the plurality of processing point images, and obtaining the position information of each processing point, and processing the PCB board according to the position information and processing parameters. The present invention achieves the purpose of ensuring the processing accuracy when processing PCB boards of different specifications and models.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of PCB board processing, and in particular to a PCB board processing method and system based on CCD self-positioning. Background Art

[0002] Printed Circuit Board (PCB) is also called Printed Wiring Board (PWB) or Printed Circuit Board.

[0003] Usually, the conductive pattern made of printed circuit printed elements or a combination of the two on the insulating material according to a predetermined design is called a printed circuit, and the finished board of the printed circuit or printed circuit is called a printed circuit board. Printed circuit boards are the main components of various electronic products, and their performance has a great impact on the quality of electronic products. Almost every electronic device cannot do without PCB, from electronic watches and calculators to aerospace, etc. PCB is an important component of electronic products. As long as there are electronic components, PCB must be used to achieve electrical interconnection of electronic components. The functions of PCB include: providing mechanical support for the fixed assembly of various electronic components such as integrated circuits; realizing the wiring, electrical connection and electrical insulation between various electronic components such as integrated circuits and providing the required electrical characteristics, such as characteristic impedance, etc., while providing solder mask patterns for automatic soldering, and providing identification characters and marking patterns for component insertion, gluing, inspection and maintenance.

[0004] In the early days, PCB processing was basically done by human eyes, which affected both positioning accuracy and production speed. With the development of PCB processing technology, people began to use CNC machine tools to process PCBs, achieving a certain degree of processing automation and improving positioning accuracy and production speed.

[0005] However, with the development of PCB boards, PCB boards have gradually evolved from single-sided boards to double-sided boards and multi-layer boards, and the structure has become more complex. At the same time, the requirements for processing accuracy are also getting higher and higher. Therefore, the existing PCB board processing methods have the following defects:

[0006] (1) The existing processing accuracy is difficult to meet the requirements;

[0007] (2) When processing PCB boards of various specifications and models, the processing accuracy will further decrease. Summary of the invention

[0008] In order to overcome the shortcomings of the prior art, the present invention provides a PCB board processing method and system based on CCD self-positioning, which is used to solve the technical problem of insufficient processing accuracy of the existing PCB board processing method, thereby achieving the purpose of ensuring processing accuracy when processing PCB boards of different specifications and models.

[0009] To solve the above problems, the technical solution adopted by the present invention is as follows:

[0010] A PCB board processing method based on CCD self-positioning includes the following steps:

[0011] Use CCD to collect and preprocess the image of the PCB board to be processed, and obtain the preprocessed PCB board image;

[0012] Identify the preprocessed PCB board image to obtain the specification model of the PCB board to be processed, and obtain the corresponding PCB board processing template image according to the currently input processing type and the specification model of the PCB board to be processed;

[0013] Cutting the preprocessed PCB board image according to the PCB board processing template image to obtain a plurality of processing point images;

[0014] Feature extraction is performed on the images of the plurality of processing points to obtain position information of each processing point, and the PCB board is processed according to the position information and processing parameters.

[0015] As a preferred embodiment of the present invention, when cutting, it includes:

[0016] Acquire the processing point coordinates and processing parameters marked on the PCB board template image, and transfer the processing point coordinates and the processing parameters to the preprocessed PCB board image;

[0017] The preprocessed PCB board image is cut with each processing point coordinate as the center to obtain the plurality of processing point images.

[0018] As a preferred embodiment of the present invention, when performing image acquisition, it includes:

[0019] Capturing images of the PCB board to be processed by scanning to obtain a plurality of first PCB board sub-images;

[0020] splicing the plurality of first PCB board sub-images to obtain the PCB board image;

[0021] Wherein, when performing splicing, it includes: performing grayscale compensation, grayscale correlation matching, image restoration and image fusion on the plurality of first PCB board images.

[0022] As a preferred embodiment of the present invention, the grayscale compensation includes:

[0023] Obtaining the centroid position of the middle grayscale level of two adjacent first PCB board images through the histogram;

[0024] Subtract the two centroid position coordinates to obtain a grayscale difference, obtain the grayscale value of each pixel point of the two adjacent first PCB board sub-images, and adjust the grayscale value so that the background light intensity of the two adjacent first PCB board sub-images is the same;

[0025] Repeat the above steps to complete the grayscale compensation of the plurality of first PCB board images, and obtain a plurality of second PCB board images.

[0026] As a preferred implementation manner of the present invention, the grayscale correlation matching includes:

[0027] One of the two adjacent second PCB board sub-images is gradually translated in two directions of the image expansion in units of pixels, thereby obtaining a plurality of overlapping areas;

[0028] Obtaining the correlation between two adjacent second PCB board sub-images in the plurality of overlapping areas;

[0029] Based on the correlation, the translation amounts in two directions when the correlation is maximum are obtained.

[0030] As a preferred embodiment of the present invention, the image restoration includes:

[0031] The two adjacent second PCB board images are scaled by bilinear interpolation to obtain a scaled and restored PCB board image;

[0032] Rotate the scaled and restored PCB board image by an angle β around the center point to obtain a rotated PCB board image;

[0033] The rotation angle β is continuously adjusted to obtain the correlation at different rotation angles, and based on the rotation angle at which the correlation is maximum, the PCB board image after image derotation is obtained;

[0034] The PCB board images after the image derotation are spliced ​​to obtain the grayscale value of the overlapping area, and the overlapping area is buffered by using a gradual in and out method.

[0035] As a preferred embodiment of the present invention, when the PCB board image is preprocessed, it includes:

[0036] Performing denoising and enhancement processing on the PCB board image;

[0037] The denoising process comprises:

[0038] Performing a first noise detection, determining a first noise point, and determining whether a noise density of the first noise point is higher than a preset density threshold;

[0039] If yes, the first noise point is considered to be a real noise point;

[0040] If not, perform a second noise detection, correct the first noise point to obtain a second noise point, and use the second noise point as the real noise point;

[0041] The real noise points are subjected to noise reduction processing in an adaptive manner.

[0042] As a preferred embodiment of the present invention, when performing identification, it includes:

[0043] Based on the structural element of each pixel, a new pixel grayscale value of each pixel in the preprocessed PCB board image is obtained;

[0044] An operator based on mathematical morphology edge detection is used to extract edge information of each pixel from the new pixel grayscale value, and the PCB board to be processed is identified based on the extracted edge information.

[0045] As a preferred embodiment of the present invention, when performing feature extraction, it includes:

[0046] Performing noise reduction and edge detection on the images of the plurality of processing points to obtain a set of contour point coordinates;

[0047] Obtaining the first distance, the second distance and the absolute value of the slope difference corresponding to the contour points in the contour point coordinate set, performing threshold comparison, completing the rough extraction of candidate contour points, and obtaining a candidate contour point set;

[0048] Obtaining the Euclidean distance between any two contour points in the candidate contour point set, performing threshold comparison, and completing the grouping of the candidate contour points;

[0049] Obtaining the mean coordinate value of the candidate contour points in each group as the new coordinate value of each group of candidate contour points;

[0050] Based on the straightness index and the new coordinate values ​​of each group of candidate contour points, pseudo contour points in the candidate contour point set are eliminated to achieve accurate identification of processing points.

[0051] A PCB board processing system based on CCD self-positioning, comprising:

[0052] Image preprocessing unit: used to preprocess the PCB board image to obtain a preprocessed PCB board image;

[0053] Image recognition unit: used to recognize the preprocessed PCB board image, obtain the specification model of the PCB board to be processed, and obtain the corresponding PCB board processing template image according to the currently input processing type and the specification model of the PCB board to be processed;

[0054] Image cutting unit: used for cutting the pre-processed PCB board image according to the PCB board processing template image to obtain a plurality of processing point images;

[0055] Processing unit: used for extracting features from the images of the plurality of processing points, obtaining position information of each processing point, and processing the PCB board according to the position information and processing parameters;

[0056] The CCD is used to collect images of the PCB board to be processed, so as to obtain the PCB board image.

[0057] Compared with the prior art, the present invention has the following beneficial effects:

[0058] (1) The enhancement processing method provided by the present invention can further improve the grayscale dynamic range of the PCB board image, enhance the contrast, and effectively enhance the shadow area in the PCB board image, thereby facilitating the subsequent recognition of the PCB board and improving the recognition accuracy;

[0059] (2) The recognition method provided by the present invention can not only fill the holes of edge information in the image, but also filter out the edge information and the interference information around it, thereby realizing accurate recognition of the PCB board image;

[0060] (3) The present invention obtains accurate processing point edges through rough extraction and fine extraction, and then processes the PCB board based on the extracted accurate processing point edges, thereby fully ensuring the processing accuracy of the PCB board.

[0061] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a step diagram of the PCB board processing method based on CCD self-positioning provided by the present invention;

[0063] Figure 2 It is a schematic diagram of the setting of the PCB board image acquisition process provided by the present invention.

[0064] Explanation of the accompanying drawings: 1. CCD; 2. PCB board; 3. First light source; 4. Second light source; 5. Third light source; 6. Filter; 7. Cylindrical mirror; 8. Optical lens. DETAILED DESCRIPTION

[0065] The PCB board processing method based on CCD self-positioning provided by the present invention is as follows: Figure 1 As shown, the following steps are included:

[0066] Step S1: using CCD 1 to collect an image of the PCB board 2 to be processed to obtain a PCB board image, and preprocessing the PCB board image to obtain a preprocessed PCB board image;

[0067] Step S2: Identify the preprocessed PCB board image to obtain the specification model of the PCB board 2 to be processed, and obtain the corresponding PCB board processing template image from a plurality of preset PCB board processing template images according to the currently required processing type and the specification model of the PCB board 2 to be processed;

[0068] Step S3: obtaining the processing point coordinates and processing parameters marked on the PCB board template image, and transferring the processing point coordinates and processing parameters to the preprocessed PCB board image;

[0069] Step S4: cutting the pre-processed PCB board image with the coordinates of each processing point as the center to obtain a number of processing point images;

[0070] Step S5: extracting features from the images of several processing points to obtain the position information of each processing point, and processing the PCB board 2 according to the position information and processing parameters;

[0071] Wherein, when the CCD 1 is used to collect the image of the PCB board 2 to be processed, it includes:

[0072] The first light source 3, the second light source 4 and the third light source 5 are provided to emit three groups of light, and filters 6 are respectively provided in front of the light sources to change the color and wavelength of the light;

[0073] The three groups of light are focused on the PCB board 2 to be processed by the cylindrical mirror 7;

[0074] An optical lens 8 is arranged in front of the CCD 1 to improve the imaging quality.

[0075] Specifically, Figure 2 As shown, the present invention can obtain light of different colors and wavelengths by replacing the filter 6 in front of the light source, thereby improving the imaging quality of PCB boards 2 of different types of boards.

[0076] Specifically, Figure 2As shown, the present invention adopts three light sources, thereby providing light sources of three angles for the PCB board 2 to be processed, and by adjusting the brightness and angle of each light source, the PCB board image collected by the CCD 1 achieves the best imaging effect, and the light sources of three angles can basically eliminate the poor exposure caused by insufficient illumination angle, and overcome the technical problem of poor imaging effect of a single light source.

[0077] In the above step S1, when the CCD 1 is used to collect the image of the PCB board 2 to be processed, it also includes:

[0078] Capturing images of the PCB board 2 to be processed by scanning to obtain a plurality of first PCB board sub-images;

[0079] splicing a plurality of first PCB board sub-images to obtain a PCB board image;

[0080] Wherein, when performing splicing, it includes: performing grayscale compensation, grayscale correlation matching, image restoration and image fusion on a plurality of first PCB board images;

[0081] Grayscale compensation includes: obtaining the centroid position of the middle grayscale level of two adjacent first PCB board images through a histogram;

[0082] Subtract the two centroid position coordinates to obtain a grayscale difference, obtain the grayscale value of each pixel point of the two adjacent first PCB board images, and subtract or add 1 / 2 of the grayscale difference value from the grayscale value of each pixel point to make the background light intensity of the two adjacent first PCB board images the same;

[0083] Repeat the above steps to complete the grayscale compensation of a plurality of first PCB board images, and obtain a plurality of second PCB board images;

[0084] When performing grayscale correlation matching, it includes:

[0085] Overlap two adjacent second PCB board sub-images, and gradually translate one of the second PCB board sub-images in two directions of image expansion in units of pixels, thereby obtaining a plurality of overlapping areas;

[0086] Obtain the correlation between two adjacent second PCB board sub-images in several overlapping areas, as shown in Formula 1:

[0087]

[0088] Where, T is the correlation, which is used to characterize the similarity between two adjacent second PCB board images; R1 and R2 are the grayscale values ​​of the overlapping area of ​​two adjacent second PCB board images; o and k are the horizontal and vertical coordinates of a certain pixel point, and O and K are the width and height of the overlapping area;

[0089] Based on the correlation, the translation amounts in two directions when the correlation is maximum are obtained.

[0090] Furthermore, when restoring the image, it includes:

[0091] Bilinear interpolation is used to scale the two adjacent second PCB board sub-images, as shown in Formula 2:

[0092]

[0093] Where o′ and k′ are the coordinates of the interpolation point, g(o′,k′) is the gray value of the interpolation point; z<o′<o+1, m<k′<k+1, s=o′-z, n=k′-m;

[0094] After adjusting the zoom factor, the translation amounts in two directions when the correlation between two adjacent second PCB board images is the largest are obtained, and the translation amounts under different zoom factors are recorded to obtain the PCB board image after zooming and restoration;

[0095] The scaled and restored PCB board image is rotated around the center point by an angle β to obtain a rotated PCB board image;

[0096] Continuously adjust the rotation angle β to obtain the correlation at different rotation angles;

[0097] Among them, the relationship between the scaled and restored PCB board image and the rotated PCB board image is as shown in the figure.

[0098] As shown in formula 3:

[0099]

[0100] Where, (c0,u0) is the center point of the scaled and restored PCB board image, (c,u) is the pixel point on the scaled and restored PCB board image, and (c′,u′) is the pixel point on the rotated PCB board image.

[0101] The rotation angle when the correlation is maximum is obtained according to formula 1, and the PCB board image after image derotation is obtained;

[0102] The PCB board images after image derotation are stitched together, and the grayscale value of the overlapping area is obtained, as shown in Formula 4:

[0103] g0(c,u)=ηg S (c,u)+(1-η)g N (c,u) (4);

[0104] In the formula, η is the gradient factor, η=(c max -c) / (c max -c min); g0(c,u) is the gray value of the overlapping area; (c max ,c min ) is the overlapping area in the abscissa direction;

[0105] The overlapping area is buffered using a gradual in-and-out method.

[0106] Specifically, the present invention uses the above method to stitch several collected PCB board images, which can achieve better stitching of different orientations, different positions and different sizes, and there is no obvious stitching mark at the stitching point.

[0107] In the above step S1, when the PCB board image is preprocessed, it includes:

[0108] The PCB board image is denoised and enhanced. The denoising process includes:

[0109] Perform a first noise detection on the PCB board image, determine the first noise point, obtain the noise density of the PCB board image, and determine whether the noise density is higher than a preset density threshold;

[0110] If yes, the first noise point is considered to be a real noise point;

[0111] If not, a second noise detection is performed to correct the first noise point to obtain a second noise point, and the second noise point is taken as the real noise point;

[0112] Adopt adaptive method to reduce noise of real noise points;

[0113] Among them, when performing the first noise detection, it includes:

[0114] The PCB board image is divided into D rectangular areas, where the lth (l = 0, 1, ..., D-1) rectangular area is denoted as T l , the gray value of any pixel (o,k) in the rectangular area is

[0115] Provide a set of all pixel gray values ​​in an n×n detection window centered at (o, k) as

[0116] From the collection Search for the maximum gray value and the minimum gray value according to With the maximum gray value and the minimum gray value Classify the pixel (o,k) based on the relationship;

[0117] like With the maximum gray value or minimum gray value If they are equal, the pixel (o, k) is considered to be the first noise point and is used Mark, if With the maximum gray value or minimum gray value If they are not equal, the pixel (o, k) is considered to be a non-noise point and is used Marking, as shown in Formula 5:

[0118]

[0119] Get the size N l ×E l The number of first noise points detected in the lth rectangular area X l , and estimate the noise density T in the rectangular area l , as shown in Formula 6:

[0120]

[0121] The noise density T l Compare with the density threshold, if the noise density T l If the density is higher than the density threshold, the first noise point is considered to be a real noise point; otherwise, a second noise detection is performed on the first noise point.

[0122] Furthermore, when performing the second noise detection, it includes:

[0123] For the first noise point, the gray values ​​of all pixels in the m×m detection window are combined into a set As shown in Formula 7:

[0124]

[0125] Get Collection The average value of all gray values ​​in And according to the first noise point and The size relationship between After correction, the second noise point is obtained, as shown in Formula 8:

[0126]

[0127] Where Y l is the preset detection threshold;

[0128] Estimated size is N l ×E l The corrected noise density T in the lth rectangular area l ′, as shown in Formula 9:

[0129]

[0130] Where, X l ′ is of size N l ×E l The number of second noise points in the lth rectangular area.

[0131] Furthermore, when the real noise point is subjected to noise reduction processing in an adaptive manner, the method includes:

[0132] For the first noise point, a weighted mean of the grayscale values ​​of a preset number of non-noise points in the filter window is obtained, and the grayscale value of the first noise point is replaced by the weighted mean of the grayscale values ​​of the preset number of non-noise points to obtain a denoised PCB board image;

[0133] For the second noise point, the mean grayscale value of all non-noise points in the filter window is obtained, and the grayscale value of the second noise point is replaced by the mean grayscale value of all non-noise points to obtain a denoised PCB board image.

[0134] Specifically, there are details such as fine lines and edges in the PCB image. The present invention greatly reduces the false detection rate through the above-mentioned graded noise detection, and combines the adaptive method to perform noise reduction processing, thereby better retaining the details such as fine lines and edges, and having a good suppression effect on impulse noise. Although the existing noise reduction method can suppress impulse noise, it will cause the loss of details such as fine lines and edges.

[0135] Furthermore, the enhancement process includes:

[0136] A two-dimensional Gaussian blur filter is used, and the Gaussian variance is estimated by learning the change of grayscale mean value, and the enhanced PCB board image is output;

[0137] Among them, the Gaussian blur filter in the two-dimensional direction is shown in formula 10:

[0138]

[0139] Where O(c,u) is the denoised PCB image, Kernel is the Gaussian kernel, m is the radius of the window, l is the number of scales of the current iteration, l = 1, 2, ... M, M is the total number of scales of iteration, and ω is the Gaussian variance;

[0140] When estimating the Gaussian variance, as shown in Formula 11:

[0141]

[0142] Where mean(O(c,u)) is the grayscale mean of image O(c,u), D is the scale difference, and ω[l] is the Gaussian variance used for the current iteration scale.

[0143] Specifically, compared with the existing image enhancement methods, the enhancement processing method provided by the present invention can further improve the grayscale dynamic range of the image, enhance the contrast, and effectively enhance the shadow area in the PCB board image, thereby facilitating the subsequent identification of the PCB board 2 and improving the accuracy of identification.

[0144] In the above step S2, when the pre-processed PCB board image is recognized, it includes:

[0145] Get the new pixel grayscale value at the midpoint (o, k) of the preprocessed PCB board image, as shown in Formula 12:

[0146]

[0147] Where, l is the magnification factor, and l>1; g(o,k) is the grayscale value of the pixel at point (o,k) in the preprocessed PCB board image; is the average gray value of the adjacent pixels at point (o, k) in the preprocessed PCB board image;

[0148] The structural element N(o,k) of the point (o,k) is applied to the opening operation of mathematical morphology, as shown in formula 13:

[0149]

[0150] In the formula, Ο is the opening operation of mathematical morphology;

[0151] The pixel gray value g(o,k) is divided into two parts, as shown in formula 14:

[0152] g(o,k)=[g(o,k)ΟN(o,k)]+[g(o,k)-g(o,k)ON(o,k)] (14);

[0153] Among them, the part [g(o,k)-g(o,k)ON(o,k)] contains the edge information of the pixel point (o,k);

[0154] Based on formula 12 and formula 13, we get formula 15:

[0155] g′(o,k)=[(g(o,k)ΟN(o,k))]+l[(g(o,k))] (15);

[0156] Let l = 2, and we get formula 16:

[0157] g′(o,k)=g(o,k)+[g(o,k)-(g(o,k)ΟN(o,k))] (16);

[0158] The edge information is extracted from [g(o,k)-(g(o,k)ΟN(o,k))] using an operator based on mathematical morphology edge detection, as shown in Formula 17:

[0159]

[0160] In the formula, is the expansion operation of mathematical morphology, Θ is the erosion operation of mathematical morphology;

[0161] The pre-processed PCB board image is recognized based on the extracted edge information.

[0162] Specifically, the recognition method provided by the present invention can not only fill the holes of edge information in the image, but also filter out the edge information and the interference information around it, thereby realizing accurate recognition of the PCB board image.

[0163] In the above step S3, when the processing point coordinates are transferred to the pre-processed PCB board image, it includes:

[0164] Perform edge tracking on the preprocessed PCB board image to obtain the contour edge of PCB board 2;

[0165] Perform Hough transform straight line fitting on the edge points of the contour of PCB board 2 to obtain the coordinates of the four corner points of the PCB board;

[0166] The coordinates of the four corner points of the PCB board in the preprocessed PCB board image are compared with the coordinates of the four corner points of the PCB board in the PCB board template image, and the preprocessed PCB board image is rotated and translated for the first time according to the comparison result to complete the rough registration of the image;

[0167] Determine the processing points in the preprocessed PCB board image according to the processing point information in the PCB board template image, and obtain the coordinates of the processing points;

[0168] The coordinates of the processing points in the PCB board template image are compared with the coordinates of the processing points in the preprocessed PCB board image, and the preprocessed PCB board image is rotated and translated for the second time to complete the precise registration of the image.

[0169] Specifically, the above edge tracking includes: edge tracking based on four-connected edge search.

[0170] Furthermore, when performing the first rotation and translation, as shown in Formula 18 and Formula 19:

[0171] c′=l1c+l2u+l3cu+l4 (18);

[0172] u′=l5c+l6u+l7cu+l8 (19);

[0173] Where c′ and u′ are the coordinates of the corner points of the PCB board in the preprocessed PCB board image, and c and u are the coordinates of the corner points of the PCB board in the PCB board template image;

[0174] Substitute the four diagonal points into formula 18 and formula 19 respectively, and obtain 8 coefficients l1, l2, l3, l4, l5, l6, l7, l8;

[0175] The spatial transformation of all pixels within the quadrilateral area is completed based on 8 coefficients.

[0176] Specifically, the present invention accurately transfers the coordinates of the processing points to the pre-processed PCB board image through two rotations and translations, laying a foundation for subsequent accurate feature extraction of the processing points.

[0177] In the above step S5, when extracting features from the images of several processing points, it includes:

[0178] The mean filter is used to reduce the noise of several processing point images, and the edge of the processing point is extracted by the edge detection algorithm to obtain the contour point coordinate set W;

[0179] Get the point Q in the contour point coordinate set W o the corresponding absolute values ​​of the first distance, the second distance and the slope difference;

[0180] The first distance, the second distance and the absolute value of the slope difference are compared with a preset first threshold and a preset second threshold respectively, to perform a rough extraction of candidate contour points and obtain a candidate contour point set;

[0181] Obtaining the Euclidean distance between any two contour points in the candidate contour point set, and comparing it with a preset third threshold value to complete the grouping of the candidate contour points;

[0182] Obtain the mean coordinate value of the candidate contour points in each group as the new coordinate value of each group of candidate contour points;

[0183] Based on the straightness index and the new coordinate values ​​of each group of candidate contour points, the pseudo contour points in the candidate contour point set are eliminated to achieve accurate identification of the processing points.

[0184] Specifically, when the edge of the processing point is extracted by the edge detection algorithm, it includes:

[0185] The edge of the processing point is extracted by the Canny edge detection operator, as shown in Formula 20:

[0186] W={Q o (c o ,u o )o=1,2,3,...,m} (20);

[0187] Where m is the total number of edge contour pixels, (c o ,u o ) is the contour point Q o The coordinates of the contour point Q o-y and contour point Q o+y and contour point Q respectively o If the contour points are separated by y pixels, then the contour point Q o-y The coordinates of (c o-y ,u o-y ), contour point Q o+y The coordinates of (c o+y ,u o+y ).

[0188] Get the contour point Q in the contour point coordinate set W o The corresponding first distance and second distance include:

[0189] Get contour point Q o and contour point Q o-y Midpoint of the chord M o1 (c o1 ,u o1 ) and the arc midpoint M o2 (c o2 ,u o2 ), as shown in Formula 21:

[0190]

[0191] Get contour point Q o and contour point Q o+y Midpoint of the chord M o3 (c o3 ,u o3 ) and the arc midpoint M o4 (c o4 ,u o4 ), as shown in Formula 22:

[0192]

[0193] Point Q in the contour point coordinate set W o The corresponding absolute value of the slope difference includes:

[0194] Get contour point Q o With contour point Q o-y , contour point Q o+y The absolute value J of the slope difference between them is shown in Formula 23:

[0195] J=|l o1 -l o2 | (23);

[0196] Among them, l o1 , l o2 The expressions are shown in Formula 24 and Formula 25 respectively:

[0197]

[0198] Set the first threshold value Y1 and the second threshold value Y2 based on the distance f o1 and distance f o2 The relationship between the absolute value J and the first threshold value Y1, and the relationship between the absolute value J and the second threshold value Y2, complete the rough extraction of contour points and obtain a candidate contour point set.

[0199] Specifically, if f o1 ≤Y1 and f o2 ≤Y1, J>Y2, the contour point in the contour point coordinate set W is considered to be a candidate contour point.

[0200] Set the third threshold Y3, obtain the Euclidean distance f between any two candidate contour points in the candidate contour point set, if the Euclidean distance f is less than the third threshold Y3, then divide the two feature points into a group, and take the coordinate mean of each group as the new coordinate K of the candidate contour point of the group kavg (c kavg ,u kavg ), as shown in Formula 26 and Formula 27:

[0201]

[0202] Where l is the number of candidate contour points in the group;

[0203] Get three adjacent groups of candidate contour points K (k-1)avg , K kavg and K (k+1)avg The distance between k1 、f k2 and f k3 , and obtain the ratio of distances, as shown in Formula 28:

[0204]

[0205] Determine the distance ratio t f Is it greater than the preset threshold t z , if so, the candidate contour point is considered to be a pseudo contour point and is removed.

[0206] Specifically, the threshold t z The value of is 0.5.

[0207] Specifically, the present invention obtains accurate processing point edges through rough extraction and fine extraction, and then processes the PCB board 2 based on the extracted accurate processing point edges, thereby fully ensuring the processing accuracy of the PCB board 2.

[0208] The PCB board processing system based on CCD self-positioning provided by the present invention comprises: an image preprocessing unit, an image recognition unit, an image cutting unit and a processing unit.

[0209] Image preprocessing unit: used for preprocessing the PCB board image to obtain the preprocessed PCB board image.

[0210] Image recognition unit: used to recognize the preprocessed PCB board image, obtain the specification model of the PCB board to be processed, and obtain the corresponding PCB board processing template image according to the currently input processing type and the specification model of the PCB board to be processed.

[0211] Image cutting unit: used to cut the pre-processed PCB board image according to the PCB board processing template image to obtain a number of processing point images.

[0212] Processing unit: used to extract features from images of several processing points, obtain the position information of each processing point, and process the PCB board according to the position information and processing parameters.

[0213] Among them, CCD is used to collect images of the PCB board to be processed to obtain the PCB board image.

[0214] The above-mentioned embodiments are only preferred embodiments of the present invention and cannot be used to limit the scope of protection of the present invention. Any non-substantial changes and substitutions made by technicians in this field on the basis of the present invention shall fall within the scope of protection required by the present invention.

Claims

1. A PCB board processing method based on CCD self-positioning, characterized in that: The following steps are involved: Use CCD to collect and preprocess the image of the PCB board to be processed, and obtain the preprocessed PCB board image; Identify the preprocessed PCB board image to obtain the specification model of the PCB board to be processed, and obtain the corresponding PCB board processing template image according to the currently input processing type and the specification model of the PCB board to be processed; Acquire the processing point coordinates and processing parameters marked on the PCB board processing template image, and transfer the processing point coordinates and the processing parameters to the preprocessed PCB board image; Cutting the preprocessed PCB board image with the coordinates of each processing point as the center to obtain a plurality of processing point images; Feature extraction is performed on the images of the plurality of processing points to obtain position information of each processing point, and the PCB board is processed according to the position information and processing parameters.

2. The PCB board processing method based on CCD self-positioning according to claim 1 is characterized in that: When acquiring images, include: Capturing images of the PCB board to be processed by scanning to obtain a plurality of first PCB board sub-images; splicing the plurality of first PCB board sub-images to obtain the PCB board image; Wherein, when performing splicing, it includes: performing grayscale compensation, grayscale correlation matching, image restoration and image fusion on the plurality of first PCB board images.

3. The PCB board processing method based on CCD self-positioning according to claim 2 is characterized in that: The grayscale compensation comprises: Obtaining the centroid position of the middle grayscale level of two adjacent first PCB board images through the histogram; Subtract the two centroid position coordinates to obtain a grayscale difference, obtain the grayscale value of each pixel point of the two adjacent first PCB board sub-images, and adjust the grayscale value so that the background light intensity of the two adjacent first PCB board sub-images is the same; Repeat the above steps to complete the grayscale compensation of the plurality of first PCB board images, and obtain a plurality of second PCB board images.

4. The PCB board processing method based on CCD self-positioning according to claim 3 is characterized in that: The grayscale correlation matching includes: One of the two adjacent second PCB board sub-images is gradually translated in two directions of the image expansion in units of pixels, thereby obtaining a plurality of overlapping areas; Obtaining the correlation between two adjacent second PCB board sub-images in the plurality of overlapping areas; Based on the correlation, the translation amounts in two directions when the correlation is maximum are obtained.

5. The PCB board processing method based on CCD self-positioning according to claim 4 is characterized in that: The image restoration comprises: The two adjacent second PCB board images are scaled by bilinear interpolation to obtain a scaled and restored PCB board image; Rotate the scaled and restored PCB board image around the center point by an angle , get the rotated PCB board image; Continuously adjust the rotation angle , obtain the correlation under different rotation angles, and based on the rotation angle when the correlation is maximum, obtain the PCB board image after image derotation; The PCB board images after the image derotation are spliced ​​to obtain the grayscale value of the overlapping area, and the overlapping area is buffered by using a gradual in and out method.

6. The PCB board processing method based on CCD self-positioning according to claim 1 is characterized in that: When the PCB board image is preprocessed, it includes: Performing denoising and enhancement processing on the PCB board image; The denoising process comprises: Performing a first noise detection, determining a first noise point, and determining whether a noise density of the first noise point is higher than a preset density threshold; If yes, the first noise point is considered to be a real noise point; If not, perform a second noise detection, correct the first noise point to obtain a second noise point, and use the second noise point as the real noise point; The real noise points are subjected to noise reduction processing in an adaptive manner.

7. The PCB board processing method based on CCD self-positioning according to claim 1 is characterized in that: When identifying, include: Based on the structural element of each pixel, a new pixel grayscale value of each pixel in the preprocessed PCB board image is obtained; An operator based on mathematical morphology edge detection is used to extract edge information of each pixel from the new pixel grayscale value, and the PCB board to be processed is identified based on the extracted edge information.

8. The PCB board processing method based on CCD self-positioning according to claim 1 is characterized in that: When performing feature extraction, it includes: Performing noise reduction and edge detection on the images of the plurality of processing points to obtain a set of contour point coordinates; Obtaining the first distance, the second distance and the absolute value of the slope difference corresponding to the contour points in the contour point coordinate set, performing threshold comparison, completing the rough extraction of candidate contour points, and obtaining a candidate contour point set; Obtaining the Euclidean distance between any two contour points in the candidate contour point set, performing threshold comparison, and completing the grouping of the candidate contour points; Obtaining the mean coordinate value of the candidate contour points in each group as the new coordinate value of each group of candidate contour points; Based on the straightness index and the new coordinate values ​​of each group of candidate contour points, pseudo contour points in the candidate contour point set are eliminated to achieve accurate identification of processing points.

9. A PCB board processing system based on CCD self-positioning, characterized in that: include: Image preprocessing unit: used to preprocess the PCB board image to obtain the preprocessed PCB board image; Image recognition unit: used to recognize the preprocessed PCB board image, obtain the specification model of the PCB board to be processed, and obtain the corresponding PCB board processing template image according to the currently input processing type and the specification model of the PCB board to be processed; Image cutting unit: used for obtaining the processing point coordinates and processing parameters marked on the PCB board processing template image, and transferring the processing point coordinates and processing parameters to the pre-processed PCB board image; cutting the pre-processed PCB board image with each processing point coordinate as the center to obtain a plurality of processing point images; Processing unit: used for extracting features from the images of the plurality of processing points, obtaining position information of each processing point, and processing the PCB board according to the position information and processing parameters; The CCD is used to collect images of the PCB board to be processed to obtain the PCB board image.

Citation Information

Patent Citations

  • Method, device and system for detecting printed circuit board (PCB)

    CN102937595A

  • Board card position detection method and device

    CN105352437A