Circle detection method and system based on geometric constraint and sub-pixel positioning, and medium

By adopting a multi-stage detection method based on geometric constraints and sub-pixel positioning, the problems of insufficient speed and accuracy in PCB circular detection are solved, achieving efficient and robust circular detection, which is applicable to a variety of PCB circular components.

CN121544622APending Publication Date: 2026-02-17SUZHOU HEXIN TECH CO LTD

Patent Information

Application Number
CN202610069841.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-20
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing circularity detection methods struggle to balance detection speed and accuracy in printed circuit board (PCB) production, and lack robustness against noise and obstruction, failing to meet industrial needs.

Method used

A multi-stage detection method based on geometric constraints and subpixel localization is adopted, including image preprocessing, edge detection, Hough circle initial screening, geometric fine screening and subpixel localization. High-precision circle detection is achieved through multiple constraints and techniques such as Gaussian filtering, Canny algorithm, Sobel operator and Hough circle detection.

Benefits of technology

It achieves a balance between detection accuracy and efficiency, improves algorithm robustness, reduces false detection and false negative rates, adapts to various PCB circular components, and provides reliable high-precision measurement results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121544622A_ABST
    Figure CN121544622A_ABST
Patent Text Reader

Abstract

The invention discloses a circle detection method based on geometric constraint and sub-pixel positioning, and the method comprises the following steps: carrying out the edge detection of a preprocessed image, calculating the gradient magnitude and gradient direction of an edge point in a binary edge image, and associating the coordinates of the edge point; performing Hough circle preliminary screening on the binarized edge image; performing grading and sorting processing on the candidate circles based on the consistency index, and performing geometric fine screening on the candidate circles according to grading and sorting priorities based on angle consistency constraint and radius stability constraint; detecting a local continuous arc section of the edge points after fine screening and removing isolated points, constructing a caliper sampling line along the radius direction of the continuous arc section, and performing sub-pixel-level positioning by detecting gradient extreme points; fitting the sub-pixel edge point set, and outputting a circle detection result; according to the invention, a multi-stage detection architecture can be adopted, and the balance between the detection precision and the efficiency is realized; and through double geometric constraints, the robustness of the algorithm is greatly improved, and the false detection and omission ratio is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial machine vision inspection technology, and in particular to a circle detection method, system and medium based on geometric constraints and sub-pixel positioning. Background Technology

[0002] During the printed circuit board (PCB) production stage, defect detection needs to be carried out on circular components such as Mark points and cylindrical capacitors on the board. Circular detection is the primary and core step in this process.

[0003] Existing circle detection methods are mainly divided into two categories. One is the Hough transform method, which is robust, but its detection accuracy is easily affected by factors such as image noise, edge breaks, and parameter space quantization. The other is the geometric fitting method, which has high accuracy, but has the disadvantages of being sensitive to initial values ​​and easily affected by outliers.

[0004] The above methods are all difficult to balance detection speed and accuracy, and are not robust enough in terms of noise and obstruction resistance, with limited versatility, and cannot meet the actual needs of industrial PCB inspection. Summary of the Invention

[0005] The purpose of this invention is to provide a circle detection method, system, and medium based on geometric constraints and sub-pixel positioning, thereby solving all or one of the aforementioned problems in the prior art.

[0006] To solve the above-mentioned technical problems, the specific technical solution of the present invention is as follows:

[0007] On the one hand, the present invention provides a circle detection method based on geometric constraints and sub-pixel localization, comprising the following steps:

[0008] Image preprocessing and edge detection: The original PCB grayscale image is preprocessed with image enhancement and noise suppression; edge detection is performed on the preprocessed image to obtain a binarized edge image; the gradient magnitude and gradient direction of the edge points in the binarized edge image are calculated, and the coordinates of the edge points are associated.

[0009] Hough circle initial screening and geometric fine screening: The binarized edge image is subjected to Hough circle initial screening to obtain the center coordinates and radius of the candidate circles; the candidate circles are scored and sorted based on the consistency index; and the candidate circles are geometrically fine screened based on the angle consistency constraint and the radius stability constraint and according to the score sorting priority.

