Fitting method and system for spatial form of measured object and storage medium

By obtaining the spatial shape of the measured object through segmentation and iterative least squares method, the problem of inaccurate fitting caused by insufficient number of feature points in the existing technology is solved, and high-precision and stable spatial shape fitting is achieved, which is suitable for high-precision measurement.

CN120997401APending Publication Date: 2025-11-21HEFEI RAYCISION MEDICAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511189470.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-25
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Existing technologies, when measuring the spatial shape of an object, suffer from inaccurate fitting results due to the limited number or uneven distribution of feature points. Furthermore, noise in CT scan data exacerbates the deviation, making it difficult to meet the requirements for high-precision measurement.

Method used

The target region is the segmented object surface. The first-level feature point set is obtained by using the least squares method to generate a first-level surface model. The intersection points are obtained by scaling as supplementary fitting points. The second-level feature point set is obtained step by step through iteration. The least squares method is used to generate a more accurate surface model until the parameter deviation is less than the threshold.

Benefits of technology

It improves the accuracy and stability of fitting results, reduces computational overhead, enhances robustness, maintains high precision in noisy environments, and is suitable for modern precision measurement scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120997401A_ABST
    Figure CN120997401A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of spatial form fitting, and particularly relates to a fitting method and system for a spatial form of a measured object and a storage medium. The fitting method comprises the following steps: obtaining a first-level feature point set in each target area on the surface of a measured object, and then obtaining a first-level surface model of each target area; scaling the first-level surface model to obtain a plurality of first-level scaling models, and obtaining intersection points of the first-level scaling models and the current target area and recording the intersection points as first-level supplementary fitting points; the first-level supplementary fitting points and the first-level feature points jointly form a second-level feature point set of the current target area; obtaining a secondary surface model of each target area; and when the parameter deviation between the current-level surface model and the previous-level surface model is smaller than a set threshold value, taking the current-level surface model as the final representation of the current target area. According to the invention, the spatial form of the measured object can be stably, accurately and efficiently fitted.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of high-precision measurement, and particularly relates to a fitting method and system for the spatial form of a measured object and a storage medium. BACKGROUND

[0002] With the increasing demand for precision machining in modern industry, the precision and reliability of measurement technology are facing higher requirements, especially the increasing concern about the uncertainty of measurement results.

[0003] The prior art uses a computed tomography (CT) device to scan a measured object, generates CT data, and then obtains surface mesh data of the measured object through surface reconstruction technology. The user needs to manually collect a number of feature points from these surface data and fit the collected feature points to obtain the spatial form of the measured object.

[0004] However, when the number of feature points collected by the user is small, or the spatial representativeness of the relative positions of the feature points and between the feature points is low, the distribution is uneven, and the position accuracy is insufficient, the accuracy of the fitted spatial form of the measured object is often unsatisfactory. Furthermore, the spatial form of the measured object fitted by the prior art is easily affected by the distribution of the feature points, so the accuracy of the fitting result is unstable and lacks robustness. In addition, CT scan data usually contains noise, which further exacerbates the deviation of the fitting result in the case of a small number of feature points, making it difficult to meet the demand for high-precision measurement. SUMMARY

[0005] The purpose of the present application is to overcome the shortcomings of the prior art and provide a fitting method for the spatial form of a measured object, which can stably and accurately and efficiently fit the spatial form of the measured object.

[0006] To achieve the above-mentioned purpose, the present application adopts the following technical solutions:

[0007] A fitting method for the spatial form of a measured object, comprising the following steps:

[0008] S1, dividing the surface of the measured object into a plurality of target regions;

[0009] S2, after obtaining a set of first feature points in each target region, obtaining a first surface model of each target region by least squares method;

[0010] S3, scaling the first surface model of the target region to obtain a plurality of first scaled models of the current target region, and recording the intersection point of the first scaled model and the current target region as a first supplementary fitting point;

[0011] S4, the primary supplementary fitting points of the target region and the primary feature points jointly form a secondary feature point set of the current target region; based on the current secondary feature point set, a secondary surface model of the current target region is obtained through a least square method;

[0012] S5, if the parameter deviation between the secondary surface model of the current target region and the primary surface model is less than a set threshold, the current secondary surface model is taken as the final representation of the current target region; otherwise, a next level feature point set is obtained, and a next level surface model of the current target region is obtained based on the next level feature point set, until the parameter deviation between the current primary surface model and the previous primary surface model is less than the set threshold, and the current primary surface model is taken as the final representation of the current target region;

[0013] S6, the final representation of all target regions of the measured object surface is determined, and at this time, the spatial form fitting of the measured object is completed.

