Visual detection method and system for circuit board gold finger guide line notch
By analyzing the differences in the included angle and length of the straight edge lines of the gold fingers on the circuit board, the arrangement direction and equally divided regions are determined. Combined with feature point descriptors, a bidirectional matching algorithm is used to align the images, which solves the problem of low detection accuracy of gold finger defects in the existing technology and improves the detection accuracy and circuit board signal stability.
Patent Information
- Application Number
- CN202511373821.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-25
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-09-25
AI Technical Summary
In existing technologies, the presence of feature points corresponding to defects in the image to be tested, while the absence of such feature points in the gold finger template image, leads to poor accuracy in traditional matching and alignment, thus affecting the gold finger defect detection effect.
By acquiring the test image and template image of the gold fingers on the circuit board, analyzing the angle and length differences of the straight edge lines, determining the arrangement direction and equally divided regions of the gold fingers, obtaining the primary and distribution descriptors of the feature points, and calculating the matching distance by combining the relative distance distribution of the feature points, a bidirectional matching algorithm is used for image alignment to detect gold finger defects.
It improves the accuracy of gold finger defect detection and matching alignment precision, optimizes the image matching process, and ensures the integrity of circuit board electrical connections and the stability of signal transmission.
Smart Images

Figure CN120876466B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of gold finger defect detection, and particularly relates to a visual detection method and system for a gold finger lead gap of a circuit board. BACKGROUND
[0002] A gold finger is a connection part in a circuit board. When a gold finger in the circuit board has a gap, the electrical connection of the circuit board is affected, leading to unstable signals. The gap around the gold finger bears a large information transmission burden, leading to overheating and certain safety hazards. Therefore, in order to ensure the integrity of the electrical connection and the stability of the signal transmission in the circuit board, it is necessary to detect the defects of the gold finger in the circuit board.
[0003] In the prior art, a to-be-detected image of a gold finger of a circuit board and a template image are directly matched and aligned to detect defects of the gold finger in the circuit board. However, since there are feature points corresponding to defects in the to-be-detected image, and there are no feature points corresponding to defects in the gold finger template image, the accuracy of the matching and alignment is affected when the traditional forced matching and alignment is performed, and the textures of each position of the gold finger are similar, which also affects the matching accuracy, and the effect of the gold finger defect detection is poor. SUMMARY
[0004] In order to solve the technical problem that the defects and the similar textures affect the accuracy of the matching and alignment, and the effect of the gold finger defect detection is poor, the purpose of the present application is to provide a visual detection method and system for a gold finger lead gap of a circuit board, and the technical solution adopted is as follows:
[0005] The present application provides a visual detection method for a gold finger lead gap of a circuit board, which comprises the following steps:
[0006] Obtaining a to-be-detected image and a template image of a gold finger of a circuit board;
[0007] For any image, a plurality of straight edge lines in the image are obtained; based on the distribution of the included angle between each straight edge line and other straight edge lines and the difference in length, the possibility of the extension direction of each straight edge line is obtained, and the arrangement direction of the gold finger is obtained;
[0008] Based on the arrangement direction of the gold finger and the number of gold fingers, a plurality of gold finger equal division regions of the image are obtained; feature points in the image and corresponding primary descriptors are obtained, and based on the position distribution between each feature point and the corresponding gold finger equal division region, a plurality of distribution descriptors of each feature point are obtained;
[0009] According to the relative distance distribution between different feature points and all feature points in the corresponding local range, the defect possibility of each feature point is obtained; according to the similarity of the primary descriptor and the distribution descriptor of different feature points between the to-be-detected image and the template image, and the defect possibility of the feature point on the to-be-detected image, the matching distance of different feature points between the to-be-detected image and the template image is obtained.
[0010] According to the matching distance of different feature points between the to-be-detected image and the template image, the to-be-detected image and the template image are matched and aligned, and the gold finger defect detection is performed.
[0011] Further, the gold finger pointing possibility obtaining method comprises:
[0012] According to the absolute value of the included angle cosine value between each straight edge line and different other straight edge lines, and the number difference of edge pixel points, the gold finger pointing possibility of the extension direction of each straight edge line is obtained, the absolute value of the included angle cosine value is positively correlated with the gold finger pointing possibility, and the number difference of edge pixel points is negatively correlated with the gold finger pointing possibility.
[0013] Further, the gold finger arrangement direction obtaining method comprises:
[0014] The straight edge line corresponding to the maximum value of the gold finger pointing possibility is selected, and the extension direction of the corresponding straight edge line is taken as the gold finger pointing direction.
[0015] The vertical direction of the gold finger pointing direction is obtained as the gold finger arrangement direction.
[0016] Further, the distribution descriptor obtaining method comprises:
[0017] Based on the position order of each feature point corresponding to the gold finger equal division area, a first distribution descriptor is obtained;
[0018] The Euclidean distance between each feature point and the centroid in the corresponding gold finger equal division area is obtained and normalized as a second distribution descriptor;
[0019] The connecting line between each feature point and the centroid in the corresponding gold finger equal division area is constructed, the included angle between the corresponding connecting line and the gold finger arrangement direction is obtained and normalized as a third distribution descriptor.
[0020] Further, the defect possibility obtaining method comprises:
[0021] The Euclidean distance between each feature point and each feature point in the local range is obtained as a relative distance; the relative distance is negatively correlated and mapped as the local similarity between each feature point and each feature point in the local range;
[0022] Obtain the fluctuation characteristics of the Euclidean distance between each feature point and all feature points in the local range as the local distance fluctuation of each feature point.
[0023] According to the local similarity degree between each feature point and different feature points in the local range, the difference of the local distance fluctuation, and the local distance fluctuation of each feature point, obtain the defect possibility of each feature point, and the local similarity degree, the difference of the local distance fluctuation, and the local distance fluctuation are positively correlated with the defect possibility.
[0024] Further, the matching distance obtaining method comprises:
[0025] For each feature point, obtain a descriptor row vector composed of the primary descriptor and the distribution descriptor;
[0026] Obtain the vector distance of the descriptor row vector of different feature points between the to-be-tested image and the template image, and calculate the product between the vector distance and the defect possibility of each feature point on the to-be-tested image as the matching distance of different feature points between the to-be-tested image and the template image.
[0027] Further, the matching and alignment of the to-be-tested image and the template image according to the matching distance of different feature points between the to-be-tested image and the template image comprises:
[0028] Based on the matching distance of different feature points between the to-be-tested image and the template image, adopt a bidirectional matching algorithm to obtain the matching feature points between the corresponding images, correspond the positions of the matching feature points, and perform the matching and alignment of the to-be-tested image and the template image.
[0029] Further, the gold finger equal division area obtaining method comprises:
[0030] Divide the image into corresponding number of gold finger equal division areas in the gold finger arrangement direction with the number of gold fingers as the division number.
[0031] Further, the obtaining of the feature points in the image and the corresponding primary descriptor comprises:
[0032] Adopt the SURF algorithm to obtain the feature points in the image and the 64-dimensional descriptor of the corresponding feature points, and take the 64-dimensional descriptor as the primary descriptor.
[0033] The application further provides a circuit board gold finger guide line gap visual detection system, which comprises a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the processor implements the steps of the visual detection method of the circuit board gold finger guide line gap.
[0034] The application has the following beneficial effects:
[0035] The application considers that the golden finger is composed of parallel straight edges, for any image, a plurality of straight edge lines in the image are obtained; according to the distribution of the included angle between each straight edge line and other straight edge lines and the difference in length, the possibility of the extension direction of each straight edge line is obtained, and the arrangement direction of the golden finger is obtained; based on the arrangement direction of the golden finger and the number of the golden finger, a plurality of golden finger equal division regions of the image are obtained, the equal division regions divide the image into sub-regions consistent with the physical layout of the golden finger, and the calculation complexity is reduced; feature points in the image and corresponding primary descriptors are obtained, according to the position distribution between each feature point and the corresponding golden finger equal division region, a plurality of distribution descriptors of each feature point are obtained, reflecting the local texture and the relative position relationship between the feature point and the golden finger region; according to the relative distance distribution between different feature points and all feature points in the corresponding local range, the defect possibility of each feature point is obtained, and the abnormal degree of the distribution of the feature point in the local space is analyzed; according to the similarity of the primary descriptors and the distribution descriptors of different feature points between the to-be-tested image and the template image, and the defect possibility of the feature points on the corresponding to-be-tested image, the matching distance of different feature points between the to-be-tested image and the template image is obtained, the similarity of the descriptors is considered, and the matching difference of the feature points between the images is more comprehensively evaluated; the to-be-tested image and the template image are matched and aligned, and the golden finger defect detection is performed. The application optimizes the image matching and alignment accuracy by accurately obtaining the matching distance of the feature points in the to-be-tested image and the template image, and improves the accuracy of the golden finger defect detection. BRIEF DESCRIPTION OF DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, and the advantages thereof, a brief introduction will be given to the drawings needed in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.
[0037] Figure 1 A flowchart of a visual detection method for a circuit board golden finger guide hole provided by an embodiment of the present application;
[0038] Figure 2 A flowchart of a defect possibility acquisition method provided by an embodiment of the present application. DETAILED DESCRIPTION
[0039] In order to further clarify the technical means and effects taken by the present application to achieve the predetermined inventive purpose, the specific implementation, structure, features and effects of the circuit board gold finger guide hole visual detection method and system according to the present application are described in detail as follows. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.
[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs.
[0041] The specific scheme of the circuit board gold finger guide hole visual detection method and system provided by the present application is described in detail below in conjunction with the drawings.
[0042] Please refer to Figure 1 , which shows a method flowchart of a circuit board gold finger guide hole visual detection method provided by an embodiment of the present application, specifically including:
[0043] Step S1: Obtain the to-be-tested image and the template image of the circuit board gold finger.
[0044] When the gold finger in the circuit board has a gap, it will affect the electrical connection of the circuit board and cause unstable signals. The present application detects the defects of the gold finger to ensure that the electrical connection in the circuit board is complete and the signal transmission is stable.
[0045] In the embodiments of the present application, in order to detect the defects of the circuit board gold finger, a template image is needed as a reference to accurately match and align the collected image with the template image. First, in order to ensure the accuracy of the visual detection effect of the gold finger defects and ensure that the image collection is kept under the same environmental conditions, an AOI automatic optical detection device is used to scan the circuit board to obtain the to-be-tested image and the template image of the circuit board gold finger. Wherein, the gold fingers are distributed at equal intervals.
[0046] Step S2: For any image, obtain a plurality of straight edge lines in the image; according to the distribution of the included angle between each straight edge line and other straight edge lines and the difference in length, obtain the possibility of the direction of each straight edge line extending to the gold finger, and obtain the arrangement direction of the gold finger.
[0047] Considering the parallel arrangement of the gold fingers, obtaining multiple straight edge lines in any image helps determine the direction of the gold fingers. It should be noted that in the embodiments of this invention, the Canny edge detection algorithm is used to obtain the edge lines in the image; then, a Hough transform is performed on the edge lines in the image to obtain straight edge lines for analysis. The specific Canny edge detection algorithm and Hough transform are well-known techniques to those skilled in the art and will not be elaborated upon here.
[0048] Since the gold fingers in the circuit board are all arranged and extend in the same direction, and the edges of the gold fingers are straight, the lengths of the gold fingers are approximately the same and the directions are consistent. By analyzing the angles and lengths between the straight edge lines, the distribution of the straight edge lines can be reflected. Based on the distribution of the angles between each straight edge line and other straight edge lines, as well as the differences in length, the probability of the gold finger pointing in the extension direction of each straight edge line can be obtained.
[0049] Preferably, in one embodiment of the present invention, the method for obtaining the pointing probability of the gold finger includes:
[0050] Based on the absolute value of the cosine of the angle between each straight edge line and other straight edge lines, and the difference in the number of edge pixels, the probability of the gold finger pointing in the extension direction of each straight edge line is obtained. The absolute value of the cosine of the angle is positively correlated with the probability of the gold finger pointing, while the difference in the number of edge pixels is negatively correlated with the probability of the gold finger pointing.
[0051] In one embodiment of the present invention, the formula for the probability of the gold finger pointing is expressed as:
[0052] ;
[0053] in, Indicates the first The possibility of a golden finger pointing in the direction of the extension of a straight edge line; Indicates the first The straight edge line and the first The cosine value of the angle between the straight edge lines; Indicates the first The number of pixels at the edge of a straight edge line; Indicates the first The number of pixels at the edge of a straight edge line; Indicates the number of straight edge lines; Indicates the preset adjustment parameters; This indicates taking the absolute value.
[0054] In the formula for the probability of the golden finger pointing, the absolute value of the cosine of the angle between the straight edge lines is... The larger the value, the closer the straight edge lines are to being parallel, the more similar the extension direction of the straight edge lines to other straight edge lines, and the more likely it is to be the direction the golden finger is pointing. The greater the probability of the golden finger pointing, the more positively correlated it is. Indicates the first The first straight edge line and the first The absolute value of the difference in the number of edge pixels between straight edge lines, i.e. the difference in the number of edge pixels, the greater the difference, the more inconsistent the lengths between straight edge lines, and the less likely it is a gold finger. The smaller the difference, the more consistent the lengths between straight edge lines, the more it reflects the characteristics of a gold finger, and the greater the likelihood of a gold finger pointing to something. They are negatively correlated.
[0055] It should be noted that, in one embodiment of the present invention, to avoid the formula having a denominator of 0 and thus being meaningless, implementers can set preset adjustment parameters according to specific circumstances. For example, it can be set to 0.01; the specific means are well known to those skilled in the art and will not be described in detail here.
[0056] Since the arrangement direction of the gold fingers is perpendicular to the direction in which the gold fingers point, the arrangement direction of the gold fingers can be obtained through probability analysis of the direction in which the gold fingers point.
[0057] Preferably, in one embodiment of the present invention, the method for obtaining the gold finger arrangement direction includes:
[0058] Select the straight edge line corresponding to the highest probability value of the golden finger pointing, and take the extension direction of the corresponding straight edge line as the direction of the golden finger pointing.
[0059] Obtain the perpendicular direction from which the gold fingers are pointing, and use this as the direction for arranging the gold fingers.
[0060] Step S3: Obtain multiple equally divided regions of the image based on the arrangement direction and number of gold fingers; obtain feature points in the image and their corresponding primary descriptors; and obtain multiple distribution descriptors for each feature point based on the positional distribution between each feature point and its corresponding equally divided region of the gold fingers.
[0061] Gold fingers are usually designed with equal spacing and parallel arrangement. The computational load is large when analyzing the whole. In order to analyze local areas and significantly improve computational efficiency, multiple gold finger division regions of the image are obtained based on the gold finger arrangement direction and the number of gold fingers.
[0062] Preferably, in one embodiment of the present invention, the method for obtaining the equally divided regions of the gold finger includes:
[0063] Using the number of gold fingers as the dividing number, the image area is divided into a corresponding number of equal regions along the gold finger arrangement direction.
[0064] In order to enhance the matching precision of detection and the adaptability to complex scenes, local texture and structure features are described, different regions of the golden finger are effectively distinguished, feature points in the image and corresponding primary descriptors are obtained; it should be noted that in an embodiment of the present application, the SURF algorithm is used to obtain the feature points in the image and the 64-dimensional descriptor of the corresponding feature points, the 64-dimensional descriptor is taken as the primary descriptor, the SURF descriptor provides structured information and can distinguish different textures of similar edges; the specific SURF algorithm is a technical means known to those skilled in the art, and will not be described here.
[0065] Since the primary descriptor only encodes local gradient and texture, the analysis of spatial position distribution is lacking, and when used alone, it cannot distinguish features that are similar in space but different in position; the position distribution between each feature point and the centroid of the corresponding golden finger equal division region is analyzed, the global distribution law of the feature points on the golden finger is reflected, and according to the position distribution between each feature point and the corresponding golden finger equal division region, multiple distribution descriptors of each feature point are obtained.
[0066] Preferably, in an embodiment of the present application, the method for obtaining the distribution descriptor comprises:
[0067] normalizing the position order of each feature point corresponding to the golden finger equal division region as a first distribution descriptor;
[0068] obtaining the Euclidean distance between each feature point and the centroid in the corresponding golden finger equal division region and normalizing it as a second distribution descriptor;
[0069] constructing a line between each feature point and the centroid in the corresponding golden finger equal division region, obtaining the included angle between the corresponding line and the arrangement direction of the golden finger, and normalizing it as a third distribution descriptor.
[0070] It should be noted that in the embodiment of the present application, the method for normalizing each data is that: for any data in the position order, the Euclidean distance, the included angle, the cumulative sum of the data corresponding to all feature points is analyzed, and the data corresponding to each feature point is divided by the cumulative sum of the data, that is, the data is normalized; it can also be processed by existing normalization methods such as maximum and minimum value normalization, and the specific means is a technical means known to those skilled in the art, which will not be described here.
[0071] Step S4: obtaining the defect possibility of each feature point according to the relative distance distribution between different feature points and all feature points in the corresponding local range; obtaining the matching distance between different feature points in the template image and the to-be-detected image according to the similarity of the primary descriptor and the distribution descriptor of different feature points between the template image and the to-be-detected image, and the defect possibility of the feature points on the to-be-detected image.
[0072] Since the texture of the gold finger is evenly distributed on the image, while the defect area is only distributed in a local position of the image, it will cause the distribution of local feature points to be abnormal. By analyzing the relative distance between different feature points and all feature points in the corresponding local area, the regularity and distribution consistency of the local structure can be reflected, and the defect probability of the feature points can be quantified. Based on the distribution of the relative distance between different feature points and all feature points in the corresponding local area, the defect probability of each feature point can be obtained.
[0073] Preferably, in one embodiment of the present invention, the method for obtaining the probability of defects is described in [reference needed]. Figure 2 It illustrates a flowchart of a method for obtaining the probability of defects, including:
[0074] Step S201: Obtain the Euclidean distance between each feature point and each feature point within the local range as the relative distance; perform negative correlation mapping on the relative distance as the local similarity between each feature point and each feature point within the local range.
[0075] It should be noted that, in one embodiment of the present invention, the local range is a range formed by selecting a preset number of feature points that are closest to the feature point in Euclidean distance, with each feature point as a reference. The preset number is 10. The reference feature point is not included in the local range. In other embodiments of the present invention, the size of the local range can be set by the implementer according to the specific situation, and will not be limited or described here.
[0076] Step S202: Obtain the fluctuation characteristics of the Euclidean distance between each feature point and all feature points within the local range, as the local distance fluctuation characteristics corresponding to each feature point.
[0077] It should be noted that, in one embodiment of the present invention, the fluctuation characteristics of Euclidean distance can be represented by calculating the variance. The larger the variance, the greater the fluctuation characteristics of Euclidean distance, reflecting that the distance distribution between each feature point and feature points within a local range is more uneven, and the greater the possibility of a defect. The smaller the variance, the smaller the fluctuation characteristics of Euclidean distance, reflecting that the distance distribution between each feature point and feature points within a local range is more uniform, and the more likely it is a texture representation. In other embodiments of the present invention, the fluctuation characteristics can also be represented by methods such as standard deviation or range. The specific means are well known to those skilled in the art and will not be described in detail here.
[0078] Step S203: Based on the local similarity between each feature point and different feature points within the local range, the difference in local distance fluctuation, and the local distance fluctuation of each feature point, obtain the defect probability of each feature point. The local similarity, the difference in local distance fluctuation, and the local distance fluctuation are all positively correlated with the defect probability.
[0079] In one embodiment of the present invention, the formula for the probability of defects is expressed as:
[0080] ;
[0081] in, Indicates the first The probability of defects at each feature point; Indicates the first The number of feature points within a local range of a feature point; Indicates the first The first feature point and the first local range Euclidean distance between feature points; Indicates the first The first feature point and the local range of the first feature point Euclidean distance between feature points; Indicates the first The fluctuation characteristics of the Euclidean distance between a feature point and all feature points within a local range, i.e., the local distance fluctuation; Indicates the first The fluctuation characteristics of the Euclidean distance between a feature point and all feature points within a local range; This represents the normalization function.
[0082] In the formula for the probability of defects, Indicates the first The first feature point and the local range of the first feature point The larger the squared difference in the local distance fluctuations between feature points, the greater the difference in local distance fluctuations, indicating that the Euclidean distance distributions between the corresponding feature points are less similar in the local range, and the greater the possibility that they are defective feature points, showing a positive correlation. Indicates the first The sum of the local similarities between a feature point and all feature points within a local range. Indicates the first The first feature point and the first local range The ratio of the local similarity between the nth feature points to the sum of their local similarities, i.e., for the nth feature point... The first feature point and the local range of the first feature point The local similarity between feature points is normalized to reflect the similarity between feature points. The greater the local similarity, the more similar the feature points should be in distribution, making the analysis of the difference square of local distance fluctuations more reliable. The greater the difference, the greater the possibility of defective feature points, showing a positive correlation.
[0083] The similarity of the primary descriptor and the distribution descriptor of the description sub-represents the region information around the feature point, and can reflect the distance between two feature points in visual content, and the greater the distance, the more the feature points are not the same structure; the defect possibility quantifies the abnormal degree of the feature point region in the to-be-tested image, and by combining the similarity of the descriptor and the defect possibility of the corresponding feature point in the to-be-tested image, the matching distance between the feature points can be more accurately and comprehensively evaluated. According to the similarity of the primary descriptor and the distribution descriptor of different feature points between the to-be-tested image and the template image, and the defect possibility of the corresponding feature point in the to-be-tested image, the matching distance of different feature points between the to-be-tested image and the template image is obtained.
[0084] Preferably, in an embodiment of the present application, the matching distance acquisition method comprises:
[0085] For each feature point, a descriptor row vector composed of the primary descriptor and the distribution descriptor is obtained;
[0086] The vector distance of the descriptor row vector of different feature points between the to-be-tested image and the template image is obtained, and the product between the vector distance and the defect possibility of each feature point in the to-be-tested image is calculated as the matching distance of the corresponding different feature points between the to-be-tested image and the template image.
[0087] In an embodiment of the present application, the formula of the matching distance is:
[0088] ;
[0089] Wherein, represents the matching distance between the i-th feature point in the to-be-tested image and the j-th feature point in the template image; represents the defect possibility of the i-th feature point in the to-be-tested image; represents the vector distance of the descriptor row vector of the i-th feature point in the to-be-tested image and the j-th feature point in the template image.
[0090] In the formula of the matching distance, the smaller the defect possibility, the more the template image and the to-be-tested image do not exist defect feature points, the more credible the vector distance between the feature points, the smaller the vector distance of the descriptor row vector of the i-th feature point in the to-be-tested image and the j-th feature point in the template image, the more similar the descriptor structure of the feature points, the smaller the matching distance, and the more possible the corresponding feature points are the feature points representing the same structure in the golden finger.
[0091] It should be noted that in some embodiments of the present application, the method for obtaining the vector distance is to obtain the vector distance by using the existing distance calculation methods such as Euclidean distance or Manhattan distance; the specific means is a technology familiar to those skilled in the art, which will not be repeated here.
[0092] Step S5: According to the matching distance of different feature points between the to-be-tested image and the template image, the to-be-tested image and the template image are matched and aligned, and the gold finger defect detection is performed.
[0093] The to-be-tested image and the template image have geometric differences, and the matching distance is used for alignment to eliminate irrelevant interference, focus on real defects, and improve the accuracy of gold finger defect detection.
[0094] Preferably, in an embodiment of the present application, according to the matching distance of different feature points between the to-be-tested image and the template image, the to-be-tested image and the template image are matched and aligned, which includes:
[0095] Based on the matching distance of different feature points between the to-be-tested image and the template image, a bidirectional matching algorithm is used to obtain the matching feature points between the corresponding images, the positions of the matching feature points are matched, and the to-be-tested image and the template image are matched and aligned.
[0096] It should be noted that the process of the bidirectional matching algorithm is as follows: for each feature point in the to-be-tested image, the feature point with the smallest matching distance in the template image is selected to form a forward matching point pair; conversely, for each feature point in the template image, the feature point with the smallest matching distance in the to-be-tested image is selected to form a reverse matching point pair; if the forward matching point pair and the reverse matching point pair are consistent, the corresponding feature point is the matching feature point between the images. The specific bidirectional matching algorithm is a technology familiar to those skilled in the art, which will not be repeated here.
[0097] It should be noted that in another embodiment of the present application, the to-be-tested image and the template image are matched and aligned, and the gold finger defect detection is performed, which includes: performing a mask operation on the to-be-tested image based on the matched and aligned template image, obtaining the mask operation result of each pixel point in the to-be-tested image, and performing normalization to obtain the defect degree of each pixel point.
[0098] If the defect degree of the pixel point is greater than the preset defect threshold, the corresponding pixel point is regarded as a defect pixel point; and the region composed of all the defect pixel points on the to-be-tested image is obtained as a gold finger defect region. The mask operation is a technology familiar to those skilled in the art, which will not be repeated here.
[0099] It should be noted that in an embodiment of the present application, the preset defect threshold is set to 0.3; in other embodiments of the present application, the size of the preset defect threshold can be set according to specific conditions, which will not be limited and repeated here.
[0100] To sum up, the application obtains multiple finger equal areas of an image based on the arrangement direction and the number of the gold fingers; obtains feature points and corresponding primary descriptors in the image, obtains multiple distribution descriptors of each feature point according to the position distribution between each feature point and the corresponding finger equal area; obtains the defect possibility of each feature point according to the relative distance distribution between different feature points and all feature points in the corresponding local range; obtains the matching distance of different feature points between the to-be-tested image and the template image by combining the similarity of the primary descriptors and the distribution descriptors of different feature points; and performs gold finger defect detection by matching and aligning the to-be-tested image and the template image. The application can accurately obtain the matching distance of the feature points in the to-be-tested image and the template image, optimize the matching and alignment accuracy of the image, and improve the accuracy of the gold finger defect detection.
[0101] The application further provides a visual detection system for the lead gap of the gold finger of a circuit board, which comprises a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the processor implements the steps of the visual detection method for the lead gap of the gold finger of a circuit board when executing the computer program.
[0102] It should be noted that the above-mentioned sequence of the embodiments of the application is only for description, and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are also possible or can be advantageous.
[0103] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment mainly describes the difference from other embodiments.
Claims
1. A visual inspection method for notches in gold fingers on circuit boards, characterized in that, The method includes: Obtain the test image and template image of the gold fingers on the circuit board; For any image, obtain multiple straight edge lines in the image; based on the distribution of the angles between each straight edge line and other straight edge lines, and the difference in length, obtain the probability of the gold finger pointing in the extension direction of each straight edge line, and obtain the gold finger arrangement direction; Based on the arrangement direction and number of gold fingers, multiple equally divided regions of the image are obtained; feature points in the image and their corresponding primary descriptors are obtained; based on the positional distribution between each feature point and its corresponding equally divided region of the gold fingers, multiple distribution descriptors for each feature point are obtained. Based on the relative distance distribution between different feature points and all feature points within the corresponding local range, the defect probability of each feature point is obtained; based on the similarity of the primary descriptors and distribution descriptors of different feature points between the test image and the template image, and the defect probability of the corresponding feature points on the test image, the matching distance between different feature points between the test image and the template image is obtained. Based on the matching distance between different feature points between the image to be tested and the template image, the image to be tested and the template image are matched and aligned to perform gold finger defect detection; The method for obtaining the distribution descriptor includes: Normalization is performed based on the positional order of the equally divided regions of the gold finger corresponding to each feature point, which is used as the first distribution descriptor; The Euclidean distance between each feature point and the centroid of the corresponding equally divided region of the gold finger is obtained and normalized to serve as the second distribution descriptor; Construct a line connecting each feature point to the centroid of the corresponding gold finger's equally divided region, obtain the angle between the corresponding line and the gold finger's arrangement direction, and normalize it to serve as the third distribution descriptor.
2. The visual inspection method for notches in gold finger guide lines on a circuit board according to claim 1, characterized in that, The methods for obtaining the probability of the gold finger pointing include: Based on the absolute value of the cosine of the angle between each straight edge line and other straight edge lines, and the difference in the number of edge pixels, the probability of the gold finger pointing in the extension direction of each straight edge line is obtained. The absolute value of the cosine of the angle is positively correlated with the probability of the gold finger pointing, while the difference in the number of edge pixels is negatively correlated with the probability of the gold finger pointing.
3. The visual inspection method for notches in gold finger guide lines on a circuit board according to claim 1, characterized in that, The method for obtaining the gold finger arrangement direction includes: Select the straight edge line corresponding to the highest probability value of the golden finger pointing, and take the extension direction of the corresponding straight edge line as the direction of the golden finger pointing. Obtain the perpendicular direction from which the gold fingers are pointing, and use this as the direction for arranging the gold fingers.
4. The visual inspection method for notches in gold finger guide lines on a circuit board according to claim 1, characterized in that, The method for obtaining the probability of the defect includes: Obtain the Euclidean distance between each feature point and every feature point within the local range, as the relative distance; perform a negative correlation mapping on the relative distances to determine the local similarity between each feature point and every feature point within the local range. Obtain the fluctuation characteristics of the Euclidean distance between each feature point and all feature points within the local range, and use them as the local distance fluctuation characteristics corresponding to each feature point; Based on the local similarity between each feature point and different feature points within the local range, the difference in local distance variability, and the local distance variability of each feature point, the defect probability of each feature point is obtained. The local similarity, the difference in local distance variability, and the local distance variability are all positively correlated with the defect probability.
5. The visual inspection method for notches in gold-plated finger guide lines on a circuit board according to claim 1, characterized in that, The method for obtaining the matching distance includes: For each feature point, obtain the descriptor row vector consisting of the primary descriptor and the distribution descriptor; Obtain the vector distance between the descriptor row vectors of different feature points between the test image and the template image. Calculate the product between the vector distance and the defect probability of each feature point on the test image, and use it as the matching distance between the test image and the template image for corresponding different feature points.
6. The visual inspection method for notches in gold finger guide lines on a circuit board according to claim 1, characterized in that, The step of matching and aligning the test image and the template image based on the matching distance of different feature points between the test image and the template image includes: Based on the matching distance between different feature points between the test image and the template image, a bidirectional matching algorithm is used to obtain the matching feature points between the corresponding images. The positions of the matching feature points are then matched and aligned between the test image and the template image.
7. The visual inspection method for notches in gold finger guide lines on a circuit board according to claim 1, characterized in that, The method for obtaining the equally divided regions of the gold finger includes: Using the number of gold fingers as the dividing number, the image area is divided into a corresponding number of equal regions along the gold finger arrangement direction.
8. The visual inspection method for notches in gold finger guide lines on a circuit board according to claim 1, characterized in that, The process of obtaining feature points and corresponding primary descriptors in an image includes: The SURF algorithm is used to obtain feature points in the image and the corresponding 64-dimensional descriptors of the feature points. The 64-dimensional descriptors are used as primary descriptors.
9. A visual inspection system for gold finger guideline notches on a circuit board, the system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the visual inspection method for gold finger guide line gaps on a circuit board as described in any one of claims 1 to 8.
Citation Information
Patent Citations
FICS goldfinger defect detection system and detection method based on a BP neural network
CN109035219A
Universal PCB golden finger defect detection method, system, equipment and medium
CN119131015A