High-precision detection method for round and elliptical burrs based on adaptive fitting

By employing adaptive fitting and iterative weighting strategies, combined with local features and dynamic thresholds, the model contamination and threshold adaptability issues in burr detection of circular and elliptical contours are resolved, achieving high-precision and fast burr detection that is adaptable to complex industrial environments.

CN122492560APending Publication Date: 2026-07-31HANGZHOU HUICUI INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU HUICUI INTELLIGENT TECH CO LTD
Filing Date
2026-04-07
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies for burr detection of circular and elliptical contours suffer from problems such as model fitting contamination by burrs, poor adaptability to global/static thresholds, insensitivity to changes in local geometric characteristics, and difficulty in balancing computational efficiency and accuracy, resulting in insufficient detection accuracy and real-time performance.

Method used

An adaptive fitting method is adopted, which combines iterative weighting and adaptive region segmentation fitting strategies with local distance deviation, local geometric features and adaptive dynamic threshold to construct a comprehensive discriminant function, thereby achieving high-precision and fast spur detection.

Benefits of technology

It significantly improves the accuracy and robustness of the benchmark model, reduces the false detection rate and false negative rate, meets the real-time requirements of industrial online detection, and enhances the robustness and engineering practicality of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122492560A_ABST
    Figure CN122492560A_ABST
Patent Text Reader

Abstract

This invention discloses a high-precision detection method for burrs in circles and ellipses based on adaptive fitting, comprising the following steps: S10, image acquisition and preprocessing; S20, sub-pixel edge extraction; S30, adaptive partitioning and initial model fitting; S40, iterative weighted refinement fitting; S50, multi-feature fusion defect detection; S60, outputting detection results. Through ingenious algorithm design, this invention achieves an excellent balance between the purity of model fitting, the adaptability of defect discrimination, and the overall computational efficiency of the system, possessing promising industrial application prospects and patent protection value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of high-precision detection technology and relates to a high-precision detection method for burrs in circles and ellipses based on adaptive fitting. Background Technology

[0002] In precision manufacturing, such as the machining of bearing rings, gear blanks, seals, optical lenses, and various shaft parts, the geometric accuracy and surface integrity of the workpiece contour are core indicators for measuring its quality. Burrs on the contour, a common machining defect, not only affect the assembly accuracy and performance of parts but may also break off under high stress or high-speed operation, causing severe wear or even system failure. Therefore, rapid, accurate, and automated inspection of workpiece contours, especially regular contours such as circles and ellipses, at the end of the production line or after key processes has become a crucial step in improving product quality and achieving intelligent manufacturing.

[0003] Machine vision technology is widely used for the detection of appearance defects due to its advantages such as non-contact operation, high efficiency, and rich information. Its core process typically includes: image acquisition, preprocessing, edge extraction, contour analysis, and defect identification and classification. For burr detection of circular / elliptical contours, the technical challenge lies in accurately separating the "true edges" generated by the true geometric contour from the "abnormal edges" caused by burrs, scratches, stains, etc., from an image that may contain noise, uneven lighting, and local blurring, and then quantitatively evaluating them.

[0004] Existing technical solutions mainly revolve around the basic idea of ​​"first fitting an ideal model, then calculating the deviation." Among them, the most similar and widely used implementation schemes can be summarized into the following two types: 1. A scheme based on least squares global fitting and static threshold discrimination This solution is a classic method for circular inspection and defect checking in current industrial vision inspection libraries (such as Halcon and OpenCV). Its technical approach is as follows: First, the original grayscale image is filtered (e.g., Gaussian filtering) to suppress noise. Then, an edge detection operator (e.g., the Canny operator) is used to extract the pixel-level edge point set of the entire workpiece. Then, assuming the contour to be inspected is a complete circle or ellipse, the entire point set is processed using the Least Squares Method (LS). Fit to a parameterized geometric model.

[0005] For the circular model, the equation is: ; in, Let the coordinates be the center of the circle. Let the radius be . The goal of least squares fitting is to find the parameters. Such that the sum of the squares of the algebraic distances from all edge points to the circle is... Minimum: ; Due to the nonlinear complexity of the objective function, linearization methods (such as the Taubin method based on algebraic distance) or iterative optimization methods are often used in practice to solve it.

