A multi-functional test board card detection method and system based on image analysis

By using grayscale image analysis to obtain the installation of markings and components in the multi-function test board detection, the problem of markings caused by large components is solved, and the accuracy and universality of detection are improved.

CN119887777BActive Publication Date: 2025-06-13陕西华容智达信息技术有限公司
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The components on the multifunctional test board are large in size, which causes the marking lines to be blocked during image acquisition, affecting the detection accuracy 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 status 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 CN119887777B_ABST
    Figure CN119887777B_ABST
Patent Text Reader

Abstract

This application relates to the field of image processing technology, and specifically relates to a multifunctional test board detection method and system based on image analysis. The method includes: collecting a grayscale image of the multifunctional test board; obtaining each high-gray pixel point and each strip cluster in the grayscale image; obtaining the marking factors of each strip cluster, and obtaining each marking line in the grayscale image through the marking factors; obtaining each super-pixel cluster of the pixel points in the grayscale image except the pixel points on all the marking lines, and obtaining the component connected domains of each marking line; obtaining the distribution coefficients of each component connected domain through the distances between the pixel points on each marking line and their component connected domains, and the position distributions of the pixel points on each marking line; obtaining the spatial influence values of each component connected domain; obtaining the installation offset degrees of each component, and detecting the offset conditions of the installation positions of each component. This application aims to improve the accuracy of detecting the offset conditions of the installation positions of components.
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 particularly relates to a method and system for detecting a multi-functional test board based on image analysis. Background Art

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

[0003] Currently, the image analysis method is often used to detect the multi-functional test board. By collecting the surface image of the multi-functional test board and comparing the actual installation position of the components with the designed position, the detection of the installation position of the components is realized. However, the components on the multi-functional test board are relatively large in volume, which may cause occlusion of the markings on the surface of the multi-functional test board during the image acquisition process, thus 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 method and system for detecting a multi-functional test board based on image analysis, which improves the accuracy of detecting the offset of the installation position of components compared with the traditional method for detecting a multi-functional test board:

[0005] In a first aspect, an embodiment of the present application provides a method for detecting a multi-functional test board based on image analysis, the method including the following steps:

[0006] Collect a grayscale image of the multi-functional test board;

[0007] Through the gray-scale distribution of all pixel points in the grayscale image, obtain each high-gray-scale pixel point and each bar-shaped cluster in the grayscale image; by analyzing the number of high-gray-scale pixel points of each pixel point in each bar-shaped cluster in a preset direction, obtain the marking factor of each bar-shaped cluster, and through the marking factor, obtain each marking line in the grayscale image;

[0008] Obtain each super-pixel cluster of the pixel points in the grayscale image except the pixel points on all the marking lines, and obtain the component connection domain of each marking line through the position relationship between each marking line and each super-pixel cluster; through the distance between each pixel point on each marking line and its component connection domain, and the position distribution of the pixel points on each marking line, obtain the distribution coefficient of each component connection domain;

[0009] Obtain the spatial influence value of each component connection domain through the centroid of each component connection domain and the center of the grayscale image, and the spatial distribution of the pixel points on the marking lines of each component connection domain;

[0010] Based on the distribution coefficient and the spatial influence value, obtain the installation deviation of each component and detect the deviation of the installation position of each component.

[0011] In one embodiment, the process of obtaining each high-gray-scale pixel point and each bar cluster is as follows:

[0012] Use an edge detection algorithm to obtain the edge pixel points in the gray-scale image, perform connected component analysis on the edge pixel points to obtain multiple connected components, and take the largest connected component as the connected component of the multi-functional test board;

[0013] Use a threshold segmentation algorithm to obtain the segmentation threshold of all pixel points in the connected component of the multi-functional test board, and mark each pixel point greater than the segmentation threshold as each high-gray-scale pixel point;

[0014] Use a clustering algorithm to cluster the pixel points that are both edge pixel points and high-gray-scale pixel points in the connected component of the multi-functional test board to obtain each bar cluster.

[0015] In one embodiment, the process of determining the marking factor is as follows:

[0016] Respectively obtain the fitting lines of all pixel points in each bar cluster, draw perpendicular lines to the fitting line through each pixel point in any bar cluster, and use the high-gray-scale pixel points on the perpendicular lines as the comparison pixel points of each pixel point in the any bar cluster;

[0017] The expression of the marking factor is: ; where represents the marking factor of the i-th bar cluster; exp( ) represents the exponential function with the natural constant as the base; represents the degree of dispersion of the number of comparison pixel points of all pixel points on the i-th bar cluster; represents the mean value of the number of comparison pixel points of all pixel points on the i-th bar cluster; N represents the mean value of the number of comparison pixel points of all pixel points on all bar clusters.

[0018] In one embodiment, the method for obtaining each marking line in the gray-scale image is: taking the bar cluster with a marking factor greater than the preset threshold as the marking line.

[0019] In one embodiment, the process of obtaining the connected component of the component is as follows:

[0020] Respectively count the number of pixel points belonging to any marking line on both sides of the fitting line of any marking line; mark the side with the smallest number as the box selection side of the marking line;

[0021] Calculate the distances between the center of any one of the marking lines and the centers of the super-pixel clusters on its selected side, and take the super-pixel cluster corresponding to the minimum distance as the reference super-pixel cluster of the any one of the marking lines;

[0022] Use an edge detection algorithm to obtain the edge pixel points of the reference super-pixel cluster, record the distances between each pixel point on the any one of the marking lines and the edge pixel points of the reference super-pixel cluster as edge distances, and record the edge pixel point of the reference super-pixel cluster with the minimum edge distance to each pixel point on the any one of the marking lines as each reference pixel point;

[0023] Cluster all the reference pixel points through a clustering algorithm to obtain each clustering cluster, take the clustering cluster containing the largest number of reference pixel points as the reference edge of the any one of the marking lines, and record the distance between the any one of the marking lines and its reference edge as the reference distance;

[0024] If the reference distance is greater than the preset distance threshold, take the reference super-pixel cluster as the component connection domain of the any one of the marking lines.

[0025] In one of the embodiments, the process of obtaining the distribution coefficient is as follows:

[0026] Calculate the distances between any pixel point on any one of the marking lines and each pixel point in its component connection domain, record the minimum value among the first distances as the second distance of the any pixel point, calculate the second distances of each pixel point on the any one of the marking lines, and record the pixel point corresponding to the minimum value of the second distances on the any one of the marking lines as the close point on the any one of the marking lines;

[0027] Calculate the distances between the two end points of the any one of the marking lines and its close point respectively, and record them as the third distances;

[0028] Take the reciprocal of the sum of the third distance and a preset constant greater than 0 as the distribution coefficient of the component connection domain of the any one of the marking lines.

[0029] In one of the embodiments, the process of obtaining the spatial influence value is as follows:

[0030] Record the distance between the centroid of each component connection domain and the center of the grayscale image as the fourth distance;

[0031] Record the distance between the close point of the marking line of each component connection domain and the center of the grayscale image as the fifth distance;

[0032] The expression of the spatial influence value is:

[0033] ; where, represents the spatial influence value of the nth component connected domain; th( ) represents the hyperbolic function; represents the distance between the centroid of the nth component connected domain and the center of the grayscale image; represents the difference between the fifth distance and the fourth distance of the nth component connected domain; represents the dispersion degree of the second distances of all pixel points on the scale line of the nth component connected domain; μ represents a preset value greater than 0.

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

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

[0036] In a second aspect, an embodiment of the present application further provides a multi-functional test board card detection system based on image analysis, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of any one of the above-mentioned multi-functional test board card detection methods based on image analysis.

[0037] The present application has at least the following beneficial effects:

[0038] The present application obtains a bar cluster suspected to be a scale line in the grayscale image through the grayscale distribution of pixel points in the grayscale image, and then obtains a scale line factor by analyzing the number of high-grayscale pixel points of each pixel point in the bar cluster in a preset direction, thereby obtaining a scale line, which can avoid misjudging the interfaces and components with high grayscale values in the grayscale image as scale lines and affecting the subsequent results of obtaining components based on the scale line; further, through the positional relationship between the scale line and the components, a distribution coefficient is obtained to reflect the possibility of the scale line being blocked by the components; by analyzing the spatial distribution of the centroid of the components, the center of the grayscale image, and the scale line, a spatial influence value is obtained to reflect the possibility of the scale line being blocked by the components due to perspective differences; and then, by combining the distribution coefficient and the spatial influence value, the installation situation of the components is evaluated from multiple angles, improving the accuracy of detecting the offset of the components. Compared with the traditional method of detecting the offset degree of the installation position of components by comparing the installation position of the components with the designed position, there is no need to compare the installation position with the designed position, improving the universality of the offset detection method and reducing the influence of the shooting perspective, and improving the accuracy of detecting the offset of the installation position of the components. Description of the Drawings

[0039] To more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0040] Figure 1 It is a flowchart of the steps of a method for detecting a multifunctional test board based on image analysis provided by an embodiment of the present application;

[0041] Figure 2 It is a schematic diagram of the acquisition process of the installation offset. Specific embodiments

[0042] In the description of the embodiments of the present application, words such as "exemplary", "or", "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly, using words such as "exemplary", "or", "for example" aims to present relevant concepts in a specific manner.

[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present application belongs. 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 stated in the present application, " / " means "or".

[0044] In addition, it should be noted that the terms "first" and "second" in the present application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0045] The following will specifically describe the specific solutions of a method and system for detecting a multifunctional test board based on image analysis provided by the present application with reference to the accompanying drawings.

[0046] Please refer to Figure 1 , which shows a flowchart of the steps of a method for detecting a multifunctional test board based on image analysis provided by an embodiment of the present application. The method includes the following steps:

[0047] Step 1, collect the grayscale image of the multifunctional test board.

[0048] A high-resolution camera is used to collect the surface image of the multi-functional test board after the components are installed, and grayscale processing is performed to obtain a grayscale image. In order to facilitate the detection of the soldering quality and component position of the multi-functional test board, a backlight illumination method is used, that is, the multi-functional test board is placed on a transparent backplane, which helps to enhance the contrast of the surface image. The specific process of grayscale processing is a well-known technology and will not be elaborated in this application.

[0049] Step 2: Obtain each high-gray-scale pixel point and each strip cluster in the grayscale image through the gray-scale distribution of all pixel points in the grayscale image; obtain the marking factor of each strip cluster by analyzing the number of high-gray-scale pixel points of each pixel point in the preset direction in each strip cluster, and obtain each marking line in the grayscale image through the marking factor.

[0050] When collecting the surface image of the multi-functional test board, the background of the multi-functional test board will be captured. Since there is a large gray-scale difference between the multi-functional test board and the background, an edge detection algorithm is used to obtain the edge pixel points in the grayscale image, and connected component analysis is performed on the edge pixel points to obtain multiple connected components, and the largest connected component is used as the connected component of the multi-functional test board.

[0051] In this embodiment, the Sobel operator is used to obtain the edge pixel points in the grayscale image. As other implementation manners, on the basis of being able to obtain the edge pixel points in the grayscale image, implementers can use other existing technologies, such as the Roberts operator, the Prewitt operator, etc. This application does not make special restrictions.

[0052] There are various components in the connected component of the multi-functional test board. During the soldering process of the components, if the temperature is too high, it may cause the components to displace during the heating stage. Since the standard positions of the components are marked on the multi-functional test board, the multi-functional test board can be detected by comparing the actual positions of the components with the standard positions.

[0053] Since the connected component contains various components and various circuits, in order to detect each component on the surface of the multi-functional test board, it is necessary to obtain the components on the surface of the multi-functional test board. Since white marking lines are used to mark the position of each component on the PCB circuit board of the multi-functional test board during the manufacturing process of the PCB circuit board, the components can be positioned by obtaining the component marking lines on the surface of the PCB circuit board. The specific implementation process is as follows:

[0054] The threshold segmentation algorithm is used to obtain the segmentation threshold of all pixel points in the connected component of the multi-functional test board, and each pixel point greater than the segmentation threshold is recorded as each high-gray-scale pixel point;

