Three-point circle-approximating high-precision vision measurement method and system
The three-point circle approximation method, which combines edge extraction, quality scoring, and uncertainty assessment, solves the problems of low efficiency, insufficient accuracy, and insufficient reliability in existing technologies. It achieves high-precision and high-reliability three-point circle approximation visual measurement, which is suitable for complex industrial environments and fully automated production lines.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU HUICUI INTELLIGENT TECH CO LTD
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-12
AI Technical Summary
Existing three-point circular vision measurement methods suffer from low efficiency, insufficient accuracy, susceptibility to noise interference, and lack of reliability assessment in industrial inspection, making it difficult to achieve high-precision and high-reliability automated measurement.
By acquiring the image to be tested, edge extraction and quality scoring are performed, a high-quality candidate point set is screened, a three-point candidate combination is generated, the radial residual and geometric distribution are evaluated, the optimal three-point combination is selected, and the reliability of the measurement results is quantified by combining the uncertainty evaluation model.
It achieves sub-pixel-level edge positioning, effectively filters high-quality candidate points, ensures the stability and reliability of fitting results, adapts to complex industrial environments, and meets the needs of fully automated production line applications.
Smart Images

Figure CN122199587A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual measurement technology, specifically to a three-point pseudo-circle high-precision visual measurement method and system. Background Technology
[0002] In the field of industrial automation inspection, circles and arcs are core geometric features of many components such as bearings, gears, flanges, bottle necks, and optical lenses. The accurate measurement of their diameter directly affects product quality control and assembly precision. Machine vision, with its non-contact and high-efficiency advantages, has become the mainstream method for online inspection of these dimensions. Its core principle involves acquiring images with a camera, extracting edge pixel sets, and then mathematically fitting parameters such as the circle's center and radius. Finally, it combines these parameters with system calibration coefficients to convert pixel dimensions into physical dimensions.
[0003] In scenarios where the measured circle is complete or mostly visible, high measurement accuracy and robustness can be achieved by extracting dozens to hundreds of edge points and fitting them using algorithms such as the least squares method. However, in actual industrial production, factors such as fixture obstruction, installation space limitations, and the need to measure only a local arc often prevent the measured circle from being fully imaged, making it difficult to obtain full-circumference point cloud data. In this case, the three-point approximation method, which determines a unique circle based on three non-collinear points, becomes the mathematically determined core solution. How to accurately acquire three effective edge points through machine vision to achieve high-precision diameter measurement has become a key technical challenge in industrial inspection.
[0004] Existing three-point circular vision measurement schemes have significant drawbacks. For example, manual point sampling and interactive measurement rely on manual operation, which is inefficient and easily affected by subjective factors, resulting in poor repeatability and consistency, and making them unsuitable for fully automated production lines. Secondly, automated schemes based on Canny edge detection and random / equal interval point sampling lack intelligence in point selection, and the edge detection results are easily affected by noise, uneven lighting, etc., leading to large fluctuations in fitting results and insufficient accuracy. Furthermore, although the local Hough circle transform has a certain degree of noise resistance, it has a large computational load, poor real-time performance, and its accuracy is limited by the discretization interval of the parameter space, making it difficult to achieve sub-pixel level measurement and prone to false detections.
[0005] In addition, existing technologies generally suffer from problems such as insufficient single-point positioning accuracy, sensitivity to noise interference, and lack of measurement reliability assessment. They cannot meet the industrial testing requirements of automation, high precision, and high reliability. There is an urgent need for a three-point pseudo-circle measurement method that can intelligently select high-quality measurement points and quantify the reliability of results. Summary of the Invention
[0006] The purpose of this invention is to provide a three-point circular high-precision visual measurement method and system to solve the problems mentioned in the background art.
[0007] According to one aspect of this application, a three-point quasi-circular high-precision visual measurement method is provided, comprising the following steps: Acquire the image to be measured that contains the target circular arc; Edge extraction is performed within the region of interest of the image to be tested to obtain an initial point set containing multiple edge points; A quality score is calculated for each edge point in the initial point set. The quality score is based at least on the gradient magnitude of the point, the continuity of the local edge it is located in, and its relative position in the local edge segment. A high-quality candidate point set is then selected from the initial point set based on a preset threshold. From the set of high-quality candidate points, the optimal three-point combination is selected by generating multiple three-point candidate combinations and evaluating each candidate combination. The evaluation includes at least calculating the radial residual of the three-point candidate combination itself relative to its fitted circle and evaluating the geometric distribution of the three-point candidate combination. The center coordinates and radius of the target circle are obtained by coordinate fitting based on the optimal combination of the three points. Based on the geometric distribution of the optimal three-point combination and the uncertainty of edge positioning, the fitting uncertainty of the target circle radius is estimated.
[0008] Preferably, the quality score for each edge point is calculated by weighted summation based on the ratio of the gradient magnitude of the edge point to the global maximum gradient magnitude, the directional consistency measure between the point and its neighboring edge points, and the relative distance of the point from the endpoint of its respective edge segment.
[0009] Preferably, selecting the optimal three-point combination from the set of high-quality candidate points specifically includes: generating a preset number of three-point candidate combinations based on the comprehensive quality score and spatial distribution; for each three-point candidate combination, calculating the root mean square of the difference between the distance from the three points to the center of the circle fitted by the combination and the fitted radius, as the radial residual.
[0010] Preferably, evaluating the geometric distribution of the three candidate combinations includes: calculating the minimum interior angle of the triangle formed by the three points, and using the minimum interior angle as a geometric distribution evaluation factor.
[0011] Preferably, the fitting uncertainty for estimating the radius of the target circle is specifically: the fitting uncertainty is directly proportional to the single-point positioning uncertainty and inversely proportional to the trigonometric function value of the smallest interior angle of the triangle formed by the optimal three-point combination.
[0012] Preferably, selecting the optimal three-point combination from the high-quality candidate point set further includes: for each reference circle fitted by the three-point candidate combination, calculating the distance from all points in the high-quality candidate point set to the reference circle, taking points whose distance from the reference circle is less than a preset tolerance as support points, and calculating the average quality score of the support points to assist in evaluating the three-point candidate combination.
[0013] In another aspect, this application also provides a three-point quasi-circular high-precision visual measurement system, comprising: The image acquisition module is used to acquire the image to be tested, which contains the target arc. The initial point set acquisition module is used to extract edges within the region of interest of the image to be tested, and obtain an initial point set containing multiple edge points; The point set filtering module is used to calculate a quality score for each edge point in the initial point set. The quality score is based at least on the gradient magnitude of the point, the continuity of the local edge it is located in, and its relative position in the local edge segment. Based on a preset threshold, a high-quality candidate point set is filtered out from the initial point set. The optimal three-point combination selection module is used to select the optimal three-point combination from the set of high-quality candidate points by generating multiple three-point candidate combinations and evaluating each candidate combination. The evaluation includes at least calculating the radial residual of the three-point candidate combination itself relative to its fitted circle and evaluating the geometric distribution state of the three-point candidate combination. The fitting module is used to obtain the center coordinates and radius of the target circle based on the coordinate fitting of the optimal combination of three points. The uncertainty estimation module is used to estimate the fitting uncertainty of the target circle radius based on the geometric distribution of the optimal three-point combination and the uncertainty of edge positioning.
[0014] This application also provides a computer device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the three-point pseudo-circle high-precision visual measurement method as described above.
[0015] In another aspect, this application provides a computer-readable storage medium having stored thereon computer program instructions that can be executed by a processor to implement the three-point quasi-circle high-precision visual measurement method as described above.
[0016] Another aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the three-point quasi-circle high-precision visual measurement method as described above.
[0017] This application improves edge point positioning accuracy through sub-pixel edge positioning technology, overcoming the limitations of traditional integer pixel positioning. A quality scoring mechanism based on gradient magnitude, continuity, and centrality effectively filters high-quality candidate points, significantly reducing noise and glitch interference. A three-point optimization strategy combining geometric constraints, radial residuals, and local consistency verification ensures the rationality and consistency of the fitted point set, avoiding accuracy fluctuations caused by blind point selection. An uncertainty assessment model quantifies the reliability of measurement results and outputs a flag, enabling system self-diagnosis and eliminating invalid data output. This invention addresses the pain points of existing technologies, such as the contradiction between automation and accuracy, weak anti-interference, and lack of reliability assessment. Its measurement repeatability and stability meet the needs of industrial precision testing, making it suitable for complex industrial environments and fully automated production line applications. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of a three-point pseudo-circle high-precision visual measurement method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the initial point set acquisition process provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the point set filtering process provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the process for obtaining the optimal three-point combination provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the measurement reliability assessment process provided in an embodiment of the present invention; Figure 6 A visual schematic diagram of the uncertainty assessment process provided in the embodiments of the present invention; Figure 7 This is a schematic diagram of a three-point pseudo-circle high-precision visual measurement system provided in an embodiment of the present invention; Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] It should be noted that all user information (including but not limited to user device information, user personal information, object information corresponding to device usage data, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, device usage data, etc.) involved in all embodiments of this disclosure are information and data authorized by the user or fully authorized by all parties.
[0021] like Figure 1 As shown in the diagram, this invention discloses a three-point pseudo-circle high-precision visual measurement method, which includes the following steps: S1, acquire the image to be measured containing the target arc; S2, perform edge extraction within the region of interest of the image to be tested to obtain an initial point set containing multiple edge points; S3, calculate a quality score for each edge point in the initial point set. The quality score is based at least on the gradient magnitude of the point, the continuity of the local edge it is located on, and its relative position in the local edge segment. A high-quality candidate point set is then selected from the initial point set based on a preset threshold. S4, from the set of high-quality candidate points, the optimal three-point combination is selected by generating multiple three-point candidate combinations and evaluating each candidate combination. The evaluation includes at least calculating the radial residual of the three-point candidate combination itself relative to its fitted circle and evaluating the geometric distribution state of the three-point candidate combination. S5, Based on the coordinate fitting of the optimal three-point combination, the center coordinates and radius of the target circle are obtained; S6. Based on the geometric distribution of the optimal three-point combination and the uncertainty of edge positioning, estimate the fitting uncertainty of the target circle radius.
[0022] In some embodiments, for step S1, specifically, the image to be measured can be acquired based on the image acquisition function of a high-precision vision measurement system. For example, the hardware system may include: selecting a high-resolution industrial camera (e.g., an area scan camera or a line scan camera) based on the motion state of the object being measured and the measurement efficiency requirements; a telecentric lens with appropriate magnification to reduce perspective projection errors and ensure consistency of measurement scale at different field-of-view positions; a high-contrast uniform illumination source, such as a backlight source for contour measurement or coaxial light or ring light for surface edge measurement, to enhance the grayscale difference between the target arc and the background; and a robust mechanical support structure to fix the camera, lens, and object being measured, avoiding image blurring caused by vibration during the measurement process.
[0023] Optionally, before actual measurement, the system can be calibrated using pixel equivalents, that is, by using standard gauge blocks or calibration parts of known size to determine the actual physical size corresponding to one pixel in the image. The unit is mm / pixel. This calibration result is used for subsequent conversion between pixel size and physical size. When a measurement trigger signal is generated, such as when the photoelectric sensor on the production line is triggered, the industrial camera acquires an image containing the target arc according to preset parameters such as exposure time and gain. This image is the image to be measured, and it must ensure that the key areas of the target arc are free from severe occlusion, blurring, or overexposure / underexposure.
[0024] In some embodiments, for step S2, please refer to Figure 2 , Figure 2 This is a schematic diagram of the initial point set acquisition process provided in an embodiment of the present invention.
[0025] Specifically, firstly, in step S201, the region of interest (ROI) is determined. This can be achieved by using methods such as preset coordinate ranges, image grayscale thresholding, or template matching to select a rectangular or irregular region within the image to be tested that contains the target arc. This reduces background noise interference and improves computational efficiency. For example, if the approximate location of the object in the image is known, fixed ROI coordinates can be directly set; if the object's location is slightly offset, template matching can be used to find the approximate outline of the target arc, and then the ROI range can be dynamically adjusted to ensure that the target arc is completely contained within the ROI.
[0026] Secondly, in S202, the image within the ROI is preprocessed. Specifically, a Gaussian filtering algorithm is used to smooth the ROI image to suppress image noise. The kernel size of the Gaussian filter can be adjusted according to the image noise intensity; for example, a 3×3 or 5×5 Gaussian kernel can be selected, with its standard deviation... It can be set between 0.5 and 1.5. Through convolution operation, the gray values of isolated noise points in the image tend to be smoother, while preserving the edge features of the target arc.
[0027] Next, in S203, the edge response of each pixel is calculated. Specifically, gradient operators based on the first derivative, such as the Sobel operator and the Prewitt operator, are used to calculate the gradient magnitude of each pixel within the ROI. and gradient direction The gradient magnitude represents the intensity of a pixel as an edge point, while the gradient direction indicates the direction of the edge. The calculation formula is as follows:
[0028]
[0029] in, and Each pixel The gray-level partial derivatives in the x and y directions are obtained by performing a difference operation on the Gaussian-smoothed image.
[0030] Then, in S204, coarse edge point screening is performed. A low gradient magnitude threshold is set. Gradient magnitude within ROI Pixels identified as potential edge pixels form a coarse selection set of edge points. Threshold The settings need to balance the integrity of edge points and the noise suppression effect, and can be determined experimentally. For example, in sample images containing typical noise, the minimum gradient magnitude that can cover the target arc edge and exclude most of the background noise can be selected as the minimum gradient magnitude. .
[0031] Finally, in S205, sub-pixel edge localization is performed. For each pixel in the coarse selection set... The local grayscale profile is extracted along the direction perpendicular to the gradient, i.e., the edge normal direction. For example, with the pixel as the center, the grayscale values of five consecutive pixels (two pixels to the left and two pixels to the right) are selected along the normal direction to form the local grayscale profile of that pixel. ,in This is the offset of the pixel on the normal, for example, with values of -2, -1, 0, 1, 2.
[0032] Subpixel offset calculated using the gray-scale moment method The specific formula is as follows:
[0033] Where the numerator is the weighted sum of the offset and the corresponding gray value, and the denominator is the sum of the gray values. The value of is usually between -1 and 1, representing the precise position of the edge between the current pixel and its adjacent pixels.
[0034] Based on sub-pixel offset and edge normal direction vector (from the gradient direction) The derivation shows that the gradient direction is perpendicular to the edge direction, therefore the normal direction vector can be expressed as: ), calculate the sub-pixel coordinates of edge points The formula is as follows: .
[0035] Through the above process, all coarsely selected edge points are converted into sub-pixel level coordinates, forming an initial point set containing multiple edge points. This step improves the edge positioning accuracy from the traditional 1 pixel to 0.1 pixels or even higher, effectively breaking through the limitation of measurement accuracy imposed by integer pixel positioning and solving the technical problem of insufficient single-point positioning accuracy in existing technologies.
[0036] According to an embodiment of the present invention, for step S3, this step performs a quality assessment on each edge point in the initial point set to select the high-quality points that best represent the characteristics of the real arc, thus avoiding interference from noise points, burrs, or broken edge points on the subsequent fitting results. Please refer to... Figure 3 , Figure 3 This is a schematic diagram of the point set filtering process provided in an embodiment of the present invention.
[0037] Specifically, firstly, in S301, three core evaluation indicators for quality scoring are determined: gradient magnitude ratio, local edge continuity measure, and edge segment centrality measure. The calculation methods for each indicator are as follows: Gradient magnitude percentage: Calculate the gradient magnitude at each edge point. Global maximum gradient magnitude within ROI ratio This metric reflects the sharpness of edge points; the closer the ratio is to 1, the clearer the edge and the less affected by blur or noise. Among these, the global maximum gradient magnitude... It is obtained by taking the maximum value after traversing the gradient magnitude of all edge points in the initial point set.
[0038] Local edge continuity measure: for each edge point Select a preset number of adjacent edge points before and after it (e.g., 2 points before and after), and calculate... The cosine of the angle between the gradient direction and the gradient direction of each adjacent point is used as the average of these cosine values as a continuity measure. The closer the cosine value is to 1, the better the directional consistency of adjacent edge points and the stronger the edge continuity; if there are breaks or burrs on the edge, this value will decrease significantly. Specifically, let... The gradient direction is Adjacent points The gradient direction is Then the directional consistency of a single adjacent point is , This is the average value of the directional consistency of all adjacent points.
[0039] Edge segment centrality measure: First, the initial point set is segmented into edge segments, dividing continuous edge points with the same orientation into the same edge segment. For each edge point... Calculate the distance from the edge to the two endpoints of the segment to which it belongs. (Take the smaller value), and combine it with the total length of the edge segment. The ratio of (the sum of distances between all adjacent points within a segment) The centrality measure is This indicator encourages selecting points close to the center of edge segments, as the endpoints of edge segments are susceptible to noise, breaks, or background interference, while points in the central region better reflect the true arc contour.
[0040] Secondly, in S302, the three evaluation indicators are weighted and summed to obtain the comprehensive quality score for each edge point. The calculation formula is as follows:
[0041] in, , , The weighting coefficients of the three indicators, and satisfying the following conditions: The weighting coefficients can be adjusted according to the actual application scenario. For example, in scenarios with blurred edges but good continuity, the weighting coefficients can be increased. The weight can be increased in noisy but sharp-edge scenes. The weight. For example, by verification, when , , At that time, it can achieve good screening results in most industrial scenarios.
[0042] Finally, in S303, the quality threshold is set. The overall quality score Edge points are selected from the initial point set to form a high-quality candidate point set. Quality threshold The setting needs to balance the quality and quantity of the point set, and is usually set between 0.5 and 0.7 to ensure that the filtered point set excludes low-quality noise points while retaining a sufficient number of valid points. Much greater than 3, for example This provides sufficient candidate samples for the subsequent optimal combination of the three points.
[0043] Therefore, through multi-dimensional quality assessment, noise points, burrs, and fracture edge points in the initial point set are effectively filtered out, solving the problem of blind point selection in existing technologies and ensuring that the candidate points used for fitting are high-quality points that can accurately reflect the geometric features of the target arc.
[0044] According to an embodiment of the present invention, for step S4, by introducing geometric constraints, radial residual evaluation, and local consistency verification (optional), the optimal combination of three points is intelligently selected from the high-quality candidate point set, avoiding the unstable fitting results caused by random or mechanical point selection in traditional methods. Please refer to... Figure 4 , Figure 4 This is a schematic diagram of the process for obtaining the optimal three-point combination provided in an embodiment of the present invention.
[0045] Preferably, in S401, a preset number of three-point candidate combinations are generated using the comprehensive quality score and spatial distribution as constraints, rather than completely random sampling.
[0046] Specifically, all points in the high-quality candidate point set S are ranked according to their comprehensive quality scores. Sort the points in descending order and select the top K points with the highest quality scores as core candidate points. The value of K can be adjusted according to the size of the point set, for example, K=30, to ensure the basic quality of the candidate combinations. Calculate the principal component direction of the core candidate point set. This direction is approximately parallel to the tangent direction of the target arc. Therefore, the direction perpendicular to the principal component is the chord direction of the arc. Divide the core candidate points into multiple intervals along the chord direction, for example, 3 to 5 intervals, ensuring that each interval contains a certain number of points. Points are selected from different intervals to form three-point candidate combinations, ensuring that the three points in the combination are widely distributed in space and avoiding unstable fitting values caused by the three points being too concentrated. For example, each time three points are selected, it must be ensured that the pixel distance between any two points is not less than a preset minimum value, such as 5 pixels, and that the three points are not collinear. This can be judged by initially calculating whether the area of the triangle formed by the three points is greater than a preset threshold. Repeat the above sampling process to generate a preset number. The three candidate combinations, among which, The value of needs to balance computational efficiency and combinatorial coverage, for example This constitutes a set of three candidate combinations. Each combination , , , All of these are points from a high-quality candidate point set.
[0047] By using the above-mentioned constrained sampling method, the generated three-point candidate combinations not only ensure the high quality of the points but also the rationality of the spatial distribution, providing high-quality candidate samples for subsequent optimization and avoiding the problem of too many low-quality combinations that may be caused by completely random sampling.
[0048] In S402, each three-point candidate combination is evaluated. Specifically, each three-point candidate combination... The evaluation is conducted from two core dimensions: radial residuals and geometric distribution state. Optionally, local consistency verification can be introduced as an auxiliary evaluation dimension.
[0049] Specifically, the radial residual is first calculated, and then the three-point circle formula is used to combine the... By fitting a circle to the three points in the diagram, we obtain the fitted circle. the center of the circle and radius The core formula for defining a circle using three points is as follows: center Calculation:
[0050]
[0051] radius Calculation:
[0052] in, , , Combinations Subpixel coordinates of the three points in the middle.
[0053] Then, calculate the distance from each point in the combination to the center of the fitted circle. distance , , The formula is as follows:
[0054] Finally, the radial residuals are calculated. , which is the root mean square of the distance difference from the three points to the fitted radius, is given by the following formula:
[0055] radial residual It reflects the consistency of the three points themselves. The smaller the value, the closer the three points are to being concyclic, and the better it represents the true characteristics of a circular arc.
[0056] Secondly, the geometric distribution state is evaluated. Specifically, three candidate combinations are calculated. The smallest interior angle of a triangle formed by three points. And the minimum interior angle is used as the geometric distribution evaluation factor.
[0057] Specifically, first, calculate the side lengths between the three points. , , The formula is as follows:
[0058] Then, calculate the three interior angles of the triangle using the Law of Cosines. , , ,by Corresponding side length Taking the opposite diagonal as an example, the formula is as follows:
[0059] Finally, the minimum value among the three interior angles is selected as the smallest interior angle. Set the minimum interior angle lower limit as follows: If the minimum interior angle of a combination of three points is lower than the lower limit, the combination is directly eliminated, because if the three points are too close or approximately collinear, the fitting result will be extremely sensitive to single-point errors and have poor numerical stability.
[0060] The evaluation of geometric distribution status solves the problem of measurement accuracy fluctuation caused by unreasonable three-point distribution in the prior art. By ensuring that the three points are uniformly distributed and non-collinear, the stability and reliability of the fitting results are improved.
[0061] Preferably, local consistency verification is introduced during the evaluation process to further improve the reliability of the optimal three-point combination. Specifically, firstly, a tolerance is set. For example, 0.5 pixels. This tolerance is the maximum allowable distance from the point to the reference circle, used to determine whether the point is a support point.
[0062] Then, for the three candidate combinations Fitted reference circle center ,radius Traverse the high-quality candidate point set all points Calculate the distance from each point to the reference circle. The formula is as follows:
[0063] Will satisfy The points are determined as support points for the combination, and all support points are collected to form a support point set. .
[0064] Finally, compute the support point set. The average of the overall quality scores of all points The formula is as follows:
[0065] in, To support the number of points in the point set. It reflects the degree of agreement between the reference circle and the high-quality candidate point set. The higher the value, the more the reference circle can represent the true geometric features of the target arc, and the more reliable the corresponding three-point combination is.
[0066] In S403, the overall score is calculated and the optimal combination is selected. Based on the above evaluation dimensions, an overall score is calculated for each valid three-point candidate combination (i.e., the combination that was not eliminated). The formula is as follows:
[0067] in, , , Let be the weighting coefficients for each evaluation dimension, and satisfy . For example, , , It can be adjusted according to the actual scenario; To prevent division by zero of small constants (e.g.) ), to avoid due to Too small a value leads to abnormal scores; if local consistency verification is not introduced, then... Only the radial residual and geometric distribution are considered.
[0068] All valid combinations are ranked according to their overall score. Sort the data in descending order and select the combination with the highest score as the optimal three-point combination. This combination possesses good self-consistency (low radial residual), reasonable spatial distribution (large minimum interior angle), and can optionally have good agreement with other high-quality points (high average mass fraction of support points), making it the three-point combination that best represents the geometric characteristics of the target arc.
[0069] In some embodiments, for step S5, the target circle parameters are fitted using the optimal three-point combination. Specifically, the optimal three-point combination... subpixel coordinates , , Substitute the exact formula for defining a circle using three points to determine the center of the target circle, and calculate the coordinates of the center of the target circle. and radius (Pixel unit). Its calculation formula is consistent with the formula for fitting the reference circle in step S4, as follows: center Calculation:
[0070]
[0071] radius Calculation:
[0072] This step is a routine geometric calculation process. Because the input is a high-quality sub-pixel point that has been selected, the fitted circle parameters have extremely high accuracy and can accurately reflect the true geometric features of the target circle.
[0073] According to an embodiment of the present invention, in step S6, by establishing an uncertainty assessment model, the reliability of the measurement results is quantified, thus solving the problem in the prior art that the reliability of measurement cannot be assessed. See also... Figure 5 , Figure 5This is a schematic diagram of the measurement reliability assessment process provided in an embodiment of the present invention.
[0074] Specifically, in S501, the uncertainty of single-point positioning is determined. Single-point positioning uncertainty This is an inherent error in subpixel edge localization technology, and its magnitude is related to factors such as the subpixel algorithm used and image quality (noise, contrast). Specifically, it can be determined in two ways: Theoretical accuracy derivation: For the gray-scale moment method, the theoretical uncertainty of its sub-pixel positioning can be derived by analyzing the noise distribution of the gray-scale profile, which is usually between 0.05 and 0.15 pixels. Experimental statistics: By repeatedly locating the same standard edge, the standard deviation of the positioning results was calculated, and this standard deviation was used as the single-point positioning uncertainty. For example, it has been verified that when the gray-scale moment method is used and the image signal-to-noise ratio is greater than 30dB, Pixel.
[0075] In practical applications, the single-point positioning uncertainty can be pre-calibrated based on the specific sub-pixel algorithm and measurement scenario. And store it in the system for later use.
[0076] In S502, a model for estimating the fitting uncertainty is established. Specifically, the fitting uncertainty... (i.e., the radius of the target circle) Uncertainty of the point and uncertainty of single-point positioning Proportional to, and the smallest interior angle of the triangle formed by the optimal combination of three points. It is inversely proportional to the sine value, and its approximate estimation formula is as follows:
[0077] in The coefficients related to geometric configuration need to be determined through calibration experiments. For example, several standard arcs of known dimensions are selected, and each is measured using this method. The deviation between the measured values and the true values is calculated, and then combined with the corresponding... and Obtained through linear regression fitting The value of is usually between; The smallest interior angle (in radians) of the triangle formed by the optimal combination of three points indicates that the three points are more evenly distributed, the fitting result is less sensitive to point errors, and the uncertainty is smaller; conversely, the more concentrated the three points are, the greater the uncertainty.
[0078] The physical significance of this model lies in the fact that the impact of a single-point positioning error on the fitting result is directly related to the geometric distribution of the three points. The more widely the three points are distributed, the larger the minimum interior angle, and the smaller the impact of the error at a single point on the overall fitting radius, resulting in more reliable measurement results. This model achieves rapid estimation of fitting uncertainty through simple geometric relationships and experimental calibration, without the need for complex Monte Carlo simulations or higher-order error propagation analysis, thus balancing accuracy and computational efficiency.
[0079] In S503, the uncertainty of the physical size is calculated. This is combined with the pixel equivalent calibrated in step S1. The radius uncertainty per pixel Diameter uncertainty converted to physical units The physical diameter of the target circle. The calculation formula is: The corresponding diameter expansion uncertainty, such as when taking the coverage factor. The confidence interval covering approximately 95% is as follows: .
[0080] In S504, the output measurement results and reliability indicators are displayed. Specifically, the system outputs the target circle diameter obtained from the fit. At the same time, it can also output based on the fitting uncertainty. Determine the measurement reliability criteria. Set a threshold for diameter uncertainty. The settings are based on the accuracy requirements of industrial measurements, for example... mm, when When the reliability indicator is "reliable", it means that the measurement results meet the accuracy requirements; when When the system displays "unreliable", it will output an alarm signal, indicating that the current image quality or arc length may not meet the measurement requirements. Users can check measurement conditions such as lighting, camera focal length, and the position of the object being measured.
[0081] Alternatively, the determination of reliability indicators can also be combined with the comprehensive score of the optimal three-point combination. Set a score threshold ,when Even at that time It was also judged as "unreliable", further improving the system's fault tolerance.
[0082] Therefore, by quantifying the uncertainty of the measurement results and outputting a reliability indicator, the system has the ability to self-diagnose, avoiding the risk of outputting erroneous values without the user's knowledge in existing technologies, and greatly improving the system's practicality and reliability.
[0083] Please see Figure 6 , Figure 6This is a visual diagram illustrating the uncertainty assessment process provided in an embodiment of the present invention. Figure 6 (a) in the image is the original image. Figure 6 In the diagram, (b) represents sub-pixel edge points, and the color indicates the quality score. Figure 6 In the diagram, (c) represents the optimal three points and the fitted circle. Figure 6 (d) in the diagram represents the uncertainty region. Subpixel edge positioning improves the accuracy of the input data by an order of magnitude. Intelligent three-point optimization based on quality scoring and geometric constraints ensures that the points used for fitting are high-quality, highly consistent points that best represent the true geometric features, thereby reducing the repeatability standard deviation of the three-point circle fitting results to the subpixel level, meeting the requirements of industrial precision measurement. It is applicable not only to partial arcs but also to complete circles, requiring only that the ROI contains a portion of the arc. It has stronger adaptability to common industrial environments such as uneven lighting and contrast variations.
[0084] Please see Figure 7 , Figure 7 A three-point circular high-precision visual measurement system 700 is provided as an embodiment of the present invention. This system embodiment is similar to... Figure 1 Corresponding to the illustrated method embodiments, this system can be specifically applied to various computer devices. The system specifically includes: The image acquisition module 701 is used to acquire the image to be tested, which contains the target arc. The initial point set acquisition module 702 is used to perform edge extraction within the region of interest of the image to be tested to obtain an initial point set containing multiple edge points; The point set filtering module 703 is used to calculate a quality score for each edge point in the initial point set. The quality score is based at least on the gradient magnitude of the point, the continuity of the local edge it is located on, and its relative position in the local edge segment. It also filters out high-quality candidate point sets from the initial point set based on a preset threshold. The optimal three-point combination selection module 704 is used to select the optimal three-point combination from the high-quality candidate point set by generating multiple three-point candidate combinations and evaluating each candidate combination. The evaluation includes at least calculating the radial residual of the three-point candidate combination itself relative to its fitted circle and evaluating the geometric distribution state of the three-point candidate combination. The fitting module 705 is used to obtain the center coordinates and radius of the target circle based on the coordinate fitting of the optimal three-point combination. Uncertainty estimation module 706 is used to estimate the fitting uncertainty of the target circle radius based on the geometric distribution of the optimal three-point combination and the uncertainty of edge positioning.
[0085] Based on the same inventive concept, this application also provides a computer device, the method corresponding to which can be the method in the foregoing embodiments, and the principle of solving the problem is similar to that method. The computer device provided in this application includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute the methods and / or technical solutions of the foregoing embodiments of this application.
[0086] The computer device can be a user device, or a device formed by integrating user devices and network devices through a network, or it can be an application running on the aforementioned devices. The user device includes, but is not limited to, various terminal devices such as computers, mobile phones, tablets, smartwatches, and smart bands. The network device includes, but is not limited to, network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets, and can be used to implement some processing functions when setting an alarm clock. Here, the cloud consists of a large number of hosts or network servers based on cloud computing. Cloud computing is a type of distributed computing, consisting of a virtual computer composed of a group of loosely coupled computer sets.
[0087] Figure 8 The diagram illustrates the structure of a computer device suitable for implementing the methods and / or technical solutions in the embodiments of this application. The computer device 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes based on a program stored in a read-only memory (ROM) 802 or a program loaded from a storage portion 808 into a random access memory (RAM) 803. The RAM 803 also stores various programs and data required for system operation. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0088] The following components are connected to I / O interface 805: an input section 806 including a keyboard, mouse, touchscreen, microphone, infrared sensor, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), LED display, OLED display, etc., and speakers, etc.; a storage section 808 including one or more computer-readable media such as hard disk, optical disk, magnetic disk, semiconductor memory, etc.; and a communication section 809 including a network interface card such as a LAN (local area network) card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet.
[0089] In particular, the methods and / or embodiments in this application can be implemented as computer software programs. For example, the embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. When the computer program is executed by a central processing unit (CPU) 801, it performs the functions defined in the methods of this application.
[0090] Another embodiment of this application provides a computer-readable storage medium having computer program instructions stored thereon, which can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of this application described above.
[0091] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0092] The flowcharts or block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of computer devices, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-specific system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0093] Furthermore, the inclusion of a single word does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices described in the system can also be implemented by a single unit or device through software or hardware. Terms such as "first," "second," etc., are used to indicate names and do not indicate any specific order.
Claims
1. A three-point near-circle high-precision visual measurement method, characterized in that, Includes the following steps: Acquire the image to be measured that contains the target circular arc; Edge extraction is performed within the region of interest of the image to be tested to obtain an initial point set containing multiple edge points; A quality score is calculated for each edge point in the initial point set. The quality score is based at least on the gradient magnitude of the point, the continuity of the local edge it is located in, and its relative position in the local edge segment. A high-quality candidate point set is then selected from the initial point set based on a preset threshold. From the set of high-quality candidate points, the optimal three-point combination is selected by generating multiple three-point candidate combinations and evaluating each candidate combination. The evaluation includes at least calculating the radial residual of the three-point candidate combination itself relative to its fitted circle and evaluating the geometric distribution of the three-point candidate combination. The center coordinates and radius of the target circle are obtained by coordinate fitting based on the optimal combination of the three points. Based on the geometric distribution of the optimal three-point combination and the uncertainty of edge positioning, the fitting uncertainty of the target circle radius is estimated.
2. The three-point pseudo-circle high-precision visual measurement method according to claim 1, characterized in that, The quality score for each edge point is calculated by weighting and summing the ratio of the gradient magnitude of the edge point to the global maximum gradient magnitude, the directional consistency measure between the point and its neighboring edge points, and the relative distance of the point from the endpoint of its corresponding edge segment to obtain a comprehensive quality score.
3. The three-point pseudo-circle high-precision visual measurement method according to claim 2, characterized in that, Selecting the optimal three-point combination from the set of high-quality candidate points specifically includes: generating a preset number of three-point candidate combinations based on the comprehensive quality score and spatial distribution; for each three-point candidate combination, calculating the root mean square of the difference between the distance from the three points to the center of the circle fitted by the combination and the fitted radius, which is used as the radial residual.
4. The three-point pseudo-circle high-precision visual measurement method according to claim 3, characterized in that, The evaluation of the geometric distribution of the three candidate combinations includes: calculating the minimum interior angle of the triangle formed by the three points, and using the minimum interior angle as the geometric distribution evaluation factor.
5. The three-point pseudo-circle high-precision visual measurement method according to claim 4, characterized in that, The fitting uncertainty for estimating the radius of the target circle is specifically: the fitting uncertainty is directly proportional to the single-point positioning uncertainty and inversely proportional to the trigonometric function value of the smallest interior angle of the triangle formed by the optimal three-point combination.
6. The three-point pseudo-circle high-precision visual measurement method according to claim 3, characterized in that, Selecting the optimal three-point combination from the set of high-quality candidate points further includes: for each reference circle fitted by the three-point candidate combination, calculating the distance from all points in the set of high-quality candidate points to the reference circle, taking points whose distance from the reference circle is less than a preset tolerance as support points, and calculating the average quality score of the support points to assist in evaluating the three-point candidate combination.
7. A three-point near-circle high-precision visual measurement system, characterized in that, include: The image acquisition module is used to acquire the image to be tested, which contains the target arc. The initial point set acquisition module is used to extract edges within the region of interest of the image to be tested, and obtain an initial point set containing multiple edge points; The point set filtering module is used to calculate a quality score for each edge point in the initial point set. The quality score is based at least on the gradient magnitude of the point, the continuity of the local edge it is located in, and its relative position in the local edge segment. Based on a preset threshold, a high-quality candidate point set is filtered out from the initial point set. The optimal three-point combination selection module is used to select the optimal three-point combination from the set of high-quality candidate points by generating multiple three-point candidate combinations and evaluating each candidate combination. The evaluation includes at least calculating the radial residual of the three-point candidate combination itself relative to its fitted circle and evaluating the geometric distribution state of the three-point candidate combination. The fitting module is used to obtain the center coordinates and radius of the target circle based on the coordinate fitting of the optimal combination of three points. The uncertainty estimation module is used to estimate the fitting uncertainty of the target circle radius based on the geometric distribution of the optimal three-point combination and the uncertainty of edge positioning.
8. A computer device, wherein the computer device is characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
9. A computer-readable medium having computer program instructions stored thereon, characterized in that, The computer program instructions can be executed by a processor to implement the method as described in any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.