Circular contour detection method based on edge detection and ROI feature extraction

Through edge detection combined with ROI area feature extraction method, the circular contour recognition problem is solved under complex background and noise interference, and efficient and accurate circular contour detection is achieved, which is suitable for real-time detection of industrial scenarios.

CN120387997APending Publication Date: 2025-07-29SHANGHAI GLORYSOFT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510470124.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

The prior art is difficult to accurately identify and measure circular contours under complex backgrounds and noise interference, and the calculation complexity is high, which cannot meet the real-time requirements.

Method used

A method based on edge detection combined with ROI region feature extraction is adopted, including gradient calculation, gradient enhancement and noise suppression, edge enhancement and ROI adaptive selection, edge points are extracted through gradient information and outliers are eliminated, circular contours are fitted using the least squares method, and robustness is improved through multiple random sampling and deviation culling mechanisms.

Benefits of technology

It significantly improves noise resistance and robustness, and can achieve high-precision circular profile detection in complex environments to meet the real-time detection needs of industrial assembly lines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120387997A_ABST
    Figure CN120387997A_ABST
Patent Text Reader

Abstract

The invention provides a circular contour detection method based on edge detection in combination with ROI feature extraction, which is characterized by comprising the following steps: step 1, preprocessing an image, including gradient calculation, gradient enhancement and noise suppression, edge enhancement and ROI adaptive selection; step 2, performing feature point extraction on the image, including extracting edge points through gradient information and removing outliers; and step 3, multiple random sampling and circle fitting are carried out to obtain a circle contour, and the circle center and the radius are calculated. According to the circular contour detection method, the problem of how to accurately identify and measure the circular contour under the complex background and noise interference is solved, the method is a circular contour identification and measurement method with high robustness and strong anti-noise capability, and the high-precision detection requirement under the complex environment can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and particularly relates to a circular contour detection method based on edge detection combined with ROI region feature extraction. Background Art

[0002] In some complex industrial scenarios, such as part detection, lens assembly detection, etc., the image processing and analysis process usually involves the recognition and calculation of circular contours. The existing circular contour detection and fitting methods have the following types of defects: 1. Noise interference problem: Since the image usually contains background noise or regions with blurred edges, it is easily interfered by background noise and illumination changes, resulting in misrecognition and overfitting. 2. Low fitting accuracy: Existing fitting methods are difficult to ensure the accuracy of circular fitting when dealing with complex backgrounds or low-contrast images, especially in images with multiple different objects or complex textures, and large errors are likely to occur. 3. High computational complexity: Some traditional circular fitting methods based on global optimization have a large amount of calculation and low efficiency. Especially when dealing with large-scale batch image data, it is difficult to accurately measure the circular features in a large number of images quickly and stably, with poor robustness and unable to meet the real-time requirements.

[0003] In view of the above situation, there is a need to solve the problem of how to accurately identify and measure circular contours under complex backgrounds and noise interference. Summary of the Invention

[0004] Aiming at the above defect problems, the present invention provides a circular contour detection method based on edge detection combined with ROI region feature extraction, which has high robustness and strong anti-noise ability and can meet the high-precision detection requirements under complex environments.

[0005] To achieve the above object, the present invention adopts the following technical solutions:

[0006] The present invention provides a circular contour detection method based on edge detection combined with ROI region feature extraction, characterized by including the following steps:

[0007] Step 1, preprocess the image, including gradient calculation, gradient enhancement and noise suppression, edge enhancement and ROI adaptive selection;

[0008] Step 2, extract feature points from the image, including extracting edge points through gradient information and removing outliers;

[0009] Step 3, fit the feature points to obtain a circular contour.

[0010] Further, in the circular contour detection method based on edge detection combined with ROI region feature extraction provided by the present invention, it may further have the following feature: In step 1, the gradient calculation is specifically as follows: The horizontal gradient and vertical gradient of the image are calculated using the Sobel operator.

[0011] Further, in the circular contour detection method based on edge detection combined with ROI region feature extraction provided by the present invention, it may further have the following feature: In step 1, gradient enhancement and noise suppression specifically include: During the gradient calculation process, the image is smoothed through a filtering operation, and high-frequency noise in the image is filtered by a noise suppression method based on local mean and standard deviation.

[0012] Further, in the circular contour detection method based on edge detection combined with ROI region feature extraction provided by the present invention, it may further have the following feature: In step 1, edge enhancement and ROI adaptive selection specifically include: During the gradient calculation process, the ROI region related to the target object is preferentially selected. In the region where the edge of the target object is clear, the edge is enhanced, while the background region is not enhanced.

[0013] Further, in the circular contour detection method based on edge detection combined with ROI region feature extraction provided by the present invention, it may further have the following feature: In step 2, extracting edge points through gradient information specifically includes: Based on the gradient calculation, a gradient intensity threshold is set, and pixel points with gradient values greater than the gradient intensity threshold are selected and recognized as the edges of the target object.

