An edge data calibration method for component geometry measurement
Patent Information
- Application Number
- CN202510870961.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2045-06-26
AI Technical Summary
[0004]然而,几何测量系统所面临的一关键问题是:如何在算法层面提高测量几何元件的精度
[0038]1.本发明提出了一种面向元件几何测量的边缘数据调校方法,首先使用融合小波与全变分对边缘进行预调校,之后计算预调校边缘中所有离散点的二阶梯度绝对值,将二阶梯度绝对值较大的预设个数离散点作为新锚点,将预调校边缘进行有交叠地划分,得到预调校边缘片段集;采用已得到的有限高斯混合模型融合二阶全变分正则,建立每个预调校边缘片段的理想边缘最大后验估计函数,以最小化该函数为目标,无约束地对该预调校边缘片段进行独立平滑校正,聚合平滑校正后的各边缘片段,得到最终调校边缘。本发明对测量元件进行边缘检测后,对离散点建立坐标系进行数据清洗,移除异常数据点,为进一步计算元器件的几何量与公差提供可靠的数据,以提高工业测量的精度。
Smart Images

Figure CN120765502B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of computer digital image processing, and more specifically, relates to an edge data calibration method for component geometric measurement. Background Technology
[0002] In industrial product conformity verification, one of the most effective and widely used methods is image-based measurement, which plays a crucial role in the measurement of components manufactured in fields such as precision manufacturing and medical devices. Because the measurement process is non-contact and based on computer vision, and the tolerance range of the measured object is extremely small, this places extremely high demands on the geometric measurement system.
[0003] The existing system's measurement process consists of three main modules: using a joystick to control a sensor to acquire digital images of the geometric component under test; performing edge detection on the images and converting them to a coordinate system, displaying the discrete edge detection points; and performing real-time fitting of the edge data to calculate the component's geometric quantities and tolerances, and then providing feedback. The latter two modules have very high requirements for numerical calculations.
[0004] However, a key challenge facing geometric measurement systems is how to improve the accuracy of measuring geometric elements at the algorithmic level. The accuracy of image-based measurements often depends on the extraction and use of edge data. If the edge detection algorithm lacks robustness, or if least-squares fitting is used when outliers are present in the edge data, significant drawbacks can occur. One approach to addressing this issue is to fine-tune the detected edges. Summary of the Invention
[0005] In view of the above-mentioned defects or improvement needs of the existing technology, the present invention provides an edge data calibration method for component geometry measurement, the purpose of which is to improve the accuracy of measuring geometric components at the algorithm level.
[0006] To achieve the above objectives, according to one aspect of the present invention, an edge data calibration method for component geometry measurement is provided, comprising:
[0007] S1. Extract discrete points of the component edge from the acquired image of the component being detected, use some discrete points as anchor points, and divide the component edge in the image in an overlapping manner to obtain a set of edge segments;
[0008] S2. Based on the finite Gaussian mixture model and by fusing wavelet and total variation, establish the maximum a posteriori estimation function of the adjusted edge corresponding to all edge segments. With the goal of minimizing this function, adjust the edge segment independently without constraints, and aggregate the adjusted edge segments to obtain the pre-adjusted edge.
[0009] S3. Calculate the absolute value of the second-order gradient of all discrete points in the pre-adjustment edge, take a preset number of discrete points with larger absolute values of the second-order gradient as new anchor points, divide the pre-adjustment edge into overlapping segments, and obtain a set of pre-adjustment edge segments; use the finite Gaussian mixture model obtained in S2 to fuse the second-order total variation regularization, establish the ideal edge maximum a posteriori estimation function for each pre-adjustment edge segment, and perform independent smoothing correction on the pre-adjustment edge segment without constraints with the goal of minimizing the function, and aggregate the edge segments after smoothing correction to obtain the final adjusted edge;
[0010] The aggregation method is as follows: calculate the Euclidean distance between the value of each overlapping point on each edge segment in the fragment set and the corresponding corrected adjustment value; sum all the adjustment values corresponding to the overlapping point by weight, and use the sum as the final adjustment result of the overlapping point in the corresponding correction, wherein each weight used is inversely proportional to the corresponding Euclidean distance.
[0011] Furthermore, in S1, based on the nth-order gradient at the feature points corresponding to the edge shape, some discrete points are determined as anchor points, where n is a positive integer.
[0012] Furthermore, in S2, the optimization problem aimed at minimizing the maximum a posteriori estimation function of the tuned edges corresponding to all edge segments is as follows:
[0013]
[0014] In the formula, N1 represents the number of segments in the edge segment set, w represents the known orthogonal wavelet basis, and s n This represents the wavelet coefficient of the nth edge segment. Represents the nth edge segment y n Smooth correction edges, express The jth n elements, M n F represents the number of discrete points in the nth edge segment. n The row vectors in the model are a cycle of (-1, 1, 0, ..., 0), ||·||1 and ||·||0 are the L1 and L0 norms respectively, and λ1 and λ2 represent the non-negative regularization coefficients; the error distribution p(ε) is in the form of a Gaussian mixture model. K is a preset value.
[0015] Furthermore, by solving the aforementioned optimization problem, each edge segment can be independently adjusted. The solution method is as follows:
[0016] Solving the optimization problem is transformed into iteratively solving the first subproblem and the second subproblem alternately to obtain S. n Through calculation To achieve adjustment of each edge segment;
[0017] The first subproblem is:
[0018]
[0019] In the formula, the superscript old indicates the numerical result of the previous iteration;
[0020] Second subproblem:
[0021]
[0022] In the formula, Parameters μ > 0 and v n There is a fixed update method μ←μη (η>1) and ν n ←ν n -μ(t n -s n ), y n and The jth n The elements are respectively and The j-th iteration result of the previous iteration of the nth pre-calibration edge represents... n One element; This represents the previous iteration result of the wavelet coefficients corresponding to the nth tuning edge; ||·|| F t represents the L2 norm; n To optimize s n The auxiliary variables introduced;
[0023] In each iteration, the given... Solve the first subproblem, updating alternately. and established and Solve the second subproblem to update S. n .
[0024] Furthermore, the optimization problem aimed at minimizing the ideal maximum a posteriori estimate function of each pre-tuned edge segment is as follows:
[0025]
[0026] In the formula, x′ n This indicates the pre-calibrated edge segment y′ in the pre-calibrated edge segment set. n Smoothing correction edges; N2 represents the number of segments in the pre-calibrated edge segment set, D n G represents the number of discrete points in the nth pre-calibrated edge segment. nThe row vectors in the array are a cycle of (1, -2, 1, 0, ..., 0); ||·|1 is the L1 norm; the regularization coefficient λ>0; In Represents y′ n -x′ n The jth n There are 1 element; the error distribution p(ε) is in the form of a Gaussian mixture model. K is a preset value.
[0027] Furthermore, by solving the aforementioned optimization problem, independent correction is achieved for each pre-calibrated edge segment. The solution method is as follows:
[0028] Solving the optimization problem is transformed into solving the following problem:
[0029]
[0030] In the formula:
[0031] z n =Gnx′ n
[0032]
[0033] The superscript "old" indicates the numerical result of the previous iteration; y′ n and The jth n The elements are and Indicates the adjustment edge x n The j-th iteration of the numerical results n One element; ||·|| F Represents the L2 norm; ν > 0 and ω n The update methods are v←vη (η>1) and ω respectively. n ←ω n -v(z n -G n x′ n ).
[0034] According to another aspect of the present invention, an electronic device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the method described above.
[0035] According to another aspect of the invention, a computer-readable storage medium is provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is run by a processor, it controls the device where the storage medium is located to perform the steps of the method described above.
[0036] According to another aspect of the invention, a computer program product is provided, comprising a computer program or instructions that, when executed by a processor, implement the steps of the method described above.
[0037] In summary, compared with the prior art, the technical solutions conceived by this invention have the following main advantages:
[0038] 1. This invention proposes an edge data calibration method for component geometry measurement. First, it pre-calibrates the edges using a fusion of wavelet and total variation regularization. Then, it calculates the absolute value of the second-order gradient of all discrete points in the pre-calibrated edge, using a predetermined number of discrete points with large absolute values of the second-order gradient as new anchor points. The pre-calibrated edge is then divided into overlapping segments to obtain a set of pre-calibrated edge fragments. Using a finite Gaussian mixture model fused with second-order total variation regularization, an ideal maximum a posteriori (MAP) estimation function for each pre-calibrated edge fragment is established. With minimizing this function as the objective, the pre-calibrated edge fragments are independently and unconstrainedly smoothed and corrected. The smoothed and corrected edge fragments are then aggregated to obtain the final calibrated edge. This invention, after edge detection of the measured component, establishes a coordinate system for discrete points and performs data cleaning to remove outlier data points, providing reliable data for further calculation of the component's geometric quantities and tolerances, thereby improving the accuracy of industrial measurements.
[0039] 2. This invention also proposes two specific solution methods for optimization problems, making the solution convenient and quick. Attached Figure Description
[0040] Figure 1 This is a flowchart illustrating an edge data calibration method for component geometry measurement, provided in an embodiment of the present invention. Detailed Implementation
[0041] 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. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0042] Example 1
[0043] An edge data calibration method for component geometry measurement, such as Figure 1 As shown, it includes:
[0044] S1. Extract discrete points of the component edge from the acquired image of the component being detected, use some discrete points as anchor points, and divide the component edge in the image in an overlapping manner to obtain a set of edge segments;
[0045] S2. Based on the finite Gaussian mixture model and by fusing wavelet and total variation, establish the maximum a posteriori estimation function of the adjusted edge corresponding to all edge segments. With the goal of minimizing this function, adjust the edge segment independently without constraints, and aggregate the adjusted edge segments to obtain the pre-adjusted edge.
[0046] S3. Calculate the absolute value of the second-order gradient of all discrete points in the pre-adjustment edge, take a preset number of discrete points with larger absolute values of the second-order gradient as new anchor points, divide the pre-adjustment edge into overlapping segments, and obtain a set of pre-adjustment edge segments; use the finite Gaussian mixture model obtained in S2 to fuse the second-order total variation regularization, establish the ideal edge maximum a posteriori estimation function for each pre-adjustment edge segment, and perform independent smoothing correction on the pre-adjustment edge segment without constraints with the goal of minimizing the function, and aggregate the edge segments after smoothing correction to obtain the final adjusted edge;
[0047] The aggregation method is as follows: calculate the Euclidean distance between the value of each overlapping point on each edge segment in the fragment set and the corresponding corrected adjustment value; sum all the adjustment values corresponding to the overlapping point by weight, and use the sum as the final adjustment result of the overlapping point in the corresponding correction, wherein each weight is inversely proportional to the corresponding Euclidean distance.
[0048] This embodiment provides a novel edge calibration method for geometry measurement, comprising the following two stages:
[0049] (1) Pre-adjust the edge by fusing wavelet and total variation;
[0050] (2) Use second-order total variation to further smooth the edges.
[0051] Phase (1) includes the following sub-steps:
[0052] (1.1) The user initializes the anchor points of the detected element image through the interactive system; wherein, preferably, some discrete points are determined as anchor points according to the nth-order gradient at the feature points corresponding to the edge shape, where n is a positive integer.
[0053] (1.2) The edges detected by the edge detection algorithm are divided into overlapping segments based on anchor points. These segments constitute an edge fragment set.
[0054] (1.3) Combine wavelet and total variation to adjust all edge segments;
[0055] (1.4) Aggregate the adjusted edge fragments into a complete edge.
[0056] The preferred optimization problem, which aims to minimize the maximum a posteriori estimation function of the tuned edges corresponding to all edge segments, is as follows:
[0057]
[0058] In the formula, N1 represents the number of segments in the edge segment set, w represents the known orthogonal wavelet basis, and s n This represents the wavelet coefficient of the nth edge segment. Represents the nth edge segment y n Smooth correction edges, express The jth n elements, M n F represents the number of discrete points in the nth edge segment. n The row vectors in the model are a cycle of (-1, 1, 0, ..., 0), ∥·∥1 and ∥·∥0 are the L1 and L0 norms respectively, and λ1 and λ2 represent the non-negative regularization coefficients; the error distribution p(ε) is in the form of a Gaussian mixture model. K is a preset value.
[0059] Alternatively, by solving the optimization problem, each edge segment can be independently adjusted. Specifically, the solution method is as follows:
[0060] (1.3.1) For the objective function (1-1) Using Jensen's inequality:
[0061]
[0062] in The right side of the above inequality with respect to n and j n Sum, and only keep those containing π. k , The terms have sub-optimization problems:
[0063]
[0064] established From (1-2), it is easy to give π. k With σ k Update format. Alternating updates. and Until the original objective function (1-1) converges.
[0065] (1.3.2) Only retain the sub-objective functions (1-2) containing The item, and use (1-1) containing s n The two regularization terms give us a sub-optimization problem:
[0066]
[0067] in, remember Add a quadratic term to the above objective function The problem can be transformed into:
[0068]
[0069] in, yes The jth n One element, ||·|| F This represents the L2 norm.
[0070] To make it easier to optimize s n ,Will s in n Replace with t n Meanwhile, a constraint t is introduced for (1-3). n =s n Using the Augmented Lagrangian Methods, constraint (1-3) can be transformed into:
[0071]
[0072] Where the parameter μ > 0 and v n There is a fixed update method μ←μη (η>1) and v n ←v n -μ(t n -s n ).
[0073] Furthermore, based on Orthogonal, with the following about s n Sub-optimization problem:
[0074]
[0075] Therefore, for s n The update will be performed using a hard-thresholding method. Also, from (1-4) regarding t... n The sub-optimization problem can be transformed into:
[0076]
[0077] in The above is a total variational noise reduction problem, which can be solved using existing algorithms for x. n Perform optimization (if using the augmented Lagrange method, refer to steps (2-3) to (2-4)); obtain x nLater given Will be used for updates n .
[0078] (1.3.3) Alternate iterative steps (1.3.1) and (1.3.2) until the objective function (1-1) converges. See Algorithm 1 for details.
[0079]
[0080] After obtaining the pre-calibrated edge segments, step (1.4) includes the following sub-steps:
[0081] (1.4.1) At the overlap point, calculate the Euclidean distance between all original edge observations and their pre-calibrated values;
[0082] (1.4.2) The pre-calibration values at the overlapping points are added together in a weighted manner to give the final pre-calibration result, where the weights are inversely proportional to the distance calculated in (1.4.1).
[0083] Similarly, stage (2) includes the following sub-steps:
[0084] (2.1) Calculate the absolute value of the second gradient of all discrete points in the pre-adjustment edge, and select some points with larger absolute values of the second gradient as new anchor points;
[0085] (2.2) The pre-calibration edges are divided in an overlapping manner according to the anchor points, and the divided edges constitute a set of pre-calibration edge segments.
[0086] (2.3) Use second-order total variation regularization to smooth all edge segments;
[0087] (2.4) Aggregate the adjusted edge fragments into a complete edge.
[0088] The preferred optimization problem, which aims to minimize the ideal maximum a posteriori estimation function of each pre-tuned edge segment, is as follows:
[0089]
[0090] In the formula, x′ n This indicates the pre-calibrated edge segment y′ in the pre-calibrated edge segment set. n Smoothing correction edges; N2 represents the number of segments in the pre-calibrated edge segment set, D n G represents the number of discrete points in the nth pre-calibrated edge segment. n The row vectors in the array are a cycle of (1, -2, 1, 0, ..., 0); ||·|1 is the L1 norm; the regularization coefficient λ>0; In Represents y′ n -x′n The jth n There are 1 element; the error distribution p(ε) is in the form of a Gaussian mixture model. K is a preset value.
[0091] Alternatively, by solving the optimization problem, each pre-calibrated edge segment can be independently corrected. Specifically, the solution method is as follows:
[0092] (2.3.1) Regarding parameters The sub-optimization problem is the same as (1-2), and has the following form:
[0093]
[0094] in, established Alternate updates and Until the original objective function (2-1) converges.
[0095] (2.3.2) Only retain the sub-objective function (2-2) containing The terms, and using (2-1) containing x′ n The regularization term has a sub-optimization problem:
[0096]
[0097] in, Similar to (1-3), the above problem can be transformed into:
[0098]
[0099] in yes The jth n One element. Introducing z n =G n x′ n Using the augmented Lagrange method, (2-3) is further transformed into:
[0100]
[0101] Where ν>0 and ω n The update methods are v←vη (η>1) and ω respectively. n ←ω n -v(z n -G n x′ n Update z n It will be done using a soft-thresholding method, while for x′ nThe update involves solving a simple system of linear equations.
[0102] (2.3.3) Iterate alternately between (2.3.1) and (2.3.2) until the objective function (2-1) converges. See Algorithm 2 for details.
[0103]
[0104] Step (2.4) has two sub-steps (1.4.1) and (1.4.2) that are the same as those in (1.4).
[0105] This embodiment employs stages (1) and (2) to clean the data after edge detection, remove abnormal data, and provide reliable data for further calculation of the geometric quantities and tolerances of industrial components, thereby improving the accuracy of industrial measurement.
[0106] Example 2
[0107] This application also relates to an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described above.
[0108] The electronic device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The memory can be used to store computer programs and / or modules. The processor performs various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory, and by accessing data stored in the memory.
[0109] The relevant technical solutions are the same as above, and will not be repeated here.
[0110] Example 3
[0111] This application also relates to a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.
[0112] Specifically, the memory may include high-speed random access memory, as well as non-volatile memory, such as hard disks, RAM, plug-in hard disks, smart media cards (SMC), secure digital cards (SD), flash cards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices.
[0113] The relevant technical solutions are the same as above, and will not be repeated here.
[0114] Example 4
[0115] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps of the method described in the above embodiments of this application.
[0116] The relevant technical solutions are the same as above, and will not be repeated here.
[0117] Those skilled in the art will readily understand that the above description is merely 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 scope of protection of the present invention.
Claims
1. A method for edge data calibration for component geometry measurement, characterized in that, include: S1. Extract discrete points of the component edge from the acquired image of the component being detected, use some discrete points as anchor points, and divide the component edge in the image in an overlapping manner to obtain a set of edge segments; S2. Based on the finite Gaussian mixture model and by fusing wavelet and total variation, establish the maximum a posteriori estimation function of the adjusted edge corresponding to all edge segments. With the goal of minimizing this function, adjust the edge segment independently without constraints, and aggregate the adjusted edge segments to obtain the pre-adjusted edge. S3. Calculate the absolute value of the second-order gradient of all discrete points in the pre-adjustment edge, take a preset number of discrete points with larger absolute values of the second-order gradient as new anchor points, divide the pre-adjustment edge into overlapping segments, and obtain a set of pre-adjustment edge segments; use the finite Gaussian mixture model obtained in S2 to fuse the second-order total variation regularization, establish the ideal edge maximum a posteriori estimation function for each pre-adjustment edge segment, and perform independent smoothing correction on the pre-adjustment edge segment without constraints with the goal of minimizing the function, and aggregate the edge segments after smoothing correction to obtain the final adjusted edge; The aggregation method is as follows: calculate the Euclidean distance between the value of each overlapping point on each edge segment in the fragment set and the corresponding corrected adjustment value; sum all the adjustment values corresponding to the overlapping point by weight, and use the sum as the final adjustment result of the overlapping point in the corresponding correction, wherein each weight used is inversely proportional to the corresponding Euclidean distance; In S2, the optimization problem aimed at minimizing the maximum a posteriori estimation function of the tuned edges corresponding to all edge segments is as follows: In the formula, N 1 indicates the number of segments in the edge segment set. Represents a known orthogonal wavelet basis. s n Indicates the first n Wavelet coefficients of each edge segment Indicates the first n edge segments Smooth correction edges, express The first in One element, F represents the number of discrete points in the nth edge segment. n The row vector in is (-1) , 1 , 0 , ··· , The loop of 0), where ∥ · ∥1 and ∥ · ∥0 are the L1 and L0 norms respectively. λ 1 and λ 2 represents the non-negative canonical coefficient; error distribution p ( ε The form is a Gaussian mixture model. K is a preset value; By solving the aforementioned optimization problem, each edge segment can be independently adjusted. The solution method is as follows: Solving the optimization problem is transformed into iteratively solving the first subproblem and the second subproblem alternately, yielding the following result. Through calculation This allows for the adjustment of each edge segment; The first subproblem is: In the formula, the superscript old indicates the numerical result of the previous iteration; Second subproblem: In the formula, ,parameter and There is a fixed update method. and , , , and The The elements are respectively and ; Indicates the first n The numerical result of the last iteration of the pre-calibrated edge One element; Indicates the first n The previous iteration result of the wavelet coefficients corresponding to each adjustment edge; Represents the L2 norm; To optimize The auxiliary variables introduced; In each iteration, the given... Solve the first subproblem by alternating updates. and ,established and Solve the second subproblem to update .
2. The edge data calibration method as described in claim 1, characterized in that, In S1, some discrete points are determined as anchor points based on the nth-order gradient at the feature points corresponding to the edge shape, where n is a positive integer.
3. The edge data calibration method as described in claim 1, characterized in that, The optimization problem aiming to minimize the ideal maximum a posteriori estimate function of each pre-tuned edge segment is as follows: In the formula, Indicates pre-calibrated edge segments. Smooth correction edges; This indicates the number of segments in the pre-calibrated edge segment set. Indicates the first n The number of discrete points in a pre-calibrated edge segment The row vector in is (1 , 2 , 1 , 0 , · · · , A loop of 0); It is the L1 norm; regularity coefficient λ> 0; In express The first in 1 element; error distribution p ( ε The form is a Gaussian mixture model. , K This is the default value.
4. The edge data calibration method as described in claim 3, characterized in that, By solving the aforementioned optimization problem, independent correction can be achieved for each pre-calibrated edge segment. The solution method is as follows: Solving the optimization problem is transformed into solving the following problem: In the formula: The superscript "old" indicates the numerical result of the previous iteration; and The The elements are and , Indicates the edge of adjustment The numerical results of the last iteration One element; Represents the L2 norm; and The update methods are respectively and .
5. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 4.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein the computer program, when executed by a processor, controls the device on which the storage medium is located to perform the steps of the method as described in any one of claims 1 to 4.
7. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Method for jointly calibrating water-water-slope ratio of upstream dam slope of earth and rockfill dam in operation period
CN118537381A
Plastic waste detection method, device and equipment and storage medium
CN119810426A