Multifunctional test board card detection method and system based on image analysis

In the multifunctional test board detection, grayscale image analysis technology is used to obtain the positional relationship between the marking and the component connection domain, and calculate the distribution coefficient and spatial influence value, the marking occlusion problem caused by component volume is solved, and the detection accuracy and universality are improved.

CN119887777AActive Publication Date: 2025-04-25陕西华容智达信息技术有限公司
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510376922.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-04-25
Estimated Expiration
2045-03-28

AI Technical Summary

Technical Problem

The components on the multifunctional test board are large in size, which causes the markings on the board surface to be blocked during image acquisition, affecting the accuracy of the detection of the component installation position.

Method used

Through the grayscale distribution of pixel points in the grayscale image, high grayscale pixel points and bar clusters are obtained, high grayscale distribution of pixel points in the bar clusters are analyzed, and the reticle factor is calculated to obtain the reticle. Combining the positional relationship between the marking lines and the component's communication domain, calculate the distribution coefficient and spatial impact value, and evaluate the installation offset of the component.

Benefits of technology

The accuracy of detection of component installation position offsets is improved, the error of high gray value is avoided as a marking line, the influence of shooting perspective is reduced, and the universality of detection methods is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119887777A_ABST
    Figure CN119887777A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to a multifunctional test board card detection method and system based on image analysis, and the method comprises the steps: collecting a grayscale image of a multifunctional test board card; obtaining each high gray level pixel point and each strip-shaped cluster in the gray level image; obtaining a marking factor of each strip-shaped cluster, and obtaining each marking in the grayscale image through the marking factor; obtaining each superpixel cluster of pixel points except the pixel points on all the marked lines in the grayscale image, and obtaining a component connected domain of each marked line; obtaining a distribution coefficient of each component connected domain according to the distance between each pixel point on each marked line and the component connected domain and the position distribution of the pixel points on each marked line; acquiring a space influence value of a connected domain of each component; and the installation offset degree of each component is obtained, and the offset condition of the installation position of each component is detected. The invention aims to improve the accuracy of detecting the deviation condition of the mounting position of the component.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a multifunctional test board detection method and system based on image analysis. Background Art

[0002] As a hardware device integrating multiple functions, the multi-function test board is widely used in many fields. In order to ensure the performance of the multi-function test board, it is necessary to detect whether there are problems such as welding and component failure on its surface.

[0003] At present, image analysis methods are often used to detect multi-function test boards. By collecting the surface image of the multi-function test board and comparing the actual installation position of the components with the designed position, the installation position of the components can be detected. However, the components on the multi-function test board are large in size, which may cause the markings on the surface of the multi-function test board to be blocked during the image acquisition process, thereby affecting the detection of the installation position of the components. Summary of the invention

[0004] In view of the above, it is necessary to provide a multifunctional test board detection method and system based on image analysis, which improves the accuracy of detecting the offset of the component installation position compared with the traditional multifunctional test board detection method: In a first aspect, an embodiment of the present application provides a multifunctional test board detection method based on image analysis, the method comprising the following steps: Collect grayscale images of multi-function test boards; By using the grayscale distribution of all pixels in the grayscale image, each high grayscale pixel and each strip cluster in the grayscale image is obtained; by analyzing the number of high grayscale pixels of each pixel in each strip cluster in a preset direction, a marking factor of each strip cluster is obtained, and each marking line in the grayscale image is obtained by using the marking factor; Obtain each superpixel cluster of pixel points in the grayscale image except the pixel points on all the marking lines, and obtain the component connected domain of each marking line through the positional relationship between each marking line and each superpixel cluster; obtain the distribution coefficient of each component connected domain through the distance between each pixel point on each marking line and its component connected domain, and the position distribution of the pixel points on each marking line; The spatial influence value of each component connected domain is obtained through the centroid of each component connected domain and the center of the grayscale image, as well as the spatial distribution of the pixel points on the marking line of each component connected domain; The installation deviation of each component is obtained through the distribution coefficient and the spatial influence value, and the deviation of the installation position of each component is detected.