[0006] For the elliptical model, the general equation of its conic section is: ; Attached elliptic constraint By minimizing the sum of squared algebraic distances And fit the data by combining the constraints (such as using Direct Least Squares, DLS).

[0007] After obtaining the baseline model, calculate each edge point. The actual geometric distance to the fitted model (for a circle, this is the absolute difference between the distance from the point to the center and the fitted radius). For ellipses, this is the shortest geometric distance from a point to the ellipse, which usually needs to be solved numerically. Finally, a global, fixed distance threshold is set. If the deviation at a certain point If a point is not found, it is considered an anomaly. Continuous or clustered anomaly areas are identified as burrs or defects.

[0008] 2. Schemes based on robust fitting (such as RANSAC) and local statistical analysis To overcome the sensitivity of the first approach to outliers (i.e., the spikes themselves), the second approach introduces a more robust model fitting method, with the Random Sample Consensus (RANSAC) algorithm being a prime example. Its process is as follows: Similarly from the edge point set Starting with the RANSAC algorithm, a minimum sample set is randomly selected (3 points for a circle, 5 points for an ellipse) to generate a hypothetical model. Then, the distance from all points to this model is calculated, and a preset distance threshold is applied. Points are categorized into inliers (those that fit the model) and outliers (those that do not fit the model). This process is iterated multiple times, and the model with the most inliers is ultimately selected as the best-fit model. This model is considered to be defined by edge points generated from "clean" contours (without significant burrs).

[0009] After obtaining a robustly fitted baseline model, more sophisticated local statistical analyses can be used to determine defects. For example, the mean distance from all interior points to the model can be calculated. and standard deviation Then those deviations exceed Points where k is a constant, usually 2-3, are identified as defect points. Alternatively, a "tolerance zone" can be established around the model (e.g., ...). Points falling outside the band are considered abnormal.

[0010] Although the aforementioned existing solutions have been applied in practice, they still have the following inherent drawbacks when facing the industrial testing requirements of high precision, high reliability, and complex working conditions. These drawbacks are precisely the core problems that this invention aims to solve: Disadvantage 1: Model fitting is contaminated by burrs, distorting the baseline. In least-squares global fitting, the objective function treats all edge points equally. When significant burrs exist on the contour, these burr points act as strong outliers, severely distorting the fitting results and causing the fitted "baseline circle / ellipse" to shift towards the burr region. This makes the baseline used for subsequent bias calculations inaccurate. On the one hand, it may underestimate the severity of the burrs (because the baseline is "pulled" towards the burrs); on the other hand, it may cause false "anomaly" alarms to be generated in defect-free areas opposite the burrs. Although RANSAC-like methods can alleviate this problem to some extent by finding an interior point set, their effectiveness is heavily dependent on the pre-defined set. Threshold and number of iterations. An improperly set threshold can either include too many spurious points, resulting in an impure fit, or exclude too many true contour points, leading to an inaccurate fitted model. Especially when the spurs are large or continuously distributed, RANSAC may not be able to find enough pure interior points, resulting in fitting failure or an absurd model.

[0011] Disadvantage 2: Poor adaptability of global / static thresholds, prone to false positives and false negatives. The first scheme uses a global threshold. The fixed method used for discrimination in the second scheme Thresholds are inherently static. They ignore the non-uniformity of contour deviations caused by numerous factors in real-world industrial scenarios: 1) Imaging perspective distortion and optical aberrations: Even with perfect contours, systematic geometric distortions may exist at the edges of the field of view, leading to increased deviations; 2) Uneven illumination and edge blurring: Image contrast varies in different areas, causing fluctuations in the positioning accuracy of edge extraction, and the noise level of the deviation is not constant; 3) Shape tolerances and installation eccentricity of the workpiece itself: Workpieces are not ideal mathematical curves and have inherent roundness / ellipticity errors, and slight eccentricity is unavoidable during installation. These factors introduce low-frequency, non-burr-like contour fluctuations. Using a single threshold may be too lenient in low-noise, high-contrast areas, missing minute burrs, while being too strict in high-distortion or low-contrast areas, generating numerous false alarms.

[0012] Disadvantage 3: Insensitive to changes in local geometric properties of the contour. Circles and ellipses are curves with constant curvature (the curvature of a circle is constant, while the curvature of an ellipse changes continuously). Existing solutions only consider the distance deviation from the model when making judgments, ignoring abrupt changes in the local geometric properties of the contour (such as curvature and tangent direction) at the defect point. A tiny protrusion (potential burr root) with a small distance deviation from the baseline may have a significantly different curvature from a smooth contour. Relying solely on distance deviation cannot effectively detect such defects, nor can it distinguish burrs from grayscale anomalies caused by dust or oil stains.