[0055] In this embodiment, the Otsu threshold segmentation algorithm is used to obtain the segmentation threshold of all pixel points in the connected region of the multi-functional test board. The Otsu threshold segmentation algorithm is a well-known technology and will not be elaborated in this application. As other implementation manners, on the basis of being able to obtain the segmentation threshold of all pixel points in the connected region of the multi-functional test board, implementers can adopt other existing technologies, such as global threshold segmentation, iterative threshold segmentation, etc., and this application does not make special restrictions;

[0056] The pixel points that are both edge pixel points and high-gray-level pixel points in the connected region of the multi-functional test board are denoted as selected pixel points;

[0057] Since there are large gray-level differences between the component markings and the PCB circuit board, they will be marked during both edge detection and threshold segmentation. However, due to the relatively high edge gray-level values of some components, there may be edge pixel points of components among the selected pixel points.

[0058] The DBSCAN (Density-Based Spatial Clustering of Applications with Noise) algorithm is used to cluster all the selected pixel points to obtain each strip-shaped cluster; among them, the DBSCAN algorithm is a well-known technology, and the specific process will not be elaborated in this application.

[0059] Since the markings are relatively slender, and some high-gray-level interfaces and components on the test board are larger than the markings, further, the fitting lines of all pixel points in each strip-shaped cluster are obtained respectively. Perpendicular lines to the fitting line are drawn through each pixel point in any strip-shaped cluster, and each high-gray-level pixel point on the perpendicular line is used as each comparison pixel point of each pixel point in the said any strip-shaped cluster.

[0060] In this embodiment, the least squares method is used to obtain the fitting line. The least squares method is a well-known technology and will not be elaborated in this application. As other implementation manners, on the basis of being able to obtain the fitting line, implementers can adopt other existing technologies to obtain the fitting line, such as locally weighted regression, K-nearest neighbor regression, etc., and this application does not make special restrictions.

[0061] Through the quantity distribution of the comparison pixel points of each pixel point in each strip-shaped cluster, the marking factor of each strip-shaped cluster is obtained, and the expression is:

[0062] ; In the formula, represents the marking factor of the i-th strip-shaped cluster; exp( ) represents the exponential function with the natural constant as the base, which is used to perform normalization; represents the degree of dispersion of the quantity of the comparison pixel points of all pixel points on the i-th strip-shaped cluster; Denote the mean value of the number of comparison pixels of all pixels on the \(i\)-th bar cluster as the first mean value; denote \(N\) as the mean value of the number of comparison pixels of all pixels on all bar clusters, which is the second mean value.

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

[0064] It should be noted that: the smaller the degree of dispersion, the closer the number of comparison pixels of the pixels on the bar cluster, and the more likely the bar cluster is a marking line; and the difference between the first mean value and the second mean value is smaller, indicating that the number of comparison pixels of the pixels on the bar cluster is generally closer to the second mean value of the grayscale image, and the width of the bar cluster is closer to the marking line; then the value of the marking line factor is larger.

[0065] Further, take the bar clusters with the marking line factor greater than the preset threshold as the marking lines in the grayscale image.

[0066] In this embodiment, the value of the preset threshold is 0.6, and the value of the preset threshold is preset manually. The implementer can set it by himself / herself, and this application does not make special restrictions.

[0067] Step 3, obtain each superpixel cluster of the pixels in the grayscale image except the pixels on all the marking lines, and obtain the component connectivity domain of each marking line through the positional relationship between each marking line and each superpixel cluster; obtain the distribution coefficient of each component connectivity domain through the distance between each pixel on each marking line and its component connectivity domain, and the positional distribution of the pixels on each marking line.

[0068] Further, perform superpixel segmentation on all the remaining pixels in the grayscale image except the pixels on all the marking lines to obtain each superpixel cluster;

[0069] 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 elaborated in this application. As other implementation manners, on the basis of being able to perform superpixel segmentation, the implementer can select other feasible superpixel segmentation methods by himself / herself, and this application does not make special restrictions.

[0070] Count the number of pixels belonging to any marking line on both sides of the fitting line of any marking line respectively; record the side with the smallest number as the box selection side of the marking line.