[0010] Subpixel localization and result output: detect local continuous arc segments of edge points after fine screening and remove isolated points. Construct caliper sampling lines along the radial direction of the continuous arc segments. Perform subpixel-level localization by detecting gradient extreme points. Fit the subpixel edge point set and output the circle detection result.

[0011] As an improved approach, the image enhancement and noise suppression preprocessing further includes:

[0012] The original PCB grayscale image is subjected to histogram equalization, adaptive contrast stretching, or CLAHE processing.

[0013] Gaussian filtering or bilateral filtering is used to suppress image noise in the original PCB grayscale image.

[0014] As an improved approach, the step of performing edge detection on the preprocessed image to obtain a binarized edge image, calculating the gradient magnitude and gradient direction of edge points in the binarized edge image, and associating the edge point coordinates further includes:

[0015] The Canny algorithm is used to extract edges from the preprocessed image;

[0016] The gradient magnitude and gradient direction of each edge point in the binarized edge image are calculated based on the Sobel operator, and the gradient magnitude and gradient direction are respectively associated with the coordinates of the corresponding edge points.

[0017] As an improved solution, the Hough circular primary screen further includes:

[0018] The Hough circle detection algorithm is run on the binarized edge image with recall priority to obtain candidate circles and the center coordinates and radius of the candidate circles.

[0019] As an improved approach, the scoring and ranking process for the candidate circles based on a consistency metric further includes:

[0020] The candidate circles are scored based at least on the number of interior points, the average gradient magnitude, and the coarse angle consistency, and then sorted from high to low scores.

[0021] The priority of the screening process for the candidate circles is set in a positive direction according to the score.

[0022] As an improved approach, the geometric screening of candidate circles based on angle consistency constraints and radius stability constraints, and according to the scoring ranking priority, further includes:

[0023] By using the angle consistency constraint, edge points that are close to the first angle are selected from the vector from the center of the circle to the circumference point and the gradient direction of the circumference point.

[0024] By constraining radius stability, the radius distribution and standard deviation of edge points are calculated, and irregular circles with large radius fluctuations are eliminated.

[0025] As an improved approach, the method of detecting and removing isolated points from local continuous arc segments at the edge points after fine screening, constructing caliper sampling lines along the radial direction of the continuous arc segments, and performing sub-pixel-level precise positioning by detecting gradient extreme points, further includes:

[0026] The edge points after fine screening are mapped to circumferential angles, continuous arc segments are detected and isolated points are removed, and the continuous arc segments are retained as candidate positions for sub-pixel sampling.

[0027] The caliper sampling line is constructed along the radial direction of the continuous arc segment and gray values ​​are collected uniformly. The extreme points of the gray gradient on the sampling line are detected as the sub-pixel positions of the circle boundary.

[0028] Interpolation or least-squares fitting is performed on the sampling points at all sub-pixel locations to obtain several sub-pixel level center coordinates and radii.

[0029] As an improved approach, the fitting of the sub-pixel edge point set to output the circle detection result further includes:

[0030] The weighted least squares method or RANSAC algorithm is used to perform final fitting on all sub-pixel edge points, and the final circle center coordinates and radius are output as the circle detection result.

[0031] On the other hand, the present invention also provides a circle detection system based on geometric constraints and sub-pixel localization, comprising:

[0032] The image preprocessing and edge detection module is used to: perform image enhancement and noise suppression preprocessing on the original PCB grayscale image; perform edge detection on the preprocessed image to obtain a binarized edge image; calculate the gradient magnitude and gradient direction of the edge points in the binarized edge image; and associate the edge point coordinates.

[0033] The Hough circle initial screening and geometric fine screening module is used to: perform Hough circle initial screening on the binarized edge image to obtain the center coordinates and radius of the candidate circles; perform scoring and sorting processing on the candidate circles based on the consistency index; and perform geometric fine screening on the candidate circles based on the angle consistency constraint and the radius stability constraint and according to the scoring and sorting priority.