[0014] Further, in the circular contour detection method based on edge detection combined with ROI region feature extraction provided by the present invention, it may further have the following feature: In step 2, outlier removal; The corresponding center of the circle is calculated based on the edge of the target object, the distance from each edge point to the center of the circle is calculated, then, the mean and standard deviation of the distances from all edge points to the center of the circle are calculated, a deviation range is set, and edge points that do not meet the deviation range are removed.

[0015] Further, in the circular contour detection method based on edge detection combined with ROI region feature extraction provided by the present invention, it may further have the following feature: Step 3 specifically includes:

[0016] Step 3-1: Fitting feature points through a predetermined algorithm;

[0017] Step 3-2: Repeat step 3-1 for multiple fittings. Each time, different random sampling points are used, the average value of each fitting result is calculated, a deviation range is set, fitting results that do not meet the deviation range are removed, and then, the average value is calculated again for all fitting results that meet the deviation range;

[0018] Step 3-3: Based on the average value of the fitting results obtained in Step 3-2, a circular contour is fitted, and the center and radius are calculated as the geometric description of the target object.

[0019] Furthermore, in the circular contour detection method based on edge detection combined with ROI region feature extraction provided by the present invention, it may also have the following feature: the predetermined algorithm in Step 3-1 is the least squares method.

[0020] Compared with the prior art, the present invention has the following beneficial effects:

[0021] (1) Strong anti-noise ability: The method of the present invention significantly reduces the influence of noise points on the results through a multi-level screening strategy, including gradient threshold, distance range, region rejection, and standard deviation filtering. This method is particularly suitable for complex background detection in industrial scenarios.

[0022] (2) High robustness: The method of the present invention uses a multiple fitting method with random sampling, combined with a deviation rejection mechanism, which significantly improves the robustness and stability of the fitting. This method has a strong fault tolerance for abnormal points.

[0023] (3) High efficiency: The method of the present invention dynamically adjusts the fitting parameters, uses the previous result for the next initial parameter optimization, and improves the processing efficiency. This method can quickly process a large number of images and meet the real-time detection requirements of industrial production lines.

[0024] (4) Quality quantifiable: The method of the present invention provides a consistency evaluation (variance) of the fitting diameter, providing data support for quality monitoring and system optimization. Brief Description of the Drawings

[0025] Figure 1 is a schematic flowchart of the circular contour detection method based on edge detection combined with ROI region feature extraction of the present invention. Detailed Embodiments

[0026] In order to make the technical means, creative features, achieved purposes, and functions of the present invention easy to understand, the following embodiments will specifically describe the technical solutions of the present invention in conjunction with the accompanying drawings.

[0027] Please refer to Figure 1 , the embodiment of the present invention provides a circular contour detection method based on edge detection combined with ROI region feature extraction. The method includes the following steps:

[0028] Step 1: Preprocess the image

[0029] The image preprocessing includes: gradient calculation, gradient enhancement and noise suppression, edge enhancement and ROI adaptive selection.

[0030] (1) The gradient calculation is specifically as follows: The horizontal gradient and vertical gradient of the image are calculated using the Sobel operator.

[0031] By calculating the horizontal gradient and vertical gradient of the image using the Sobel operator, the gradient intensity of each pixel point is calculated, and then the edges of the target object are identified. The change in the gradient intensity value can reflect the edge change situation of the target object in the image. Generally speaking, the gradient value is larger at the edges of the object in the image, while the gradient is smaller in the background or flat areas of the image. Therefore, through gradient calculation, the contour of the target object can be effectively identified.

[0032] (2) Gradient enhancement and noise suppression specifically include: During the gradient calculation process, the image is smoothed to a certain extent through a filtering operation (Gaussian blur is used in this embodiment), while retaining the key edge features; and the high-frequency noise in the image is filtered through a noise suppression method based on local mean and standard deviation.

[0033] Through such gradient enhancement and noise suppression operations, misidentifications caused by noise can be avoided, especially in low-contrast images and complex backgrounds, significantly improving the stability and reliability of edge detection.

[0034] (3) Edge enhancement and ROI adaptive selection specifically include:

[0035] First, define the ROI (Region of Interest) adaptive selection area. During the gradient calculation process, not only the edges of the entire image are concerned, but the ROI area related to the target object is preferentially selected. The area that may contain the target object is dynamically selected for gradient calculation. In the area where the edges of the target object are clear, the edges are enhanced, while the background area is not enhanced.

[0036] Through such edge enhancement and ROI adaptive selection operations, the computing resources can be concentrated in the area of the object edges, only focusing on the area where the circular target is located, reducing the influence of the irrelevant background, avoiding the interference of irrelevant areas, and improving the computing efficiency and the accuracy of edge detection.

[0037] Step 2: Image feature point extraction

[0038] Image feature point extraction includes: Extracting edge points through gradient information and removing outliers.

[0039] (1) Edge point extraction