[0013] Disadvantage 4: It's difficult to balance computational efficiency and accuracy. Accurately calculating the shortest geometric distance from a point to an ellipse is a nonlinear optimization problem, resulting in high computational costs and making it difficult to meet the real-time requirements of online detection. Existing solutions either use approximate algebraic distances (fast but inaccurate) or iterative numerical methods (accurate but slow). Achieving high-speed computation while ensuring high-precision discrimination remains a significant engineering challenge. Summary of the Invention

[0014] Based on the above analysis, the purpose of this invention is to provide a novel method for detecting burrs on circular / elliptical contours, aiming to: 1. Establish a clean and robust baseline profile model: Through an innovative iterative weighting and adaptive region segmentation fitting strategy, the influence of burr points on the baseline model fitting is minimized to obtain a baseline that can truly reflect the workpiece design profile or "ideal" profile.

[0015] 2. Achieve adaptive and high-precision defect discrimination: By combining local distance deviation, local geometric features (curvature), and adaptive dynamic threshold, a comprehensive discrimination function is constructed, which can automatically adjust the discrimination sensitivity according to the characteristics of different regions of the image (such as edge positioning accuracy and distortion level), significantly reducing the false detection rate and false negative rate.

[0016] 3. Improve computational efficiency and practicality: Design a fast and accurate approximate calculation method for elliptical distance and optimize the overall algorithm flow to enable millisecond-level processing of high-definition images on standard industrial computers, meeting the real-time requirements of industrial online inspection.

[0017] 4. Enhance the robustness and generalization ability of the system: enable the method to effectively cope with complex industrial field environments such as changes in lighting, partial occlusion, and background interference, and have good engineering practical value.

[0018] To solve the above problems, the technical solution of the present invention is a high-precision detection method for burrs in circles and ellipses based on adaptive fitting, comprising the following steps: S10, Image Acquisition and Preprocessing; S20, subpixel edge extraction; S30, adaptive partitioning and initial model fitting; S40, iterative weighted refinement fitting; S50, multi-feature fusion defect detection; S60 outputs the detection results.

[0019] Preferably, step S10 uses an area array or line array industrial camera to acquire workpiece images under controlled lighting conditions; the preprocessing specifically includes: Non-uniform illumination correction: Use methods based on background estimation or homomorphic filtering to eliminate brightness gradients in the image; Noise filtering: An adaptive edge-preserving filter is applied to smooth noise while preserving edge sharpness; Region of Interest (ROI) Definition: Based on prior knowledge or through template matching and Blob analysis, the approximate area of ​​the workpiece is automatically located, narrowing down the processing range.

[0020] Preferably, step S20 includes employing a sub-pixel-level edge detection algorithm to extract contour points from the preprocessed image and outputting an ordered or unordered set of sub-pixel edge points. ,in Points, coordinates It is a floating-point number.

[0021] Preferably, step S30 includes the following steps: S31, Coarse Fitting and Global Bias Calculation, for the entire set An initial circle or ellipse model is fitted using Least Median Squares (LMedS) or Fast RANSAC. Calculate all points arrive geometric distance ; S32, adaptive partitioning based on deviation distribution; S33, based on quadratic fitting of the trusted region.

[0022] Preferably, the analysis in S32 Based on the statistical distribution, an adaptive partitioning strategy is introduced to divide the entire contour point set into reliable regions. and suspicious areas Set two adaptive thresholds: Core threshold ,in for The mean and standard deviation, It is a preset coefficient; Exclusion threshold ,in It is a ratio Large preset coefficient; definition These points are considered to have a high probability of belonging to a real smooth contour; definition These points are burrs, noise, or located in areas of high distortion; for Points that are not identified are directly marked as strong outliers in the initial stage and are not included in the baseline model fitting.

[0023] Preferably, only a set of reliable points is used in S33. The refined initial model was obtained by fitting the model using the weighted least squares method. .

[0024] Preferably, step S40 includes the following steps: S41, Initialization, set the current model Number of iterations A candidate point set containing all points ; S42, Iterative process.