[0034] The subpixel localization and result output module is used to: detect local continuous arc segments of edge points after fine screening and remove isolated points; construct caliper sampling lines along the radial direction of the continuous arc segments; perform subpixel-level localization by detecting gradient extreme points; fit the subpixel edge point set and output the circle detection result.

[0035] On the other hand, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the circle detection method based on geometric constraints and sub-pixel positioning.

[0036] The beneficial effects of the technical solution of this invention are:

[0037] 1. The circular detection method based on geometric constraints and sub-pixel positioning described in this invention can adopt a multi-stage detection architecture, achieving a balance between detection accuracy and efficiency; through dual geometric constraints, the robustness of the algorithm is greatly improved, and the false detection and false negative rates are reduced; its core principle does not depend on a specific template, can be adapted to a variety of PCB circular components, and has strong versatility; the sub-pixel caliper positioning technology ensures the repeatability of high-precision measurements, providing reliable data support for PCB quality inspection.

[0038] 2. The circle detection system based on geometric constraints and sub-pixel localization described in this invention can realize the circle detection method based on geometric constraints and sub-pixel localization described in this invention through the cooperation of system modules.

[0039] 3. The computer-readable storage medium of the present invention can enable the guidance system module to cooperate and thus realize the circle detection method based on geometric constraints and sub-pixel positioning of the present invention. Furthermore, the computer-readable storage medium of the present invention can effectively improve the operability of the circle detection method based on geometric constraints and sub-pixel positioning. Attached Figure Description

[0040] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0041] Figure 1 This is a detailed flowchart of the circle detection method based on geometric constraints and sub-pixel localization described in Embodiment 1 of the present invention;

[0042] Figure 2 This is a schematic diagram of the logic flow of the circle detection method based on geometric constraints and sub-pixel localization as described in Embodiment 1 of the present invention;

[0043] Figure 3 This is a schematic diagram of the actual detection process of the circle detection method based on geometric constraints and sub-pixel positioning described in Embodiment 1 of the present invention;

[0044] Figure 4This is a schematic diagram of the architecture of the circle detection system based on geometric constraints and sub-pixel positioning as described in Embodiment 2 of the present invention. Detailed Implementation

[0045] The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby providing a clearer and more explicit definition of the scope of protection of the present invention.

[0046] In the description of this invention, it should be noted that the embodiments described in this invention are only some embodiments of this invention, not all embodiments; based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0047] The terms "first," "second," etc., used in this specification, claims, and accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0048] Example 1: This example provides a circle detection method based on geometric constraints and sub-pixel localization, such as... Figures 1-3 As shown, it includes the following steps:

[0049] S100, Image preprocessing steps, including:

[0050] S101. Perform image enhancement operations such as histogram equalization, adaptive contrast stretching, or CLAHE on the original PCB grayscale image.

[0051] S102. Use Gaussian filtering or bilateral filtering to suppress noise;

[0052] This step improves the visibility of circular edges, reduces interference from background textures and isolated noise, and lays the foundation for subsequent edge detection.

[0053] S200, edge detection steps, including:

[0054] S201. The Canny algorithm is used to extract edges from the preprocessed image to obtain a binarized edge image. The dual threshold parameters for edge extraction are adaptively configured according to the actual working conditions. This retains the edge information of weak edges and partially occluded circles while effectively suppressing noisy edges, thus forming a set of edge points for candidate circles.

[0055] S300, the edge point gradient calculation steps include:

[0056] S301. Calculate the gradient magnitude and gradient direction of each edge point based on the Sobel operator, and store them in association with the edge point coordinates to provide data support for subsequent angle consistency screening and sub-pixel fine positioning.

[0057] The S400 and Hofball primary screening steps include:

[0058] S401. Run the Hough circle detection algorithm on the edge map, with parameters set to prioritize recall, quickly obtain the center coordinates and radius of candidate circles, and ensure that weak edges or partially occluded circles are not missed, forming a candidate set of potential circular regions.

