Fitting method and system of incomplete cylindrical surface point cloud, medium and equipment
By calculating and dividing the normal direction of the plane step by step, the problems of low accuracy and slow efficiency in incomplete cylindrical point cloud fitting are solved, and a robust and high-precision fitting effect is achieved.
Patent Information
- Application Number
- CN202410626015.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-20
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-05-20
AI Technical Summary
The existing technology has the problems of low accuracy, slow efficiency and poor stability in incomplete cylindrical surface point cloud fitting, especially the defects of sensitivity to data noise and local convergence.
By calculating the radius and axis equations of the incomplete cylindrical point cloud step by step, the methods of dividing plane normal direction, cutting plane generation, space arc fitting and space straight line fitting are used to avoid local convergence or divergence when the parameters are optimized together. , improving the efficiency and accuracy of the algorithm.
Robust, high-precision incomplete cylindrical point cloud fitting is achieved, local convergence and divergence are avoided, and the stability and efficiency of the algorithm are improved.
Smart Images

Figure CN118587268A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of quality inspection and relates to a fitting method, system, medium and equipment for an incomplete cylindrical point cloud. Background Art
[0002] Cylindrical objects are extremely common in industrial production and daily life. The dimensional accuracy of their production has an important impact on the performance and life of the product. How to achieve efficient, high-precision and stable measurement of cylindrical objects in production has become the core technology in the production of such objects.
[0003] Three-dimensional optical measurement technology has been widely used in the field of industrial measurement in recent years due to its advantages such as non-contact and high efficiency. This technology can quickly obtain the surface information of cylindrical objects and reconstruct the three-dimensional shape point cloud of the object. Based on the point cloud data of the object, its size can be measured.
[0004] In actual measurement, due to the complex spatial shape of the object and in order to improve the efficiency of measurement, for rotating objects such as cylindrical surfaces, generally only part of the cylindrical surface point cloud is obtained for measurement. Therefore, achieving robust, fast and high-precision measurement of incomplete cylindrical surface point clouds is the focus of research.
[0005] The existing cylinder fitting methods mainly include the eigenvalue method, the least squares method and the projection roundness discrimination method. Among them, the eigenvalue method has high requirements on the quality of data. When the data contains large gross errors, the fitting accuracy is low, and the implementation process is relatively complicated. The least squares method is the most widely used in cylinder fitting, but it has high requirements on the initial values of the solution parameters and is extremely sensitive to data noise. It is easy to cause the iterative process to diverge or fall into local convergence, and the success rate of fitting is low. The projection roundness discrimination method has good theoretical stability, but its search efficiency is extremely low, which limits its practical application.
[0006] The above methods have good effects on complete cylindrical point clouds, but for the fitting of incomplete cylindrical point clouds, the accuracy and stability of the eigenvalue method are poor. The least squares method can obtain relatively accurate results when the initial parameter values are relatively accurate and the point cloud data quality is good, but sometimes it will fall into local convergence and obtain wrong fitting results. The projection roundness discrimination rule can obtain accurate results, but it may take several seconds or even tens of seconds, which is inefficient. Summary of the invention
[0007] In order to overcome the shortcomings of the above-mentioned prior art, the purpose of the present invention is to provide a fitting method, system, medium and equipment for an incomplete cylindrical point cloud. The present invention calculates the radius and axis equations of the incomplete cylindrical point cloud step by step, thereby avoiding the risk of falling into local convergence or divergence when all parameters are optimized together, thereby ensuring both accuracy and efficiency and stability of the algorithm.
[0008] In order to achieve the above object, the present invention adopts the following technical solutions:
[0009] In a first aspect, the present invention discloses a method for fitting an incomplete cylindrical point cloud, comprising the following steps:
[0010] Calculate the normal direction of the segmentation plane based on the cylindrical point cloud data;
[0011] Calculate the initial value of the length and the initial values of the two endpoints of the cylindrical point cloud data according to the normal direction of the segmentation plane;
[0012] Generate a number of cutting planes according to the initial values of the two end points, the initial value of the length and the normal direction of the splitting 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] 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;
[0015] The length of the cylindrical point cloud is calculated according to the cylindrical point cloud data and the axis position coordinates of the cylindrical point cloud, and the radius of the cylinder is obtained according to the radius of the arc corresponding to all cutting planes.
[0016] In a second aspect, the present 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 value of the length of the cylindrical point cloud data and the initial values of the two endpoints according to the normal direction of the segmentation plane;
[0019] Cutting plane generation module: used to generate a number of cutting planes according to the initial values of the two endpoints, the initial value of the length and the normal direction of the splitting plane;
[0020] Circle center radius acquisition module: 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 arcs corresponding to 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 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 axis position coordinates 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] In a third aspect, the present invention provides an electronic device, comprising: a processor; a memory for storing computer program instructions; and steps for implementing a method for fitting an incomplete cylindrical point cloud when executing the computer program.
[0024] In a fourth aspect, the present invention provides a storage medium storing computer program instructions. When the computer program instructions are loaded and executed by a processor, the processor executes a method for fitting an incomplete cylindrical point cloud.
[0025] Compared with the prior art, the present invention has the following beneficial effects:
[0026] 1. The method of the present invention calculates the normal direction of the segmentation plane according to the cylindrical point cloud data; calculates the initial value of the length of the cylindrical point cloud data and the initial values of the two endpoints according to the normal direction of the segmentation plane; generates a number of cutting planes according to the initial values of the two endpoints, the initial value of the 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 arcs corresponding to all cutting planes based on the method of spatial arc fitting. The present invention improves the efficiency of the algorithm by segmenting the cylindrical point cloud and transferring the optimization iterative process of spatial arc fitting to a two-dimensional plane; performs spatial straight line fitting on the center coordinates of the arcs corresponding to all cutting planes to obtain the axis position coordinates of the cylindrical point cloud; calculates the length of the cylindrical point cloud according to the cylindrical point cloud data and the axis position coordinates of the cylindrical point cloud, and obtains the radius of the cylinder according to the radius of the arcs corresponding to all cutting planes. By calculating the radius and axis equations of the incomplete cylindrical point cloud step by step, the risk of falling into local convergence or divergence when all parameters are optimized together is avoided, which not only ensures the accuracy but also ensures the efficiency and stability of the algorithm, and has the characteristics of robustness and high precision.
[0027] 2. The system of the present invention 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 which are connected in sequence. The modules work together to obtain the radius and axis equations of an incomplete cylindrical point cloud, avoiding the risk of falling into local convergence or divergence when all parameters are optimized together, thus ensuring both accuracy and the efficiency and stability of the algorithm.
[0028] 3. The medium and device of the present invention can also realize the acquisition of the radius and axis equations of an incomplete cylindrical point cloud, avoiding the risk of falling into local convergence or divergence when all parameters are optimized together, thereby ensuring both accuracy and efficiency and stability of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a schematic diagram of the overall steps of the present invention.
[0030] Figure 2 Schematic diagram of Gaussian mapping of cylindrical point cloud with normal vector information.
[0031] Figure 3 Schematic diagram of the directed distance from a point in space to a plane.
[0032] Figure 4 Schematic diagram of the projection of a cylindrical point cloud onto a plane with its three principal component directions as normals.
[0033] Figure 5 Schematic diagram of the criterion calculation process for selecting the optimal principal component direction.
[0034] FIG6 is a schematic diagram of searching for the optimal cutting plane by spatial step-by-step approximation.
[0035] Figure 7 Schematic diagram for calculating the length of a cylindrical point cloud and determining its endpoints.
[0036] Figure 8 Schematic diagram of the cutting plane generation process.
[0037] Fig. 9 Schematic diagram of the projection of the neighborhood points of the cutting plane on its cutting plane.
[0038] Fig.10 The figure is a flow chart of the method of the present invention.
[0039] Fig.11 This is a connection diagram of the system modules of the present invention. DETAILED DESCRIPTION
[0040] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work 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 and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0042] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0043] See also Fig.10 The present invention discloses a method for fitting an incomplete cylindrical point cloud, 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, 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 carry the normal information of the cylindrical surface, a step-by-step approximation method is used to search for the optimal projection plane that can minimize the circularity 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 value of the length of the cylindrical point cloud data and the initial values of the two endpoints according to the normal direction of the segmentation plane, as follows:
[0048] All points in the cylindrical point cloud data are de-centered, that is, the coordinates of each point in the cylindrical point cloud data are subtracted from the average value of all point cloud coordinates, and the de-centered cylindrical point cloud is projected onto the straight line passing through the center of gravity of the cylindrical point cloud through the projection matrix, with the projection direction being the normal direction of the segmentation plane;
[0049] The above straight line is aligned with the positive direction of the x-axis of the coordinate system through the Rodriguez rotation process. Among the transformed points, the maximum x-coordinate value and the minimum x-coordinate value are the point coordinates on the two end planes of the cylindrical point cloud after the center of gravity is removed. The point coordinates on the two end planes are added to the average value of the point cloud coordinates to obtain the initial values of the two end points of the cylindrical point cloud. The difference between the maximum x-coordinate value and the minimum x-coordinate value is the initial value of the length of the cylindrical point cloud.
[0050] S3. Generate a number of cutting planes according to the initial values of the two endpoints, the initial value of the length and the normal direction of the splitting plane, as follows:
[0051] The step length of the cutting plane is obtained according to the initial value of the length of the cylindrical point cloud data and the initial values of the two end points. 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 length 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 arcs corresponding to all cutting planes based on the spatial arc fitting method, as follows:
[0053] For each cutting plane, its neighborhood τ range 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 point in the neighborhood range of the cutting plane τ;
[0054] Project each point in the neighborhood of the cutting plane τ onto the cutting plane, transform the projected point to a position that coincides with the xoy plane of the coordinate system by means of coordinate transformation, transform the space arc into a plane arc, and then obtain the center coordinates and radius of the plane arc by means of plane arc fitting;
[0055] The center coordinates of the plane arc obtained by fitting are transformed to the original position through the inverse process of coordinate transformation to obtain the center coordinates of the space 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 center coordinates of the arcs corresponding to all cutting planes, the weighted least squares method is used to perform spatial straight line fitting to obtain the axis position coordinates of the cylindrical point cloud. The specific process is as follows:
[0058] The least square method is used to combine the coordinates of the centers of the arcs corresponding to all cutting planes to obtain the initial value of the spatial straight line to be fitted;
[0059] Calculate the distance from each circle center coordinate point to the initial value of the spatial straight line to be fitted and the standard deviation of the distances from all circle center coordinate points to the initial value of the spatial straight line to be fitted, and then use the Turkey weight method to calculate the weight of the circle center coordinate point using the above standard deviation and the distance from each circle center coordinate point to the initial value of the spatial straight line to be fitted, and perform least squares fitting of the spatial straight line based on the weighted circle center coordinate point.
[0060] S6. Calculate the length of the cylindrical point cloud according to the cylindrical point cloud data and the axis position coordinates of the cylindrical point cloud, and obtain the radius of the cylinder according to the radius of the arc corresponding to all cutting planes, as follows:
[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-centered, and the de-centered 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 projection axis of the cylindrical point cloud is aligned with the positive direction of the x-axis of the coordinate system through the Rodriguez rotation process. The difference between the maximum x-coordinate value and the minimum x-coordinate value of the transformed point 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 cutting planes.
[0065] See also Fig.10 In another feasible embodiment of the present invention, the following is adaptively modified according to the situation. Calculate the normal direction of the splitting plane according to the cylindrical point cloud data; calculate the initial value of the length of the cylindrical point cloud data and the initial values of the two endpoints according to the normal direction of the splitting plane; generate a number of cutting planes according to the initial values of the two endpoints, the initial value of the length and the normal direction of the splitting 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 method of spatial arc fitting; perform spatial straight line fitting on the center coordinates of the corresponding arcs of all cutting planes obtained to obtain the axis position coordinates of the cylindrical point cloud; calculate the length of the cylindrical point cloud according to the cylindrical point cloud data and the axis position coordinates of the cylindrical point cloud, and obtain the radius of the cylinder according to the radius of the arcs corresponding to all cutting planes. The present invention avoids the risk of falling into local convergence or divergence when all parameters are optimized together by calculating the radius and axis equation of the incomplete cylindrical point cloud in steps, thereby ensuring both accuracy and efficiency and stability of the algorithm.
[0066] Embodiment 1:
[0067] See also Figure 1 and Fig.10 The present invention discloses a fitting method for an incomplete cylindrical surface point cloud, which specifically comprises 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 the normal vector information of the cylindrical surface, 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 carry the normal information of the cylindrical surface, the step-by-step approximation method is used to search for the optimal projection plane that can minimize 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 value of the length of the cylindrical point cloud and the initial values of the two endpoints. The specific process is as follows:
[0072] First, all points in the cylindrical point cloud data are decentered, that is, the coordinates of each point in the cylindrical point cloud data are subtracted from the average value of all point cloud coordinates, and then the above-mentioned decentered cylindrical point cloud is projected on the straight line passing through the center of gravity of the cylindrical point cloud and in the normal direction obtained in step S1 through the projection matrix, and then the above-mentioned straight line is aligned with the positive direction of the x-axis of the coordinate system through the Rodriguez rotation process. At this time, the projection points corresponding to the point with the largest x-coordinate value and the point with the smallest x-coordinate value in the transformed points are the point coordinates on the two end planes of the decentered cylindrical point cloud, and the difference between the largest x-coordinate value and the smallest x-coordinate value in the transformed points is the initial value of the length of the cylindrical point cloud. Finally, the coordinates of the two endpoints are added to the average value of the point cloud coordinates 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] According to the initial value of the length of the cylindrical point cloud and the number of cutting planes obtained in step S2, the step length of generating the cutting plane 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 above calculated step length of the cutting plane.
[0075] S4, project each point in the neighborhood of the cutting plane onto the cutting plane, and then obtain the center coordinates and radius of the arc corresponding to the cutting plane based on the spatial arc fitting method, see Fig. 9 , the specific process is as follows:
[0076] For each cutting plane, define its neighborhood τ range as follows: for any point in space, if its distance to the above-mentioned cutting plane is less than τ, then the point belongs to the point within the neighborhood range of the above-mentioned cutting plane τ. Then, for each cutting plane generated in step S3, project the points within its τ neighborhood range onto this cutting plane, and then transform this cutting plane to a position that coincides with the xoy plane of the coordinate system by means of coordinate transformation, transform the spatial arc into a plane arc, and then obtain the center coordinates and radius of the plane arc by means of plane arc fitting, and finally, transform the center coordinates of the fitted plane arc to the original position by means of the inverse process of coordinate transformation to obtain the center coordinates of the spatial arc.
[0077] In the above plane arc fitting process, the repeated least truncation weighted squares (RLTWS) technique is used for plane arc fitting. The specific process is as follows:
[0078] For the points of the plane arc obtained, the ordinary least squares method is first used to fit the plane arc to obtain the coordinates of the center of the arc and the initial value of the radius, and the fitted circle is obtained. Then, the distance and error from each point of the plane arc to the fitted circle are calculated. Then, the points of the plane arc are sorted in ascending order according to the error size of each point. After sorting, the first 70% of the points are selected, and the weighted least squares method is used to fit the plane arc. The point selection and fitting process is repeated until the conditions for iterative exit are met.
[0079] S5. Perform spatial straight line fitting on the center coordinates of all the cutting plane arcs to obtain the axis position 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, the weighted least squares method is used to fit the spatial straight line. The specific process is: first, the least squares method is used to obtain the initial value of the spatial straight line to be fitted, and then the distance from each point to the straight line and the standard deviation of the distances from all points to the straight line are calculated, and then the Turkey weight method is used to calculate the weight of the point using the above standard deviation and the distance from each point to the straight line, and the least squares fitting of the spatial straight line is performed again based on the weighted points, and the weighted fitting process is repeated until the conditions for termination of the iteration are met and exited.
[0081] S6. Calculate the length of the cylindrical point cloud and the radius of the cylinder. The specific process is as follows:
[0082] First, the coordinates of each point in the cylindrical point cloud data are subtracted from the coordinates of the corresponding center point on the axis obtained in step S5, and then the above-mentioned cylindrical point cloud after decentering is projected on the axis of the cylinder through the projection matrix. Then, the above-mentioned straight line is aligned with the positive direction of the x-axis of the coordinate system through the Rodrigues rotation process. The difference between the maximum x-coordinate value and the minimum x-coordinate value of the transformed point 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 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 the original point cloud data directly obtained by the scanner or the pre-processed point cloud data. In addition, the point cloud data can have the normal information of the cylindrical surface or not.
[0085] It should be noted that the present invention can be used for fitting of incomplete cylindrical point clouds as well as for fitting of complete cylindrical point clouds.
[0086] The advantages of the present invention are:
[0087] The invention calculates the axis and radius parameters of the cylinder step by step, thereby avoiding the risk of falling into local convergence during overall optimization, and has the characteristics of robustness and high precision.
[0088] The present invention calculates the initial value of the cutting plane by searching the optimal projection plane based on the normal information of the cylindrical point cloud and the step-by-step approximation method. It does not rely solely on a single piece of information. At the same time, a robust regression estimation method is used in the process of arc fitting and straight line fitting, thereby improving the robustness of the algorithm in practical applications.
[0089] The present invention transfers the optimization iterative process of space arc fitting to a two-dimensional plane by segmenting the cylindrical point cloud, thereby improving the efficiency of the algorithm.
[0090] Embodiment 2:
[0091] See also Figure 1 This embodiment discloses a method for fitting an incomplete cylindrical point cloud, comprising the following steps:
[0092] S1, including step S101, step S102 and step S103, the specific process is:
[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 carries normal vector information, proceed to step S102 ; otherwise, proceed to step S103 .
[0094] Step S102: Gaussian mapping is performed on the point cloud data of the cylinder. The mapping result GM(P) is an arc distributed on the unit sphere. The center of the arc is at the center of the unit sphere, that is, the origin of the coordinate system, as shown in Figure 2 These arc points are approximately distributed on the plane π passing through the center of the unit sphere. o On the top, establish the covariance matrix for the k points in the Gaussian mapping result GM(P):
[0095]
[0096] Among them, Cov is the covariance, is a point in the Gaussian mapping result GM(P), and T is the transpose of the matrix;
[0097] The three eigenvectors obtained by eigenvalue decomposition of the covariance matrix are λ1, λ2 and λ3, λ1>λ2>λ3, and the corresponding eigenvectors are α1, α2 and α3. The eigenvector α3 corresponding to the minimum eigenvalue λ3 is the plane π o The normal direction is also the normal direction of the cylindrical point cloud cutting plane.
[0098] Step S103: Establish a covariance matrix for the cylindrical point cloud data P without normal information. Assume that there are k points in the cylindrical point cloud P, and the centroid of these k points is After removing the center of gravity of 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 is a point in the cylindrical point cloud, and are the means of the x, y, and z coordinates of all points in the cylindrical point cloud;
[0101] The three eigenvectors obtained by eigenvalue decomposition of the covariance matrix M are λ1, λ2 and λ3, λ1>λ2>λ3, and the corresponding eigenvectors are α1, α2 and α3. Unitize the eigenvectors to get and And and As a passing point The normal vectors of the planes π1, π2 and π3. Figure 3 As shown, the signed distance sd from each point in the cylindrical point cloud to these three planes i They are:
[0102]
[0103] in, is the normalized eigenvector The transpose of i is a point in the cylindrical point cloud, is the centroid coordinate of the cylindrical point cloud, j is the following table of eigenvectors;
[0104] According to the directed distance of each point and the plane π jThe normal vector, j = 1, 2, 3, can be obtained by j Projection point on :
[0105]
[0106] Among them, sd i is a point p in the cylindrical point cloud i The directed distance at is the feature vector α j The normalized vector;
[0107] Next, the coordinates of the projected points on each plane are transformed so that they coincide with the xoy plane of the coordinate system. First, the projected points are decentered, and then the plane π is calculated. j The normal vector Angle θ with the x-axis j , k j for The antisymmetric matrix of the plane π can be obtained according to the Rodriguez formula. j Transform to a position that coincides with the xoy plane of the coordinate system Get the transformed plane point A j ,like Figure 4 As shown, Figure 4 a~ Figure 4 b is the vector of the secondary cylindrical point cloud P The projection on the corresponding plane.
[0108] R j =cosα j I+(1-cosα j ) j k j T +sinα j k j ∧
[0109] Among them, k j for The antisymmetric matrix, R j To normalize the eigenvector Rotate to the rotation matrix parallel to the z-axis of the coordinate system;
[0110] In plane In the example, 30 ray clusters L are generated from the origin using polar coordinates, and the range direction vector of each line is l t ,like Figure 5 a~ Figure 5 c. Then, point A is selected j Middle to straight line t The distance from point a is less than 1 mmc , and calculate the filtered points on the straight line l t Projection point on :
[0111]
[0112] in, For point a c On the straight line t The projection point on t is a ray in the ray cluster L, a c Point A j Middle to straight line t For points whose distance is less than 1 mm, T is the transpose of the matrix;
[0113] Calculate each line l t The length of the projection point on the plane and the longest value among all the straight lines is taken as the plane π j According to the above method, the criteria of planes π1, π2, and π3 are calculated respectively, and the normal vector of the plane with the smallest criterion is selected as the starting point α for searching the optimal cutting plane.
[0114] According to the obtained starting point α, its coordinates in the spherical coordinate system They are:
[0115]
[0116] r0 is the radial distance; θ0 is the polar angle; is the azimuth; x is the abscissa in the Cartesian coordinate system; y is the ordinate in the Cartesian coordinate system; z is the z-axis coordinate in the Cartesian coordinate system;
[0117] Starting from α, the direction of the optimal cutting plane is searched through the following three steps, such as Figure 6a to Figure 6c As shown:
[0118] Step 1: With α as the center, r = 1, θ = 0°~180°, And θ and The step size is step = 2°, generating unit vector U, where each vector u i ∈U can be regarded as the normal vector of the plane. Then the cylindrical point cloud P′ after removing the center of gravity is moved to u i The corresponding plane is projected and a circle is fitted. The distances from all the projection points on the plane to the fitted circle are calculated, and the mean is taken as the roundness error of the projection points on the plane. The vector u corresponding to the projection plane with the smallest roundness error is then taken as i As a new search starting point α 1 .
[0119] Step 2: Take α 1is the center, r = 1, θ = 0°~180°, And θ and The step size is step = 1°, generating a unit vector set U 1 ,u 1 i ∈U 1 As one of the unit vectors, the cylindrical point cloud P′ after removing the center of gravity is moved to u 1 i The corresponding plane projection is used to calculate the roundness error of the projected point, and the vector u corresponding to the projection plane with the smallest roundness error is 1 i As a new search starting point α 2 .
[0120] Step 3: Take α 2 is the center, r = 1, θ = 0°~180°, And θ and The step size is step = 0.5°, generating a unit vector U 2 ,u 2 i ∈U 2 As one of the unit vectors, the cylindrical point cloud P′ after removing the center of gravity is moved to u 2 i The corresponding plane projection is used to calculate the roundness error of the projected point, and the vector u corresponding to the projection plane with the smallest roundness error is 2 i As the normal vector of the optimal cutting plane found
[0121] The specific process of plane 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] Among them, A, B, C and D are the four parameters of the plane circle equation; x and y are the horizontal and vertical coordinates on the two-dimensional plane.
[0125] The equation of a circle on a plane can be solved directly using the eigenvalue method proposed in the literature "Error analysis for circle fitting algorithms" (Al-Sharadqah A, Chernov N. Error analysis for circle fitting algorithms [J]. 2009) without the need for any initial values.
[0126] According to the equation of the plane circle above, the coordinates of the center of the circle can be expressed as:
[0127]
[0128] Among them, 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] Among them, R is the radius of the circle, A, B, C and D are the four parameters of the plane circle equation;
[0132] The specific process of step S2 of this embodiment is as follows.
[0133] First, remove the center of gravity of the input cylindrical point cloud data P to obtain P'. Then calculate each point p in P' i ′ passes through the center of gravity of the point cloud data P Direction is the normal direction of the cutting plane obtained in step S1 The projection point on the straight line L is:
[0134]
[0135] in, For point p i ′ corresponds to the projection point on the straight line L, is the normal of the cutting plane, T is the transpose of the matrix, p i ′ is the point of the cylindrical point cloud data without centroid;
[0136] Then, the projection points on the straight line are made to coincide with the x-axis of the coordinate system through the Rodriguez rotation process described in step S103. At this time, the projection points corresponding to the point with the largest x-coordinate value and the point with the smallest x-coordinate value among the transformed points are the points on the two end planes of the cylindrical point cloud after the centroid is removed, and the difference between the largest x-coordinate value and the smallest x-coordinate value among the transformed points is the initial length of the cylindrical point cloud. Finally, the coordinates of the two endpoints are added to the average value of the point cloud coordinates to obtain points t1 and t2 on the two end planes of the cylindrical point cloud, as shown in Figure 7 shown.
[0137] The specific process of step S3 of this embodiment is as follows.
[0138] According to the initial value length of the cylindrical point cloud obtained in step S2 and the number h of segmentation planes to be generated, the interval distance between any two cutting planes is calculated:
[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 segmentation plane obtained in step S1 Move an interval distance s to get the position of the next cutting plane:
[0142]
[0143] Among them, 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. is the normal direction of the splitting plane;
[0144] Repeat the above process until the number of cutting planes is equal to the number of specified points, such as Figure 8 shown.
[0145] The specific process of step S4 of 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 point in the neighborhood of the above-mentioned cutting plane τ. Then, starting from the first cutting plane p0, traverse the cylindrical point cloud P to search for points in its τ=1 neighborhood, and then project its neighborhood points to plane p0 according to the process of projecting the spatial point to the plane described in step S103, and obtain the spatial arc point arc0 located on plane p0, as shown in Fig. 9 shown.
[0147] Next, coordinate transformation is performed on the cutting plane p0 to make it coincide with the xoy plane of the coordinate system. First, all points in the spatial arc arc0 are decentered, and then the plane p0 is coincident with the xoy plane of the coordinate system through the Rodriguez rotation matrix described in step S103, thereby converting the spatial arc arc0 into the plane arc parc0.
[0148] Then, the radius of the arc parc0 is obtained by using the circle fitting method described in step S103 for the plane arc parc0. and the center The initial value of the coordinates, and the residual of each point in the arc parc0 is calculated by the following formula j ;
[0149] residual j =Dj -r i
[0150] Where D j Represents each point in the arc parc0 and the center of the circle distance, residual j is the residual of each point in arc parc0, r i is the radius of the arc parc0 obtained by fitting;
[0151]
[0152] Among them, x j ,y j is the horizontal and vertical coordinates of a point in parc0; c x 、c y is the center coordinate of arc parc0, D j For each point in arc parc0 and the center of the circle distance;
[0153] Then the standard deviation σ of the residual is calculated by the following formula resi :
[0154]
[0155] Among them, σ resi is the standard deviation of the residual; j is the residual; is the mean of the residual; k is the number of points in the arc parc0.
[0156] Then, sort the points in the plane arc in ascending order according to the residuals, and take the first 70% of the points for weighted least squares circle fitting:
[0157]
[0158] In the formula, c x and c y is the center of the circle to be fitted, r i is the radius of the circle to be fitted, F e is the representation of the error equation, x j ,y j is the horizontal and vertical coordinates of a point in parc0; c x 、c y is the coordinate of the center of arc parc0, ω i is the weight;
[0159] The above equation is a nonlinear equation, which is solved by LM iterative optimization method or Gauss-Newton iterative optimization method. The whole process from point selection to weighted least squares solution is the minimum stage weighted squares.
[0160] ω i The specific values are:
[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 plane arc are obtained, and 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 to complete the fitting of the space arc arc0.
[0163] Furthermore, other cutting planes also obtain the center coordinates and radius of the space arcs at their locations through the above method.
[0164] The specific process of step S5 of this embodiment is as follows.
[0165] For the center coordinates A on all cutting planes obtained in step S4, the weighted least square method is used to fit the spatial straight line. According to the following spatial straight line point normal equation, it can be seen that six parameters are required to determine a spatial straight line: a point L on the straight line k (x0,y0,z0) and the direction of the line Moreover, the fitted spatial straight line will pass through the weighted center point A of the circle to be fitted. G (x g ,y g ,z g ):
[0166]
[0167]
[0168] Among them, x0, y0, z0 is a point on the straight line L k The three coordinates of; change the symbols x, y, z to x i ,y i and z i , where x i ,y i 、z i Represents a point A in the center of a circle i The three coordinates of w i Point A i When calculating the initial value of the axis, take w i =1, in subsequent iterative calculations, its value is related to its distance to the straight line
[0169] In the formula, w i Point A i (x i ,y i ,z i ) weight, when calculating the initial value of the axis, take w i =1, in the subsequent iterative calculation, its value is related to the distance from the straight line. It can be seen that the equation of the cylinder axis can be obtained by simply obtaining the direction of the straight line. Assume that the direction of the axis of the cylindrical point cloud is Then, any center coordinate A i (x i ,y i ,z i ) to the straight line L a The distance is:
[0170]
[0171] in, A is the center point of the circle i To the straight line L a distance; Point A i With point A g The vector formed; The straight line L a The direction vector of
[0172] According to the least squares idea, we hope that each center point of the circle and the straight line L a The distances are 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 get The objective function for unconstrained optimization under constraints is:
[0175]
[0176] Where E is the objective function of unconstrained optimization, λ is the Lagrange multiplier variable; l, m, n are the straight line L a The three components of direction;
[0177] When function E reaches an extreme value, the minimization requirement of objective function E can be met. Function E reaches an extreme value when and only when parameters l, m, and n meet the following conditions:
[0178]
[0179]
[0180]
[0181]
[0182] in:
[0183]
[0184] Among them, w i Point A i The weight of x i ,y i 、z i Represents a point A in the center of a circle i The three coordinates of x g ,y g 、z g is the centroid coordinate of A g The three components of
[0185] In the satisfaction
[0186]
[0187] Under the premise of , the matrix form of the first three equations is:
[0188]
[0189] From the matrix form of the above equation, it can be seen that the axis direction is an eigenvector of the coefficient matrix of the above equation, and λ is the eigenvalue corresponding to the eigenvector. According to the objective function E, if its value is to be minimized, g=[l(x i -x g )+m(y i -y g )+n k (z i -z g )] 2 The largest, so It should be the eigenvector corresponding to the largest eigenvalue of the coefficient matrix. Assuming that the three eigenvalues obtained by decomposing the coefficient matrix are λ1, λ2, and λ3, and λ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, it is necessary to select appropriate weights to obtain a more accurate position of the cylinder axis during spatial straight line fitting. Here, the Turkey method with relatively simple parameters is selected to calculate the weights, and its weight function is defined as:
[0191]
[0192] In the formula, τ is the clipping factor, which represents a pre-set distance. The weight function will completely ignore points with a distance greater than τ, and for points with a distance less than or equal to τ, the weight changes smoothly between 0 and 1. Here, the standard deviation σ of the distance from the center point A to the straight line is used to determine the appropriate value according to different scenarios. When τ = 2σ, a more accurate fitting result can be obtained.
[0193] The above weighted process is iterated until the iteration stop condition is met. The direction of the straight line obtained at this time is the direction of the cylinder axis, and the weighted centroid 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 of this embodiment is as follows.
[0195] First, subtract the coordinates of each point in the cylindrical point cloud from the point A on the axis obtained in step S5. G The coordinates of the cylindrical point cloud are then projected onto the axis of the cylinder through the projection process from the point in space to the straight line described in step S2. The straight line is then aligned with the positive direction of the x-axis of the coordinate system through the Rodriguez rotation process. The difference between the maximum x-coordinate value and the minimum x-coordinate value of the transformed point is the length of the cylindrical point cloud.
[0196] Then, the average value of the radii of the space 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 points:
[0198] 1. Calculation method of cutting plane direction of cylindrical point cloud with normal information:
[0199] In order to solve the problem of calculating the cutting plane direction of a cylindrical point cloud with normal vector information, the present invention proposes a cutting plane direction calculation technology for Gaussian mapping of a cylindrical point cloud with normal. By performing principal component analysis on the Gaussian mapping results of a cylindrical point cloud with normal, the direction of the cutting plane of the cylindrical point cloud can be quickly obtained.
[0200] 2. Calculation method for the cutting plane direction of the cylindrical point cloud that cannot be directed to information:
[0201] In order to solve the problem that it is impossible to calculate the direction of the cutting plane of a cylindrical point cloud, the present invention proposes a cutting plane direction calculation technology for a step-by-step approximation search. The starting point of the search is determined by performing principal component projection discrimination on the cylindrical point cloud, and then a high-precision normal vector of the cutting plane is quickly obtained in the space near the starting point by using a projection roundness discrimination method and gradually reducing the search step size.
[0202] 3. Spatial arc robust fitting method based on RLTWS:
[0203] Aiming at the problem of poor accuracy and stability of traditional spatial arc fitting, this paper proposes a spatial arc robust fitting technology called RLTWS. The spatial arc is converted into a plane arc through coordinate transformation, and then the points with smaller errors are iteratively selected for weighted least squares fitting to obtain the center coordinates and radius. This not only ensures the accuracy of the algorithm, but also improves the stability and accuracy of subsequent steps.
[0204] See also Fig.11 Based on the above method, the present invention also 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:
[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 value of the length of the cylindrical point cloud data and the initial values of the two endpoints according to the normal direction of the segmentation plane;
[0207] Cutting plane generation module: used to generate a number of cutting planes according to the initial values of the two endpoints, the initial value of the length and the normal direction of the splitting plane;
[0208] Circle center radius acquisition module: 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 arcs corresponding to 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 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 axis position coordinates 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 also Fig.11In another feasible embodiment of the present invention, the following is adaptively modified according to the situation. 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 according to the cylindrical point cloud data. The initial value acquisition module is used to calculate the initial value of the length of the cylindrical point cloud data and the initial values of the two endpoints according to the normal direction of the segmentation plane. The cutting plane generation module is used to generate a number of cutting planes according to the initial values of the two endpoints, the initial value of the length and the normal direction of the segmentation plane. The center radius acquisition module 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 arcs of all cutting planes based on the method of spatial arc fitting. The axis coordinate acquisition module is used to perform spatial straight 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. The length radius acquisition module is used to calculate 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 to obtain the radius of the cylinder based on the radius of the arc corresponding to all cutting planes. The various modules work together to obtain the radius and axis equations of the incomplete cylindrical point cloud, avoiding the risk of falling into local convergence or divergence when all parameters are optimized together, ensuring both accuracy and efficiency and stability of the algorithm.
[0212] An electronic device comprises: a processor; a memory for storing computer program instructions; and steps for implementing a method for fitting an incomplete cylindrical surface point cloud when executing the computer program.
[0213] A storage medium stores computer program instructions. When the computer program instructions are loaded and run by a processor, the processor executes a fitting method for an incomplete cylindrical point cloud.
[0214] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented 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] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0216] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0217] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0218] The above contents are only for explaining the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.
Claims
1. A fitting method for an incomplete cylindrical point cloud, characterized in that: The following steps are involved: Calculate the normal direction of the segmentation plane based on the cylindrical point cloud data; Calculate the initial value of the length and the initial values of the two endpoints of the cylindrical point cloud data according to the normal direction of the segmentation plane; Generate a number of cutting planes according to the initial values of the two end points, the initial value of the length and the normal direction of the splitting 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; 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; The length of the cylindrical point cloud is calculated according to the cylindrical point cloud data and the axis position coordinates of the cylindrical point cloud, and the radius of the cylinder is obtained according to the radius of the arc corresponding to all cutting planes.
2. The method for fitting an incomplete cylindrical point cloud according to claim 1, characterized in that: The calculation of the normal direction of the segmentation plane according to the cylindrical point cloud data is specifically as follows: If the cylindrical point cloud data contains the normal vector information of the cylindrical surface, 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 carry the normal information of the cylindrical surface, a step-by-step approximation method is used to search for the optimal projection plane that can minimize the circularity of the cylindrical point cloud projection. The normal direction of the optimal projection plane is the normal direction of the cutting plane.
3. The method for fitting an incomplete cylindrical point cloud according to claim 1, characterized in that: The calculation of the initial value of the length of the cylindrical point cloud data and the initial values of the two endpoints according to the normal direction of the segmentation plane is as follows: All points in the cylindrical point cloud data are de-centered, that is, the coordinates of each point in the cylindrical point cloud data are subtracted from the average value of all point cloud coordinates, and the de-centered cylindrical point cloud is projected onto the straight line passing through the center of gravity of the cylindrical point cloud through the projection matrix, with the projection direction being the normal direction of the segmentation plane; The above straight line is aligned with the positive direction of the x-axis of the coordinate system through the Rodriguez rotation process. Among the transformed points, the maximum x-coordinate value and the minimum x-coordinate value are the point coordinates on the two end planes of the cylindrical point cloud after the center of gravity is removed. The point coordinates on the two end planes are added to the average value of the point cloud coordinates to obtain the initial values of the two endpoints of the cylindrical point cloud. The difference between the maximum x-coordinate value and the minimum x-coordinate value is the initial value of the length of the cylindrical point cloud.
4. The method for fitting an incomplete cylindrical point cloud according to claim 1, characterized in that: The specific steps of generating a number of cutting planes according to the initial values of the two endpoints, the initial value of the length and the normal direction of the splitting plane are as follows: The step length of the cutting plane is obtained according to the initial value of the length of the cylindrical point cloud data and the initial values of the two end points. 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 length of the cutting plane calculated above.
5. The method for fitting an incomplete cylindrical point cloud according to claim 1, characterized in that: The method of projecting the points in the neighborhood of each cutting plane onto the corresponding cutting plane and obtaining the center coordinates and radius of the arcs corresponding to all cutting planes based on the spatial arc fitting method is as follows: For each cutting plane, its neighborhood τ range 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 point in the neighborhood range of the cutting plane τ; Project each point in the neighborhood of the cutting plane τ onto the cutting plane, transform the projected point to a position that coincides with the xoy plane of the coordinate system by means of coordinate transformation, transform the space arc into a plane arc, and then obtain the center coordinates and radius of the plane arc by means of plane arc fitting; The center coordinates of the plane arc obtained by fitting are transformed to the original position through the inverse process of coordinate transformation to obtain the center coordinates of the space arc.
6. The method for fitting an incomplete cylindrical point cloud according to claim 1, characterized in that: The coordinates of the center of the arcs corresponding to all the cutting planes are fitted with a spatial straight line to obtain the axis position coordinates of the cylindrical point cloud as follows: For the center coordinates of the arcs corresponding to all cutting planes, the weighted least squares method is used to perform spatial straight line fitting to obtain the axis position coordinates of the cylindrical point cloud. The specific process is as follows: The least square method is used to combine the coordinates of the centers of the arcs corresponding to all cutting planes to obtain the initial value of the spatial straight line to be fitted; Calculate the distance from each circle center coordinate point to the initial value of the spatial straight line to be fitted and the standard deviation of the distances from all circle center coordinate points to the initial value of the spatial straight line to be fitted, and then use the Turkey weight method to calculate the weight of the circle center coordinate point using the above standard deviation and the distance from each circle center coordinate point to the initial value of the spatial straight line to be fitted, and perform least squares fitting of the spatial straight line based on the weighted circle center coordinate point.
7. The method for fitting an incomplete cylindrical point cloud according to claim 1, characterized in that: The length of the cylindrical point cloud is calculated according to the cylindrical point cloud data and the axis position coordinates of the cylindrical point cloud, and the radius of the cylinder is obtained according to the radius of the arc corresponding to all cutting planes 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-centered, and the de-centered 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 projection axis of the cylindrical point cloud is aligned with the positive direction of the x-axis of the coordinate system through the Rodriguez rotation process. The difference between the maximum x-coordinate value and the minimum x-coordinate value of the transformed point 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 cutting planes.
8. A fitting system for an incomplete cylindrical point cloud for implementing the method according to any one of claims 1 to 7, characterized in that: It 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, which are connected in sequence, 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 value of the length of the cylindrical point cloud data and the initial values of the two endpoints according to the normal direction of the segmentation plane; Cutting plane generation module: used to generate a number of cutting planes according to the initial values of the two endpoints, the initial value of the length and the normal direction of the splitting plane; Circle center radius acquisition module: 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 arcs corresponding to 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 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 axis position coordinates 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.
9. An electronic device, comprising: processor; A memory for storing computer program instructions; characterized in that it is used to implement the steps of the method for fitting an incomplete cylindrical point cloud as described in any one of claims 1 to 7 when executing the computer program.
10. A storage medium storing computer program instructions, characterized in that: When the computer program instructions are loaded and executed by a processor, the processor executes the method for fitting an incomplete cylindrical point cloud according to any one of claims 1 to 7.
Citation Information
Patent Citations
Steel member cylinder fitting algorithm
CN111027010A
Cylindrical surface point cloud fitting method based on geometrical characteristics of section cutting plane
CN112465979A
Groove cutting method and system, electronic equipment, storage medium and product
CN117086878A
Cited By
Method for measuring capacity of thin film type liquefied natural gas storage tank based on geometric feature modeling
CN118762073A
Cylindrical surface detection method and device
CN119205723A
Cylinder detection method and device, electronic equipment and storage medium
CN119887767A
Cylinder detection method, device, electronic device and storage medium
CN119887767B
Point cloud cutting method and inclination monitoring method based on point cloud
CN122087252A
