N*N dot matrix circle intelligent detection and completion method and system based on OpenCV
By using OpenCV's N×N lattice circle intelligent detection and completion method, the problems of parameter sensitivity and annotation data dependence are solved. It realizes intelligent completion of missing points and multi-variety detection, adapts to complex imaging conditions, and meets the high-precision detection needs of semiconductor wafers, automotive parts and biochips.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-03-13
AI Technical Summary
Existing technologies are sensitive to parameters, rely on a large amount of labeled data, cannot adapt to different dot matrix specifications, and lack the ability to intelligently complete missing points, making it difficult to meet the high-precision inspection needs of scenarios such as semiconductor wafer inspection, automotive parts positioning, and biochip data analysis.
An intelligent detection and completion method for N×N dot matrix circles based on OpenCV is adopted, which includes image preprocessing, initial circle detection, outlier filtering, dynamic clustering analysis of grid structure and intelligent completion. The complete coordinates of the center of the N×N dot matrix circle are generated by adaptive parameter setting, dynamic statistical method and interpolation priority strategy.
It can adapt to different dot matrix specifications without the need for a large amount of labeled data, has the ability to intelligently complete missing points, adapt to complex imaging conditions, lower the threshold for use, and meet the testing needs of multi-variety, small-batch production.
Smart Images