[0059] S500, the initial screening step for candidate round cells, includes:

[0060] S501. Based on indicators such as the number of interior points, average gradient magnitude, and coarse angle consistency, the candidate circles are initially scored and sorted, and high-scoring candidate circles are processed first in subsequent steps.

[0061] S502. If there is only a single circle within the detection range, it can be directly used as the optimal candidate circle for subsequent fine processing, thereby improving the screening efficiency and reducing the probability of false screening and missed screening.

[0062] It should be noted that the purpose of this step is to quickly identify high-confidence circles from a large number of candidate circles, while providing a priority processing strategy for the optimal circle, thus providing reliable initial values ​​for subsequent geometric constraint screening and sub-pixel precise positioning, thereby achieving the above-mentioned effects.

[0063] S600, geometric constraint fine screening steps, include:

[0064] S601. Perform geometric analysis on the candidate circles, and through angle consistency constraints, select edge points whose angle with the vector from the center of the circle to the circumference point is close to 90° (i.e., the first angle).

[0065] S602. By constraining the radius stability, calculate the radius distribution and standard deviation of the edge points, thereby eliminating irregular circles with large radius fluctuations;

[0066] Ultimately, this achieves effective removal of pseudo-circles and distorted circles, improving the robustness and accuracy of the detection results.

[0067] S700, continuous arc segment detection steps, including:

[0068] S701. Map the finely screened edge points to the circumferential angle, detect continuous arc segments and remove isolated points, and then retain the continuous arc segments as candidate positions for sub-pixel sampling to ensure sampling and fitting stability.

[0069] S800, sub-pixel level positioning steps, including:

[0070] S801. Construct a "caliper" sampling line along the radius of the continuous arc segment and uniformly collect gray values. Detect the extreme points of the gray gradient on the sampling line as the sub-pixel positions of the circle boundary.

[0071] S802. Interpolate or perform least squares fitting on all sampling points to obtain sub-pixel level center coordinates and radius. At the same time, weight the edge points according to the gradient magnitude to enhance the robustness of weak edge or occluded area detection.

[0072] It should be noted that the purpose of this step is to improve the circular positioning accuracy based on pixel-level detection, so as to meet the high-precision measurement requirements of industrial PCBs.

[0073] S900, Final Circle Parameter Fitting and Output:

[0074] S901. Use weighted least squares or RANSAC algorithm to perform final fitting on the sub-pixel edge point set to remove outliers, and output the final circle center coordinates and radius to form a circular detection result set.

[0075] S902. Visualize the above results set or interface it with an industrial inspection system to complete the positioning, size measurement and defect detection of PCB circular components.

[0076] It should be noted that the purpose of this step is to improve the stability of the fitting, ensure that the detection results are accurate, stable and universal, and can be adapted to PCB circular devices of different sizes and types.

[0077] It should be noted that the above examples are merely for explaining the present invention and should not be construed as limiting the scope of protection of the present invention.

[0078] Example 2: This example is based on the same inventive concept as the circle detection method based on geometric constraints and sub-pixel localization described in Example 1, and provides a circle detection system based on geometric constraints and sub-pixel localization, such as... Figure 4 As shown, it includes:

[0079] The image preprocessing and edge detection module is used to: perform image enhancement and noise suppression preprocessing on the original PCB grayscale image; perform edge detection on the preprocessed image to obtain a binarized edge image; calculate the gradient magnitude and gradient direction of the edge points in the binarized edge image; and associate the edge point coordinates.

[0080] The Hough circle initial screening and geometric fine screening module is used to: perform Hough circle initial screening on the binarized edge image to obtain the center coordinates and radius of the candidate circles; perform scoring and sorting processing on the candidate circles based on the consistency index; and perform geometric fine screening on the candidate circles based on the angle consistency constraint and the radius stability constraint and according to the scoring and sorting priority.