[0014] Preferably, in S1, the following sub-steps are further included:

[0015] S11, after obtaining the surface image data of the measured object, a surface mesh data set of the measured object is generated based on a surface reconstruction algorithm;

[0016] S12, the surface mesh data set is divided into a plurality of surface mesh sub-data sets, and each surface mesh sub-data set corresponds to a target region.

[0017] Preferably, in S2, the following sub-steps are further included:

[0018] S21, a plurality of mesh data in the surface mesh sub-data set are selected as the primary feature points of the corresponding target region;

[0019] S22, based on the primary feature points of each target region, a least square method is used to calculate the primary surface model of the corresponding target region.

[0020] Preferably, in S3, the following sub-steps are further included:

[0021] S31, after scaling the primary surface model of the current target region, a plurality of primary scaled models are generated;

[0022] S32, the intersection data between the primary scaled model of the current target region and the surface mesh sub-data set is calculated, and the points corresponding to the intersection data are taken as the primary supplementary fitting points of the current target region.

[0023] Preferably, in S5, the following is further included: calculating whether all geometric parameter deviations between the secondary surface model of the current target region and the primary surface model are less than a set threshold, if so, fitting the spatial form of the current target region tends to be stable, and the current secondary surface model is taken as the final representation of the current target region; otherwise, the secondary surface model of the current target region is scaled to obtain a plurality of secondary scaled models; then, intersection data between the secondary scaled model of the current target region and the surface mesh sub-data set is calculated, and the points corresponding to the intersection data are taken as the tertiary supplementary fitting points of the current target region; the tertiary supplementary fitting points of the current target region and the secondary feature points jointly constitute the tertiary feature point set of the current target region; based on the current tertiary feature point set, a tertiary surface model of the current target region is obtained by least square method; and whether all geometric parameter deviations between the tertiary surface model of the current target region and the secondary surface model are less than a set threshold is determined and repeatedly until all geometric parameter deviations between the current primary surface model and the last primary surface model are less than a set threshold, and the current primary surface model is taken as the final representation of the current target region.

[0024] Preferably, the least square method is used to calculate the primary surface model corresponding to the target region, including the following sub-steps: step 1, using the least square method to obtain the initial parameters θ (0) of the primary feature points;

[0025] Step 2, based on the initial parameters θ (0) , the weight of each primary feature point under the local noise scale is calculated;

[0026] Step 3, based on the weight of each primary feature point, the weighted least square is used to solve the primary surface model g 1 .

[0027] Preferably, in step 2, the following sub-steps are further included:

[0028] Step 21, according to the Euclidean distance, a symmetric distance matrix D of the primary feature points is constructed, and each element in the symmetric distance matrix D is the Euclidean distance between two primary feature points;

[0029] Step 22, for all primary feature points, the K feature points with the smallest Euclidean distance except themselves in the symmetric distance matrix D are taken to form the local neighborhood of the corresponding primary feature point; at the same time, the residual of each primary feature point is calculated based on the initial parameters θ (0) ;

[0030] Step 23, the local noise variance of each primary feature point is calculated:

[0031]

[0032] wherein, denotes a local noise variance of the primary feature point p i ; μ1 is a first noise parameter; median(·) denotes a median; denotes a residual of the primary feature point p 0 calculated based on the initial parameters θ i ; Np i denotes a local neighborhood of the primary feature point p i ; denotes a local neighborhood Np i ; and 0 denotes a residual median calculated based on the initial parameters θ

[0033] Step 24, calculating a weight of each primary feature point p at a local noise scale: wherein μ2 denotes a second noise parameter; denotes a weight of the primary feature point p i at the local noise scale.

[0034] Preferably, in step 7, the following is further included: solving the primary surface model parameters θ (1) corresponding to the optimal solution of the optimization objective function L of the weighted least squares by singular value decomposition: wherein the homogeneous linear constraint is denotes a linearized vector of the primary feature point p i ; denotes a transpose of ; and the corresponding geometric model of the primary surface model parameters θ (1) is the primary surface model g 1 .

