Three-dimensional space point set plane mapping and circle fitting method based on transformation matrix
Through the transformation matrix-based method, the three-dimensional point set plane mapping and circle fitting are solved, and the problems of numerical instability, insufficient robustness and high computational complexity in the existing technology are achieved, and a high precision and efficient three-dimensional point set is achieved. Fitting, suitable for real-time applications in multiple fields.
Patent Information
- Application Number
- CN202410920152.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-11-12
AI Technical Summary
The prior art has problems such as numerical instability, insufficient robustness and high computational complexity when dealing with large-scale three-dimensional point sets. Especially when facing noise and outliers, the accuracy of the fitting results is difficult to guarantee, and the result explanation is Poor performance and difficult to meet real-time application requirements.
The three-dimensional spatial point set plane mapping and circle fitting method based on transformation matrix is adopted, and the centralized point set is centralized through data preprocessing, and the plane-to-space transformation matrix is used to solve the plane-to-space transformation matrix, and the point set mapping is used to use the inverse transformation matrix. Combining the least squares method for circle fitting reduces the computational complexity and improves robustness.
Ensure the numerical stability and accuracy of the fitting process, enhance the robustness to noise and outliers, reduce the computational complexity, adapt to large-scale point set processing and real-time application requirements, and provide high-precision three-dimensional plane and spatial circle fitting results .
Smart Images