[0081] The subpixel localization and result output module is used to: detect local continuous arc segments of edge points after fine screening and remove isolated points; construct caliper sampling lines along the radial direction of the continuous arc segments; perform subpixel-level localization by detecting gradient extreme points; fit the subpixel edge point set and output the circle detection result.

[0082] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0083] Example 3: This example provides a computer-readable storage medium, including:

[0084] The storage medium is used to store computer software instructions for implementing the circle detection method based on geometric constraints and sub-pixel positioning as described in Embodiment 1. These instructions include a program for executing the circle detection method based on geometric constraints and sub-pixel positioning. Specifically, this executable program can be embedded in the circle detection system based on geometric constraints and sub-pixel positioning as described in Embodiment 2. Thus, the circle detection system based on geometric constraints and sub-pixel positioning can implement the circle detection method based on geometric constraints and sub-pixel positioning as described in Embodiment 1 by executing the embedded executable program.

[0085] Furthermore, the computer-readable storage medium in this embodiment can be any combination of one or more readable storage media, wherein the readable storage medium includes an electrical, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof.

[0086] Unlike existing technologies, the circular detection method, system, and medium based on geometric constraints and sub-pixel positioning proposed in this application can adopt a multi-stage detection architecture, achieving a balance between detection accuracy and efficiency. Through dual geometric constraints, the robustness of the algorithm is greatly improved, and the false detection and false negative rates are reduced. Its core principle does not depend on a specific template and can be adapted to various circular PCB components, making it highly versatile. The sub-pixel caliper positioning technology ensures the repeatability of high-precision measurements, providing reliable data support for PCB quality inspection.

[0087] It should be understood that in the various embodiments of this document, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this document.

[0088] It should also be understood that, in the embodiments herein, the term "and / or" is merely a description of the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following associated objects have an "or" relationship.

[0089] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this document.

[0090] In the embodiments provided herein, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be indirect couplings or communication connections through some interfaces, devices, or units, or they may be electrical, mechanical, or other forms of connection.

[0091] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments described herein, depending on actual needs.

[0092] Furthermore, the functional units in the various embodiments of this document can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0093] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this paper, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this paper. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0094] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A circle detection method based on geometric constraints and sub-pixel localization, characterized in that, The method comprises the following steps: image preprocessing and edge detection: image enhancement and noise suppression preprocessing are performed on the original PCB gray image; edge detection is performed on the preprocessed image to obtain a binary edge image, the gradient amplitude and the gradient direction of the edge points in the binary edge image are calculated, and the edge point coordinates are associated; Hough circle initial screening and geometric fine screening: Hough circle initial screening is performed on the binary edge image to obtain the center coordinates and the radius of the candidate circles; the candidate circles are scored and sorted based on the consistency index, and the geometric fine screening is performed on the candidate circles based on the angle consistency constraint and the radius stability constraint and according to the scoring priority; sub-pixel positioning and result output: local continuous arc segments of the edge points after detection fine screening are detected and isolated points are removed, a caliper sampling line is constructed along the radius direction of the continuous arc segment, and sub-pixel level positioning is performed through detection of gradient extreme points; the sub-pixel edge point set is fitted, and the circle detection result is output.

2. The circle detection method based on geometric constraints and sub-pixel positioning according to claim 1, wherein the image enhancement and noise suppression preprocessing further comprises: the original PCB gray image is subjected to histogram equalization, adaptive contrast stretching or CLAHE processing; the image noise of the original PCB gray image is suppressed by using Gaussian filtering or bilateral filtering processing.

3. The circle detection method based on geometric constraints and sub-pixel positioning according to claim 1, wherein the edge detection is performed on the preprocessed image to obtain a binary edge image, the gradient amplitude and the gradient direction of the edge points in the binary edge image are calculated, and the edge point coordinates are associated, and the method further comprises: the Canny algorithm is used to extract edges from the preprocessed image; the gradient amplitude and the gradient direction of each edge point in the binary edge image are calculated based on the Sobel operator, and the gradient amplitude and the gradient direction are associated with the corresponding edge point coordinates.