[0035] The application further provides a system for fitting a spatial form of a measured object, comprising: a segmentation module, a feature point module, a surface model module, a scaling model module, a supplementary fitting point module, and a discrimination module; the segmentation module is used to segment the surface of the measured object into a plurality of target regions and send the target regions into the feature point module; the feature point module is used to generate feature points of corresponding levels for the target regions and send the feature points into the surface model module; the surface model module is used to generate surface models of corresponding levels; when the level of the surface model is less than 2, the surface model module sends the current first-level surface model into the scaling model module; otherwise, the surface model module sends the current first-level surface model into the discrimination module; the discrimination module is used to determine whether the parameter deviation between the current first-level surface model and the previous first-level surface model is less than a set threshold value, and if yes, the current first-level surface model is output as the final representation of the current target region; otherwise, the current first-level surface model is sent into the scaling model module; the scaling model module is used to generate scaling models of corresponding levels and send the scaling models into the supplementary fitting point module; the supplementary fitting point module is used to generate supplementary fitting points of corresponding levels in the current target region and send the supplementary fitting points into the feature point module; each module is programmed or configured to perform the steps of the fitting method of the spatial form of the measured object.

[0036] The application further provides a computer-readable storage medium storing a computer program programmed or configured to perform the fitting method of the spatial form of the measured object.

[0037] The application has the following advantages:

[0038] (1) Unlike the spatial form fitted directly according to the feature points selected manually in the prior art, the fitting method of the spatial form of the measured object of the application is to select first-level feature points to obtain a first-level surface model, scale the first-level surface model to obtain a plurality of first-level scaling models, obtain the intersection points of the first-level scaling models and the current target region, use the intersection points as first-level supplementary fitting points, and use the first-level feature points and the first-level supplementary fitting points to form a second-level feature point set, and then obtain a second-level surface model based on the second-level feature point set. Therefore, the second-level feature points used to fit the second-level surface model are significantly more than the first-level feature points, which expands the coverage range and representativeness of the fitting point set, so that the second-level surface model is more consistent with the target region of the surface of the measured object than the first-level surface model, and the fitting result is more accurate.

[0039] (2) In order to ensure the accuracy of the final fitting of the spatial form of the measured object, the application continuously obtains several current first-level scaled models by scaling the current first-level surface model, and then uses the intersection points of the several current first-level scaled models and the current target region to expand the number of feature points in the next-level feature point set, so as to fit a more accurate next-level surface model. This iterative method can gradually approach the true geometric characteristics of the target region, significantly improve the fitting accuracy of the next-level surface model, and meet the needs of high-precision measurement scenarios.

[0040] (3) While ensuring the accuracy of the final fitting of the spatial form of the measured object, the application also aims to reduce the computational overhead and improve the fitting efficiency. When the parameter deviation between the current first-level surface model and the previous-level surface model is less than a set threshold, it is considered that the fitting result has stabilized, and the current first-level surface model can be used as the final representation of the corresponding target region. Because the determination criterion is uniform when determining the surface model of the final representation of the corresponding target region, the accuracy of the final fitting of the spatial form of the measured object is similar for any measured object, that is, the accuracy of the fitting result of the application is relatively stable, and the fitting method has high robustness, meeting the high standards of modern precision measurement.

[0041] (4) Because the final fitting result output by the application is at least a second-level surface model of each target region of the measured object, if the accuracy of the second-level surface model is not sufficient, the application will continue to add feature points to obtain a more accurate surface model. Therefore, the accuracy of the final fitting result output by the application is greatly improved compared to existing technologies, and is not affected by the number and quality of the first-level feature points (i.e., the relative position of the first-level feature points is not representative in space, and the position accuracy is insufficient).

[0042] (5) In the fitting process, the application automatically obtains supplementary fitting points through the intersection of the scaled model and the target region, without the need for technical personnel to intervene or rely on the number and quality of the current supplementary fitting points (because if the accuracy of the surface model obtained based on these supplementary fitting points is not sufficient, the application will automatically continue to obtain new supplementary fitting points until the fitted surface model stabilizes). Therefore, the fitting method of the application is simple and easy to use, and has high universality.

[0043] (6) Even if the CT scan data makes the feature points contain noise, because the fitting result finally output by the present application is based on enough feature points, and has been a high-accuracy fitting result that tends to be stable; moreover, the method for calculating the primary surface model of the corresponding target region of the present application is to calculate the weight of each primary feature point under the local noise scale, and finally solve the primary surface model; when solving the next level surface model, all corresponding level feature points affected by local noise are also considered; therefore, the noise contained in the feature points will not have any huge negative impact on the accuracy of the final output fitting result, and the case of "further exacerbating the deviation of the fitting result in the case of fewer feature points" in the prior art will not occur. BRIEF DESCRIPTION OF DRAWINGS

[0044] Figure 1 The whole flowchart of the fitting method of the spatial form of the measured object of the present application;

[0045] Figure 2 The flowchart of the S1 sub-step in the fitting method of the present application;

[0046] Figure 3 The flowchart of the S2 sub-step in the fitting method of the present application;