[0040] On the basis of calculating the horizontal and vertical gradients of the image using the Sobel operator in the previous step to obtain the gradient information in the horizontal and vertical directions respectively, further calculate the sum of squares and square roots of the horizontal and vertical gradients, so as to obtain the gradient intensity of each pixel point in the image, and the gradient intensity represents the degree of brightness change. Set a gradient intensity threshold, screen out the pixel points with gradient values greater than the gradient intensity threshold, and identify these pixel points as the edges of the target object.

[0041] (2) Remove outliers

[0042] Calculate the corresponding center of the circle based on the edge of the target object, and calculate the distance from each edge point to the center of the circle. Then, calculate the mean and standard deviation of the distances from all edge points to the center of the circle, set a deviation range, and remove the edge points that do not meet the deviation range.

[0043] The image may contain some noisy or misdetected points, which are usually far from the center of the circle. Therefore, removing the points with too large deviation from the mean distance can remove some outliers caused by noise or errors and improve the accuracy of edge point detection.

[0044] Step 3: Fit a circle

[0045] Step 3-1: Fit the feature points by the least squares method.

[0046] The least squares method fits the model by minimizing the difference between the predicted value and the true value. In the context of circle fitting in the present invention, the goal is to find the center coordinates (xc, yc) and radius r such that the distances from all points to the center of the circle are as close to r as possible.

[0047] Step 3-2: Repeat Step 3-1 for multiple fittings, each time using different randomly sampled points, calculate the average value of each fitting result, set a deviation range, remove the fitting results that do not meet the deviation range, and then calculate the average value again for all fitting results that meet the deviation range.

[0048] Step 3-3: Based on the average value of the fitting results obtained in Step 3-2, fit a circular contour. This contour is a stable and accurate circular contour obtained after multiple fittings, calculating the average value, and removing the fitting results of outliers, ensuring the high accuracy of the fitting results. Even in an image with a large amount of noise, the circular contour of the target object can be accurately extracted. The final circular contour parameters, including the center coordinates and radius, are used as the geometric description of the target object, providing accurate data for subsequent measurement, analysis, and application.

[0049] The above embodiments are only preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. For those skilled in the art, various modifications and variations can be made to the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are all included within the protection scope of the present invention.

Claims

1. A circular contour detection method based on edge detection combined with ROI region feature extraction, characterized in that, It includes the following steps: Step 1, preprocess the image, including gradient calculation, gradient enhancement and noise suppression, edge enhancement and ROI adaptive selection; Step 2, extract feature points from the image, including extracting edge points through gradient information and removing outliers; Step 3, fit the feature points to obtain a circular contour.

2. The circular contour detection method based on edge detection combined with ROI region feature extraction according to claim 1, characterized in that: Among them, In step 1, the gradient calculation is specifically: use the Sobel operator to calculate the horizontal gradient and vertical gradient of the image.

3. The circular contour detection method based on edge detection combined with ROI region feature extraction according to claim 1, characterized in that: Among them, The gradient enhancement and noise suppression in step 1 specifically include: During the gradient calculation process, smooth the image through a filtering operation, and filter the high-frequency noise in the image through a noise suppression method based on local mean and standard deviation.

4. The circular contour detection method based on edge detection combined with ROI region feature extraction according to claim 1, characterized in that: Among them, The edge enhancement and ROI adaptive selection in step 1 specifically include: During the gradient calculation process, preferentially select the ROI region related to the target object. In the region where the edge of the target object is clear, the edge is enhanced, and the background region is not enhanced.

5. The circular contour detection method based on edge detection combined with ROI region feature extraction according to claim 1, characterized in that: Among them, The extraction of edge points through gradient information in step 2 specifically includes: Based on the gradient calculation, set a gradient intensity threshold, screen out the pixel points whose gradient values are greater than the gradient intensity threshold, and identify these pixel points as the edges of the target object.

6. The circular contour detection method based on edge detection combined with ROI region feature extraction according to claim 1, characterized in that: Among them, Remove outliers in step 2; Calculate the corresponding center of the circle according to the edge of the target object, calculate the distance from each edge point to the center of the circle, then calculate the mean and standard deviation of the distances from all edge points to the center of the circle, set a deviation range, and remove the edge points that do not meet the deviation range.

7. The circular contour detection method based on edge detection combined with ROI region feature extraction according to claim 1, characterized in that: Among them, Step 3 specifically includes: Step 3-1: Fit the feature points through a predetermined algorithm; Step 3-2: Repeat step 3-1 for multiple fittings, each time using different random sampling points, calculate the average value of each fitting result, set a deviation range, remove the fitting results that do not meet the deviation range, and then calculate the average value again for all fitting results that meet the deviation range; Step 3-3: Based on the average value of the fitting results obtained in step 3-2, fit to obtain a circular contour, calculate the center of the circle and the radius, and use them as the geometric description of the target object.

8. The circular contour detection method based on edge detection combined with ROI region feature extraction according to claim 7, characterized in that: Among them, The predetermined algorithm in step 3-1 is the least squares method.