[0005] In one embodiment, the process of obtaining each high grayscale pixel point and each strip cluster is as follows: An edge detection algorithm is used to obtain edge pixels in the grayscale image, and a connected domain analysis is performed on the edge pixels to obtain multiple connected domains, and the largest connected domain is used as the connected domain of the multi-functional test board. A threshold segmentation algorithm is used to obtain a segmentation threshold of all pixels in the connected domain of the multifunctional test board, and each pixel greater than the segmentation threshold is recorded as a high grayscale pixel; A clustering algorithm is used to cluster the pixel points that are both edge pixels and high grayscale pixels in the connected domain of the multifunctional test board to obtain stripe clusters.

[0006] In one embodiment, the process of determining the marking factor is as follows: Obtain fitting straight lines for all pixels in each strip cluster respectively, draw a perpendicular line to the fitting straight line through each pixel in any strip cluster, and use each high grayscale pixel on the perpendicular line as each comparison pixel for each pixel in any strip cluster; The expression of the marking factor is: ; In the formula, represents the scale factor of the i-th bar cluster; exp( ) represents an exponential function with a natural constant as the base; Indicates the discrete degree of the number of comparison pixels of all pixels on the i-th bar cluster; represents the mean value of the number of comparison pixels of all pixels on the i-th strip cluster; N represents the mean value of the number of comparison pixels of all pixels on all strip clusters.

[0007] In one embodiment, the method for obtaining each marking line in the grayscale image is: taking a strip cluster whose marking line factor is greater than a preset threshold as a marking line.

[0008] In one embodiment, the process of obtaining the component connectivity domain is as follows: Count the number of pixel points belonging to any marking line on both sides of the fitting straight line of any marking line respectively; and record the side with the least number as the frame-selected side of the marking line; Calculate the distance between the center of any marking line and the centers of each superpixel cluster on the selected side thereof, and use the superpixel cluster corresponding to the minimum distance as the reference superpixel cluster for any marking line; An edge detection algorithm is used to obtain edge pixel points of the reference superpixel cluster, and the distance between each pixel point on any of the marking lines and each edge pixel point of the reference superpixel cluster is recorded as the edge distance, and the edge pixel point of the reference superpixel cluster with the smallest edge distance with each pixel point on any of the marking lines is recorded as each reference pixel point; Clustering all reference pixels by a clustering algorithm to obtain clusters, taking the cluster containing the largest number of reference pixels as the reference edge of any marking line, and recording the distance between any marking line and its reference edge as the reference distance; If the reference distance is greater than a preset distance threshold, the reference superpixel cluster is used as a component connected domain of any of the marking lines.

[0009] In one embodiment, the process of obtaining the distribution coefficient is: Calculate the distance between any pixel point on any marking line and each pixel point in the connected domain of its components, record it as the first distance, record the minimum value of the first distances as the second distance of any pixel point, calculate the second distance of each pixel point on the any marking line, and record the pixel point corresponding to the minimum value of the second distance on the any marking line as the close point on the any marking line; Calculate the distances between the two endpoints of any marking line and its close point respectively, and record them as the third distance; The reciprocal of the sum of the third distance and a preset constant greater than 0 is used as a distribution coefficient of the component connected domain of any one marking line.

[0010] In one embodiment, the process of obtaining the spatial impact value is as follows: The distance between the centroid of the connected domain of each component and the center of the grayscale image is recorded as the fourth distance; The distance between the close point of the marking line of each component connected domain and the center of the grayscale image is recorded as the fifth distance; The expression of the spatial influence value is: ; In the formula, represents the spatial influence value of the connected domain of the nth component; th( ) represents the hyperbolic function; Represents the distance between the centroid of the connected domain of the nth component and the center of the grayscale image; represents the difference between the fifth distance and the fourth distance of the connected domain of the nth component; It represents the discrete degree of the second distance of all pixel points on the marking line of the connected domain of the nth component; μ represents a preset value greater than 0.