[0047] Figure 4 The flowchart for obtaining the primary surface model of the corresponding target region;

[0048] Figure 5 The flowchart of the S3 sub-step in the fitting method of the present application;

[0049] Figure 6 The whole structure schematic diagram of the fitting system of the spatial form of the measured object of the present application. DETAILED DESCRIPTION

[0050] In order to make the technical solutions of the present application clearer and more explicit, the present application will be described clearly and completely below in combination with the drawings. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. The technical features of the technical solutions of the present application obtained by equivalent replacement and routine inference by those skilled in the art without creative labor fall within the protection scope of the present application.

[0051] As shown in the flowchart of the fitting method of the spatial form of the measured object, comprising the following steps: Figure 1

[0052] S1, the surface of the measured object is divided into several target regions;

[0053] S2, after obtaining the primary feature point set in each target region, the primary surface model of each target region is obtained by the least square method;​

[0054] S3, after scaling the first-level surface model of the target area, we obtain several first-level scaled models of the current target area, and the intersection points of the first-level scaled models and the current target area are recorded as first-level supplementary fitting points;

[0055] S4, the first-level supplementary fitting points of the target region and the first-level feature points together constitute the second-level feature point set of the current target region; based on the current second-level feature point set, the second-level surface model of the current target region is obtained by the least squares method;

[0056] S5. If the parameter deviation between the secondary surface model and the primary surface model of the current target region is less than a set threshold, then the current secondary surface model is taken as the final representation of the current target region; otherwise, the next level feature point set is obtained, and the next level surface model of the current target region is obtained based on the next level feature point set, until the parameter deviation between the current primary surface model and the previous level surface model is less than the set threshold.

[0057] The steps of obtaining the next-level feature point set and then obtaining the next-level surface model of the current target region based on the next-level feature point set are similar to S3 to S4, and will not be repeated here.

[0058] S6, determine the final representation of all target areas on the surface of the object being measured. At this point, the spatial morphology fitting of the object being measured is complete.

[0059] like Figure 2 As shown, S1 includes the following:

[0060] S11. After acquiring the surface image data of the object under test, generate the surface mesh dataset of the object under test based on the surface reconstruction algorithm.

[0061] S12 divides the surface mesh dataset into several surface mesh subsets, with each surface mesh subset corresponding to a target region.

[0062] The image data of the surface of the object being measured can be medical imaging data, such as positron emission tomography (PET), magnetic resonance imaging (MRI), magnetic resonance tomography (MRT), single photon emission computed tomography (SPECT), computed tomography (CT), etc., or it can be natural image data or other three-dimensional imaging data.

[0063] Surface reconstruction algorithms, based on surface image data, can generate surface mesh data that characterizes the geometric features of the measured object. Surface reconstruction algorithms include, but are not limited to, Marching Cubes algorithms, isosurface generation algorithms, or other algorithms suitable for extracting surface topology from volume data.

[0064] By accurately extracting geometric features from the image data of the object under test, the generated mesh accurately reflects the surface morphology and topological properties of the object, thus ensuring the accuracy of the surface mesh data. The generated mesh is represented in the form of a triangular mesh or other polygonal mesh.

[0065] Optionally, the generated mesh can be smoothed to improve mesh quality, reduce noise interference with surface mesh data, and enhance the accuracy of the surface mesh data.

[0066] like Figure 3 As shown, S2 also includes the following sub-steps:

[0067] S21, select several grid data points from the surface grid subset as the first-level feature points of the corresponding target region; let the set of n first-level feature points in a certain target region be {p1, ..., p2}. i , ..., p n}, where p i Let i represent the i-th first-level feature point; i and n are positive integers, and 1≤i≤n.

[0068] Primary feature points can be selected by technical personnel or randomly.

[0069] S22, based on the first-level feature points of each target region, the first-level surface model g of the corresponding target region is calculated using the least squares method. 1 .

[0070] like Figure 4 As shown, the first-order surface model g of the corresponding target region is calculated using the least squares method. 1 This includes the following sub-steps:

[0071] Step 1: Use the least squares method to obtain the initial parameters θ of the first-order feature points. (0) ;

[0072] Step 2, based on the initial parameter θ (0) Calculate the weight of each first-level feature point under the local noise scale;

[0073] Step 3: Based on the weight of each first-level feature point, solve for the first-level surface model g using weighted least squares. 1 .

[0074] Step 2 also includes the following sub-steps:

[0075] Step 21: Construct a symmetric distance matrix D for the first-level feature points based on the Euclidean distance. Each element in the symmetric distance matrix D is the Euclidean distance between two first-level feature points.

