A method, system, medium, and device for fitting an incomplete cylindrical surface point cloud
By calculating the normal direction of the cylindrical point cloud step by step, generating the cutting plane, and fitting the spatial straight line, the problems of low accuracy, low efficiency, and poor stability of incomplete cylindrical point cloud fitting in the prior art are solved, and high-precision and high-efficiency cylindrical point cloud fitting is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XI AN JIAOTONG UNIV
- Filing Date
- 2024-05-20
- Publication Date
- 2026-07-14
AI Technical Summary
Existing cylindrical fitting methods suffer from low accuracy, low efficiency, and poor stability when processing point clouds of incomplete cylindrical surfaces. In particular, the eigenvalue method has high requirements for data quality, the least squares method is sensitive to initial values and is prone to getting trapped in local convergence, and the projection roundness discrimination method is inefficient.
By calculating the radius and axis equations of the incomplete cylindrical point cloud step by step, the normal direction of the segmentation plane is first calculated, then the cutting plane is generated, the center coordinates and radius are obtained based on spatial arc fitting, and finally spatial straight line fitting is performed, thus avoiding the risk of local convergence or divergence when the parameters are optimized together.
It achieves high-precision, stable, and efficient cylindrical point cloud fitting, improving the robustness and efficiency of the algorithm, and is applicable to fitting incomplete and complete cylindrical point clouds.
Smart Images