[0025] Preferably, step S42 includes the following steps: S421, Distance weight calculation: For Every point , k The iteration number is used to calculate the number of iterations up to the current model. geometric distance Distance weight Defined as: in In this iteration The robustness estimate is that the function makes the points with smaller distances have larger weights, and the rate of weight decay is adaptively determined by the dispersion of the current data. S422, Local Consistency Weight Calculation, for point In its neighborhood along the contour sequence Within this range, we examine the continuity of its distance deviation and define a local consistency measure. This is the absolute difference between the deviation at this point and the median deviation in the neighborhood: Then the local consistency weight is: ,in yes The scaling estimate is used to penalize isolated points whose behavior is inconsistent with that of their surrounding points. S423, Comprehensive Weight Allocation: Points The overall weight is the product of the two mentioned above: ; S424, Weighted Model Fitting: Using weighted least squares method, As weight, for The points in the model are fitted with a circle or ellipse model to obtain the updated model. The objective function of weighted least squares is: For ellipses: Minimize ,satisfy ; S425, Convergence Check: Calculate the model parameter vector for this iteration. Compared with the previous parameter vector relative change ,like The iteration terminates if the maximum number of iterations is reached. The final baseline model is output based on preset values. Otherwise, let Return to S421.

[0026] Preferably, S50 includes the following steps: S51, precise distance calculation; S52, Local curvature estimation; S53, adaptive dynamic threshold generation; S54, fusion of discriminant function and defect determination.

[0027] Preferably, in S52, each point Generate a dynamic threshold related to its local environment, which includes: a basic tolerance threshold, a positioning uncertainty threshold, and a model fitting residual threshold.

[0028] The present invention has at least the following beneficial effects: 1. Significantly Improved Accuracy and Robustness of the Benchmark Model: Through a two-stage strategy of "adaptive partitioning initial fitting" and "iterative weighted refinement fitting," this invention effectively resists the contamination of model fitting by spur points. Initial partitioning quickly isolates strong outliers, while the iterative weighting process dynamically reduces the weights of non-contour points (spurs, noise) to negligible levels through dual constraints of distance and local consistency, thereby ensuring the accuracy of the final benchmark model. It is generated entirely by "pure" contour points. Experiments show that even in the extreme case where the burr area accounts for 20% of the contour length, the center position error fitted by this invention is reduced by more than 70% compared with the traditional least squares method and by more than 50% compared with the standard RANSAC, laying a solid foundation for subsequent high-precision detection.

[0029] 2. Significantly Enhanced Defect Detection Sensitivity and Reliability: The invention's pioneering "multi-feature fusion discrimination" and "adaptive dynamic threshold" mechanisms fundamentally solve the problem of poor adaptability of static thresholds. (Fusing distance deviation) and local curvature changes This allows the algorithm to not only capture the positional shift of the contour but also perceive local abrupt changes in the contour shape, exhibiting higher detection sensitivity for small, gently sloping but abnormally curved protrusions (the initial form of burrs). Meanwhile, Based on the local image quality of each point ( ) and model fit ( The algorithm dynamically adjusts to achieve a "region-specific" detection strategy. This allows the algorithm to capture sub-pixel-level defects in clear image areas while tolerating greater background noise in poorly imaged areas, thus achieving optimal detection performance across the entire field of view. The overall false positive rate is reduced by more than 60% and the false negative rate is reduced by more than 40% compared to the fixed threshold method.

[0030] 3. High computational efficiency, meeting online inspection requirements: This invention optimizes key time-consuming steps. In model fitting, weighted least squares can be quickly solved by solving the weighted normal equation, and the iteration process usually converges in 3-5 iterations. In defect identification, the proposed fast elliptic geometric distance approximation method improves the distance calculation speed by 3-5 times while maintaining sub-pixel accuracy. The entire algorithm process is modularized and parallelized. For a 2-megapixel image, the processing time on a mainstream industrial PC can be controlled within 50 milliseconds, fully meeting the real-time requirements of high-speed production line online inspection (usually <100ms).

[0031] 4. Strong System Robustness and Engineering Applicability: The method exhibits stronger robustness to uneven illumination, partial occlusion (such as fixture occlusion), and background clutter. The adaptive partitioning and weighting mechanism automatically ignores points or strong background edges in occluded areas. Dynamic thresholding compensates for differences in edge extraction accuracy caused by uneven illumination. These characteristics allow the invention to adapt to a certain range of production condition variations without cumbersome parameter readjustment, reducing deployment and maintenance costs and enhancing its practical value in complex industrial environments. Attached Figure Description