[0076] Step 22, for all primary feature points, respectively, in the symmetric distance matrix D excluding the minimum K Euclidean distance of the feature points themselves, to form the corresponding local neighborhood of primary feature points; at the same time, based on the initial parameters θ (0) Calculate the residual of each primary feature point;

[0077] Step 23, calculate the local noise variance of each primary feature point:

[0078]

[0079] Wherein, The local noise variance of the primary feature point p i ; μ1 is the first noise parameter, in this embodiment μ = 1.4826; median(·) represents the median, The residual of the primary feature point p (0) calculated based on the initial parameters θ i ; The difference between the position estimate value and the actual value of the primary feature point p i obtained by the current parameters θ (0) at the same spatial position; The local neighborhood of the primary feature point p i ; The local neighborhood The median of the residual calculated based on the initial parameters θ (0) .

[0080] Step 24, calculate the weight of each primary feature point in the local noise scale:

[0081] Wherein, μ2 represents the second noise parameter, in this embodiment μ2 = 0.0001; The weight of the primary feature point p i in the local noise scale.

[0082] In step 3, the following contents are also included:

[0083] The primary surface model parameters θ (1) corresponding to the optimal solution of the weighted least squares optimization objective function L are solved by singular value decomposition: Wherein, the homogeneous linear constraint is The linearized vector of the primary feature point p i ; The transpose of ; the corresponding geometric model of the primary surface model parameters θ (1) is the primary surface model g 1 .

[0084] Any geometric model (such as a straight line, a circle, an ellipse) can be written in the form of homogeneous linear constraints, so the first-level surface model parameter θ (1) of the corresponding geometric model can be obtained based on the first-level surface model parameter θ (1) .

[0085] The first-level feature points are generally specific position points in the corresponding target region that are strongly related to the geometric element to be fitted, and are discrete points that can represent the representative morphology in the corresponding target region, laying a solid foundation for subsequent fitting accuracy. For example, in medical imaging applications, grid data on organs, tissues or lesions in the target region are often selected as first-level feature points. In industrial measurement scenarios, grid data on specific contact surfaces of parts or components in the target region are often selected as first-level feature points.

[0086] The first-level surface model g is composed of geometric elements, which can represent the spatial distribution geometric characteristics of the target region containing the feature points. For example, the first-level surface model g 1 is a mathematical model of geometric shapes such as a cone, a cylinder or a horizontal plane.

[0087] As shown in S3, the following sub-steps are further included: Figure 5

[0088] S31, the technician sets a plurality of scaling ratios, and generates a plurality of first-level scaling models after scaling the first-level surface model of the current target region.

[0089] For example, the technician sets b scaling ratios, and the current target region has b first-level scaling models, which are respectively denoted as wherein g represents the kth first-level scaling model of the current target region, 1≤k≤b, and k and b are positive integers.

[0090] In the present application, the scaling ratio is in the range of 0.9 to 1.1; specifically, it is 0.9, 0.95, 1.0, 1.05, and 1.1. In the present application, the scaling ratio can also be generated based on a dynamic step size. The value of the scaling ratio is not a limitation on the present application.

[0091] Specifically, b represents the maximum allowable error required in the fitting process, a represents the size of the first-level surface model of the current target region, and b / a serves as the scaling step size. The scaling step size directly reflects the relative relationship between the model size scale and the target accuracy.

[0092] After the i-th scaling of the first-level surface model of the current target region, the scaling coefficient s i :

[0093] s​i = 1 ± i x Δ, Δ = AD - b / a,

[0094] wherein, Δ represents the precision ratio, and AD represents the utilization size of the primary surface model of the current target region.

[0095] S32, calculate the intersection data between the primary scaling model of the current target region and the surface mesh data set, and take the point corresponding to the intersection data as the primary supplementary fitting point of the current target region. Let the primary scaling model of a certain target region be and the m primary supplementary fitting points of the current target region be wherein, represents the jth primary supplementary fitting point corresponding to the kth primary scaling model in the current target region; j and m are positive integers, and 1≤j≤m.

[0096] The intersection data between the primary scaling model and the surface mesh data set can be solved by a geometric algorithm, for example, a new set of intersection data, that is, a new set of discrete points, is calculated based on the intersection of the mesh triangle and the scaling geometric element. The new set of discrete points is the primary supplementary fitting point.