Figure CN118587268B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of quality inspection technology, and relates to a method, system, medium and device for fitting incomplete cylindrical point clouds. Background Technology
[0002] Cylindrical objects are extremely common in industrial production and daily life. The dimensional accuracy of their manufacturing has a significant impact on the performance and lifespan of products. How to achieve efficient, high-precision, and stable measurement of cylindrical objects in manufacturing has become the core technology in the production of such objects.
[0003] Three-dimensional optical measurement technology has been widely used in industrial measurement in recent years due to its advantages such as non-contact operation and high efficiency. This technology can quickly obtain surface information of cylindrical objects and reconstruct the object's three-dimensional topographic point cloud. Based on the object's point cloud data, its dimensions can be measured.
[0004] In practical measurements, due to the complex spatial shape of objects and in order to improve measurement efficiency, only a portion of the cylindrical surface point cloud is typically acquired for measurement of rotating objects such as cylinders. Therefore, achieving robust, fast, and high-precision measurement of incomplete cylindrical surface point clouds is a key research focus.
[0005] Existing cylinder fitting methods mainly include the eigenvalue method, the least squares method, and the projected roundness discrimination method. Among these, the eigenvalue method requires high-quality data; its fitting accuracy is low when the data contains significant gross errors, and its implementation is relatively complex. The least squares method is the most widely used in cylinder fitting, but it has high requirements for the initial values of the solution parameters and is extremely sensitive to data noise, easily causing the iterative process to diverge or get stuck in local convergence, resulting in a low fitting success rate. The projected roundness discrimination method has good theoretical stability, but its extremely low search efficiency limits its practical applications.
[0006] The methods described above perform well for complete cylindrical point clouds, but for incomplete cylindrical point clouds, the eigenvalue method has poor accuracy and stability. The least squares method can obtain relatively accurate results when the initial parameter values are accurate and the point cloud data quality is good, but it can sometimes get stuck in local convergence, resulting in incorrect fitting results. The projected roundness discrimination method can obtain accurate results, but it may take several seconds or even tens of seconds, making it inefficient. Summary of the Invention
[0007] To overcome the shortcomings of the prior art, the present invention aims to provide a fitting method, system, medium, and device for incomplete cylindrical point clouds. The present invention avoids the risk of local convergence or divergence when optimizing all parameters together by calculating the radius and axis equations of the incomplete cylindrical point cloud step by step, thus ensuring both accuracy and the efficiency and stability of the algorithm.
[0008] To achieve the above objectives, the present invention employs the following technical solution:
[0009] In a first aspect, the present invention discloses a method for fitting incomplete cylindrical point clouds, comprising the following steps:
[0010] Calculate the normal direction of the segmentation plane based on the cylindrical point cloud data;
[0011] Calculate the initial length and initial values of the two endpoints of the cylindrical point cloud data based on the normal direction of the segmentation plane;
[0012] A number of cutting planes are generated based on the initial values of the two endpoints, the initial value of the length, and the normal direction of the dividing plane;
[0013] Project the points in the neighborhood of each cutting plane onto the corresponding cutting plane, and obtain the center coordinates and radius of the arcs corresponding to all cutting planes based on the spatial arc fitting method;
[0014] Spatial straight line fitting is performed on the center coordinates of the corresponding arcs of all the obtained cutting planes to obtain the axis position coordinates of the cylindrical point cloud;
[0015] The length of the cylindrical point cloud is calculated based on the cylindrical point cloud data and the coordinates of its axial position. The radius of the cylinder is obtained based on the radii of the arcs corresponding to all cutting planes.
[0016] Secondly, this invention discloses a fitting system for an incomplete cylindrical point cloud, comprising a normal direction acquisition module, an initial value acquisition module, a cutting plane generation module, a center radius acquisition module, an axis coordinate acquisition module, and a length radius acquisition module connected in sequence, wherein:
[0017] Normal direction acquisition module: used to calculate the normal direction of the segmentation plane based on the cylindrical point cloud data;
[0018] Initial value acquisition module: used to calculate the initial length and initial values of the two endpoints of the cylindrical point cloud data based on the normal direction of the segmentation plane;
[0019] Cutting plane generation module: used to generate a number of cutting planes based on the initial values of the two endpoints, the initial value of the length, and the normal direction of the dividing plane;
[0020] Center radius acquisition module: It is used to project the points in the neighborhood of each cutting plane onto the corresponding cutting plane, and obtain the center coordinates and radius of the corresponding arc of all cutting planes based on the spatial arc fitting method;
[0021] Axis coordinate acquisition module: used to perform spatial straight line fitting on the center coordinates of the corresponding arcs of all the obtained cutting planes to obtain the axis position coordinates of the cylindrical point cloud;
[0022] Length and radius acquisition module: used to calculate the length of the cylindrical point cloud based on the cylindrical point cloud data and the coordinates of the axis position of the cylindrical point cloud, and to obtain the radius of the cylinder based on the radius of the arc corresponding to all cutting planes.
[0023] Thirdly, the present invention provides an electronic device, comprising: a processor; a memory for storing computer program instructions; and steps for implementing a fitting method for an incomplete cylindrical point cloud when executing the computer program.
[0024] Fourthly, the present invention provides a storage medium storing computer program instructions, which are loaded and executed by a processor, wherein the processor performs a fitting method for an incomplete cylindrical point cloud.
[0025] Compared with the prior art, the present invention has the following beneficial effects:
[0026] 1. The method of this invention calculates the normal direction of the segmentation plane based on cylindrical point cloud data; calculates the initial length and initial values of the two endpoints of the cylindrical point cloud data based on the normal direction of the segmentation plane; generates a number of cutting planes based on the initial values of the two endpoints, the initial length, and the normal direction of the segmentation plane; projects the points in the neighborhood of each cutting plane onto the corresponding cutting plane, and obtains the center coordinates and radius of the corresponding arcs of all cutting planes based on a spatial arc fitting method. This invention improves the efficiency of the algorithm by segmenting the cylindrical point cloud and transferring the optimization iteration process of spatial arc fitting to a two-dimensional plane; performs spatial line fitting on the center coordinates of the corresponding arcs of all cutting planes to obtain the axis position coordinates of the cylindrical point cloud; calculates the length of the cylindrical point cloud based on the cylindrical point cloud data and the axis position coordinates of the cylindrical point cloud, and obtains the radius of the cylinder based on the radius of the corresponding arcs of all cutting planes. By calculating the radius and axis equations of the incomplete cylindrical point cloud step by step, the risk of getting stuck in local convergence or divergence when optimizing all parameters together is avoided. This ensures both accuracy and the efficiency and stability of the algorithm, making it robust and highly accurate.
[0027] 2. The system of this invention includes a normal direction acquisition module, an initial value acquisition module, a cutting plane generation module, a circle center radius acquisition module, an axis coordinate acquisition module, and a length radius acquisition module connected in sequence. These modules work together to acquire the radius and axis equations of an incomplete cylindrical point cloud, avoiding the risk of local convergence or divergence when optimizing all parameters together. This ensures both accuracy and the efficiency and stability of the algorithm.
[0028] 3. The medium and device of this invention can also obtain the radius and axis equations of incomplete cylindrical point clouds, avoiding the risk of getting stuck in local convergence or divergence when optimizing all parameters together, thus ensuring both accuracy and the efficiency and stability of the algorithm. Attached Figure Description
[0029] Figure 1 This is a schematic diagram of the overall process of the present invention.
[0030] Figure 2 This is a schematic diagram of a Gaussian mapping of a cylindrical point cloud with normal vector information.
[0031] Figure 3 This is a schematic diagram of the directed distance from a point in space to a plane.
[0032] Figure 4 This is a schematic diagram of the projection of a cylindrical point cloud onto a plane with its three principal component directions as normals.
[0033] Figure 5 A schematic diagram illustrating the calculation process of the criterion for selecting the optimal principal component direction.
[0034] Figure 6 is a schematic diagram of the spatial step-by-step approximation search for the optimal cutting plane.
[0035] Figure 7 A schematic diagram for calculating the length of a cylindrical point cloud and determining its endpoints.
[0036] Figure 8 This is a schematic diagram of the process of generating the cutting plane.
[0037] Figure 9 This is a schematic diagram of the projection of a neighboring point of the cutting plane onto the cutting plane.
[0038] Figure 10 This is a flowchart of the method of the present invention.
[0039] Figure 11 This is a connection diagram of the system modules of the present invention. Detailed Implementation
[0040] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0041] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0042] The present invention will now be described in further detail with reference to the accompanying drawings:
[0043] See Figure 10 This invention discloses a method for fitting incomplete cylindrical point clouds, comprising the following steps:
[0044] S1. Calculate the normal direction of the segmentation plane based on the cylindrical point cloud data, as follows:
[0045] If the cylindrical point cloud data contains the normal vector information of the cylindrical surface, then Gaussian mapping is directly performed on the cylindrical point cloud data, and then principal component analysis is performed on the mapping result to obtain the normal direction of the cutting plane.
[0046] If the cylindrical point cloud data does not contain the normal information of the cylindrical surface, a step-by-step approximation method is used to search for the optimal projection plane that minimizes the roundness of the cylindrical point cloud projection. The normal direction of the optimal projection plane is the normal direction of the cutting plane.
[0047] S2. Calculate the initial length and initial values of the two endpoints of the cylindrical point cloud data based on the normal direction of the segmentation plane, as follows:
[0048] The cylindrical point cloud data is de-centrified by subtracting the average coordinate of all points from the coordinate of each point in the cylindrical point cloud data. The de-centrified cylindrical point cloud is then projected onto a straight line passing through the centroid of the cylindrical point cloud and in the direction of the normal direction of the segmentation plane using a projection matrix.
[0049] By aligning the aforementioned straight line with the positive x-axis of the coordinate system through the Rodrigues rotation process, the largest and smallest x-coordinate values among the transformed points are the coordinates of the points on the two end planes of the cylindrical point cloud after decentering. The average value of the point cloud coordinates is added to the coordinates of the points on the two end planes to obtain the initial values of the two endpoints of the cylindrical point cloud. The difference between the largest and smallest x-coordinate values is the initial value of the length of the cylindrical point cloud.
[0050] S3. Generate a number of cutting planes based on the initial values of the two endpoints, the initial value of the length, and the normal direction of the dividing plane, as follows:
[0051] The step size of the cutting plane is obtained based on the initial length and the initial values of the two endpoints of the cylindrical point cloud data. Then, starting from any end of the cylindrical point cloud, a number of cutting planes are generated along the normal direction of the segmentation plane with the step size of the cutting plane calculated above.
[0052] S4. Project the points in the neighborhood of each cutting plane onto the corresponding cutting plane, and obtain the center coordinates and radius of the corresponding arcs of all cutting planes based on the spatial arc fitting method, as follows:
[0053] For each cutting plane, its neighborhood τ is defined as follows: for any point in space, if its distance to the cutting plane is less than τ, then the point belongs to the neighborhood of the cutting plane τ.
[0054] Project the points within the τ neighborhood of each cutting plane onto this cutting plane, and transform the projected points to a position that coincides with the xoy plane of the coordinate system by using coordinate transformation, thus transforming the spatial arc into a planar arc. Then, obtain the center coordinates and radius of the planar arc by using planar arc fitting.
[0055] By inverting the coordinate transformation process, the center coordinates of the fitted planar arc are transformed back to their original positions to obtain the center coordinates of the spatial arc.
[0056] S5. Perform spatial straight-line fitting on the center coordinates of the corresponding arcs of all the obtained cutting planes to obtain the axis position coordinates of the cylindrical point cloud, as follows:
[0057] For the coordinates of the center of the arc corresponding to all cutting planes, a weighted least squares method is used to fit a spatial straight line, and the axis position coordinates of the cylindrical point cloud are obtained by fitting. The specific process is as follows:
[0058] The initial value of the spatial line to be fitted is obtained by combining the coordinates of the center of the arcs corresponding to all cutting planes using the least squares method.
[0059] Calculate the distance from each center point to the initial value of the spatial line to be fitted, and the standard deviation of the distances from all center points to the initial value of the spatial line to be fitted. Then, using the Turkey weight method, calculate the weight of the center point using the above standard deviation and the distance from each center point to the initial value of the spatial line to be fitted. Perform least squares fitting of the spatial line based on the weighted center points.
[0060] S6. Calculate the length of the cylindrical point cloud based on the cylindrical point cloud data and the coordinates of its axial position. Obtain the radius of the cylinder based on the radii of the arcs corresponding to all cutting planes, as detailed below:
[0061] Subtract the axis position coordinates of the cylindrical point cloud from the coordinates of each point in the cylindrical point cloud data;
[0062] All points in the cylindrical point cloud data are de-centrated, and the de-centrated cylindrical point cloud data is projected onto the axis position coordinates of the cylindrical point cloud through a projection matrix to obtain the cylindrical point cloud projection axis.
[0063] The cylindrical point cloud projection axis is aligned with the positive x-axis of the coordinate system through the Rodriguez rotation process. The difference between the largest and smallest x-coordinate values of the transformed points is the length of the cylindrical point cloud.
[0064] The radius of the cylinder is obtained by averaging the radii of the arcs corresponding to all the cutting planes.
[0065] See Figure 10 In another feasible embodiment of the present invention, the following modifications are made as needed. The normal direction of the segmentation plane is calculated based on the cylindrical point cloud data; the initial length and initial values of the two endpoints of the cylindrical point cloud data are calculated based on the normal direction of the segmentation plane; a number of cutting planes are generated based on the initial values of the two endpoints, the initial length, and the normal direction of the segmentation plane; points in the neighborhood of each cutting plane are projected onto the corresponding cutting plane, and the center coordinates and radii of the corresponding arcs of all cutting planes are obtained based on a spatial arc fitting method; spatial straight line fitting is performed on the center coordinates of the corresponding arcs of all cutting planes to obtain the axial position coordinates of the cylindrical point cloud; the length of the cylindrical point cloud is calculated based on the cylindrical point cloud data and the axial position coordinates of the cylindrical point cloud, and the radius of the cylinder is obtained based on the radii of the corresponding arcs of all cutting planes. This invention avoids the risk of local convergence or divergence when optimizing all parameters together by calculating the radius and axial equation of the incomplete cylindrical point cloud step by step, thus ensuring both accuracy and the efficiency and stability of the algorithm.
[0066] Example 1:
[0067] See Figure 1 and Figure 10 This invention discloses a method for fitting incomplete cylindrical point clouds, specifically including the following steps:
[0068] S1. Calculate the normal direction of the segmentation plane based on the information of the cylindrical point cloud. The specific method is as follows:
[0069] Depending on whether the input point cloud data contains normal vector information, different methods are used to calculate the normal direction of the segmentation plane. If the input point cloud data contains normal vector information of a cylindrical surface, a Gaussian mapping is directly performed on the cylindrical point cloud data, and then principal component analysis (PCA) is performed on the mapping result to obtain the normal direction of the cutting plane.
[0070] If the input point cloud data does not contain the normal information of the cylindrical surface, a step-by-step approximation method is used to search for the optimal projection plane that minimizes the roundness of the cylindrical point cloud projection. The normal direction of the optimal projection plane is the normal direction of the cutting plane.
[0071] S2. Calculate the initial length and initial values of the two endpoints of the cylindrical point cloud. The specific process is as follows:
[0072] First, all points in the cylindrical point cloud data are de-centrated, meaning the coordinates of each point in the cylindrical point cloud data are subtracted from the average of all point cloud coordinates. Then, the de-centrated cylindrical point cloud is projected onto a straight line passing through the centroid of the cylindrical point cloud and oriented in the normal direction obtained in step S1, using a projection matrix. Next, the straight line is aligned with the positive x-axis of the coordinate system through a Rodrigues rotation process. At this point, the projection points corresponding to the points with the largest and smallest x-coordinate values among the transformed points are the coordinates of the points on the two end planes of the de-centrated cylindrical point cloud. The difference between the largest and smallest x-coordinate values among the transformed points is the initial value of the length of the cylindrical point cloud. Finally, the average of the point cloud coordinates is added to the coordinates of the two endpoints to obtain the initial values of the two endpoints of the cylindrical point cloud.
[0073] S3. Generate a specified number of cutting planes. The specific process is as follows:
[0074] Based on the initial value of the cylindrical point cloud length obtained in step S2 and the number of cutting planes, the step size for generating the cutting planes can be obtained. Then, starting from any end of the cylindrical point cloud, a specified number of cutting planes are generated along the normal direction of the segmentation plane calculated in step S1 with the step size of the cutting planes calculated above.
[0075] S4. Project the points in the neighborhood of each cutting plane onto the cutting plane, and then obtain the center coordinates and radius of the corresponding arc of the cutting plane based on the spatial arc fitting method. See [link to documentation]. Figure 9 The specific process is as follows:
[0076] For each cutting plane, its neighborhood τ is defined as follows: for any point in space, if its distance to the cutting plane is less than τ, then the point belongs to the neighborhood of the cutting plane τ. Therefore, for each cutting plane generated in step S3, the points within its neighborhood τ are projected onto this cutting plane. Then, the cutting plane is transformed to a position coinciding with the xoy plane of the coordinate system, transforming the spatial arc into a planar arc. The center coordinates and radius of this planar arc are then obtained through planar arc fitting. Finally, the center coordinates of the fitted planar arc are transformed back to their original position through the reverse process of coordinate transformation to obtain the center coordinates of the spatial arc.
[0077] In the above-mentioned planar circular arc fitting process, the Repeated Least Truncation Weighted Squares (RLTWS) technique is used for planar circular arc fitting, and the specific process is as follows:
[0078] For the points of the obtained planar arc, the ordinary least squares method is first used to fit the planar arc to obtain the initial values of the center coordinates and radius of the arc, and the fitted circle is obtained. Then, the distance and error from each point of the planar arc to the fitted circle are calculated. Then, the points of the planar arc are sorted in ascending order according to the error of each point. After sorting, the top 70% of the points are selected, and the weighted least squares method is used to fit the planar arc. This process of selecting points and fitting is repeated until the condition for exiting the iteration is met.
[0079] S5. Perform spatial straight line fitting on the coordinates of the centers of all the obtained cutting plane arcs to obtain the axis positions of the cylindrical point cloud. The specific process is as follows:
[0080] For the center coordinates of the arc corresponding to the cutting plane obtained in step S4, a weighted least squares method is used to fit a spatial line. The specific process is as follows: First, the initial value of the spatial line to be fitted is obtained using the least squares method. Then, the distance from each point to the line and the standard deviation of the distances from all points to the line are calculated. Then, based on the Turkey weight method, the weight of the point is calculated using the above standard deviation and the distance from each point to the line. The spatial line is then fitted again based on the weighted points using least squares. This weighted fitting process is repeated until the iteration termination condition is met.
[0081] S6. Calculate the length of the cylindrical point cloud and the radius of the cylinder. The specific process is as follows:
[0082] First, subtract the coordinates of the corresponding center point on the axis obtained in step S5 from the coordinates of each point in the cylindrical point cloud data. Then, project the de-centered cylindrical point cloud onto the axis of the cylinder using a projection matrix. Next, align the straight line with the positive direction of the x-axis of the coordinate system using a Rodriguez rotation process. The difference between the largest and smallest x-coordinate values among the transformed points is the length of the cylindrical point cloud.
[0083] For the radius of the cylindrical point cloud, the average value of the radii of all the arcs obtained in step S4 is taken.
[0084] It should be noted that the cylindrical point cloud data in the above process can be either raw point cloud data directly acquired by the scanner or pre-processed point cloud data. Furthermore, the point cloud data may or may not contain the normal information of the cylindrical surface.
[0085] It should be noted that this invention can be used for fitting point clouds of incomplete cylindrical surfaces as well as point clouds of complete cylindrical surfaces.
[0086] The advantages of this invention are:
[0087] This invention avoids the risk of getting stuck in local convergence during overall optimization by calculating the axis and radius parameters of the cylinder step by step, and has the characteristics of robustness and high precision.
[0088] This invention calculates the initial value of the cutting plane by using the normal information of the cylindrical point cloud and a step-by-step approximation search for the optimal projection plane. It does not rely on a single piece of information. In addition, a robust regression estimation method is used in the process of arc fitting and line fitting, which improves the robustness of the algorithm in practical applications.
[0089] This invention improves the efficiency of the algorithm by segmenting the cylindrical point cloud and transferring the optimization iteration process of spatial circular arc fitting to a two-dimensional plane.
[0090] Example 2:
[0091] See Figure 1 This embodiment discloses a method for fitting incomplete cylindrical point clouds, including the following steps:
[0092] S1 includes steps S101, S102, and S103, and the specific process is as follows:
[0093] Step S101: Input the point cloud data P of the cylinder and determine whether it contains the normal information of the cylindrical surface. If the input cylindrical point cloud contains normal vector information, proceed to step S102; otherwise, proceed to step S103.
[0094] Step S102: Perform Gaussian mapping on the point cloud data of the cylinder. The mapping result GM(P) is an arc distributed on the unit sphere, with the center of the arc at the center of the unit sphere, i.e., the origin of the coordinate system. Figure 2 As shown. These arc points are approximately distributed in the plane π passing through the center of the unit sphere. o Above, construct the covariance matrix for k points in the Gaussian mapping result GM(P):
[0095]
[0096] Where Cov is the covariance. Let T be a point in the Gaussian mapping result GM(P), and let T be the transpose of the matrix.
[0097] The three eigenvectors obtained by eigenvalue decomposition of the covariance matrix are λ1, λ2, and λ3, where λ1 > λ2 > λ3. The corresponding eigenvectors are α1, α2, and α3. The eigenvector α3 corresponding to the smallest eigenvalue λ3 is the eigenvector in the plane π. o The normal direction is also the normal direction of the cutting plane of the cylindrical point cloud.
[0098] Step S103: Establish the covariance matrix for the point cloud data P of the cylinder without normal information. Assume that there are k points in the cylindrical point cloud P, and the centroids of these k points are... After removing the centroid from the cylindrical point cloud, we get Then the covariance matrix M of the cylindrical point cloud P is:
[0099]
[0100] Among them, p1 and p k For points in a cylindrical point cloud, and These are the mean values of the x, y, and z coordinates of all points in the cylindrical point cloud, respectively.
[0101] The three eigenvectors obtained by eigenvalue decomposition of the covariance matrix M are λ1, λ2, and λ3, where λ1 > λ2 > λ3, and the corresponding eigenvectors are α1, α2, and α3. Normalizing the eigenvectors yields... and and with and As a passing point The normal vectors of planes π1, π2, and π3. According to Figure 3 As shown, the directed distance sd from each point in the cylindrical point cloud to these three planes. i They are respectively:
[0102]
[0103] in, normalized eigenvectors transpose, p i For points in a cylindrical point cloud, Let be the centroid coordinates of the cylindrical point cloud, and j be the eigenvectors in the table below;
[0104] Based on the directed distance of each point and the plane π jThe normal vector, j = 1, 2, 3, can be used to obtain the cylindrical point cloud in the plane π. j Projection points on:
[0105]
[0106] Among them, sd i For a point p in a cylindrical point cloud i The directed distance at a point, For the eigenvector α j Normalized vector;
[0107] Next, a coordinate transformation is performed on the projected points on each plane to make them coincide with the xoy plane of the coordinate system. First, the centroids of the projected points are removed, and then the plane π is calculated. j normal vector The angle θ with the x-axis j k j for Given an antisymmetric matrix, then according to Rodriguez's formula, we can obtain the antisymmetric matrix of the plane π. j Transform to a position coinciding with the xoy plane of the coordinate system. Obtain the transformed plane point A j ,like Figure 4 As shown, Figure 4 a~ Figure 4 b is the vector P of the subcylindrical point cloud. The projection onto the corresponding plane.
[0108] R j =cosα j I+(1-cosα j )k j k j T +sinα j k j ∧
[0109] Where, k j for The antisymmetric matrix, R j To normalize the eigenvectors Rotate to a position parallel to the z-axis of the coordinate system using a rotation matrix;
[0110] In plane In the above, 30 ray clusters L emanating from the origin are generated using polar coordinates, with the range direction vector of each line being l. t ,like Figure 5 a~ Figure 5 As shown in c. Then, select point A. j From the middle to the straight line l t Point a with a distance less than 1mmc And calculate the points selected on line l t Projection points on:
[0111]
[0112] in, Let point a c On line l t The projection point on, l t Let a be a ray in ray cluster L. c Let point A j From the middle to the straight line l t For points whose distance is less than 1 mm, T is the transpose of the matrix;
[0113] Calculate the line l for each line t The length of the projection point is taken as the longest value among all lines, and the result is used as the plane π. j The criteria for determining the optimal cutting plane are calculated using the method described above. The normal vector of the plane with the smallest criterion is selected as the starting point α for searching the optimal cutting plane.
[0114] Based on the obtained starting point α, its coordinates in the spherical coordinate system They are respectively:
[0115]
[0116] r0 is the radial distance; θ0 is the polar angle; y is the azimuth angle; x is the x-coordinate in the Cartesian coordinate system; y is the y-coordinate in the Cartesian coordinate system; z is the z-axis coordinate in the Cartesian coordinate system.
[0117] Starting from α, the optimal cutting plane direction is searched through the following 3 steps, as follows: Figures 6a-6c As shown:
[0118] Step 1: With α as the center, r = 1, θ = 0°~180°, And θ and The step size is step = 2°, generating a unit vector U, where each vector u i ∈U can all be considered as normal vectors of the plane. Then, the centroid-free cylindrical point cloud P′ is directed towards u. i The corresponding plane projection is then performed, and a circle fit is applied. The distances from all projected points on that plane to the fitted circle are calculated, and their average is taken as the roundness error of the projected points on that plane. Finally, the vector u corresponding to the projection plane with the smallest roundness error is calculated. i As a new starting point for the search α 1 .
[0119] Step 2: Using α 1With the center as r = 1, θ = 0°~180°, And θ and The step size is step = 1°, generating a unit vector set U. 1 u 1 i ∈U 1 Using one of the unit vectors, the de-centroided cylindrical point cloud P′ is directed towards u. 1 i For the corresponding plane projection, calculate the roundness error of the points obtained after projection, and then assign the vector u corresponding to the projection plane with the smallest roundness error. 1 i As a new starting point for the search α 2 .
[0120] Step 3: Using α 2 With the center as r = 1, θ = 0°~180°, And θ and The step size is step = 0.5°, generating a unit vector U. 2 u 2 i ∈U 2 Using one of the unit vectors, the de-centroided cylindrical point cloud P′ is directed towards u. 2 i For the corresponding plane projection, calculate the roundness error of the points obtained after projection, and then assign the vector u corresponding to the projection plane with the smallest roundness error. 2 i The normal vector of the optimal cutting plane obtained by the search
[0121] The specific process of planar circle fitting in the above process is as follows:
[0122] The equation of a circle on a plane can be expressed as:
[0123] A(x 2 +y 2 )+(Bx+Cy)+D=0
[0124] Where A, B, C, and D are the four parameters of the equation of the plane circle; x and y are the abscissa and ordinate of the two-dimensional plane.
[0125] The equation of a circle in a plane can be solved directly using the eigenvalue method proposed in the paper “Error analysis for circle fitting algorithms” (Al-Sharadqah A, Chernov N. Error analysis for circle fitting algorithms[J].2009), without requiring any initial values.
[0126] According to the equation of the plane circle above, the coordinates of the center can be expressed as:
[0127]
[0128] Where x0 and y0 are the coordinates of the center of the plane circle, and A, B and C are the parameters in the plane circle;
[0129] The radius of a circle can be expressed as:
[0130]
[0131] Where R is the radius of the circle, and A, B, C, and D are the four parameters of the equation of the plane circle;
[0132] The specific process of step S2 in this embodiment is as follows.
[0133] First, the input cylindrical point cloud data P is decentrifuged to obtain P′. Then, each point p in P′ is calculated. i At the center of gravity of point cloud data P The direction is the normal to the cutting plane obtained in step S1. Projection point on line L:
[0134]
[0135] in, For point p i The corresponding projection point on line L, Let T be the normal to the cutting plane, and T be the transpose of the matrix. i ′ represents the centroid-free point in the cylindrical point cloud data;
[0136] Then, through the Rodriguez rotation process described in step S103, the projection points on the aforementioned straight line are aligned with the x-axis of the coordinate system. At this point, the projection points corresponding to the points with the largest and smallest x-coordinate values among the transformed points are the points on the two end planes of the de-centroided cylindrical point cloud. The difference between the largest and smallest x-coordinate values among the transformed points is the initial length of the cylindrical point cloud. Finally, the average value of the point cloud coordinates is added to the coordinates of the two endpoints to obtain points t1 and t2 on the two end planes of the cylindrical point cloud, as shown below. Figure 7 As shown.
[0137] The specific process of step S3 in this embodiment is as follows.
[0138] Based on the initial value of the cylindrical point cloud length obtained in step S2 and the number of segmentation planes h to be generated, calculate the distance between any two cutting planes:
[0139]
[0140] Where s is the distance between any two cutting planes, length is the initial value of the length of the cylindrical point cloud, and h is the number of segmentation planes to be generated;
[0141] Take one end of the cylindrical point cloud as the position p0 of the first cutting plane, and then follow the normal direction of the cutting plane obtained in step S1. Move the plane a distance s to obtain the position of the next cutting plane:
[0142]
[0143] Where p1 is the position of the second cutting plane, p0 is the position of the first cutting plane, and s is the distance between any two cutting planes. The normal direction of the dividing plane;
[0144] Repeat the above process until the number of cutting planes equals the number of specified points, such as... Figure 8 As shown.
[0145] The specific process of step S4 in this embodiment is as follows.
[0146] For any plane p, its neighborhood τ is defined as follows: For any point in space, if its distance to the upper plane p is less than τ, then the point belongs to the neighborhood range of the aforementioned cutting plane τ. Therefore, starting from the first cutting plane p0, the cylindrical point cloud P is traversed to search for points in its τ=1 neighborhood. Then, according to the process of projecting spatial points onto a plane as described in step S103, its neighboring points are projected onto plane p0 to obtain the spatial arc point arc0 located on plane p0, as shown below. Figure 9 As shown.
[0147] Next, the cutting plane p0 is subjected to coordinate transformation to coincide with the xoy plane of the coordinate system. First, all points in the spatial arc arc0 are decentized, and then the plane p0 is coincided with the xoy plane of the coordinate system by the Rodrigues rotation matrix described in step S103, thereby transforming the spatial arc arc0 into the planar arc parc0.
[0148] Then, the radius of the arc parc0 is obtained by using the circle fitting method described in step S103. and the center The initial values of the coordinates are determined, and the residual at each point in the arc parc0 is calculated using the following formula. j ;
[0149] residual j =Dj -r i
[0150] In the formula, D j Represents each point in the arc parc0 and its relationship to the center of the circle. distance, residual j Let r be the residual at each point in the arc parc0. i The radius of the fitted circular arc parc0;
[0151]
[0152] Where, x j y j Let c be the x and y coordinates of a point in parc0; x c y Let D be the coordinates of the center of the arc parc0. j For each point in the arc parc0, the distance between the point and the center of the circle is... The distance;
[0153] Then the standard deviation σ of the residual is calculated using the following formula. resi :
[0154]
[0155] Where, σ resi The standard deviation of the residual; residual j For residuals; is the mean of the residuals; k is the number of points in the arc parc0.
[0156] Then, the points in the planar circular arc are sorted in ascending order according to the residuals, and the first 70% of the points are used for weighted least squares circle fitting:
[0157]
[0158] In the formula, c x and c y The center of the circle to be fitted, r i F is the radius of the circle to be fitted. e To represent the error equation, x j y j Let c be the x and y coordinates of a point in parc0; x c y Let ω be the coordinates of the center of the arc parc0. i For weights;
[0159] The above equation is a nonlinear equation, which can be solved using the LM iterative optimization method or the Gauss-Newton iterative optimization method. The entire process from point selection to weighted least squares solution is the minimum-stage weighted squares problem.
[0160] ω i The specific value is:
[0161]
[0162] By repeating the above minimum truncation weighted square process until the iteration exit condition is met, the center coordinates and radius of the planar arc are obtained. Then, the center coordinates and radius are restored to the position of the cutting plane p0 through the inverse process of the above coordinate transformation, thus completing the fitting of the spatial arc arc arc0.
[0163] Furthermore, the center coordinates and radius of the spatial arc at the location of other cutting planes can also be obtained using the above method.
[0164] The specific process of step S5 in this embodiment is as follows.
[0165] For the coordinates A of the center of the circles on all the cutting planes obtained in step S4, a spatial straight line is fitted using the weighted least squares method. According to the point-normal equation of a spatial straight line, six parameters are needed to determine a spatial straight line: a point L on the line... k (x0, y0, z0) and the direction of the line Furthermore, the fitted spatial straight line will pass through the weighted center point A of the center point A of the circle to be fitted. G (x g ,y g ,z g ):
[0166]
[0167]
[0168] Where x0, y0, z0 are points L on the line. k The three coordinates; change the symbols x, y, and z to x i y i and z i , where x i y i z i Describe a point A in the circle whose center is A. i The three coordinates; w i Let point A i The weight of w is taken when calculating the initial value of the axis. i =1, and its value in subsequent iterative calculations depends on its distance from the line.
[0169] In the formula, w i Let point A i (x i ,y i ,z i The weight of ) is taken as w when calculating the initial value of the axis. i =1, and its value in subsequent iterative calculations depends on its distance from the line. Therefore, we can derive the equation of the cylinder's axis by determining the direction of the line. Assume the direction of the cylinder's point cloud axis is... Then, for any center coordinate A i (x i ,y i ,z i ) to line L a The distance is:
[0170]
[0171] in, Center point A i to line L a The distance; Let point A i With point A g The vector formed; For line L a The direction vector;
[0172] Based on the least squares approach, we hope that each center point of the circle is aligned with line L. a The distances are all small enough, that is:
[0173]
[0174] The above formula must also satisfy This is a constrained optimization problem. According to the Lagrange multiplier method, we can obtain... The objective function for unconstrained optimization under constraints is:
[0175]
[0176] Where E is the objective function for unconstrained optimization, λ is the Lagrange multiplier variable; l, m, and n are the line L a The three components of direction;
[0177] When function E reaches an extreme value, the objective function E is minimized if and only if the parameters l, m, and n satisfy the following conditions:
[0178]
[0179]
[0180]
[0181]
[0182] in:
[0183]
[0184] Among them, w i Let point A i The weights; x i y i z i Describe a point A in the circle whose center is A. i The three coordinates; x g y g z g Let A be the coordinates of the centroid of A. g The three components;
[0185] In the satisfying form
[0186]
[0187] Given this premise, the matrix form of the first three equations is:
[0188]
[0189] From the matrix form of the equation above, it can be seen that the axis direction Let be an eigenvector of the coefficient matrix of the above equation, and let λ be the eigenvalue corresponding to this eigenvector. According to the objective function E, to minimize its value, g = [l(x...]. i -x g )+m(y i -y g )+n k (z i -z g )] 2 The largest, therefore It should be the eigenvector corresponding to the largest eigenvalue of the coefficient matrix. Assuming the coefficient matrix, after decomposition, yields three eigenvalues λ1, λ2, and λ3, where λ1 > λ2 > λ3, and the eigenvectors are β1, β2, and β3, then the direction of the axis... That is, the eigenvalue β1 corresponding to λ1.
[0190] The coordinates of the arc center point obtained in step S4 may contain errors. Therefore, when fitting a straight line in space, it is necessary to select appropriate weights to obtain a more accurate position of the cylinder axis. Here, the relatively simple Turkey method is selected for weight calculation, and its weight function is defined as follows:
[0191]
[0192] In the formula, τ is the clipping factor, representing a pre-defined distance. This weighting function completely ignores points with a distance greater than τ, while for points with a distance less than or equal to τ, the weight changes smoothly between 0 and 1. Here, it is based on the standard deviation σ of the distance from the center point A to the straight line to determine a suitable value according to different scenarios. When τ = 2σ, a more accurate fitting result can be obtained.
[0193] The above weighted calculation process is iterated until the iteration stopping condition is met. The direction of the straight line obtained at this point is the direction of the cylinder axis, and the weighted center A of the center point coordinates is... G It is a point on the axis of the cylinder.
[0194] The specific process of step S6 in this embodiment is as follows.
[0195] First, subtract the coordinates of point A on the axis obtained in step S5 from the coordinates of each point in the cylindrical point cloud. G The coordinates are then determined, and the centroid-free cylindrical point cloud is projected onto the axis of the cylinder through the projection process from the spatial midpoint to the straight line described in step S2. Then, the straight line is aligned with the positive direction of the x-axis of the coordinate system through the Rodriguez rotation process. The difference between the largest and smallest x-coordinate values among the transformed points is the length of the cylindrical point cloud.
[0196] Then, the average radius of the spatial arcs on all the cutting planes obtained in step S4 is taken as the radius R of the fitted cylinder.
[0197] The core technologies proposed in this invention include the following:
[0198] 1. Calculation method for the cutting plane direction of a cylindrical point cloud with normal information:
[0199] To address the problem of calculating the cutting plane direction of cylindrical point clouds with normal vector information, this invention proposes a technique for calculating the cutting plane direction of cylindrical point clouds with normal vector Gaussian mapping. By performing principal component analysis on the Gaussian mapping results of cylindrical point clouds with normal vector, the direction of the cutting plane of the cylindrical point cloud can be obtained quickly.
[0200] 2. Calculation method for the cutting plane direction of cylindrical point clouds that cannot be mapped:
[0201] To address the problem of being unable to calculate the direction of the cutting plane in a cylindrical point cloud, this invention proposes a step-by-step approximation search technique for calculating the direction of the cutting plane. The starting point of the search is determined by principal component projection discrimination of the cylindrical point cloud, and then the normal vector of the cutting plane is quickly obtained in the space near the starting point by using projection roundness discrimination and gradually reducing the search step size.
[0202] 3. A robust spatial circular arc fitting method based on RLTWS:
[0203] To address the issues of poor accuracy and stability in traditional spatial arc fitting, this paper proposes a robust spatial arc fitting technique called RLTWS. This technique transforms spatial arcs into planar arcs through coordinate transformation, and then iteratively selects points with smaller errors to perform weighted least squares fitting to obtain the center coordinates and radius. This approach not only ensures the accuracy of the algorithm but also improves the stability and accuracy of subsequent steps.
[0204] See Figure 11 Based on the above method, this invention also discloses a fitting system for incomplete cylindrical point clouds, comprising a normal direction acquisition module, an initial value acquisition module, a cutting plane generation module, a center radius acquisition module, an axis coordinate acquisition module, and a length radius acquisition module connected in sequence, wherein:
[0205] Normal direction acquisition module: used to calculate the normal direction of the segmentation plane based on the cylindrical point cloud data;
[0206] Initial value acquisition module: used to calculate the initial length and initial values of the two endpoints of the cylindrical point cloud data based on the normal direction of the segmentation plane;
[0207] Cutting plane generation module: used to generate a number of cutting planes based on the initial values of the two endpoints, the initial value of the length, and the normal direction of the dividing plane;
[0208] Center radius acquisition module: It is used to project the points in the neighborhood of each cutting plane onto the corresponding cutting plane, and obtain the center coordinates and radius of the corresponding arc of all cutting planes based on the spatial arc fitting method;
[0209] Axis coordinate acquisition module: used to perform spatial straight line fitting on the center coordinates of the corresponding arcs of all the obtained cutting planes to obtain the axis position coordinates of the cylindrical point cloud;
[0210] Length and radius acquisition module: used to calculate the length of the cylindrical point cloud based on the cylindrical point cloud data and the coordinates of the axis position of the cylindrical point cloud, and to obtain the radius of the cylinder based on the radius of the arc corresponding to all cutting planes.
[0211] See Figure 11In another feasible embodiment of the present invention, the following modifications are made as needed. It includes a normal direction acquisition module, an initial value acquisition module, a cutting plane generation module, a center radius acquisition module, an axis coordinate acquisition module, and a length radius acquisition module connected in sequence, wherein: the normal direction acquisition module is used to calculate the normal direction of the segmentation plane based on the cylindrical point cloud data. The initial value acquisition module is used to calculate the initial length value and the initial values of the two endpoints of the cylindrical point cloud data based on the normal direction of the segmentation plane. The cutting plane generation module is used to generate a number of cutting planes based on the initial values of the two endpoints, the initial length value, and the normal direction of the segmentation plane. The center radius acquisition module is used to project points in the neighborhood of each cutting plane onto the corresponding cutting plane, and obtain the center coordinates and radius of the corresponding arcs of all cutting planes based on a spatial arc fitting method. The axis coordinate acquisition module is used to perform spatial line fitting on the obtained center coordinates of the corresponding arcs of all cutting planes to obtain the axis position coordinates of the cylindrical point cloud. The length and radius acquisition module calculates the length of the cylindrical point cloud based on the cylindrical point cloud data and the coordinates of its axis position. It also obtains the radius of the cylinder based on the radii of the arcs corresponding to all cutting planes. The various modules work together to obtain the radius and axis equations of an incomplete cylindrical point cloud, avoiding the risk of local convergence or divergence when optimizing all parameters together. This ensures both accuracy and the efficiency and stability of the algorithm.
[0212] An electronic device includes: a processor; a memory for storing computer program instructions; and steps for implementing a fitting method for an incomplete cylindrical point cloud when executing the computer program.
[0213] A storage medium storing computer program instructions, which are loaded and executed by a processor, wherein the processor performs a fitting method for an incomplete cylindrical point cloud.
[0214] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0215] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0216] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0217] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0218] The above content is only for illustrating the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solution based on the technical concept proposed in this invention shall fall within the scope of protection of the claims of this invention.
Claims
1. A method for fitting incomplete cylindrical point clouds, characterized in that, Includes the following steps: The normal direction of the segmentation plane is calculated based on the cylindrical point cloud data, as follows: If the cylindrical point cloud data contains the normal vector information of the cylindrical surface, then Gaussian mapping is directly performed on the cylindrical point cloud data, and principal component analysis is performed on the mapping result to obtain the normal direction of the cutting plane. If the cylindrical point cloud data does not contain the normal information of the cylindrical surface, a step-by-step approximation method is used to search for the optimal projection plane that minimizes the roundness of the cylindrical point cloud projection. The normal direction of the optimal projection plane is the normal direction of the cutting plane. Calculate the initial length and initial values of the two endpoints of the cylindrical point cloud data based on the normal direction of the segmentation plane; A number of cutting planes are generated based on the initial values of the two endpoints, the initial value of the length, and the normal direction of the dividing plane; Project the points in the neighborhood of each cutting plane onto the corresponding cutting plane, and obtain the center coordinates and radius of the arcs corresponding to all cutting planes based on the spatial arc fitting method; Spatial straight line fitting is performed on the center coordinates of the corresponding arcs of all the obtained cutting planes to obtain the axial position coordinates of the cylindrical point cloud, as follows: For the coordinates of the center of the arc corresponding to all cutting planes, a weighted least squares method is used to fit a spatial straight line, and the axis position coordinates of the cylindrical point cloud are obtained by fitting. The specific process is as follows: The initial value of the spatial line to be fitted is obtained by combining the coordinates of the center of the arcs corresponding to all cutting planes using the least squares method. Calculate the distance from each center point to the initial value of the spatial line to be fitted, and the standard deviation of the distances from all center points to the initial value of the spatial line to be fitted. Then, based on the Turkey weight method, calculate the weight of the center point using the above standard deviation and the distance from each center point to the initial value of the spatial line to be fitted. Based on the weighted center points, perform least squares fitting of the spatial line. The length of the cylindrical point cloud is calculated based on the cylindrical point cloud data and the coordinates of its axial position. The radius of the cylinder is obtained based on the radii of the arcs corresponding to all cutting planes.
2. The fitting method for an incomplete cylindrical point cloud according to claim 1, characterized in that, The initial values for the length and the two endpoints of the cylindrical point cloud data are calculated based on the normal direction of the segmentation plane as follows: The cylindrical point cloud data is de-centrified by subtracting the average coordinate of all points from the coordinate of each point in the cylindrical point cloud data. The de-centrified cylindrical point cloud is then projected onto a straight line passing through the centroid of the cylindrical point cloud and in the direction of the normal direction of the segmentation plane using a projection matrix. By aligning the aforementioned straight line with the positive x-axis of the coordinate system through the Rodrigues rotation process, the largest and smallest x-coordinate values among the transformed points are the coordinates of the points on the two end planes of the cylindrical point cloud after decentering. The average value of the point cloud coordinates is added to the coordinates of the points on the two end planes to obtain the initial values of the two endpoints of the cylindrical point cloud. The difference between the largest and smallest x-coordinate values is the initial value of the length of the cylindrical point cloud.
3. The fitting method for an incomplete cylindrical point cloud according to claim 1, characterized in that, The specific steps for generating a number of cutting planes based on the initial values of the two endpoints, the initial value of the length, and the normal direction of the dividing plane are as follows: Based on the initial length and the initial values of the two endpoints of the cylindrical point cloud data, the step size of the cutting plane is obtained. Starting from any end of the cylindrical point cloud, a number of cutting planes are generated along the normal direction of the segmentation plane with the step size of the cutting plane calculated above.
4. The fitting method for an incomplete cylindrical point cloud according to claim 1, characterized in that, The process of projecting points within the neighborhood of each cutting plane onto the corresponding cutting plane, and obtaining the center coordinates and radii of the corresponding arcs for all cutting planes based on spatial arc fitting, is as follows: For each cutting plane, define its neighborhood. The range is as follows: For any point in space, if its distance to the cutting plane is less than... If so, then the point belongs to the aforementioned cutting plane. Points within the neighborhood; Each cutting plane Points within the neighborhood are projected onto this cutting plane. The projected points are transformed to coincide with the xoy plane of the coordinate system by coordinate transformation, turning the spatial arc into a planar arc. Then, the center coordinates and radius of the planar arc are obtained by fitting the planar arc. By inverting the coordinate transformation process, the center coordinates of the fitted planar arc are transformed back to their original positions to obtain the center coordinates of the spatial arc.
5. The fitting method for an incomplete cylindrical point cloud according to claim 1, characterized in that, The calculation of the length of the cylindrical point cloud based on the cylindrical point cloud data and the axial position coordinates of the cylindrical point cloud, and the acquisition of the radius of the cylinder based on the radius of the arc corresponding to all cutting planes are as follows: Subtract the axis position coordinates of the cylindrical point cloud from the coordinates of each point in the cylindrical point cloud data; All points in the cylindrical point cloud data are de-centrated, and the de-centrated cylindrical point cloud data is projected onto the axis position coordinates of the cylindrical point cloud through a projection matrix to obtain the cylindrical point cloud projection axis. The cylindrical point cloud projection axis is aligned with the positive x-axis of the coordinate system through the Rodriguez rotation process. The difference between the largest and smallest x-coordinate values of the transformed points is the length of the cylindrical point cloud. The radius of the cylinder is obtained by averaging the radii of the arcs corresponding to all the cutting planes.
6. A fitting system for an incomplete cylindrical point cloud for implementing the method of any one of claims 1 to 5, characterized in that, It includes, in sequence, a normal direction acquisition module, an initial value acquisition module, a cutting plane generation module, a center radius acquisition module, an axis coordinate acquisition module, and a length radius acquisition module, wherein: Normal direction acquisition module: used to calculate the normal direction of the segmentation plane based on the cylindrical point cloud data; Initial value acquisition module: used to calculate the initial length and initial values of the two endpoints of the cylindrical point cloud data based on the normal direction of the segmentation plane; Cutting plane generation module: used to generate a number of cutting planes based on the initial values of the two endpoints, the initial value of the length, and the normal direction of the dividing plane; Center radius acquisition module: It is used to project the points in the neighborhood of each cutting plane onto the corresponding cutting plane, and obtain the center coordinates and radius of the corresponding arc of all cutting planes based on the spatial arc fitting method; Axis coordinate acquisition module: used to perform spatial straight line fitting on the center coordinates of the corresponding arcs of all the obtained cutting planes to obtain the axis position coordinates of the cylindrical point cloud; Length and radius acquisition module: used to calculate the length of the cylindrical point cloud based on the cylindrical point cloud data and the coordinates of the axis position of the cylindrical point cloud, and to obtain the radius of the cylinder based on the radius of the arc corresponding to all cutting planes.
7. An electronic device, comprising: processor; A memory for storing computer program instructions; characterized in that, when executing the computer program, it implements the steps of the fitting method for incomplete cylindrical point clouds as described in any one of claims 1-5.
8. A storage medium storing computer program instructions, characterized in that, When the computer program instructions are loaded and run by the processor, the processor executes the fitting method for the incomplete cylindrical point cloud as described in any one of claims 1-5.