[0032] Figure 1 This is a flowchart illustrating the steps of the high-precision detection method for burrs in circles and ellipses based on adaptive fitting, according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the S20 process of the high-precision detection method for burrs in circles and ellipses based on adaptive fitting according to an embodiment of the present invention. Figure 3 This is a schematic diagram of the S30 adaptive partitioning result of the high-precision detection method for circle and ellipse burrs based on adaptive fitting according to an embodiment of the present invention. Figure 4 This is a visual diagram of the weights in the S40 iterative weighted refinement fitting of the high-precision detection method for burrs in circles and ellipses based on adaptive fitting, according to an embodiment of the present invention. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0034] Conversely, this invention encompasses any substitutions, modifications, equivalent methods, and solutions made within the spirit and scope of the invention as defined in the claims. Furthermore, to provide a better understanding of the invention, certain specific details are described in detail below. However, those skilled in the art will fully understand the invention even without these detailed descriptions.

[0035] See Figure 1 The flowchart below is a method embodiment of the present invention, including the following steps: S10, Image Acquisition and Preprocessing; S20, subpixel edge extraction; S30, adaptive partitioning and initial model fitting; S40, iterative weighted refinement fitting; S50, multi-feature fusion defect detection; S60 outputs the detection results.

[0036] The S10 uses a high-resolution area or line scan industrial camera to acquire workpiece images under controlled lighting conditions (such as backlighting, coaxial lighting, or dome lighting). Preprocessing aims to enhance the contour signal and suppress noise, including: Non-uniform illumination correction: Use methods based on background estimation or homomorphic filtering to eliminate brightness gradients in the image; Noise filtering: Apply adaptive edge-preserving filters (such as bilateral filtering or guided filtering) to smooth noise while preserving edge sharpness as much as possible; Region of Interest (ROI) definition: Based on prior knowledge or through template matching and Blob analysis, the approximate area of ​​the workpiece is automatically located, narrowing down the processing scope.

[0037] S20 includes using sub-pixel-level edge detection algorithms (such as Zernike moment-based, gray-scale moment-based, or Steger-based algorithms) to extract contour points from the preprocessed image, outputting an ordered or unordered set of sub-pixel edge points. ,in Points, coordinates It is a floating-point number. Figure 2 This is a schematic diagram of the S20 process. Figure 2 (a): Original grayscale image. Shows a local area of ​​a circular or elliptical workpiece with slightly jagged edges. Figure 2 (b): Pixel-level edge extraction results. The extraction results of operators such as Canny are displayed using white lines of single-pixel width, with the lines exhibiting a distinct stepped (jagged) shape. Figure 2 (c): Subpixel edge extraction results used in this invention. Compared with pixel-level edges, subpixel edges can provide contour position information with higher spatial resolution, which is the basis for subsequent high-precision fitting and detection.

[0038] S30 aims to provide a good initial model for subsequent refined fitting and to preliminarily delineate suspicious regions, including the following steps: S31, Coarse Fitting and Global Bias Calculation, for the entire set An initial circle or ellipse model is fitted using Least Median Squares (LMedS) or Fast RANSAC. Calculate all points arrive geometric distance ; S32, Adaptive partitioning based on deviation distribution, analysis The statistical distribution of the contour points is shown. We introduce an adaptive partitioning strategy to divide the entire contour point set into "trustworthy regions". and "suspicious areas" Set two adaptive thresholds: Core threshold ,in for The mean and standard deviation, It is a relatively small coefficient (e.g., 1.0); Exclusion threshold ,in It is a relatively large coefficient (e.g., 3.0~5.0); definition These points are considered to have a high probability of belonging to a real smooth contour; definition These points may be small burrs, noise, or located in areas of high distortion; for Points that are not identified are directly marked as strong outliers in the initial stage and are not included in the baseline model fitting. See also Figure 3 The partitioning results based on the initial fitting bias are illustrated. The reliable region is evenly distributed, while the suspicious region and outliers are mostly located at potential defect locations.

[0039] S33, based on quadratic fitting of the trusted region, using only the trusted point set. The refined initial model was obtained by fitting the model using the weighted least squares method. At this time, due to Obvious outliers have been largely eliminated. Compare A more realistic ideal outline.