Figure CN118941707A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision and geometric processing, and in particular to a three-dimensional space point set plane mapping and circle fitting method based on a transformation matrix. Background Art
[0002] In the field of computer vision and geometric processing, mapping of 3D point sets to planes and geometric fitting are common problems. Common methods include plane fitting based on least squares method, point set transformation based on projection matrix, and geometric fitting (such as circle fitting). These technologies have been widely used in many fields, including but not limited to robot navigation, computer graphics, reverse engineering, medical image processing, etc. Although the existing technology has made significant progress, there are still some problems and the following shortcomings in practical applications:
[0003] Numerical stability: Many methods are prone to numerical instability when dealing with large-scale point sets or unevenly distributed point sets;
[0004] Insufficient robustness: Existing methods are less robust to noise and outliers. In practical applications, point set data is often interfered by noise and outliers, which may significantly reduce the accuracy of the fitting results.
[0005] High computational complexity: Some existing methods have bottlenecks in computational complexity, especially when processing high-dimensional data or real-time applications, the computational overhead is large, which makes it difficult to meet the needs of real-time applications;
[0006] Poor result interpretability: In some application scenarios, the results of existing methods are poorly interpretable, especially when physical interpretation or further analysis of the fitting results is required; for example, the geometric meaning of the fitting results is unclear and may be difficult to correspond to the physical model in actual applications; in summary, the existing technology has certain limitations in numerical stability, robustness, and result interpretability, and cannot meet the needs of long-term use. Summary of the invention
[0007] The purpose of the present invention is to solve the above problems and to design a three-dimensional space point set plane mapping and circle fitting method based on transformation matrix.
[0008] The technical solution of the present invention to achieve the above object is a three-dimensional space point set plane mapping and circle fitting method based on a transformation matrix, comprising the following steps:
[0009] Step 1: Data preprocessing;
[0010] Step 2: plane fitting;
[0011] Step 3: Construction of plane to space transformation matrix;
[0012] Step 4: Mapping of spatial points to plane points;
[0013] Step 5: spatial circle fitting;
[0014] Step 6: Result conversion and output.
[0015] As a further supplement to the technical solution, the data preprocessing includes the following steps:
[0016] (1) Calculate the mean of the input point set data on each coordinate axis;
[0017] (2) Subtract the mean from the coordinates of each input point and centralize the input point set.
[0018] As a further supplement to the technical solution, the plane fitting comprises the following steps:
[0019] (1) Normalize the centralized point set according to the standard deviation of the point set and construct homogeneous coordinates;
[0020] (2) Use SVD to solve the right singular vector corresponding to the minimum singular value and obtain the parameters of the standard plane equation.
[0021] As a further supplement to the technical solution, the point set data represents points in 3D space, which serves as initial input; and the plane equation parameters represent the fitted plane, which is used to construct a transformation matrix.
[0022] As a further supplement to the technical solution, the construction of the plane-to-space transformation matrix includes the following steps:
[0023] (1) Obtain the plane normal vector from the plane equation parameters and calculate its unit vector;
[0024] (2) Calculate the maximum absolute value component of the plane unit normal vector;
[0025] (3) Calculate the origin o of the plane coordinate system and another plane point m according to the maximum component of the plane unit normal vector in step 2;
[0026] (4) The normalized vector om is used as the x-axis of the plane coordinate system, the unit normal vector is the z-axis, and the result of the cross product of the two is used as the y-axis;
[0027] (5) According to the standard form of the transformation matrix, the transformation matrix can be constructed from the obtained coordinate system and origin coordinates.
[0028] As a further supplement to the technical solution, the transformation matrix is used to convert the coordinates of a point between a space and a plane coordinate system.
[0029] As a further supplement to the technical solution, the construction of the mapping from the spatial point to the plane point includes the following steps:
[0030] (1) Expand the coordinates of the spatial point set into homogeneous coordinates;
[0031] (2) Use the inverse matrix of the transformation matrix to map the spatial point set to the plane coordinate system while ignoring the z-axis coordinate.
[0032] As a further supplement to the technical solution, the construction of the space circle fitting includes the following steps:
[0033] (1) Construct a system of linear equations to express the general expression of a circle;
[0034] (2) Use the least squares method to solve the coordinates of the center and radius of the circle.
[0035] As a further supplement to the technical solution, the result conversion and output includes the following steps:
[0036] (1) Expand the coordinates of the center of the circle in the plane coordinate system into homogeneous coordinates;
[0037] (2) Use the transformation matrix to map the coordinates of the plane center to the spatial coordinate system;
[0038] (3) Output the coordinates of the circle center, radius, and the plane in which the circle lies (defined by the x-axis and y-axis in step 3).
[0039] As a further supplement to the technical solution, the center coordinates of the circle are one of the final results, representing the center of the circle fitted on the plane.
[0040] The invention has the beneficial effects of ensuring the numerical stability and accuracy of the fitting process by adopting the singular value decomposition method; enhancing the robustness of the method to noise and outliers by constructing a plane-to-space transformation matrix and realizing accurate mapping of the point set by using the inverse transformation matrix; innovatively using the maximum component of the plane normal vector to determine the origin and coordinate axis of the plane coordinate system in the process of constructing the transformation matrix; reducing the computational complexity and improving the computational efficiency by using efficient matrix operations and the least squares method, and adapting to the needs of large-scale point set processing and real-time applications; the method of the invention can fit three-dimensional planes and space circles according to a given point set with high accuracy, and is not only applicable to the fields of engineering and scientific research, but also can be applied in multiple fields such as computer vision, 3D reconstruction, geographic information systems, etc.; the method has strong robustness, such as the centering and normalization in the data preprocessing step, which effectively solves the problem of computational errors caused by the large scale of data in reality; and when constructing the plane-to-space transformation matrix, the stability and robustness of the algorithm are improved by selecting the maximum component of the coordinate system, and even in the face of outliers or non-standard data distribution, the method can still run stably and provide accurate results. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1It is a spatial circle comparison diagram fitted by the present invention according to the input point set;
[0042] Figure 2 is the space circle fitted by the input point set of the algorithm of the present invention;
[0043] Figure 3 This is a view of the present invention marking a circular sign in a scene. DETAILED DESCRIPTION
[0044] In order to make the technical solution more clear to those skilled in the art, Figure 1-3 The technical solution of the present invention is described in detail:
[0045] A three-dimensional space point set plane mapping and circle fitting method based on transformation matrix, comprising the following steps:
[0046] Step 1: Data preprocessing;
[0047] Step 2: plane fitting;
[0048] Step 3: Construction of plane to space transformation matrix;
[0049] Step 4: Mapping of spatial points to plane points;
[0050] Step 5: spatial circle fitting;
[0051] Step 6: Result conversion and output.
[0052] Among them, data preprocessing includes the following steps:
[0053] (1) Calculate the mean of the input point set data on each coordinate axis;
[0054] (2) Subtract the mean from the coordinates of each input point and centralize the input point set.
[0055] The plane fitting includes the following steps:
[0056] (1) Normalize the centralized point set according to the standard deviation of the point set and construct homogeneous coordinates;
[0057] (2) Use SVD to solve the right singular vector corresponding to the minimum singular value and obtain the parameters of the standard plane equation.
[0058] Among them, the point set data represents the points in the 3D space as the initial input; the plane equation parameters represent the fitted plane and are used to construct the transformation matrix.
[0059] The construction of the plane-to-space transformation matrix includes the following steps:
[0060] (1) Obtain the plane normal vector from the plane equation parameters and calculate its unit vector;
[0061] (2) Calculate the maximum absolute value component of the plane unit normal vector;
[0062] (3) Calculate the origin o of the plane coordinate system and another plane point m according to the maximum component of the plane unit normal vector in step 2;
[0063] (4) The normalized vector om is used as the x-axis of the plane coordinate system, the unit normal vector is the z-axis, and the result of the cross product of the two is used as the y-axis;
[0064] (5) According to the standard form of the transformation matrix, the transformation matrix can be constructed from the obtained coordinate system and origin coordinates.
[0065] The transformation matrix is used to convert the coordinates of a point between the space and the plane coordinate system.
[0066] The construction of the mapping from space points to plane points includes the following steps:
[0067] (1) Expand the coordinates of the spatial point set into homogeneous coordinates;
[0068] (2) Use the inverse matrix of the transformation matrix to map the spatial point set to the plane coordinate system while ignoring the z-axis coordinate.
[0069] The construction of circle fitting includes the following steps:
[0070] (1) Construct a system of linear equations to express the general expression of a circle;
[0071] (2) Use the least squares method to solve the coordinates of the center and radius of the circle.
[0072] The result conversion and output includes the following steps:
[0073] (1) Expand the coordinates of the center of the circle in the plane coordinate system into homogeneous coordinates;
[0074] (2) Use the transformation matrix to map the coordinates of the plane center to the spatial coordinate system;
[0075] (3) Output the coordinates of the circle center, radius, and the plane in which the circle lies (defined by the x-axis and y-axis in step 3).
[0076] Among them, the center coordinates are one of the final results, indicating the center of the circle fitted on the plane.
[0077] Hardware considerations involved in the steps
[0078] 1. Processor: A processor with floating-point computing capabilities is required for matrix calculations and least squares solutions.
[0079] 2. Memory: Sufficient memory is required to store point set data and intermediate results, especially for large point set data.
[0080] 3. Storage device: used to store input point set data and output results.
[0081] In detail, 1. Data preprocessing
[0082] First, calculate the mean of all points in the input 3D point set, that is, the average value of each coordinate axis. The purpose of this step is to centralize the point set in the future, eliminate the calculation error caused by the large scale of the original data, and make the plane fitting more accurate.
[0083] Subtract the calculated mean from each point so that the center of the point set is located at the origin of the coordinate system. The centralized point set helps improve the robustness of numerical calculations. The processed point set is denoted as P. There are:
[0084]
[0085] 2. Plane fitting
[0086] The centered three-dimensional point set is represented as a homogeneous coordinate matrix. This step expands each three-dimensional point into four dimensions, which is convenient for subsequent calculations. Through singular value decomposition (SVD), the right singular vector corresponding to the minimum singular value of the homogeneous coordinate matrix is solved to satisfy the plane equation ax+by+cz+d=0. That is:
[0087] P=UΣV T
[0088] The parameters of the plane equation are extracted from the right singular vector corresponding to the minimum singular value obtained by SVD, including the three components a, b, c of the normal vector and the distance constant term d of the plane.
[0089] 3. Construction of plane to space transformation matrix
[0090] First, the plane normal vector [a, b, c] obtained in step 2 is T Normalize to facilitate the subsequent calculation of the basis vectors of the plane coordinate system. Then, calculate the component with the largest absolute value of the normalized plane normal vector, and use it to determine the origin o of the plane coordinate system and an arbitrary point m on the plane.
[0091] For example, if the absolute value of the a component is the largest, then the origin o of the plane coordinate system can be selected as (-d / a, 0, 0), and a point m (-(b+c+d) / a, 1, 1) can be selected on the plane. The advantage of selecting the maximum component is that when a component of the plane normal vector is close to zero, if this component is used to calculate o and m, the calculation results may have large errors. Selecting the maximum component can avoid this situation, thereby improving the stability of the calculation. In addition, selecting the maximum component can ensure that o and m are sufficiently far apart in the direction corresponding to the maximum component of the plane normal vector, which helps to calculate p x Better reflect the orientation of the plane.
[0092] Construct the vector om and normalize it as the x-axis basis vector p of the plane coordinate system x , the normalized plane normal vector is used as the basis vector p of the z-axis z , p x and p z Cross product to get the y-axis basis vector p y Using the determined plane coordinate system basis vectors and the plane origin, construct the transformation matrix from the plane coordinate system to the space coordinate system The transformation matrix is a fourth-order matrix that contains translation and rotation information, so that the points on the plane can be mapped back to space. That is:
[0093]
[0094] Depend on Taking the inverse can get the inverse transformation matrix from spatial coordinates to plane coordinates
[0095] 4. Mapping of spatial points to plane points
[0096] First, homogenize each spatial point and expand the three-dimensional coordinates into four-dimensional homogeneous coordinates to facilitate linear transformation using the transformation matrix. Using the inverse transformation matrix calculated in step 3 Map the spatial coordinates to the fitted plane coordinate system. That is:
[0097]
[0098] At the same time, the z coordinate of the point in the mapped plane coordinate system is ignored, and only the x and y coordinates are retained.
[0099] 5. Space circle fitting
[0100] The general expression of a circle in a two-dimensional plane is: (xa) 2 +(yb) 2 =r 2 , its general expression can be converted into matrix form, that is, -2xa-2yb+(a 2+b 2 -r 2 )=-(x 2 +y 2 ), written in matrix form as:
[0101]
[0102] Here, the least squares method can be used to solve a, b and r, that is, the radius r of the fitted circle and the coordinates of the center of the circle in the plane coordinate system (a, b).
[0103] 6. Result conversion and output
[0104] Using the forward transformation matrix constructed previously Map the fitted circle center coordinates from the plane coordinate system back to the space coordinate system. This step ensures that the final output circle center coordinates are consistent with the reference system of the original space point set. The calculated circle center coordinates and radius are used as the final output results for further analysis and application.
[0105] This implementation demonstrates the whole process of mapping a 3D point set to a plane, fitting a circle on the plane, and mapping it back to 3D space through detailed mathematical principles and algorithm steps. The action objects and results of each step are clearly defined, which is suitable for implementation and deployment in engineering applications.
[0106] Performance evaluation and comparison
[0107] For a given circle in space, 50, 20 and 5 points are randomly sampled, and these points are input into the previous method and this method to fit the circle. As can be seen from the table, although the number of input points decreases and the available information decreases, the errors of the center coordinates o (x, y, z) and radius r of the circle fitted by this method are still small.
[0108] Figure 1 The results of inputting five random points are visualized. The blue star mark (input points) is the input point set, the red circle (our_func) is the circle fitted by this method, and the green circle (other_func) is the circle fitted by the previous method. It can be seen that the circle fitted by this method has a better effect, while the circle fitted by the previous method has a certain deviation.
[0109] Table 1
[0110]
[0111] Figure 2 The blue star mark (input points) in the middle is the input point set, and the red solid line (fitted circle) is the spatial circle fitted by this algorithm based on the input point set. It can be seen that the fitting effect is very good.
[0112] Figure 3 As shown, the circular sign in the scene is annotated; when annotating the elements of the Lidar point cloud, several points in the space can be selected for automatic matching and annotation.
[0113] The above technical solutions only reflect the preferred technical solutions of the technical solutions of the present invention. Some changes that may be made to certain parts thereof by technicians in this technical field all reflect the principles of the present invention and fall within the protection scope of the present invention.
Claims
1. A three-dimensional space point set plane mapping and circle fitting method based on transformation matrix, characterized in that: The following steps are involved: Step 1: Data preprocessing; Step 2: plane fitting; Step 3: Construction of plane to space transformation matrix; Step 4: Mapping of spatial points to plane points; Step 5: spatial circle fitting; Step 6: Result conversion and output.
2. A three-dimensional space point set plane mapping and circle fitting method based on transformation matrix according to claim 1, characterized in that: The data preprocessing comprises the following steps: (1) Calculate the mean of the input point set data on each coordinate axis; (2) Subtract the mean from the coordinates of each input point and centralize the input point set.
3. The three-dimensional space point set plane mapping and circle fitting method based on transformation matrix according to claim 2, characterized in that: The plane fitting comprises the following steps: (1) Normalize the centralized point set according to the standard deviation of the point set and construct homogeneous coordinates; (2) Use SVD to solve the right singular vector corresponding to the minimum singular value and obtain the parameters of the standard plane equation.
4. The method for plane mapping and circle fitting of three-dimensional space point sets based on transformation matrix according to claim 3, characterized in that: The point set data represents points in 3D space and is used as initial input; the plane equation parameters represent the fitted plane and are used to construct a transformation matrix.
5. The three-dimensional space point set plane mapping and circle fitting method based on transformation matrix according to claim 1, characterized in that: The construction of the plane-to-space transformation matrix includes the following steps: (1) Obtain the plane normal vector from the plane equation parameters and calculate its unit vector; (2) Calculate the maximum absolute value component of the plane unit normal vector; (3) Calculate the origin o of the plane coordinate system and another plane point m according to the maximum component of the plane unit normal vector in step 2; (4) The normalized vector om is used as the x-axis of the plane coordinate system, the unit normal vector is the z-axis, and the result of the cross product of the two is used as the y-axis; (5) According to the standard form of the transformation matrix, the transformation matrix can be constructed from the obtained coordinate system and the origin coordinates.
6. A three-dimensional space point set plane mapping and circle fitting method based on transformation matrix according to claim 5, characterized in that: The transformation matrix is used to convert the coordinates of a point between a spatial and a planar coordinate system.
7. The method for plane mapping and circle fitting of a three-dimensional space point set based on a transformation matrix according to claim 1, characterized in that: The construction of the mapping from the spatial point to the plane point comprises the following steps: (1) Expand the coordinates of the spatial point set into homogeneous coordinates; (2) Use the inverse matrix of the transformation matrix to map the spatial point set to the plane coordinate system while ignoring the z-axis coordinate.
8. A three-dimensional space point set plane mapping and circle fitting method based on transformation matrix according to claim 7, characterized in that: The construction of the space circle fitting comprises the following steps: (1) Construct a system of linear equations to express the general expression of a circle; (2) Use the least squares method to solve the coordinates of the center and radius of the circle.
9. The method for plane mapping and circle fitting of three-dimensional space point sets based on transformation matrix according to claim 1, characterized in that: The result conversion and output comprises the following steps: (1) Expand the coordinates of the center of the circle in the plane coordinate system into homogeneous coordinates; (2) Use the transformation matrix to map the coordinates of the plane center to the spatial coordinate system; (3) Output the coordinates of the circle center, radius, and the plane in which the circle lies (defined by the x-axis and y-axis in step 3).
10. A three-dimensional space point set plane mapping and circle fitting method based on transformation matrix according to claim 9, characterized in that: The circle center coordinates are one of the final results, and represent the center of the circle fitted on the plane.