[0097] To ensure the calculation efficiency and accuracy in the subsequent calculation, the value of the scaling ratio and the number of scaling ratios can be set according to the specific application scenario. For example, in a high-precision measurement scenario, multiple scaling ratios can be used to generate multiple primary supplementary fitting points, thereby improving the coverage rate of the primary supplementary fitting points in the corresponding target region; in a scenario where the calculation resources are limited, the number of scaling ratios can be appropriately reduced to reduce the overall calculation complexity of solving the primary supplementary fitting points.

[0098] S5 specifically further includes the following contents:

[0099] Calculate the secondary surface model g 2 of the current target region. 1whether all geometric parameter deviations between the current secondary surface model and the surface mesh sub-data set are less than a set threshold value, if yes, the spatial form of the current target region is fitted to be stable, and the current secondary surface model is taken as the final representation of the current target region; otherwise, the secondary surface model of the current target region is scaled to obtain a plurality of secondary scaled models; then, intersection data between the secondary scaled model of the current target region and the surface mesh sub-data set is calculated, and points corresponding to the intersection data are taken as tertiary supplementary fitting points of the current target region; the tertiary supplementary fitting points of the current target region and the secondary feature points jointly form a tertiary feature point set of the current target region; based on the current tertiary feature point set, a tertiary surface model of the current target region is obtained through the least square method; whether all geometric parameter deviations between the tertiary surface model of the current target region and the secondary surface model are less than the set threshold value is determined again and repeatedly until whether all geometric parameter deviations between the current primary surface model and the last level surface model are less than the set threshold value.

[0100] The method for calculating the next level surface model is similar to steps 1-3, which will not be repeated here.

[0101] The method for calculating the primary surface model of the corresponding target region in the application is to calculate the weight of each primary feature point under the local noise scale, and finally solve the primary surface model; when solving the next level surface model, the influence of all corresponding level feature points on the local noise is also considered; so that the finally obtained fitted spatial form of the measured object is more accurate.

[0102] In the application, the geometric parameter deviation includes the parameter deviation of the position, direction and size. For example, the position parameter deviation is the difference between the position parameter of the current primary surface model and the position parameter of the last level surface model.

[0103] The set threshold value is set by the technician according to experience.

[0104] Unlike the existing technology which directly fits the spatial form according to the artificially selected feature points, the fitting method of the spatial form of the measured object in the application is to select primary feature points to obtain a primary surface model; then, a plurality of primary scaled models are obtained by scaling the primary surface model, and then the intersection points between the primary scaled models and the current target region are obtained, which are taken as primary supplementary fitting points to jointly form a secondary feature point set with the primary feature points, and then a secondary surface model is obtained based on the secondary feature point set. Therefore, the secondary feature points of the secondary surface model are much more than the primary feature points, and these secondary feature points are indeed points on the surface of the measured object, which makes the secondary surface model more consistent with the corresponding target region of the surface of the measured object, and the fitting result is more accurate.

[0105] Further, in order to ensure the accuracy of the final fitting of the spatial form of the measured object, the application continuously obtains a plurality of current first-level scaled models by scaling the current first-level surface model, and uses the intersection of the plurality of current first-level scaled models and the current target region to expand the number of feature points in the next-level feature point set, and fits a more accurate next-level surface model. This iterative method can gradually approach the true geometric characteristics of the target region, significantly improve the fitting accuracy of the next-level surface model, and meet the needs of high-precision measurement scenarios.

[0106] While ensuring the accuracy of the final fitting of the spatial form of the measured object, the application also aims to minimize computational overhead and improve fitting efficiency. When the parameter deviation between the current first-level surface model and the previous first-level surface model is less than a set threshold, the fitting result is considered to have stabilized, and the current first-level surface model can be used as the final representation of the corresponding target region. Because the determination criterion is uniform when determining the final representation of the surface model of the corresponding target region, the accuracy of the final fitting of the spatial form of the measured object is similar for any measured object, i.e., the accuracy of the fitting result is relatively stable, and the fitting method has high robustness, meeting the high standards of modern precision measurement.

[0107] The first-level feature points of the application can be manually selected points with representative features of the current surface geometric elements, or randomly selected points. Because the final fitting result output by the application is at least a second-level surface model of each target region of the measured object. If the accuracy of the second-level surface model is not sufficient, the application will continue to add feature points to obtain a more accurate surface model. Therefore, the accuracy of the final fitting result output by the application is significantly improved compared to existing technologies, and is not affected by the number and quality of the first-level feature points (i.e., the spatial representativeness of the relative positions of the first-level feature points is low, and the position accuracy is insufficient). In the fitting process, the application automatically obtains supplementary fitting points through the intersection of the scaled model and the target region, without the need for technical personnel to intervene or rely on the number and quality of the current supplementary fitting points (because if the accuracy of the surface model obtained based on these supplementary fitting points is not sufficient, the application will automatically continue to obtain new supplementary fitting points until the fitted surface model stabilizes). Therefore, the fitting method of the application is simple and easy to use, and has high universality.