[0040] S40 includes the following steps: S41, Initialization, set the current model Number of iterations A candidate point set containing all points (except strong outliers). ; S42, Iterative process (the...) The next iteration includes the following steps: S421, Distance weight calculation: For Every point , k The iteration number is used to calculate the number of iterations up to the current model. geometric distance Distance weight Defined as: in In this iteration Robustness estimation (e.g., using MAD, Median Absolute Deviation), a function that makes points with smaller distances have larger weights, and the rate of weight decay is adaptively determined by the dispersion of the current data; S422, Local Consistency Weight Calculation, for point In its neighborhood along the contour sequence Within a range of m points (before and after), examine the continuity of distance deviation and define a local consistency measure. This is the absolute difference between the deviation at this point and the median deviation in the neighborhood: Then the local consistency weight is: ,in yes The scaling estimate is used to penalize isolated points whose behavior is inconsistent with that of their surrounding points. S423, Comprehensive Weight Allocation: Points The overall weight is the product of the two mentioned above: See also Figure 4 The visualization shows the weights of different points based on distance and local consistency in one iteration, and it can be seen that the weights of points in the spur region are significantly reduced. S424, Weighted Model Fitting: Using weighted least squares method, As weight, for The points in the model are fitted with a circle or ellipse model to obtain the updated model. The objective function of weighted least squares is: For ellipses: Minimize ,satisfy ; S425, Convergence Check: Calculate the model parameter vector for this iteration. (For example, for an ellipse) ) and the previous parameter vector relative change ,like The iteration terminates if the maximum number of iterations is reached. For preset values ​​(such as) Output the final benchmark model Otherwise, let Return to S421.

[0041] The S50 achieves high-precision benchmark models. Then, for all original edge points Defect determination is performed. This invention employs a discrimination strategy that fuses distance deviation, local curvature change, and adaptive dynamic threshold. The steps include: S51, Precise Distance Calculation: For each point Calculate its to Sign distance (Outer values ​​are positive, inner values ​​are negative). To improve the speed of ellipse calculations, this invention proposes a fast geometric distance approximation method: for the distance on the ellipse... nearest point Its satisfaction The normal at the point passes through We utilize the initial estimated points (such as...) By projecting the points onto the elliptic algebraic curve and performing 1-2 Newton iterations through a first-order Taylor expansion, the approximate closest point and distance that meet the accuracy requirements can be obtained, which is several times faster than the exact iteration method.

[0042] S52, Local curvature estimation: at point Within the contour neighborhood, a local circular arc or quadratic curve is fitted using several points before and after it, and the calculation is performed. curvature on the local fitted curve Simultaneously, the baseline model is calculated. In Theoretical curvature at the corresponding angle (or normal direction) Define the change in curvature .

[0043] S53, Adaptive Dynamic Threshold Generation (Innovation): Instead of using a global threshold, we generate a threshold for each point. Generate a dynamic threshold that is related to its local environment. It consists of three parts: Basic tolerance threshold : Set according to the tolerance requirements of the workpiece drawing; Positioning uncertainty threshold : By analyzing points The image gradient magnitude and direction within the neighborhood are used to estimate the standard deviation of sub-pixel edge localization at that point. Regions with strong gradients and consistent directions provide more accurate localization. Small, setting ,in , where is the confidence coefficient (e.g., 3).

[0044] Model Fitting Residual Threshold In the final iteration of step four, the point The weighted mean of the fitted residuals in the local region (binned by angle or arc length) This reflects the overall volatility level of the model's fit in this region. (Setting) .

[0045] The overall dynamic threshold is: The threshold is automatically tightened in areas with clear edges and good model fit, and automatically widened in areas with blurred edges or systematic distortion.

[0046] S54, Fusion Discriminant Function and Defect Judgment: Constructing a fusion feature discriminant function : in, and It is a weighting coefficient that balances the importance of distance features and curvature features. ), It is the normalized reference threshold for curvature variation. When At time, point These are identified as defect points. Consecutive defect points constitute a defect region. Furthermore, the area, maximum protrusion depth, and average [value] of each defect region can be calculated. Values ​​are used as quantitative indicators of burrs.