Figure CN121661022A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of dot matrix data image processing, and in particular to an intelligent detection and completion method and system for N×N dot matrix circles based on OpenCV. Background Technology
[0002] In the field of precision industrial inspection based on machine vision, the rapid and accurate identification and positioning of regularly arranged N×N dot matrix circles is a key technology, widely used in semiconductor wafer bonding point detection, automotive part assembly hole positioning, and biochip microsphere analysis. Currently, existing technologies for achieving this function can be mainly divided into two categories: methods based on traditional image processing and methods based on deep learning, but both have significant limitations.
[0003] (1) Methods based on traditional image processing
[0004] These methods typically utilize algorithms such as the Hough Circle Transform for circle detection. The Hough Circle Transform uses image gradients to accumulate votes and detect the center and radius of the circle. However, this method is extremely sensitive to input parameters (such as the accumulator threshold), requiring tedious manual adjustments and optimizations based on different imaging conditions (such as illumination and contrast). The same set of parameters is difficult to adapt to images of varying quality, leading to unstable detection results. More importantly, these methods can only output circles that can be directly detected in the image. For missing points that are completely undetected due to occlusion, reflection, or noise, they lack any inference or completion mechanism and cannot reconstruct the complete dot matrix structure.
[0005] (2) Deep learning-based methods
[0006] These methods primarily utilize convolutional neural network classifiers or object detection models such as YOLO to achieve circle recognition and localization through end-to-end learning. While these methods can automatically learn features to some extent, their performance is highly dependent on training with large-scale, high-quality labeled samples. In practical industrial applications, collecting and labeling tens of thousands of effective samples for a specific dot matrix is costly. Furthermore, the trained models have poor generalization ability; when the size (N), spacing, or scaling of the dot matrix changes, it is usually necessary to recollect data and retrain the model, lacking flexibility and making it difficult to adapt to the production inspection needs of multi-variety, small-batch operations.
[0007] Therefore, there is an urgent need for a dot matrix circle detection technology that can adapt to complex imaging conditions and different dot matrix specifications, does not rely on a large amount of labeled data, and has the ability to intelligently infer and complete missing points. Summary of the Invention
[0008] The technical problem to be solved by this invention is to design an intelligent detection and completion method and system for N×N dot matrix circles based on OpenCV, which solves the problems of existing technologies such as sensitivity to parameters, reliance on a large amount of labeled data, inability to adapt to different dot matrix specifications, and lack of intelligent completion capability for missing points, so as to meet the high-precision detection needs of scenarios such as semiconductor wafer inspection, automotive parts positioning, and biochip data analysis.
[0009] To address the aforementioned technical problems, this invention provides an intelligent detection and completion method for N×N dot matrix circles based on OpenCV, specifically including the following steps:
[0010] Step S1: Image preprocessing: Obtain the image to be processed, and obtain the preprocessed image after block-based background removal, adaptive Gaussian blurring, and grayscale normalization.
[0011] Step S2: Initial circle detection: based on the expected circle radius and theoretical grid spacing The system adaptively sets the circle detection parameters, performs Hough circle detection on the preprocessed image, and performs geometric deduplication and edge circle filtering on the detection results. When the number of detected circles reaches N×N, an early exit mechanism is triggered, and the initial circle set is output.
[0012] Step S3: Outlier Filtering: Calculate the average distance from each circle center in the initial circle set to the centers of all other circles. Based on the average distance The statistical distribution characteristics are used to filter out outlier circles, resulting in a set of valid circles.
[0013] Step S4: Dynamic clustering analysis of the mesh structure: For all centers of the valid circles in the set... coordinates and Cluster analysis is performed on the coordinates to dynamically determine the row and column structure of the lattice.
[0014] Step S5: Based on the row and column structure, calculate the center-to-center distances in the row and column directions, and according to the calculated distances and the preset interpolation priority strategy, perform interpolation to fill in the missing center positions, and generate a complete set of N×N dot matrix center coordinates through boundary constraint processing.
[0015] In a further step of this invention, in step S1, the local background of the image is removed by dividing the image into multiple small blocks, the mean of each small block is calculated, and the mean is subtracted from each pixel value in each block.
[0016] In a further step of this invention, in step S1, the image is smoothed and denoised by calling the Gaussian blur interface of OpenCV, and the result is determined according to the expected circle radius. The kernel size of the Gaussian blur is dynamically calculated.
[0017] Furthermore, in step S2 of this invention, the Hough circle detection parameters include the minimum circle spacing minDist, the minimum circle radius minRadius, and the maximum circle radius maxRadius, whose values are as follows:
[0018] Minimum circle spacing minDist: Take and The smaller value in;
[0019] minimum circle radius minRadius: take The larger of the two (and 5);
[0020] Maximum circle radius maxRadius: ;
[0021] Among them, theoretical grid spacing The formula used to determine the spacing between each cell in a grid distributed in an image is as follows:
[0022]
[0023] This represents the smaller of the image width and height.
[0024] Furthermore, in step S2 of this invention, a multi-parameter trial strategy is employed to improve the circle detection effect. Initially, decrease each time Value, until In each attempt, call OpenCV's... The function performs circle detection.
[0025] Furthermore, in step S2 of this invention, the detected center coordinates are stored in a set `centerSet`, and a threshold is set accordingly. To remove duplicate circles, the duplicate circle filtering step includes: calculating the distance between the centers of any two circles. If the distance Less than the threshold for determining the repetition circle If the two circles are found to be duplicates, then the duplicates will be removed.
[0026] Furthermore, in step S3 of this invention, the step based on average distance... The statistical distribution characteristics are used to filter outoutliers, specifically:
[0027] Calculate the median of the average distance between the centers of all circles. and median absolute deviation ;
[0028] For each circle center, calculate the corrected Z-score based on its mean distance, median, and absolute deviation from the median. ;
[0029] The corrected Z-score absolute value | |Exceeding the preset threshold The center of the circle is determined to be an outlier circle and then filtered.
[0030] Furthermore, in step S3 of this invention:
[0031] The average distance from each circle to all other circles is calculated as follows:
[0032]
[0033] in, It is the number of circles. It is the first The average distance from one circle to all other circles , The first The circle and the first The coordinates of the center of each circle;
[0034] absolute deviation of median The calculation formula is:
[0035]
[0036] Corrected Z-score The calculation formula is:
[0037]
[0038] When | If the condition is met, then the circle is determined not to be an outlier and the circle is retained.
[0039] When | If the condition is met, the circle is determined to be an outlier and is filtered out.
[0040] Furthermore, in this invention, step S5 specifically includes the following steps:
[0041] S51: Cluster by row and column. Divide the detected circles into clusters according to row and column labels, calculate the representative coordinates of each cluster, and use the mean of the centers of all circles in the cluster as the representative coordinates of each cluster.
[0042] S52: Extract and sort valid data points. Utilize spacing information in orthogonal directions (e.g., horizontal / vertical) to dynamically optimize the spacing estimate in the current direction, taking the smaller value in the horizontal or vertical direction to obtain the minimum spacing. and ensure .
[0043] S53: Prioritize insertion of missing points. The insertion point is determined by calculating the position score. The strategy prioritizes finding the middle position that satisfies the minimum spacing. Insert the missing point, then find a larger space on both sides to satisfy the requirement. The insertion point.
[0044] S54: Generate complete N×N row and column coordinates.
[0045] S55: Perform boundary constraint correction on the coordinate set to ensure that all circle centers are located within the valid area of the image.
[0046] S56: Retain the detected circles in the output and fill in the missing circles according to the corrected coordinate set to generate a complete N×N grid circle.
[0047] This invention also provides an intelligent detection and completion system for N×N dot matrix circles based on OpenCV, employing the aforementioned intelligent detection and completion method for N×N dot matrix circles based on OpenCV, including:
[0048] An image preprocessing module is used to preprocess the image to be processed.
[0049] The initial circle detection module is used to adaptively set parameters based on the expected circle radius and the lattice size N and perform Hough circle detection, obtaining an initial circle set through multi-parameter trial and deduplication.
[0050] The outlier filtering module is used to filter outliers in the initial set of circles based on the statistical distribution of the average distance between their centers.
[0051] The mesh structure analysis module is used to dynamically cluster the filtered center coordinates along the row and column directions to determine the lattice structure.
[0052] The intelligent completion module is used to interpolate and generate complete N×N dot matrix coordinates based on the dot matrix structure and spacing statistics, according to a priority strategy.
[0053] The present invention, based on OpenCV, provides an intelligent detection and completion method and system for N×N dot matrix circles, which has the following advantages:
[0054] (1) No need to know the standard geometric parameters of the dot matrix. It can be adaptively calculated through dynamic statistical methods. Traditional methods require the pre-input of geometric parameters such as row and column spacing and center spacing of the dot matrix.
[0055] (2) It can adapt to different sizes of dot matrix, from 3×3 to 10×10 without recalibrating the equipment.
[0056] (3) It can still reconstruct the complete structure even when the dot matrix is missing. In large dot lattices, even if only some points are detected, the global coordinates of all points can be accurately inferred.
[0057] (4) The parameters are simplified. Only the lattice size N and the expected radius need to be input, which greatly reduces the threshold for use. Attached Figure Description
[0058] The specific embodiments of the present invention will be further explained below with reference to the accompanying drawings.
[0059] Figure 1 This is a flowchart of the intelligent detection and completion method for N×N dot matrix circles based on OpenCV according to the present invention.
[0060] Figure 2 The image shown is the original grayscale image from Example 1.
[0061] Figure 3 The image is the one obtained after preprocessing in Example 1.
[0062] Figure 4 This is the image obtained after the initial circle detection in Example 1.
[0063] Figure 5 This is the image obtained after filtering outliers in Example 1.
[0064] Figure 6 This is the image obtained after intelligent circle completion in Example 1.
[0065] Figure 7 This is a system block diagram of the N×N dot matrix circle intelligent detection and completion system based on OpenCV of the present invention. Detailed Implementation
[0066] Example 1
[0067] Combination Figure 1 As shown, the intelligent detection and completion method for N×N dot matrix circles based on OpenCV in this embodiment specifically includes the following steps:
[0068] Step S1: Image preprocessing: Obtain the image to be processed, and obtain the preprocessed image after block-based background removal, adaptive Gaussian blurring, and grayscale normalization.
[0069] In this embodiment, preferably, in step S1, local background of the image is removed by dividing the image into multiple small blocks, calculating the mean of each small block, and subtracting the mean from each pixel value in each block. This helps to remove local background noise and highlight the differences in the image.
[0070] In this embodiment, specifically for each small block:
[0071]
[0072]
[0073] in, This represents the mean value of each small block of pixels in the image. The original pixel values in each small block. These are the pixel values obtained after processing.
[0074] In this embodiment, preferably, in step S1, the image is smoothed and denoised by calling OpenCV's Gaussian blur interface, and the image is then processed according to the expected circle radius. The kernel size of the Gaussian blur is dynamically calculated.
[0075] In this embodiment, preferably, in step S1, the OpenCV interface is used to normalize to an 8-bit grayscale image. If the image is a floating-point type (CV_32F), the minimum and maximum values of the image are calculated, and then the pixel values are normalized to the range of [0, 255] through linear transformation.
[0076]
[0077] in, These are the original pixel values. and These are the minimum and maximum pixel values of the image, respectively.
[0078] Step S2: Initial circle detection: based on the expected circle radius and theoretical grid spacing The system adaptively sets the circle detection parameters, performs Hough circle detection on the preprocessed image, and performs geometric deduplication and edge circle filtering on the detection results. When the number of detected circles reaches N×N, an early exit mechanism is triggered, and the initial circle set is output.
[0079] In this embodiment, preferably, in step S2, the Hough circle detection parameters include the minimum circle spacing minDist, the minimum circle radius minRadius, and the maximum circle radius maxRadius, and their values are as follows:
[0080] Minimum circle spacing minDist: Take and The smaller value in;
[0081] minimum circle radius minRadius: take The larger of the two (and 5);
[0082] Maximum circle radius maxRadius: ;
[0083] Among them, theoretical grid spacing The formula used to determine the spacing between each cell in a grid distributed in an image is as follows:
[0084]
[0085] This represents the smaller of the image width and height.
[0086] In this embodiment, preferably, a multi-parameter trial strategy is used in step S2 to improve the circle detection effect. Initially, decrease each time Value, until In each attempt, call OpenCV's... The function performs circle detection.
[0087] In this embodiment, preferably, in step S2, the detected center coordinates are stored in a set centerSet, and then a threshold is set accordingly. To remove duplicate circles, the duplicate circle filtering step includes: calculating the distance between the centers of any two circles. If the distance Less than the threshold for determining the repetition circle If the two circles are found to be duplicates, then the duplicates will be removed.
[0088] Specifically, in this embodiment, the threshold for determining the repeating circle is... Based on theoretical grid spacing The minimum circular spacing minDist is calculated using the following formula:
[0089]
[0090] Distance between any two circles The calculation formula is:
[0091]
[0092] and These are the coordinates of the centers of the two circles.
[0093] when < If the circle is not found to be a duplicate circle, then it is considered a duplicate circle and deduplication is performed.
[0094] Specifically, in this embodiment, the loop exits early when a sufficient number of circles are detected. Each time a new circle is detected, it checks whether the number of currently detected circles has reached the target N*N. If the target number has been reached, the loop ends and outputs a vector containing the center coordinates and radii of all deduplicated and filtered circles.
[0095] Step S3: Outlier Filtering: Calculate the average distance from each circle center in the initial circle set to the centers of all other circles. Based on the average distance The statistical distribution characteristics are used to filter out outlier circles, resulting in a set of valid circles.
[0096] In this embodiment, preferably, in step S3, the step based on average distance... The statistical distribution characteristics are used to filter outoutliers, specifically:
[0097] Calculate the median of the average distance between the centers of all circles. and median absolute deviation ;
[0098] For each circle center, calculate the corrected Z-score based on its mean distance, median, and absolute deviation from the median. ;
[0099] The corrected Z-score absolute value | |Exceeding the preset threshold The center of the circle is determined to be an outlier circle and then filtered.
[0100] In this embodiment, preferably, in step S3:
[0101] The average distance from each circle to all other circles is calculated as follows:
[0102]
[0103] in, It is the number of circles. It is the first The average distance from one circle to all other circles , The first The circle and the first The coordinates of the center of each circle;
[0104] absolute deviation of median The calculation formula is:
[0105]
[0106] Corrected Z-score The calculation formula is:
[0107]
[0108] When | If the condition is met, then the circle is determined not to be an outlier and the circle is retained.
[0109] When | If the condition is met, the circle is determined to be an outlier and is filtered out.
[0110] Step S4: Dynamic clustering analysis of the mesh structure: For all centers of the valid circles in the set... coordinates and Cluster analysis is performed on the coordinates to dynamically determine the row and column structure of the lattice.
[0111] In this embodiment, the row and column structure is dynamically analyzed based on the coordinates of the detected circles. The number of clusters is dynamically determined, specifically the number of rows and columns based on the distance between the circle centers. Row and column clustering, respectively for coordinates and K-means clustering is performed on the coordinates using OpenCV's K-means interface.
[0112] Step S5: Based on the row and column structure, calculate the center-to-center distances in the row and column directions, and according to the calculated distances and the preset interpolation priority strategy, perform interpolation to fill in the missing center positions, and generate a complete set of N×N dot matrix center coordinates through boundary constraint processing.
[0113] In this embodiment, step S5 preferably includes the following steps:
[0114] S51: Cluster by row and column. Divide the detected circles into clusters according to row and column labels, calculate the representative coordinates of each cluster, and use the mean of the centers of all circles in the cluster as the representative coordinates of each cluster.
[0115] S52: Extract and sort valid data points. Utilize spacing information in orthogonal directions (e.g., horizontal / vertical) to dynamically optimize the spacing estimate in the current direction, taking the smaller value in the horizontal or vertical direction to obtain the minimum spacing. and ensure .
[0116] In this embodiment, the spacing is specifically calculated as follows:
[0117]
[0118] S53: Prioritize insertion of missing points. The insertion point is determined by calculating the position score. The strategy prioritizes finding the middle position that satisfies the minimum spacing. Insert the missing point, then find a larger space on both sides to satisfy the requirement. The insertion point.
[0119] In this embodiment, specifically, the position score is calculated. The calculation formula is:
[0120]
[0121] in, This is the current gap width. Indexed by the center location.
[0122] S54: Generate complete N×N row and column coordinates.
[0123] S55: Perform boundary constraint correction on the coordinate set to ensure that all circle centers are located within the valid area of the image.
[0124] In this embodiment, the formula for boundary constraint processing is as follows:
[0125]
[0126] in, Represents the side length (length or width) of the image. The minimum circle radius is set manually. Represents the x-coordinate or y-coordinate of the detection circle. This represents the radius of the detection circle.
[0127] S56: Retain the detected circles in the output and fill in the missing circles according to the corrected coordinate set to generate a complete N×N grid circle.
[0128] This implementation of an OpenCV-based intelligent circle detection and completion method for N×N dot matrix arrays automatically calculates the geometric features of the dot matrix using row-column separation dynamic clustering analysis (K-means) and a global spacing statistical algorithm. In this implementation, outlier point filtering effectively removes noise interference: the first-level filtering uses geometric constraints (minimum center spacing limit), and the second-level filtering uses statistical filtering (Z-score based on MAD). This embodiment introduces a spatial scoring mechanism, prioritizing the completion of dots at positions with the largest gaps and close to the center through priority interpolation scoring. This embodiment uses a 3×3 dot matrix as an example, applying the method described in this embodiment for detection and completion, with the results as follows: Figures 2-6 As shown, Figure 2 The original grayscale image data. Figure 3 The image obtained after preprocessing. Figure 4 This is the image obtained after initial circle detection. Figure 5 The image obtained after filtering out outliers. Figure 6 The image obtained after intelligent circle completion.
[0129] Example 2
[0130] Combination Figure 7 As shown, the OpenCV-based N×N raster circle intelligent detection and completion system in this embodiment adopts the OpenCV-based N×N raster circle intelligent detection and completion method in Embodiment 1, specifically including:
[0131] The image preprocessing module includes a block background removal unit and an adaptive Gaussian blur unit, used to preprocess the image to be processed.
[0132] The initial circle detection module includes a multi-parameter Hough transform unit and a geometric deduplication unit, which are used to adaptively set parameters based on the expected circle radius and lattice size N and perform Hough circle detection to obtain an initial circle set through multi-parameter trial and deduplication.
[0133] The outlier filtering module includes a spacing constraint filtering unit and a statistical filtering unit, which are used to filter outliers in the initial set of circles based on the statistical distribution of the average distance between the circle centers.
[0134] The grid structure analysis module includes a row and column K-means clustering unit and a topological relationship verification unit, which are used to perform dynamic clustering in the row and column directions on the filtered center coordinates to determine the lattice structure.
[0135] The intelligent completion module includes a priority interpolation unit and a boundary processing unit, which are used to interpolate and generate complete N×N matrix coordinates according to the priority strategy based on the matrix structure and spacing statistics.
[0136] Many specific details have been set forth in the foregoing description to provide a thorough understanding of the present invention. However, the above description is merely a preferred embodiment of the present invention, and the present invention can be implemented in many other ways different from those described herein. Therefore, the present invention is not limited to the specific embodiments disclosed above. Furthermore, any person skilled in the art can make many possible variations and modifications to the technical solutions of the present invention, or modify them into equivalent embodiments, using the methods and techniques disclosed above, without departing from the scope of the present invention. Any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention, without departing from the content of the present invention, shall still fall within the protection scope of the present invention.
Claims
1. A method for intelligent detection and completion of N×N dot matrix circles based on OpenCV, characterized in that: Includes the following steps: Step S1: Image preprocessing: Obtain the image to be processed, and obtain the preprocessed image after block-based background removal, adaptive Gaussian blurring and grayscale normalization; Step S2: Initial circle detection: based on the expected circle radius and theoretical grid spacing Adaptively set circle detection parameters, perform Hough circle detection on the preprocessed image, and perform geometric deduplication and edge circle filtering on the detection results. When the number of detected circles reaches N×N, trigger an early exit mechanism and output the initial circle set. Step S3: Outlier Filtering: Calculate the average distance from each circle center in the initial circle set to the centers of all other circles. Based on the average distance The statistical distribution characteristics are used to filter out outlier circles, resulting in a set of valid circles; Step S4: Dynamic clustering analysis of the mesh structure: For all centers of the valid circles in the set... coordinates and Cluster analysis is performed on the coordinates to dynamically determine the row and column structure of the lattice; Step S5: Based on the row and column structure, calculate the center-to-center distances in the row and column directions, and according to the calculated distances and the preset interpolation priority strategy, perform interpolation to fill in the missing center positions, and generate a complete set of N×N dot matrix center coordinates through boundary constraint processing.
2. The intelligent detection and completion method for N×N dot matrix circles based on OpenCV according to claim 1, characterized in that: In step S1, the local background of the image is removed by dividing the image into multiple small blocks, the mean of each small block is calculated, and the mean is subtracted from each pixel value in each block.
3. The intelligent detection and completion method for N×N dot matrix circles based on OpenCV according to claim 1, characterized in that: In step S1, the image is smoothed and denoised by calling OpenCV's Gaussian blur interface, and the radius of the circle is determined according to the expected radius. The kernel size of the Gaussian blur is dynamically calculated.
4. The intelligent detection and completion method for N×N dot matrix circles based on OpenCV according to claim 1, characterized in that: In step S2, the Hough circle detection parameters include the minimum circle spacing minDist, the minimum circle radius minRadius, and the maximum circle radius maxRadius, whose values are as follows: Minimum circle spacing minDist: Take and The smaller value in; minimum circle radius minRadius: take The larger of the two values; Maximum circle radius maxRadius: ; Among them, theoretical grid spacing The formula used to determine the spacing between each cell in a grid distributed in an image is as follows: This represents the smaller of the image width and height.
5. The intelligent detection and completion method for N×N dot matrix circles based on OpenCV according to claim 1, characterized in that: Step S2 employs a multi-parameter trial strategy to improve the circle detection performance. Initially, decrease each time Value, until In each attempt, call OpenCV's... The function performs circle detection.
6. The intelligent detection and completion method for N×N dot matrix circles based on OpenCV according to claim 1, characterized in that: In step S2, the detected center coordinates are stored in the set centerSet, and then determined according to the threshold. To remove duplicate circles, the duplicate circle filtering step includes: calculating the distance between the centers of any two circles. If the distance Less than the threshold for determining the repetition circle If the two circles are found to be duplicates, then the duplicates will be removed.
7. The intelligent detection and completion method for N×N dot matrix circles based on OpenCV according to claim 1, characterized in that: In step S3, the average distance-based The statistical distribution characteristics are used to filter outoutliers, specifically: Calculate the median of the average distance between the centers of all circles. and median absolute deviation ; For each circle center, calculate the corrected Z-score based on its mean distance, median, and absolute deviation from the median. ; The corrected Z-score absolute value | |Exceeding the preset threshold The center of the circle is determined to be an outlier circle and then filtered.
8. The intelligent detection and completion method for N×N dot matrix circles based on OpenCV according to claim 7, characterized in that: In step S3: The average distance from each circle to all other circles is calculated as follows: in, It is the number of circles. It is the first The average distance from one circle to all other circles. , The first The circle and the first The coordinates of the center of each circle; absolute deviation of median The calculation formula is: Corrected Z-score The calculation formula is: When | If the condition is met, then the circle is determined not to be an outlier and the circle is retained. When | If the condition is met, the circle is determined to be an outlier and is filtered out.
9. The intelligent detection and completion method for N×N dot matrix circles based on OpenCV according to claim 1, characterized in that: Step S5 specifically includes the following steps: S51: Cluster by row and column. Divide the detected circles into clusters according to row and column labels, calculate the representative coordinates of each cluster, and use the mean of the centers of all circles in the cluster as the representative coordinates of each cluster. S52: Extract and sort valid data points. Utilize the spacing information in orthogonal directions to dynamically optimize the spacing estimate in the current direction, taking the smaller value in either the horizontal or vertical direction to obtain the minimum spacing. and ensure ; S53: Prioritize insertion of missing points. The insertion point is determined by calculating the position score. The strategy prioritizes finding the middle position that satisfies the minimum spacing. Insert the missing point, then find a larger space on both sides to satisfy it. The insertion point; S54: Generate complete N×N row and column coordinates; S55: Perform boundary constraint correction on the coordinate set to ensure that all circle centers are located within the valid area of the image; S56: Retain the detected circles in the output and fill in the missing circles according to the corrected coordinate set to generate a complete N×N grid circle.
10. An intelligent detection and completion system for N×N dot matrix circles based on OpenCV, characterized in that: The method for intelligent detection and completion of N×N dot matrix circles based on OpenCV, as described in any one of claims 1-9, includes: An image preprocessing module is used to preprocess the image to be processed; The initial circle detection module is used to adaptively set parameters based on the expected circle radius and the lattice size N and perform Hough circle detection, and obtain an initial circle set through multi-parameter trial and deduplication; An outlier filtering module is used to filter outlier circles in the initial set of circles based on the statistical distribution of the average distance between circle centers. The mesh structure analysis module is used to dynamically cluster the filtered center coordinates along the row and column directions to determine the lattice structure. The intelligent completion module is used to interpolate and generate complete N×N dot matrix coordinates based on the dot matrix structure and spacing statistics, according to a priority strategy.