[0011] In one embodiment, the installation offset is a ratio of the distribution coefficient to the spatial influence value.

[0012] In one embodiment, the method for detecting the offset of the installation position of each component is: when the installation offset of any component is greater than a preset offset threshold, it is determined that the any component is offset.

[0013] In the second aspect, an embodiment of the present application also provides a multifunctional test board detection system based on image analysis, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the steps of any one of the multifunctional test board detection methods based on image analysis described above are implemented.

[0014] This application has at least the following beneficial effects: The present application obtains a strip cluster suspected to be a marking line in a grayscale image through the grayscale distribution of pixels in a grayscale image, and then obtains a marking line factor by analyzing the number of high-grayscale pixels of each pixel in a preset direction in the strip cluster, and then obtains the marking line. This can avoid misjudging interfaces and components with high grayscale values ​​in the grayscale image as marking lines, which affects the subsequent results of obtaining components based on the marking line; further, the distribution coefficient is obtained through the positional relationship between the marking line and the component, reflecting the possibility that the marking line is blocked by the component; the distribution coefficient is obtained by analyzing the centroid of the component, the center of the grayscale image and the spatial distribution of the marking line. The spatial influence value is obtained by distributing the distribution coefficient and reflecting the possibility that the marking line is blocked by components due to the difference in viewing angle. Then, the installation status of components is evaluated from multiple angles in combination with the distribution coefficient and the spatial influence value, thereby improving the accuracy of detecting the offset of components. Compared with the traditional method of comparing the installation position of components with the design position to detect the degree of offset of the installation position of components, there is no need to compare the installation position with the design position, thereby improving the universality of the offset detection method, reducing the influence of the shooting viewing angle, and improving the accuracy of detecting the offset of the installation position of components. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0016] Figure 1 A flowchart of a multifunctional test board detection method based on image analysis provided in one embodiment of the present application; Figure 2 The figure is a schematic diagram of the process of obtaining the installation offset. DETAILED DESCRIPTION

[0017] In the description of the embodiments of the present application, words such as "exemplary", "or", "for example" and the like are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "or", "for example" and the like is intended to present related concepts in a concrete manner.