4. The circle detection method based on geometric constraints and sub-pixel positioning according to claim 1, wherein the Hough circle initial screening further comprises: the Hough circle detection algorithm is run on the binary edge image, the parameters are set to prioritize recall, and the candidate circles and the center coordinates and the radius of the candidate circles are obtained.

5. The circle detection method based on geometric constraints and sub-pixel positioning according to claim 1, wherein the scoring and sorting processing of the candidate circles based on the consistency index further comprises: the candidate circles are scored based on at least the number of inner points, the average gradient amplitude and the rough included angle consistency, and the scoring is sorted from high to low; the fine screening priority of the candidate circles is set in a positive direction according to the scoring high and low.

6. The circle detection method based on geometric constraints and sub-pixel positioning according to claim 1, wherein the geometric fine screening of the candidate circles based on the angle consistency constraint and the radius stability constraint and according to the scoring priority further comprises: the edge points with the center-to-circumferential point vector and the circumferential point gradient direction included angle close to a first angle are screened through the angle consistency constraint. ​ ​ ​ ​ ​ The radius distribution and standard deviation of the edge points are calculated by radius stability constraint, and the irregular circle with large radius fluctuation is removed.

7. The circle detection method based on geometric constraint and sub-pixel positioning according to claim 1, further comprising: The local continuous arc segment of the edge points after fine screening is detected and isolated points are removed, the caliper sampling line is constructed along the radius direction of the continuous arc segment, and the sub-pixel level positioning is performed by detecting the gradient extreme point, further comprising: The edge points after fine screening are mapped to the circular angle, the continuous arc segment is detected and isolated points are removed, and the continuous arc segment is reserved as the candidate position of sub-pixel sampling; The caliper sampling line is constructed along the radius direction of the continuous arc segment and the gray value is uniformly collected, and the gray gradient extreme point on the sampling line is detected as the sub-pixel position of the circle boundary; The sampling points at all sub-pixel positions are subjected to interpolation or least square fitting processing, and a plurality of sub-pixel level circle center coordinates and radii are obtained.

8. The circle detection method based on geometric constraint and sub-pixel positioning according to claim 1, further comprising: The fitting of the sub-pixel edge point set is performed, and the circle detection result is output, further comprising: The weighted least square method or RANSAC algorithm is adopted to perform final fitting on all sub-pixel position edge points, and the final circle center coordinates and radius are output as the circle detection result.

9. A circle detection system based on the circle detection method based on geometric constraint and sub-pixel positioning according to any one of claims 1-8, characterized in that, The system comprises: An image preprocessing and edge detection module, configured to: perform image enhancement and noise suppression preprocessing on an original PCB gray-scale image; perform edge detection on the preprocessed image to obtain a binary edge image, calculate the gradient amplitude and gradient direction of the edge points in the binary edge image, and associate the edge point coordinates; A Hough circle preliminary screening and geometric fine screening module, configured to: perform Hough circle preliminary screening on the binary edge image to obtain the circle center coordinates and radius of the candidate circle; perform scoring and sorting processing on the candidate circle based on the consistency index, and perform geometric fine screening on the candidate circle based on the angle consistency constraint and the radius stability constraint and according to the scoring and sorting priority; A sub-pixel positioning and result output module, configured to: detect the local continuous arc segment of the edge points after fine screening and remove isolated points, construct the caliper sampling line along the radius direction of the continuous arc segment, and perform sub-pixel level positioning by detecting the gradient extreme point; perform fitting on the sub-pixel edge point set, and output the circle detection result.

10. A computer-readable storage medium, characterized in that, The computer program is stored on the computer readable storage medium, and the computer program is executed by the processor to realize the steps of the circle detection method based on geometric constraint and sub-pixel positioning according to any one of claims 1-8.

Citation Information

Patent Citations

  • Cable joint roundness detection method and device based on sub-pixel edge detection

    CN117911364A

Cited By

  • Machine vision circle-circle intersection point measurement method based on dynamic fitting and local optimization

    CN121904172A