[0108] Based on the above, even if the CT scan data contains noise in the feature points, because the final fitting result output by the application is based on a sufficient number of feature points and is a high-accuracy fitting result that has stabilized, the noise in the feature points will not have a significant negative impact on the accuracy of the final fitting result, and the situation in existing technologies where "in the case of a small number of feature points, the deviation of the fitting result is further aggravated" will not occur.

[0109] After the technician checks, the accuracy of the spatial form of the measured object fitted by the fitting method of the spatial form of the measured object of the application far exceeds the prior art, and the stability is as high as 98%; compared with the same fitting accuracy achieved by using the prior art as a control group, the fitting method of the application improves the efficiency by at least 3 times.

[0110] The application also provides a fitting system for the spatial form of a measured object, as shown in Figure 6 The fitting system comprises:

[0111] A segmentation module, a feature point module, a surface model module, a scaling model module, a supplementary fitting point module, and a discrimination module.

[0112] The segmentation module is used to divide the surface of the measured object into a plurality of target regions and then send the target regions into the feature point module.

[0113] The feature point module is used to generate feature points of corresponding levels for the target regions and then send the feature points into the surface model module.

[0114] The surface model module is used to generate surface models of corresponding levels; when the level of the surface model is less than 2, the surface model module sends the current first-level surface model into the scaling model module; otherwise, the surface model module sends the current first-level surface model into the discrimination module.

[0115] The discrimination module is used to determine whether the parameter deviation between the current first-level surface model and the previous first-level surface model is less than a set threshold value; if yes, the current first-level surface model is output as the final representation of the current target region; otherwise, the current first-level surface model is sent into the scaling model module.

[0116] The scaling model module is used to generate scaling models of corresponding levels and send the scaling models into the supplementary fitting point module.

[0117] The supplementary fitting point module is used to generate supplementary fitting points of corresponding levels for the current target region and then send the supplementary fitting points into the feature point module.

[0118] Each module is programmed or configured to perform the steps of the fitting method for the spatial form of the measured object as described above.

[0119] The application also provides a computer-readable storage medium storing a computer program programmed or configured to perform the fitting method for the spatial form of the measured object as described above.

[0120] The technology, shape, structure part not described in the present application are all known technology. It also needs to be pointed out that the above is only the preferred embodiment of the present application, and is not used to limit the present application, and the components or steps in the embodiment of the present application can be decomposed and / or recombined, and these decompositions and / or recombination should be regarded as the equivalent solutions of the present application, and should fall within the protection scope of the present application.

Claims

1. A method of fitting the spatial form of an object under test, characterized by, The method comprises the following steps: S1, dividing the surface of the measured object into a plurality of target regions; S2, after obtaining a first feature point set in each target region, a first surface model of each target region is obtained by using a least square method; S3, a plurality of first scaled models of the current target region are obtained after scaling the first surface model of the target region, and an intersection point of the first scaled model and the current target region is recorded as a first supplementary fitting point; S4, the first supplementary fitting point of the target region and the first feature point jointly form a second feature point set of the current target region; Based on the current second feature point set, a second surface model of the current target region is obtained by using a least square method; S5, if the parameter deviation between the second surface model of the current target region and the first surface model is less than a set threshold, the current second surface model is taken as the final representation of the current target region; Otherwise, a next level feature point set is obtained, and a next level surface model of the current target region is obtained based on the next level feature point set, until the parameter deviation between the current first surface model and the previous level surface model is less than the set threshold, and the current first surface model is taken as the final representation of the current target region; S6, the final representation of all target regions of the measured object surface is determined, and at this time, the spatial form fitting of the measured object is completed.

2. The method of claim 1, wherein, In S1, the following sub-steps are further included: S11, after obtaining the surface image data of the measured object, a surface mesh data set of the measured object is generated based on a surface reconstruction algorithm; S12, the surface mesh data set is divided into a plurality of surface mesh sub-data sets, and each surface mesh sub-data set corresponds to a target region.

3. The method of claim 2, wherein, In S2, the following sub-steps are further included: S21, selecting a plurality of mesh data in the surface mesh sub-data set as the first feature points of the corresponding target region; S22, based on the first feature points of each target region, a first surface model of the corresponding target region is calculated by using a least square method.