[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art in the present application. The terms used in the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. It should be understood that, unless otherwise specified, " / " means or.

[0019] It should also be noted that the terms "first" and "second" in the present application are used to distinguish similar objects rather than to describe a specific order or sequence.

[0020] The following is a detailed description of a specific scheme of a multifunctional test board detection method and system based on image analysis provided by the present application in conjunction with the accompanying drawings.

[0021] See also Figure 1 , which shows a flowchart of a multifunctional test board detection method based on image analysis provided by an embodiment of the present application, the method comprising the following steps: Step 1: collect the grayscale image of the multi-function test board.

[0022] A high-resolution camera is used to collect the surface image of the multifunctional test board after the components are installed, and grayscale processing is performed to obtain a grayscale image, wherein, in order to facilitate the detection of the welding quality and component position of the multifunctional test board, a backlighting method is used, that is, the multifunctional test board is placed on a transparent back plate, which helps to enhance the contrast of the surface image. The specific process of grayscale processing is a known technology and will not be repeated in this application.

[0023] Step 2, through the grayscale distribution of all pixels in the grayscale image, obtain each high-grayscale pixel and each strip cluster in the grayscale image; by analyzing the number of high-grayscale pixels of each pixel in each strip cluster in a preset direction, obtain the marking factor of each strip cluster, and obtain each marking line in the grayscale image through the marking factor.

[0024] When collecting the surface image of the multifunctional test board, the background of the multifunctional test board will be photographed. Since there is a large grayscale difference between the multifunctional test board and the background, an edge detection algorithm is used to obtain edge pixels in the grayscale image, and a connected domain analysis is performed on the edge pixels to obtain multiple connected domains, and the largest connected domain is used as the connected domain of the multifunctional test board.

[0025] In this embodiment, the Sobel operator is used to obtain edge pixel points in the grayscale image. As other implementation methods, on the basis of being able to obtain edge pixel points in the grayscale image, the implementer can adopt other existing technologies, such as the Roberts operator, the Prewitt operator, etc., and this application does not make any special restrictions.

[0026] There are various components in the connected domain of the multifunctional test board. During the soldering process of the components, if the temperature is too high, the components may be displaced during the heating stage. Since the standard position of each component will be marked on the multifunctional test board, the multifunctional test board can be tested by comparing the actual position of the component with the standard position.

[0027] Since the connected domain contains various components and various lines, in order to detect the components on the surface of the multi-function test board, it is necessary to obtain the components on the surface of the multi-function test board. During the production process of the PCB circuit board of the multi-function test board, white markings are used to mark the position of each component on the surface of the PCB circuit board. Therefore, the components can be located by obtaining the component markings on the surface of the PCB circuit board. The specific implementation process is as follows: A threshold segmentation algorithm is used to obtain a segmentation threshold of all pixels in the connected domain of the multifunctional test board, and each pixel greater than the segmentation threshold is recorded as a high grayscale pixel; In this embodiment, the Otsu threshold segmentation algorithm is used to obtain the segmentation threshold of all pixels in the connected domain of the multifunctional test board. The Otsu threshold segmentation algorithm is a well-known technology and will not be described in detail in this application. As other implementation methods, on the basis of being able to obtain the segmentation threshold of all pixels in the connected domain of the multifunctional test board, the implementer may adopt other existing technologies, such as global threshold segmentation, iterative threshold segmentation, etc., and this application does not make any special restrictions. The pixel points in the connected domain of the multifunctional test board that are both edge pixel points and high grayscale pixel points are recorded as selected pixel points; Since there is a large grayscale difference between the component markings and the PCB circuit board, they will be marked during edge detection and threshold segmentation. However, since the edge grayscale values ​​of some components are high, edge pixels of components may exist in the selected pixels.

[0028] The DBSCAN (Density-Based Spatial Clustering of Applications with Noise) algorithm is used to cluster all selected pixel points to obtain strip clusters; wherein, the DBSCAN algorithm is a well-known technology, and the specific process is not repeated in this application.

[0029] Since the marking line is relatively slender, and some high grayscale value interfaces and components on the test board are larger than the marking line, therefore, further, the fitting straight lines of all pixel points in each strip cluster are obtained respectively, and a perpendicular line to the fitting straight line is drawn through each pixel point in any strip cluster, and each high grayscale pixel point on the perpendicular line is used as the comparison pixel point for each pixel point in any strip cluster.

[0030] In this embodiment, the least squares method is used to obtain the fitting straight line. The least squares method is a well-known technology and will not be described in detail in this application. As other implementation methods, on the basis of being able to obtain the fitting straight line, the implementer may use other existing technologies to obtain the fitting straight line, such as local weighted regression, K-nearest neighbor regression, etc., and this application does not make any special restrictions.

[0031] By comparing the number of pixels in each bar cluster, the marking factor of each bar cluster is obtained. The expression is: ; In the formula, represents the scale factor of the i-th bar cluster; exp( ) represents an exponential function with a natural constant as the base, which is used to Perform normalization; Indicates the discrete degree of the number of comparison pixels of all pixels on the i-th bar cluster; represents the mean value of the number of comparison pixels of all pixels on the i-th strip cluster, recorded as the first mean value; N represents the mean value of the number of comparison pixels of all pixels on all strip clusters, recorded as the second mean value.

[0032] In this embodiment, the degree of discreteness of the number of comparison pixels of all pixel points is the variance. As other implementation methods, on the basis of being able to measure the uneven distribution of the number of comparison pixels of all pixel points, the implementer may adopt other existing technologies, such as standard deviation, coefficient of variation, etc., and the implementer does not make any special restrictions.

[0033] It should be noted that: the smaller the degree of dispersion, the closer the number of comparison pixels on the strip cluster is, and the more likely the strip cluster is a marking line; and the difference between the first mean and the second mean is The smaller it is, the number of comparison pixels on the strip cluster is closer to the second mean of the grayscale image as a whole, and the closer the width of the strip cluster is to the marking line; the larger the value of the marking line factor is.

[0034] Furthermore, the strip clusters whose marking factors are greater than a preset threshold are used as marking lines in the grayscale image.

[0035] In this embodiment, the value of the preset threshold is 0.6. The value of the preset threshold is preset manually and can be set by the implementer. This application does not impose any special restrictions.

[0036] Step 3, obtain the superpixel clusters of the pixel points in the grayscale image except the pixel points on all the marking lines, and obtain the component connected domain of each marking line through the positional relationship between each marking line and each superpixel cluster; obtain the distribution coefficient of the connected domain of each component through the distance between each pixel point on each marking line and its component connected domain, as well as the position distribution of the pixel points on each marking line.

[0037] Further, all the pixels in the grayscale image except the pixels on all the marking lines are segmented into superpixels to obtain superpixel clusters; In this embodiment, the SLIC (simple linear iterative clustering) algorithm is used for superpixel segmentation. The SLIC algorithm is a well-known technology and will not be described in detail in this application. As other implementation methods, on the basis of being able to perform superpixel segmentation, the implementer can select other feasible superpixel segmentation methods on his own, and this application does not impose any special restrictions.

[0038] Count the number of pixel points belonging to any marking line on both sides of the fitting straight line of any marking line respectively; and record the side with the least number as the frame-selected side of the marking line; Calculate the distance between the center of any marking line and the center of each superpixel cluster on its frame-selected side, and use the superpixel cluster corresponding to the minimum distance as the reference superpixel cluster for any marking line; use the edge detection algorithm to obtain the edge pixel points of the reference superpixel cluster, and record the distance between each pixel point on any marking line and each edge pixel point of the reference superpixel cluster as the edge distance, and record the edge pixel point of the reference superpixel cluster with the minimum edge distance with each pixel point on any marking line as each reference pixel point; cluster all reference pixel points through a clustering algorithm to obtain each cluster cluster, and use the cluster cluster containing the largest number of reference pixel points as the reference edge of any marking line, calculate the distance between any marking line and its reference edge, and record it as the reference distance. If the reference distance is greater than a preset distance threshold, use the reference superpixel cluster as the component connected domain of any marking line.

[0039] In this embodiment, the K-Means algorithm is used to cluster all reference pixels, and the implementer can select other feasible clustering algorithms.

[0040] In this embodiment, the distance between any marking line and its reference edge is the DTW (Dynamic TimeWarping) distance, the distance between the center of any marking line and the centers of each superpixel cluster on its framed side is the Euclidean distance, and the distance between each pixel point on any marking line and each edge pixel point of the reference superpixel cluster is the Euclidean distance.

[0041] In this embodiment, the Sobel operator is used to obtain the edge pixel points of the reference superpixel clusters. As other implementation methods, on the basis of realizing the edge pixel points of the reference superpixel clusters, the implementer can adopt other existing technologies, such as the Roberts operator, the Prewitt operator, etc., and this application does not impose any special restrictions.

[0042] Under normal circumstances, components are located within the encirclement of the markings. However, some markings may not completely encircle the components because the markings themselves are incomplete or blocked by components. Therefore, analysis is required based on the situation of the markings.

[0043] Calculate the distance between any pixel point on any marking line and each pixel point in the connected domain of its components, record it as the first distance, record the minimum value of the first distances as the second distance of any pixel point, calculate the second distance of each pixel point on any marking line, and record the pixel point corresponding to the minimum value of the second distance on any marking line as the close point on any marking line.

[0044] Calculate the distances between the two endpoints of any marking line and its close point respectively, and record them as the third distance; The reciprocal of the sum of the third distance and the constant ε which is preset to be greater than 0 is used as the distribution coefficient of the connected domain of the components of any marking line. ε is used to avoid the denominator being 0, and the value of ε is preset manually and can be set by the implementer. In this embodiment, the value of ε is 0.01.

[0045] It should be noted that: if there are multiple component connected domains with marked lines that are the same component connected domain, the distribution coefficient of the same component connected domain is the average value of all corresponding distribution coefficients.

[0046] In this embodiment, in the process of calculating the distribution coefficient, the distances involved are all Euclidean distances.

[0047] It should be noted that: when the distance between the close point on the marking line and its end point is smaller, it means that the component is closer to the end point of the marking line, the marking line is more likely to be disconnected due to component occlusion, and the value of the distribution coefficient is larger.

[0048] Step 4: Obtain the spatial influence value of each component connected domain through the centroid of each component connected domain and the center of the grayscale image, as well as the spatial distribution of the pixel points on the marking line of each component connected domain.

[0049] Furthermore, since some components on the multifunctional test board are relatively high, when acquiring the surface image of the multifunctional test board, some markings may be blocked by components due to differences in viewing angles, so it is necessary to analyze the viewing angles of each component.

[0050] Get the centroid of the connected domain of each component and get the center of the grayscale image.

[0051] Since the perspective difference caused by camera shooting is more serious the closer to the edge of the image, and the part of the marking line blocked by the components will appear in the area far away from the perspective, therefore, the distance between the centroid of the connected domain of each component and the center of the grayscale image is obtained and recorded as the fourth distance.

[0052] The distance between the close point of the marking line of each component connected domain and the center of the grayscale image is recorded as the fifth distance.

[0053] Furthermore, the spatial influence value of each component connected domain is obtained by the distance between the centroid of each component connected domain and the center of the grayscale image, the distance between the close point of the marking line of each component connected domain and the center of the grayscale image, and the discrete degree of the second distance of all pixel points on the marking line of each component connected domain. The expression is: ; In the formula, represents the spatial influence value of the connected domain of the nth component; th( ) represents the hyperbolic function, which is used to convert Mapped to the range [0,1]; Represents the distance between the centroid of the connected domain of the nth component and the center of the grayscale image; represents the difference between the fifth distance and the fourth distance of the connected domain of the nth component; Represents the discrete degree of the second distance of all pixel points on the marking line of the connected domain of the nth component; μ represents a preset value greater than 0, which is used to avoid the denominator being 0. The value of μ is preset manually and can be set by the implementer. In this embodiment, the value of μ is 0.01.

[0054] In this embodiment, the degree of discreteness of the second distance of all pixel points on the marking line is the variance. As other implementation methods, on the basis of being able to measure the uneven distribution of the second distance of all pixel points on the marking line, the implementer may adopt other existing technologies for measurement, such as standard deviation, coefficient of variation, etc., and this application does not impose any special restrictions.

[0055] It should be noted that: when the components are farther away from the center of the image viewing angle and the closer the point is, the farther away from the center of the image viewing angle, The larger the distance between all pixels on the marking line and the components is, the closer the distance between all pixels on the marking line and the components is. The larger the value, the more the markings of components are affected by the viewing angle.

[0056] Step 5: Obtain the installation offset of each component through the distribution coefficient and the spatial influence value, and detect the offset of the installation position of each component.

[0057] The installation offset of each component is obtained through the distribution coefficient and the spatial influence value of the connected domain of each component. Specifically, the ratio of the distribution coefficient and the spatial influence value of the connected domain of each component is used as the installation offset of each component.

[0058] It should be noted that: the more obvious the obstruction of the component marking line is, and the smaller the component is affected by the viewing angle, the greater the component installation offset. Figure 2 shown.

[0059] When the installation deviation of any component is greater than a preset deviation threshold, it is determined that the component is offset and is recalibrated and pasted.

[0060] In this embodiment, the value of the preset deviation threshold is 0.6. The value of the preset deviation threshold is preset manually and can be set by the implementer. This application does not impose any special restrictions.

[0061] Based on the same inventive concept as the above method, an embodiment of the present application also provides a multifunctional test board detection system based on image analysis, including a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, it implements the steps of any one of the above-mentioned multifunctional test board detection methods based on image analysis.

[0062] In summary, the present application obtains strip clusters suspected to be marking lines in the grayscale image through the grayscale distribution of pixels in the grayscale image, and then obtains the marking line factor by analyzing the number of high grayscale pixels of each pixel in the strip cluster in a preset direction, and then obtains the marking line, which can avoid misjudging interfaces and components with high grayscale values ​​in the grayscale image as marking lines, affecting the subsequent results of obtaining components based on the marking lines; further, the distribution coefficient is obtained through the positional relationship between the marking line and the component, reflecting the possibility of the marking line being blocked by the component; by analyzing the centroid of the component, the center of the grayscale image and the space between the marking line The spatial distribution is calculated to obtain the spatial influence value, which reflects the possibility that the marking line is blocked by components due to the difference in viewing angle. Then, the installation status of components is evaluated from multiple angles by combining the distribution coefficient and the spatial influence value, which improves the accuracy of detecting the offset of components. Compared with the traditional method of comparing the installation position of components with the design position to detect the degree of offset of the installation position of components, there is no need to compare the installation position with the design position, which improves the universality of the offset detection method, reduces the influence of the shooting viewing angle, and improves the accuracy of detecting the offset of the installation position of components.

[0063] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.

[0064] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the basic features of the present application. Therefore, no matter from which point of view, the above embodiments of the present application should be regarded as exemplary and non-restrictive.

Claims

1. A multifunctional test board detection method based on image analysis, characterized in that: The method comprises the following steps: Collect grayscale images of multi-function test boards; By using the grayscale distribution of all pixels in the grayscale image, each high grayscale pixel and each strip cluster in the grayscale image is obtained; by analyzing the number of high grayscale pixels of each pixel in each strip cluster in a preset direction, a marking factor of each strip cluster is obtained, and each marking line in the grayscale image is obtained by using the marking factor; Obtain each superpixel cluster of pixel points in the grayscale image except the pixel points on all the marking lines, and obtain the component connected domain of each marking line through the positional relationship between each marking line and each superpixel cluster; obtain the distribution coefficient of each component connected domain through the distance between each pixel point on each marking line and its component connected domain, and the position distribution of the pixel points on each marking line; The spatial influence value of each component connected domain is obtained through the centroid of each component connected domain and the center of the grayscale image, as well as the spatial distribution of the pixel points on the marking line of each component connected domain; The installation deviation of each component is obtained through the distribution coefficient and the spatial influence value, and the deviation of the installation position of each component is detected.

2. A multifunctional test board detection method based on image analysis as claimed in claim 1, characterized in that: The acquisition process of each high grayscale pixel point and each strip cluster is as follows: An edge detection algorithm is used to obtain edge pixels in the grayscale image, and a connected domain analysis is performed on the edge pixels to obtain multiple connected domains, and the largest connected domain is used as the connected domain of the multi-functional test board. A threshold segmentation algorithm is used to obtain a segmentation threshold of all pixels in the connected domain of the multifunctional test board, and each pixel greater than the segmentation threshold is recorded as a high grayscale pixel; A clustering algorithm is used to cluster the pixel points that are both edge pixels and high grayscale pixels in the connected domain of the multifunctional test board to obtain stripe clusters.

3. A multifunctional test board detection method based on image analysis as claimed in claim 1, characterized in that: The determination process of the marking factor is: Obtain fitting straight lines for all pixels in each strip cluster respectively, draw a perpendicular line to the fitting straight line through each pixel in any strip cluster, and use each high grayscale pixel on the perpendicular line as each comparison pixel for each pixel in any strip cluster; The expression of the marking factor is: ; In the formula, represents the scale factor of the i-th bar cluster; exp( ) represents an exponential function with a natural constant as the base; Indicates the discrete degree of the number of comparison pixels of all pixels on the i-th bar cluster; represents the mean value of the number of comparison pixels of all pixels on the i-th strip cluster; N represents the mean value of the number of comparison pixels of all pixels on all strip clusters.

4. A multifunctional test board detection method based on image analysis as claimed in claim 1, characterized in that: The method for obtaining each marking line in the grayscale image is: taking a strip cluster whose marking line factor is greater than a preset threshold as a marking line.

5. A multifunctional test board detection method based on image analysis as claimed in claim 3, characterized in that: The process of obtaining the component connectivity domain is as follows: The number of pixel points belonging to any marking line on both sides of the fitting straight line of any marking line is counted respectively; the side with the least number is recorded as the frame-selected side of the marking line; Calculate the distance between the center of any marking line and the centers of each superpixel cluster on the selected side thereof, and use the superpixel cluster corresponding to the minimum distance as the reference superpixel cluster for any marking line; An edge detection algorithm is used to obtain edge pixel points of the reference superpixel cluster, and the distance between each pixel point on any of the marking lines and each edge pixel point of the reference superpixel cluster is recorded as the edge distance, and the edge pixel point of the reference superpixel cluster with the smallest edge distance with each pixel point on any of the marking lines is recorded as each reference pixel point; Clustering all reference pixels by a clustering algorithm to obtain clusters, taking the cluster containing the largest number of reference pixels as the reference edge of any marking line, and recording the distance between any marking line and its reference edge as the reference distance; If the reference distance is greater than a preset distance threshold, the reference superpixel cluster is used as a component connected domain of any of the marking lines.

6. A multifunctional test board detection method based on image analysis as claimed in claim 1, characterized in that: The process of obtaining the distribution coefficient is as follows: Calculate the distance between any pixel point on any marking line and each pixel point in the connected domain of its components, record it as the first distance, record the minimum value of the first distances as the second distance of any pixel point, calculate the second distance of each pixel point on the any marking line, and record the pixel point corresponding to the minimum value of the second distance on the any marking line as the close point on the any marking line; Calculate the distances between the two endpoints of any marking line and its close point respectively, and record them as the third distance; The reciprocal of the sum of the third distance and a preset constant greater than 0 is used as a distribution coefficient of the component connected domain of any one marking line.

7. A multifunctional test board detection method based on image analysis as claimed in claim 6, characterized in that: The process of obtaining the spatial impact value is as follows: The distance between the centroid of the connected domain of each component and the center of the grayscale image is recorded as the fourth distance; The distance between the close point of the marking line of each component connected domain and the center of the grayscale image is recorded as the fifth distance; The expression of the spatial influence value is: ; In the formula, represents the spatial influence value of the connected domain of the nth component; th( ) represents the hyperbolic function; Represents the distance between the centroid of the connected domain of the nth component and the center of the grayscale image; represents the difference between the fifth distance and the fourth distance of the connected domain of the nth component; It represents the discrete degree of the second distance of all pixel points on the marking line of the connected domain of the nth component; μ represents a preset value greater than 0.

8. A multifunctional test board detection method based on image analysis as claimed in claim 1, characterized in that: The installation offset is a ratio of the distribution coefficient to the spatial influence value.

9. A multifunctional test board detection method based on image analysis as claimed in claim 1, characterized in that: The method for detecting the deviation of the installation position of each component is as follows: when the installation deviation of any component is greater than a preset deviation threshold, it is determined that the any component is deviated.

10. A multifunctional test board detection system based on image analysis, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the multifunctional test board detection method based on image analysis as described in any one of claims 1-9 are implemented.

Citation Information

Patent Citations

  • BGA element detecting and positioning method based on linear clustering analysis

    CN105066892A

  • A via hole detection method of a flexible IC package substrate based on circular contour extraction

    CN109671052A

  • Interpretation method for circular target with shielding deformation

    CN112668565A

  • Method and system for detecting position deviation of electrical pin, and electronic equipment

    CN119437046A

  • Method for detecting center position of pixel of imaging device

    JP2006127238A