[0071] Calculate the distances between the center of any one of the marking lines and the centers of the superpixel clusters on its selected side, and take the superpixel cluster corresponding to the minimum distance as the reference superpixel cluster of any one of the marking lines; use an edge detection algorithm to obtain the edge pixel points of the reference superpixel cluster, and record the distances between each pixel point on any one of the marking lines and the edge pixel points of the reference superpixel cluster as edge distances. Record the edge pixel points of the reference superpixel cluster with the minimum edge distance from each pixel point on any one of the marking lines as the respective reference pixel points; perform clustering on all the reference pixel points through a clustering algorithm to obtain each clustering cluster, and take the clustering cluster with the largest number of reference pixel points as the reference edge of any one of the marking lines. Calculate the distance between any one of the marking lines and its reference edge, and record it as the reference distance. If the reference distance is greater than the preset distance threshold, then take the reference superpixel cluster as the component connected domain of any one of the marking lines.

[0072] In this embodiment, the K-Means algorithm is used to perform clustering on all the reference pixel points, and the implementer can select other feasible clustering algorithms by themselves.

[0073] In this embodiment, the distance between any one of the marking lines and its reference edge is the DTW (Dynamic Time Warping) distance, the distance between the center of any one of the marking lines and the centers of the superpixel clusters on its selected side is the Euclidean distance, and the distance between each pixel point on any one of the marking lines and the edge pixel points of the reference superpixel cluster is the Euclidean distance.

[0074] In this embodiment, the Sobel operator is used to obtain the edge pixel points of the reference superpixel cluster. As other implementation manners, on the basis of being able to implement the edge pixel points of the reference superpixel cluster, the implementer can adopt other existing technologies, such as the Roberts operator, the Prewitt operator, etc., and this application does not make special restrictions.

[0075] Since under normal circumstances, the components are located within the enclosed range of the marking lines, but there may be some marking lines that cannot completely enclose the components. The reason is that the marking lines themselves are incomplete or the marking lines are blocked by the components. Therefore, it is necessary to analyze according to the situation of the marking lines.

[0076] Calculate the distances between any pixel point on any one of the marking lines and each pixel point in its component connected domain, and record them as the first distances. Record the minimum value among the first distances as the second distance of any one of the pixel points. Calculate the second distances of each pixel point on any one of the marking lines, and record the pixel point corresponding to the minimum value of the second distances on any one of the marking lines as the close point on any one of the marking lines.

[0077] Calculate the distances between the two end points of any one of the marking lines and its close point respectively, and record them as the third distances;

[0078] Take the reciprocal of the sum of the third distance and a preset constant ε greater than 0 as the distribution coefficient of the component connected region of any one of the marking lines. Here, ε is used to avoid the denominator being 0, and the value of ε is preset manually. The implementer can set it by himself. In this embodiment, the value of ε is 0.01.

[0079] It should be noted that: if the component connected regions of multiple marking lines are the same component connected region, then the distribution coefficient of the same component connected region is the average value of all its corresponding distribution coefficients.

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

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

[0082] Step 4, obtain the spatial influence value of each component connected region through the centroid of each component connected region and the center of the grayscale image, and the spatial distribution of the pixel points on the marking line of each component connected region.

[0083] Furthermore, since the heights of some components on the multifunctional test board are relatively high, therefore, when collecting the surface image of the multifunctional test board, some marking lines may be occluded by components due to the perspective difference. Therefore, it is necessary to analyze the perspective situation of each component.

[0084] Obtain the centroid of each component connected region and the center of the grayscale image.

[0085] Since the perspective difference caused by camera shooting is more serious closer to the image edge, and the occluded part of the marking line by the component will appear in the area far from the perspective, therefore, obtain the distance between the centroid of each component connected region and the center of the grayscale image, and record it as the fourth distance.

[0086] Record the distance between the close point of the marking line of each component connected region and the center of the grayscale image as the fifth distance.

[0087] Furthermore, through the distance between the centroid of each component connected region and the center of the grayscale image, the distance between the close point of the marking line of each component connected region and the center of the grayscale image, and the dispersion degree of the second distance of all pixel points on the marking line of each component connected region, obtain the spatial influence value of each component connected region. The expression is:

[0088] ; In the formula, represents the spatial influence value of the nth component connected region; th( ) represents the hyperbolic function, which is used to Mapped to the range of [0, 1]; Represents the distance between the centroid of the nth component connected region and the center of the grayscale image; Represents the difference between the fifth distance and the fourth distance of the nth component connected region; Represents the degree of dispersion of the second distances of all pixel points on the scale line of the nth component connected region; μ represents a preset value greater than 0, used to avoid a denominator of 0, and the value of μ is preset manually, and the implementer can set it by himself. In this embodiment, the value of μ is 0.01.

[0089] In this embodiment, the degree of dispersion of the second distances of all pixel points on the scale line is the variance. As other implementation manners, on the basis of being able to measure the uneven degree of the distribution of the second distances of all pixel points on the scale line, the implementer can use other existing technologies for measurement, such as standard deviation, coefficient of variation, etc., and this application does not make special restrictions.

[0090] It should be noted that: when the component is farther away from the image view center and the closer point is farther away from the image view center, is larger; and when the distances between all pixel points on the scale line and the component are more similar, is larger; at this time, the scale line of the component is more affected by the view angle.

[0091] Step 5, obtain the installation offset of each component through the distribution coefficient and the space influence value, and detect the offset of the installation position of each component.

[0092] Obtain the installation offset of each component through the distribution coefficient and the space influence value of each component connected region. Specifically: take the ratio of the distribution coefficient and the space influence value of each component connected region as the installation offset of each component.

[0093] It should be noted that: the more obvious the occlusion of the scale line of the component is, and the less the component is affected by the view angle, the larger the installation offset of the component is. The schematic flow diagram for obtaining the installation offset is as Figure 2 shown.

[0094] When the installation offset of any component is greater than the preset offset threshold, it is determined that the any component has an offset, and it is recalibrated and pasted.

[0095] In this embodiment, the value of the preset offset threshold is 0.6, and the value of the preset offset threshold is preset manually, and the implementer can set it by himself. This application does not make special restrictions.

[0096] Based on the same inventive concept as the above method, an embodiment of the present application further provides a multi-functional test board card detection system based on image analysis, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the steps of any one of the above methods of the multi-functional test board card detection method based on image analysis are implemented.

[0097] In summary, the present application obtains a bar cluster suspected to be a marking line in the grayscale image through the grayscale distribution of pixel points in the grayscale image, and then obtains a marking factor by analyzing the number of high-grayscale pixel points of each pixel point in the bar cluster in a preset direction, and then obtains the marking line, which can avoid misjudging the interfaces and components with high grayscale values in the grayscale image as marking lines and affecting the subsequent results of obtaining components according to the marking lines; further, through the positional relationship between the marking line and the component, the distribution coefficient is obtained to reflect the possibility of the marking line being blocked by the component; by analyzing the spatial distribution of the centroid of the component, the center of the grayscale image and the marking line, the spatial influence value is obtained to reflect the possibility of the marking line being blocked by the component due to the viewing angle difference; and then, by combining the distribution coefficient and the spatial influence value, the installation situation of the component is evaluated from multiple angles, improving the accuracy of detecting the offset situation of the component; compared with the traditional method of detecting the offset degree of the installation position of the component by comparing the installation position of the component with the design position, there is no need to compare the installation position with the design position, improving the universality of the offset detection method and reducing the influence of the shooting angle, and improving the accuracy of detecting the offset situation of the installation position of the component.

[0098] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of code, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the drawings. For example, two consecutive blocks may in fact be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. In the description corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may in fact be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0099] For those skilled in the art, it is obvious that the present application is not limited to the details of the above-described exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the basic characteristics of the present application. Therefore, from any point of view, the above embodiments of the present application should be regarded as exemplary and non-limiting.

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; Obtaining the installation offset of each component through the distribution coefficient and the spatial influence value, and detecting the offset of the installation position of each component; 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.

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 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.

4. A multifunctional test board detection method based on image analysis as claimed in claim 1, characterized in that: 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.

5. 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.

6. A multifunctional test board detection method based on image analysis as claimed in claim 5, 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.

7. 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.

8. 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.

9. 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-8 are implemented.

Citation Information

Patent Citations

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

    CN105066892A