4. The method of claim 2, wherein, In S3, the following sub-steps are further included: S31, after scaling the first surface model of the current target region, a plurality of first scaled models are generated; S32, the intersection point data between the first scaled model of the current target region and the surface mesh sub-data set is calculated, and the point corresponding to the intersection point data is taken as the first supplementary fitting point of the current target region.

5. The method of claim 2, wherein, In S5, the following contents are further included: Whether all geometric parameter deviations between the second surface model of the current target region and the first surface model are less than the set threshold is calculated, if yes, the spatial form fitting of the current target region tends to be stable, and the current second surface model is taken as the final representation of the current target region; Otherwise, a plurality of second scaled models are obtained after scaling the second surface model of the current target region; Then the intersection data between the secondary scaling model of the current target region and the surface mesh data set is calculated, and the point corresponding to the intersection data is taken as the tertiary supplementary fitting point of the current target region; the tertiary supplementary fitting point of the current target region and the secondary feature point jointly constitute the tertiary feature point set of the current target region; based on the current tertiary feature point set, the tertiary surface model of the current target region is obtained through the least square method; whether all the geometric parameter deviations between the tertiary surface model and the secondary surface model of the current target region are less than the set threshold is determined again, and the process is repeatedly until whether all the geometric parameter deviations between the current primary surface model and the last primary surface model are less than the set threshold, and the current primary surface model is taken as the final representation of the current target region.

6. The method of claim 1, wherein, The least square method is used to calculate the primary surface model corresponding to the target region, including the following sub-steps: Step 1, obtain initial parameters θ of primary feature points using least square method (0) ; Step 2, compute the weight of each primary feature point under the local noise scale based on the initial parameter θ (0) , compute the weight of each primary feature point under the local noise scale based on the initial parameter θ Step 3, based on the weight of each primary feature point, a weighted least square is used to solve the primary surface model g 1 .

7. The method of claim 6, wherein, In step 2, the following sub-steps are also included: Step 21, a symmetric distance matrix D of the primary feature points is constructed according to the Euclidean distance, and each element in the symmetric distance matrix D is the Euclidean distance between two primary feature points; Step 22, for all primary feature points, respectively, in the symmetric distance matrix D to exclude the minimum K Euclidean distance of the feature points other than itself, to form the corresponding primary feature point local neighborhood; at the same time, based on the initial parameters θ (0) Calculate the residual of each primary feature point; Step 23, the local noise variance of each primary feature point is calculated: wherein, denotes a local noise variance of the primary feature point p i ; μ1 is a first noise parameter; median(·) denotes the median; denotes a residual of the primary feature point p (0) computed based on the initial parameters θ i ; denotes a local neighborhood of the primary feature point p i ; denotes a local neighborhood median of the residuals computed based on the initial parameters θ (0) ; Step 24, calculate the weight of each primary feature point under the local noise scale: wherein μ2 represents the second noise parameter; denotes the primary feature point p i the weight under the local noise scale.

8. The method of claim 1, wherein, In step 7, the following is also included: The first-order surface model parameter θ corresponding to the optimal solution of the optimization objective function L of the weighted least squares is solved by singular value decomposition (1) : The homogeneous linear constraint is The linearization vector of the first-order feature point p i ; The transpose of The corresponding geometric model of the first-order surface model parameter θ (1) is the first-order surface model g 1 .

9. A system for fitting the spatial form of an object under test, characterized by Segmentation module, feature point module, surface model module, scaling model module, supplementary fitting point module, discrimination module; The segmentation module is used to divide the surface of the measured object into several target regions and then send them into the feature point module; the feature point module is used to generate the feature points of each target region corresponding to the level and then send them into the surface model module; The surface model module is used to generate the surface model corresponding to the level; When the level of the surface model is less than 2, the surface model module sends the current primary surface model into the scaling model module; otherwise, the surface model module sends the current primary surface model into the discrimination module; The discrimination module is used to determine whether the parameter deviation between the current primary surface model and the last primary surface model is less than the set threshold, and if so, the current primary surface model is taken as the final representation of the current target region and output; otherwise, the current primary surface model is sent into the scaling model module; The scaling model module is used to generate the scaling model corresponding to the level and send it into the supplementary fitting point module; the supplementary fitting point module is used to generate the supplementary fitting point corresponding to the level in the current target region and then send it into the feature point module; Each module is programmed or configured to perform the steps of the fitting method of the spatial form of the measured object as claimed in any one of claims 1-8. The computer readable storage medium stores the computer program programmed or configured to perform the fitting method of the spatial form of the measured object as claimed in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that: ​