[0047] The core of this invention lies in its unique and interrelated technical concepts and implementation methods. The specific claims should cover the following key technical points: 1. An adaptive contour partitioning method based on bias statistics: This method dynamically partitions edge point sets into "trustworthy regions," "suspicious regions," and "strong outlier regions" based on the bias to the initial fitted model, and includes an adaptive threshold for partitioning. and The calculation logic (based on the mean of global deviation) and standard deviation With coefficient (The determination).

[0048] 2. Iterative weighted model fitting method incorporating local consistency: During the iterative fitting process, a comprehensive weight is assigned to each point. The calculation method. Emphasis is placed on protecting local consistency weights. Definition and calculation, i.e., point-based The deviation and its contour neighborhood The exponential decay function of the difference in the median of the internal biases, and its effect on purifying the fitted point set and improving the robustness of the model.

[0049] 3. Multi-feature fusion discriminant function for circle / ellipse burr detection: preserves and utilizes the geometric distance deviation from the point to the reference model. and local contour curvature change To construct a defect discrimination function The method, and through weighting coefficients A technical solution that balances the contributions of both.

[0050] 4. An adaptive dynamic threshold generation method for defect detection: This method dynamically generates a discrimination threshold for each contour point. The technology, especially its basic tolerances Edge localization uncertainty threshold based on local image gradient estimation and the regional fluctuation threshold based on the fitting residual of the local model. The scheme is composed of three parts.

[0051] 5. Complete system process and method combination: Protect the complete detection process formed by the combination of the above key points, that is, the circle / ellipse contour burr detection method includes three core stages: "adaptive partition initial fitting", "iterative weighted fine fitting" and "multi-feature fusion dynamic threshold discrimination".

[0052] 6. Fast Elliptical Geometric Distance Approximation Method: Protecting the calculation point To the ellipse When calculating the distance, the specific algorithm steps involve using the initial estimation of the projection point and performing a finite number (e.g., 1-2) of Newton iterations to quickly obtain a high-precision approximate solution.

[0053] To achieve the same inventive objective, based on the technical solution of this invention, the following alternative solutions with equivalent or similar effects can be considered: 1. Alternative to the initial partitioning method: In step three, besides using a method based on the statistical bias of the initial fit for partitioning, clustering methods based on the consistency of local gradients at edge points or the uniformity of gray-level distribution (such as DBSCAN clustering) can also be used to directly separate potential defect point clusters, thereby dividing reliable regions. However, the statistical bias method is simpler and more direct to calculate, and its connection with subsequent fitting logic is more natural.

[0054] 2. Alternatives to Local Consistency Weights: In calculating local consistency weights... At that time, the neighborhood The definition of consistency can be extended beyond the contour sequence neighborhood; it can encompass neighborhood points within the Euclidean distance range. Alternatively, the difference between the deviation at this point and the deviation of the neighborhood mean can be used, or the "isolation degree" statistic of the deviation at this point within the neighborhood can be calculated (e.g., based on the idea of ​​the Local Outlier Factor (LOF)). However, methods based on the contour sequence neighborhood and median are more robust to edge breaks and noise.

[0055] 3. Alternative to multi-feature fusion methods: discriminant function More complex machine learning models can be used instead of linear weighted fusion, for example, to... Using local texture features as input features, a lightweight binary classification model (such as a support vector machine (SVM) or a small-scale neural network) is trained to directly determine whether each point is a defect. This may achieve better performance on specific datasets, but it increases the complexity of model training and deployment, reducing its general applicability. The linear fusion scheme of this invention is transparent, efficient, and easy to adjust.

[0056] 4. Alternatives to dynamic thresholds: In In addition to estimating positioning uncertainty based on gradients, a priori, position-related positioning error map can also be obtained by taking multiple standard part images under the same imaging conditions and statistically analyzing the repeatability of edge points at each location. In some cases, the robust standard deviation of the distance deviation of all points in the local region where the point is located (such as MAD) can be used instead of the weighted residual mean. These alternatives can achieve similar adaptive effects.

[0057] 5. Simplified alternative to the overall process: For scenarios with slightly lower accuracy requirements or extremely high speed requirements, the "iterative weighted fine-tuning fitting" step can be simplified to perform only one "adaptive partition fitting" step, and then directly proceed to "multi-feature fusion discrimination". Although the accuracy of the baseline model may decrease slightly, combined with dynamic thresholding, it can still significantly outperform the traditional static thresholding method. This is a compromise between performance and efficiency.

[0058] In summary, this invention provides an innovative solution to the problem of burr detection on circular / elliptical contours. Its core advantage lies in achieving an excellent balance between the purity of model fitting, the adaptability of defect discrimination, and the overall computational efficiency of the system through ingenious algorithm design. It has good prospects for industrial application and patent protection value.

[0059] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A high-precision detection method for burrs in circles and ellipses based on adaptive fitting, characterized in that, Includes the following steps: S10, Image Acquisition and Preprocessing; S20, subpixel edge extraction; S30, adaptive partitioning and initial model fitting; S40, iterative weighted refinement fitting; S50, multi-feature fusion defect detection; S60, output the detection result; The S10 uses an area array or line array industrial camera to acquire workpiece images under controlled lighting conditions. Preprocessing specifically includes: Non-uniform illumination correction: Use methods based on background estimation or homomorphic filtering to eliminate brightness gradients in the image; Noise filtering: An adaptive edge-preserving filter is applied to smooth noise while preserving edge sharpness; Region of Interest (ROI) Definition: Based on prior knowledge or through template matching and Blob analysis, the approximate area of ​​the workpiece is automatically located, narrowing down the processing scope. S20 includes employing a sub-pixel-level edge detection algorithm to extract contour points from the preprocessed image, outputting an ordered or unordered set of sub-pixel edge points. ,in Points, coordinates It is a floating-point number; S30 includes the following steps: S31, Coarse Fitting and Global Bias Calculation, for the entire set An initial circle or ellipse model is fitted using Least Median Squares (LMedS) or Fast RANSAC. Calculate all points arrive geometric distance ; S32, adaptive partitioning based on deviation distribution; S33, based on quadratic fitting of the reliable region; The analysis in S32 Based on the statistical distribution, an adaptive partitioning strategy is introduced to divide the entire contour point set into reliable regions. and suspicious areas Set two adaptive thresholds: Core threshold ,in for The mean and standard deviation, It is a preset coefficient; Exclusion threshold ,in It is a ratio Large preset coefficient; definition These points are considered to have a high probability of belonging to a real smooth contour; definition These points are burrs, noise, or located in areas of high distortion; for Points that are identified are directly marked as strong outliers in the initial stage and are not included in the baseline model fitting. S33 uses only a set of reliable points. The refined initial model is obtained by fitting the model using the weighted least squares method. ; S40 includes the following steps: S41, Initialization, set the current model Number of iterations A candidate point set containing all points ; S42, Iterative process.

2. The high-precision detection method for burrs in circles and ellipses based on adaptive fitting according to claim 1, characterized in that, S42 includes the following steps: S421, Distance weight calculation: For Every point , k The iteration number is used to calculate the number of iterations up to the current model. geometric distance Distance weight Defined as: in In this iteration The robustness estimation of the function makes the points with smaller distances have larger weights, and the rate of weight decay is adaptively determined by the dispersion of the current data. S422, Local Consistency Weight Calculation, for point In its neighborhood along the contour sequence Within this range, we examine the continuity of its distance deviation and define a local consistency measure. This is the absolute difference between the deviation at this point and the median deviation in the neighborhood: Then the local consistency weight is: ,in yes The scaling estimate is used to penalize isolated points whose behavior is inconsistent with that of their surrounding points. S423, Comprehensive Weight Allocation: Points The overall weight is the product of the two mentioned above: ; S424, Weighted Model Fitting: Using weighted least squares method, As weight, for The points in the model are fitted with a circle or ellipse model to obtain the updated model. The objective function of weighted least squares is: For ellipses: Minimize ,satisfy ; S425, Convergence Check: Calculate the model parameter vector for this iteration. Compared with the previous parameter vector relative change ,like The iteration terminates if the maximum number of iterations is reached. The final baseline model is output based on preset values. Otherwise, let Return to S421.

3. The high-precision detection method for burrs in circles and ellipses based on adaptive fitting according to claim 2, characterized in that, S50 includes the following steps: S51, precise distance calculation; S52, Local curvature estimation; S53, adaptive dynamic threshold generation; S54, fusion of discriminant function and defect determination.

4. The high-precision detection method for burrs in circles and ellipses based on adaptive fitting according to claim 3, characterized in that, In S52, each point Generate a dynamic threshold related to its local environment, which includes: a basic tolerance threshold, a positioning uncertainty threshold, and a model fitting residual threshold.