Point cloud filtering algorithm based on Gocner
By adopting a three-dimensional point cloud filtering algorithm based on Gocator sensor in industrial manufacturing, the geometric constraint characteristics of point cloud data are calculated and weight calculation formulas are introduced, the problem of excessive smoothing and sharp feature passivation in point cloud filtering is solved, and high Accurate and efficient point cloud data acquisition.
Patent Information
- Application Number
- CN202411601605.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-11-11
AI Technical Summary
The prior art has problems of excessive smoothing and sharp feature passivation in point cloud filtering process in industrial manufacturing, resulting in low acquisition accuracy and efficiency.
Using a three-dimensional point cloud filtering algorithm based on Gocator sensor, by calculating the geometric constraint features (curvature, normal vector, feature distance) of each frame of point cloud data, and introducing a weight calculation formula, substituting it into the guide filtering cost formula, to point Cloud data is filtered.
It realizes smooth point cloud data while retaining the sharp features of the object, making it closer to the original state of the object, greatly improving the acquisition accuracy and efficiency.
Smart Images

Figure CN119477708A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of machine vision nondestructive testing, and specifically is a three-dimensional point cloud filtering algorithm based on Gocator. Background Art
[0002] With the rapid development of computer vision technology in the field of industrial inspection, 3D reconstruction technology has also played an important role in industrial manufacturing and other fields. Point cloud filtering technology plays a vital role in the field of industrial manufacturing, especially in application scenarios involving 3D measurement, inspection and quality control. With the advancement of 3D sensor technology, point cloud data is often accompanied by noise, redundant information and abnormal points during the collection process, which requires point cloud filtering algorithms to optimize the data to ensure the accuracy and availability of the data.
[0003] In industrial manufacturing, the main applications of point cloud data include product size detection, shape reconstruction, assembly accuracy detection, and quality control. However, the density and accuracy of point cloud data are usually affected by multiple factors such as environmental noise, the performance of the measuring equipment, and the reflective characteristics of the workpiece surface. Especially in complex industrial environments, factors such as surfaces with poor reflectivity, ambient light interference, and sensor angles can easily lead to outliers or noise in point cloud data. In this case, unprocessed point cloud data will be difficult to use directly for accurate geometric analysis or quality inspection. Therefore, point cloud filtering, as a preprocessing step, is of great significance.
[0004] According to different application requirements and data characteristics, point cloud filtering can be roughly divided into four categories: statistical filtering, voxel filtering, neighborhood filtering, and smoothing filtering. Statistical filtering uses the local statistical characteristics of each point in the point cloud to identify and remove abnormal points. Voxel filtering divides the point cloud data into three-dimensional grid units (voxels) of equal size, retaining only one representative point in each voxel, and is mainly used for the simplification of point cloud data. The neighborhood-based filtering method uses geometric constraints to smooth the point cloud or remove points that do not conform to the local geometric structure by analyzing the neighboring points around each point. Smoothing filtering is used to reduce high-frequency noise in the point cloud while retaining the edges and detail features of the object as much as possible. The above methods take a long time to calculate and have poor robustness. Since the parameters used in the filtering process are the same, the filtering effects on different objects vary greatly. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a three-dimensional point cloud filtering algorithm based on the Gocator sensor in view of the deficiencies of the above-mentioned prior art. The algorithm can adaptively calculate the geometric constraint features (i.e., curvature, normal vector, and feature distance) of each frame of point cloud data acquired by the Gocator, and based on this feature, introduce a weight calculation formula, and substitute it into the guided filtering cost formula to filter the three-dimensional point cloud data, thereby solving problems such as over-smoothing caused by fixed filtering parameters, and achieving smooth point cloud data while retaining the sharp features of the object, making it closer to the original state of the object, greatly improving the acquisition accuracy and efficiency.
[0006] In order to achieve the above technical objectives, the technical solution adopted by the present invention is:
[0007] A point cloud filtering algorithm based on Gocator, including:
[0008] Step 1: Build the Gocaotr sensor scanning platform, collect 3D point cloud data on the surface of the object to be tested, and record each frame of point cloud data;
[0009] Step 2: Calculate the neighborhood set of each frame of point cloud, and remove outliers based on the calculated neighborhood set;
[0010] Step 3: Based on the point cloud after removing outliers in step 2, calculate the curvature, normal vector and feature distance of each point in each frame of the point cloud;
[0011] Step 4: Based on the curvature, normal vector and feature distance calculated in step 3, introduce the weight calculation formula, substitute the calculated weight into the guided filtering cost formula, and perform guided filtering after weight allocation on each frame of point cloud;
[0012] Step 5: During the mobile acquisition process, each time a frame of point cloud data is obtained, steps 2 to 4 are repeated until the acquisition is completed;
[0013] Step 6: Arrange each frame of filtered data in the X-axis direction according to the parameters of the Gocaotr sensor and the acquisition rate, so as to obtain complete surface point cloud data of the object to be tested.
[0014] As a further improved technical solution of the present invention, the step 1 is specifically:
[0015] Step 1.1, design a front-end data acquisition device, wherein the front-end data acquisition device includes a sensor placement frame, a Y-axis electric linear slide and a Z-axis electric linear slide; a plurality of Gocator sensors are connected to the sensor placement frame; the Y-axis electric linear slide is connected to the Z-axis electric linear slide and the motor in the Z-axis electric linear slide is used to drive the Y-axis electric linear slide to move along the Z-axis direction, the sensor placement frame is connected to the Y-axis electric linear slide and the motor in the Y-axis electric linear slide is used to drive the sensor placement frame to move along the Y-axis direction; and then adjust the position of the Gocator sensor, thereby adjusting the distance between the Gocator sensor and the object to be measured;
[0016] Step 1.2, connect the front-end data acquisition device to the ground rail, the ground rail is extended along the X-axis direction, a motor is installed on the ground rail, and the motor is used to drive the front-end data acquisition device to move at a uniform speed along the X-axis direction on the ground rail; and then build a Gocaotr sensor scanning platform;
[0017] Step 1.3. Adjust the position of the Gocator sensor according to the size of the object to be measured through the Y-axis electric linear slide and the Z-axis electric linear slide. After the position is adjusted, select the number of Gocator sensors to be turned on and set the internal parameters of the Gocator sensor.
[0018] Step 1.4: The Gocator sensor in the Gocaotr sensor scanning platform starts to collect 3D point cloud data on the surface of the object to be measured. While the Gocator sensor is collecting data, the motor drives the front-end data acquisition device to move at a constant speed along the X-axis direction on the ground track; each frame of point cloud data collected is recorded.
[0019] As a further improved technical solution of the present invention, the multiple Gocator sensors in step 1 are arranged vertically and at intervals on the sensor placement rack.
[0020] As a further improved technical solution of the present invention, the step 2 is specifically:
[0021] Step 2.1, when collecting the three-dimensional point cloud data of the surface of the object to be measured, the neighborhood set is calculated for the frame of point cloud data collected in step 1, and the neighboring points within a specified radius around each point in the frame of point cloud data are found by constructing a kd-tree to construct a neighborhood set for each point in the frame of point cloud data;
[0022] Step 2.2: After dividing the neighborhood of each point, since the X coordinates of each frame of point cloud data are the same, each frame of point cloud data is regarded as a two-dimensional data point set containing Y-axis coordinates and Z-axis coordinates, that is, {(y1,z1),(y2,z2),…,(y k ,z k)};
[0023] Step 2.3: Set a threshold m, and consider the points whose number of points in the neighborhood set in a frame of point cloud data is less than m as outliers, and remove them.
[0024] As a further improved technical solution of the present invention, the step 3 is specifically as follows:
[0025] Step 3.1, assuming that the frame of point cloud data after denoising in step 2 is q, calculate the curvature, normal vector and feature distance of all points in the point cloud data q;
[0026] Step 3.1.1, the i-th point q in the point cloud data q i The characteristic distance for:
[0027]
[0028] Among them, |N i | indicates point q i The number of points in the neighborhood of i represents the i-th point in the point cloud data q, y(q i ) represents point q i The y coordinate of z(q i ) represents point q i The z coordinate, y(q ij ) represents point q i The jth point q in the neighborhood of ij The y coordinate of z(q ij ) represents point q i The jth point q in the neighborhood of ij The z coordinate, q ij ∈N i Represents the traversal point q i All points in the neighborhood;
[0029] Step 3.1.2, calculate the normal vector of the point. Since the X coordinate of each point is the same, the normal vector of the point is calculated using the neighborhood set of the point in two-dimensional space.
[0030] The i-th point q in the point cloud data q i The normal vector The calculation method is:
[0031] Point q i The neighborhood of and including point q i The discrete points of the spline are interpolated to obtain the spline interpolation curve. Then calculate the spline interpolation curve The first derivative of to obtain the point q i The tangent vector at point qi The tangent vector at point q is used to calculate the normal vector. i The normal vector
[0032] Set the direction of the normal vectors of all points to point to the first quadrant or the second quadrant, or set the direction of the normal vectors of all points to point to the third quadrant or the fourth quadrant;
[0033] Step 3.1.3: Interpolate the curve based on the spline The parametric equation of , using the numerical differentiation method to calculate the spline interpolation curve At point q i The first and second derivatives at point q i The first and second derivatives at point q are calculated. i The curvature of
[0034] Click q i The curvature value is calculated as:
[0035]
[0036] In the formula, k i Indicates point q i The curvature value at y′(q i ) represents the spline interpolation curve At point q i The first derivative value of the parametric equation y(q) at i ) represents the spline interpolation curve At point q i The first derivative value of the parametric equation z(q) at y ″″ (q i ) represents the spline interpolation curve At point q i The second derivative value of the parametric equation y(q) at i ) represents the spline interpolation curve At point q i The second derivative value of the parametric equation z(q) at .
[0037] As a further improved technical solution of the present invention, the step 4 is specifically as follows:
[0038] Step 4.1: Based on the curvature, normal vector and feature distance of all points in the point cloud data q calculated in step 3, a weight calculation formula is introduced; point q i The corresponding weight ω i The calculation formula is:
[0039]
[0040] In the formula, α and β are constants, and ω can be adjusted by adjusting the value of α. i Take values within a certain range, For point q i The average distance to the points in its neighborhood, For point q i The average angle between the normal vector of and the normal vectors of the points in its neighborhood;
[0041] Step 4.2: Assuming that the input point cloud data is q, and the output point cloud data after filtering is q′, the assumed linear model is:
[0042] q′ i =a i q i +b i (4);
[0043] In the formula, q i Represents the i-th point q in the point cloud data q i The coordinate vector, q′ i Represents the i-th point q in the point cloud data q′ output after filtering i ′ coordinate vector, a i and b i represents the coefficients of the linear model restricted to the neighborhood of the i-th point;
[0044] By minimizing the cost function, we can obtain a i and b i The value of
[0045] The cost function is defined as follows:
[0046]
[0047] In the formula, q ij For point q i The coordinate vector of the jth point in the neighborhood, ∈ represents the filtering parameters;
[0048] Find the partial derivative of the cost function, the specific equation is as follows:
[0049]
[0050] Make the partial derivatives of formula (6) and formula (7) both 0, and finally get a i and b i The solutions are shown in equations (8) and (9) respectively:
[0051]
[0052] Where |N i | for point q i The number of points in the neighborhood; For point q i The coordinate vector of the center point in the neighborhood, specifically point q i All points in the neighborhood including point q i The average value of the coordinate vector itself;
[0053] Step 4.3: The weight ω calculated in step 4.1 i Introducing the guided filter cost formula (8), we can get a i The latest calculation formula is as follows:
[0054]
[0055] The a calculated by formula (10) and formula (9) i and b i Substitute the value of into formula (4) to obtain the filtered point cloud data.
[0056] As a further improved technical solution of the present invention, the step 5 is specifically as follows:
[0057] Step 5.1: When the Gocator sensor moves to collect point cloud data, each time a frame of point cloud data is collected, steps 2 to 4 are repeated until the collection is completed, the Gocaotr sensor scanning platform is turned off, and all data filtering is completed.
[0058] As a further improved technical solution of the present invention, the step 6 is specifically as follows:
[0059] Step 6.1: During acquisition, use PLC to control the front-end data acquisition device to move at a speed of 10 mm / s along the X-axis on the ground rail, set the scanning rate of the Gocator sensor to match the moving speed along the X-axis, and collect a frame of point cloud data every 0.275 mm; assume that k frames of point cloud data are finally acquired, and the k frames of point cloud data are filtered through steps 2 to 4;
[0060] Step 6.2, assign the X value in each frame of the filtered point cloud data in the order of the collected time, that is, the X value of the first frame of the filtered point cloud data is 0, the X value of the second frame of the filtered point cloud data is 0.275, the X value of the third frame of the filtered point cloud data is 0.55, and so on, the X value of the kth frame of the filtered point cloud data is (k-1)*0.275;
[0061] Step 6.3. Finally, put all the point cloud data into a pcd file to obtain the final three-dimensional point cloud data of the object surface.
[0062] The beneficial effects of the present invention are:
[0063] (1) The present invention builds a Gocaotr sensor scanning platform and places multiple Gocator sensors on the scanning platform, so that it can adapt to objects of various sizes. Even if the object to be measured is large, it only needs to turn on multiple Gocator sensors at the same time to obtain complete three-dimensional data of the surface of the object to be measured.
[0064] (2) The Gocator sensor of the present invention can filter each frame of point cloud data it acquires, instead of having to wait until the sensor acquires the complete point cloud data before filtering. This method can greatly reduce computing costs and processing time, and can achieve real-time acquisition and filtering, thereby improving acquisition efficiency.
[0065] (3) The present invention designs a front-end data acquisition device. Before acquisition, the Gocator sensor can adjust the position of the Y-axis and Z-axis directions of the Gocator sensor according to the size of the object to be measured and actual needs, thereby adjusting the distance between the sensor and the object to be measured. After the position is adjusted, the number of Gocator sensors to be turned on can be selected according to the size of the object to be measured, and the internal parameters of the Gocator sensor can be set at the same time. The front-end data acquisition device can also move at a uniform speed along the X-axis direction on the ground rail driven by a motor to realize the acquisition of multi-frame point cloud data. Therefore, the present invention is suitable for the acquisition of various objects with different surface shapes and has good robustness.
[0066] (4) The present invention improves the guided filtering and introduces a self-set weight calculation formula, which is substituted into the guided filtering formula to solve problems such as over-smoothing caused by fixed filtering parameters. It achieves smoothing of the point cloud edges while reducing the degree of blunting of sharp features, which can better obtain the original three-dimensional features of the object surface and improve the accuracy of the acquired three-dimensional point cloud data. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 The following is the overall flow chart.
[0068] Figure 2 Schematic diagram of the scanning platform.
[0069] Figure 3 This is an example of a standard frame of raw point cloud data.
[0070] Figure 4 This is an example diagram of a frame of noisy point cloud data to be filtered collected by the Gocaotr sensor of the present invention.
[0071] Figure 5 In order to use the filtering algorithm of the present invention Figure 4 An example of point cloud data after filtering the point cloud in .
[0072] Figure 6A schematic diagram of the complete point cloud. DETAILED DESCRIPTION
[0073] The specific embodiments of the present invention are further described below according to the accompanying drawings:
[0074] A 3D point cloud filtering algorithm based on Gocator, the flow chart is as follows Figure 1 As shown, including:
[0075] Step 1: Build the Gocaotr sensor scanning platform, collect 3D point cloud data on the surface of the object to be tested, and record each frame of point cloud data;
[0076] Step 2: Calculate the neighborhood set of each frame of point cloud, and remove outliers based on the calculated neighborhood set;
[0077] Step 3: Based on the point cloud after removing outliers in step 2, calculate the curvature, normal vector and feature distance of each point in each frame of the point cloud;
[0078] Step 4: Based on the curvature, normal vector and feature distance calculated in step 3, introduce the weight calculation formula, substitute the calculated weight into the guided filtering cost formula, and perform guided filtering after weight allocation on each frame of point cloud;
[0079] Step 5: During the mobile acquisition process, each time a frame of point cloud data is obtained, steps 2 to 4 are repeated until the acquisition is completed;
[0080] Step 6: Arrange each frame of filtered data in the X-axis direction according to the parameters of the Gocaotr sensor and the acquisition rate, so as to obtain complete surface point cloud data of the object to be tested.
[0081] The step 1 is specifically as follows:
[0082] Step 1.1, design the front-end data acquisition equipment, including Figure 2 As shown, the front-end data acquisition device includes a sensor placement frame D, a Y-axis electric linear slide C and a Z-axis electric linear slide B; a plurality of Gocator sensors E are connected to the sensor placement frame D; the Y-axis electric linear slide C is connected to the Z-axis electric linear slide B and the motor in the Z-axis electric linear slide B is used to drive the Y-axis electric linear slide C to move along the Z-axis direction, the sensor placement frame D is connected to the Y-axis electric linear slide C and the motor in the Y-axis electric linear slide C is used to drive the sensor placement frame D to move along the Y-axis direction; and then the position of the Gocator sensor E is adjusted, thereby adjusting the distance between the Gocator sensor E and the object A to be measured.
[0083] Step 1.2, connect the front-end data acquisition device to the ground rail F, the ground rail F is extended along the X-axis direction, and a motor is installed on the ground rail F. The motor is used to drive the front-end data acquisition device to move at a uniform speed along the X-axis direction on the ground rail F; then build a Gocaotr sensor scanning platform; the motor can drive the front-end data acquisition device to move at a uniform speed along the X-axis direction on the ground rail F through a transmission chain, and the specific structural connection method adopts the existing technology.
[0084] Step 1.3. Adjust the position of Gocator sensor E according to the size of the object A to be measured through the Y-axis electric linear slide and the Z-axis electric linear slide. After the position is adjusted, select the number of Gocator sensors E to be turned on and set the internal parameters of Gocator sensor E.
[0085] Step 1.4, the Gocator sensor E in the Gocaotr sensor scanning platform starts to collect 3D point cloud data of the surface of the object to be measured. While the Gocator sensor E is collecting, the motor drives the front-end data acquisition device to move at a constant speed along the X-axis direction on the ground track; and records each frame of point cloud data collected.
[0086] The Gocaotr sensor scanning platform contains four servo motors, two of which are used to control the movement of the two linear slides in step 1.1, and the other two are used to control the front-end data acquisition device to move at a uniform speed along the X-axis direction. The servo motors are controlled by PLC to achieve the purpose of collecting three-dimensional point cloud data on the surface of the object to be measured, and each frame of point cloud data collected is recorded.
[0087] The multiple Gocator sensors E in step 1 are arranged vertically and spaced apart on the sensor placement rack D. The multiple Gocator sensors E collect point cloud data and send the data to the processing module for subsequent point cloud filtering processing in steps 2 to 6.
[0088] The step 2 is specifically as follows:
[0089] Step 2.1, when collecting the three-dimensional point cloud data of the surface of the object to be measured, calculate the neighborhood set of the frame of point cloud data collected in step 1, and construct a kd-tree to find the neighboring points within a specified radius around each point in the frame of point cloud data, and construct the neighborhood set of each point in the frame of point cloud data.
[0090] Step 2.2: After dividing the neighborhood of each point, since the X coordinates of each frame of point cloud data are the same, each frame of point cloud data can be regarded as a two-dimensional data point set, that is, {(y1,z1),(y2,z2),…,(y k ,z k )}.
[0091] Step 2.3: Set a threshold m, and consider the points whose number of points in the neighborhood set in a frame of point cloud data is less than m as outliers, and remove them.
[0092] The step 3 is specifically as follows:
[0093] Step 3.1: Assume that the frame of point cloud data after denoising in step 2 is q, calculate the curvature, normal vector and feature distance of all points in the point cloud data q, as shown in steps 3.1.1-3.1.3.
[0094] Step 3.1.1, the i-th point q in the point cloud data q i The characteristic distance for:
[0095]
[0096] Among them, |n i | indicates point q i The number of points in the neighborhood of i represents the i-th point in the point cloud data q, y(q i ) represents point q i The y coordinate of z(q i ) represents point q i The z coordinate, y(q ij ) represents point q i The jth point q in the neighborhood of ij The y coordinate of z(q ij ) represents point q i The jth point q in the neighborhood of ij The z coordinate, q ij ∈N i Represents the traversal point q i All points in the neighborhood.
[0097] Step 3.1.2, calculate the normal vector of the point. Since the X coordinate of each point is the same, the normal vector of the point is calculated using the neighborhood set of the point in two-dimensional space.
[0098] The i-th point q in the point cloud data q i The normal vector The calculation method is:
[0099] Point q i The neighborhood of and including point q i The discrete points of the spline are interpolated to obtain the spline interpolation curve. Then calculate the spline interpolation curve The first derivative of to obtain the point q i The tangent vector at point q i The tangent vector at point q is used to calculate the normal vector.i The normal vector
[0100] To facilitate subsequent calculations, the directions of the normal vectors of all points are set to point to the first quadrant or the second quadrant, or the directions of the normal vectors of all points are set to point to the third quadrant or the fourth quadrant.
[0101] Step 3.1.3: Interpolate the curve based on the spline The parametric equation of , using the numerical differentiation method to calculate the spline interpolation curve At point q i The first and second derivatives at point q i The first and second derivatives at point q are calculated. i The curvature of
[0102] Click q i The curvature value is calculated as:
[0103]
[0104] In the formula, k i Indicates point q i The curvature value at y′(q i ) represents the spline interpolation curve At point q i The first derivative value of the parametric equation y(q) at i ) represents the spline interpolation curve At point q i The first derivative value of the parametric equation z(q) at y′′(q i ) represents the spline interpolation curve At point q i The second-order derivative value of the parametric equation y(q) at i ) represents the spline interpolation curve At point q i The second derivative value of the parametric equation z(q) at .
[0105] The step 4 is specifically as follows:
[0106] Step 4.1: Based on the curvature, normal vector and feature distance of all points in the point cloud data q calculated in step 3, a weight calculation formula is introduced; point q i The corresponding weight ω i The calculation formula is:
[0107]
[0108] In the formula, α and β are constants, and ω can be adjusted by adjusting the value of α. i Take values within a certain range, For point q i The average distance to the points in its neighborhood, For point q i The average angle between the normal vector of the point and the normal vectors of the points in its neighborhood.
[0109] Step 4.2: Traditional point cloud guided filtering is inspired by guided filtering in image processing and applied to the field of three-dimensional point clouds. The guided filtering is introduced from the two-dimensional image to the three-dimensional point cloud using the position information of the points in the point cloud, and the noise point cloud is smoothed by filtering. This is a neighborhood-based point cloud filtering method. Assuming that the input point cloud data is q, and the output point cloud data after filtering is q′, the assumed linear model is:
[0110] q′ i =a i q i +b i (4);
[0111] In the formula, q i Represents the i-th point q in the point cloud data q i The coordinate vector, q′ i Represents the i-th point q in the point cloud data q′ output after filtering i ′ coordinate vector, a i and b i represents the coefficients of the linear model restricted to the neighborhood of the i-th point;
[0112] a can be obtained by minimizing the cost function i and b i The value of
[0113] The cost function is defined as follows:
[0114]
[0115] In the formula, q ij For point q i The coordinate vector of the jth point in the neighborhood, ∈ represents the filtering parameter; in order to prevent a i The value of is too large, so a filtering parameter ∈ is set to control the filtering effect.
[0116] Find the partial derivative of the cost function, the specific equation is as follows:
[0117]
[0118] Make the partial derivatives of formula (6) and formula (7) both 0, and finally get a i and b i The solutions are shown in equations (8) and (9) respectively:
[0119]
[0120] Where |N i | for point q i The number of points in the neighborhood; For point q i The coordinate vector of the center point in the neighborhood, specifically point q i All points in the neighborhood including point q i The average value of the coordinate vector itself.
[0121] Step 4.3: The weight ω calculated in step 4.1 i Introducing the guided filter cost formula (8), we can get a i The latest calculation formula is as follows:
[0122]
[0123] The a calculated by formula (10) and formula (9) i and b i Substitute the value of into formula (4), perform guided filtering after weight allocation on a frame of point cloud, and obtain the filtered point cloud data.
[0124] When i Feature distance of points When it is larger, it means that the probability that the point is a noise point is greater. At this time, the feature weight ω i The smoothing effect is significantly improved. i The smaller the curvature k of a point is, the smoother the point is, so the feature weight ω i Smaller, less smoothing effect. The purpose is to achieve better smoothing effect while retaining sharp features. When , it means that the point is more likely to be noise, then ω i along with increases with the increase of the smoothing force, and when When , it means that the probability that the point is a sharp feature point is greater, at this time ω i along with The increase of the value decreases, and the sharp features can be well preserved.
[0125] The step 5 is specifically as follows:
[0126] Step 5.1: When the Gocator sensor E moves to collect point cloud data, each time a frame of point cloud data is collected, steps 2 to 4 are repeated until the collection is completed, the Gocaotr sensor scanning platform is turned off, and all data filtering is completed.
[0127] The step 6 is specifically as follows:
[0128] Step 6.1. During acquisition, use PLC to control the operation of the motor set on the ground rail and then control the front-end data acquisition device to move at a speed of 10 mm / s along the X-axis direction on the ground rail. Set the scanning rate of Gocator sensor E to match the moving speed along the X-axis direction, and collect a frame of point cloud data every 0.275 mm. Assume that k frames of point cloud data are finally acquired, and the k frames of point cloud data are filtered through steps 2 to 4.
[0129] Step 6.2, assign the X value in each frame of the filtered point cloud data in the order of the collected time, that is, the X value of the first frame of the filtered point cloud data is 0, the X value of the second frame of the filtered point cloud data is 0.275, the X value of the third frame of the filtered point cloud data is 0.55, and so on. The X value of the kth frame of the filtered point cloud data is (k-1)*0.275.
[0130] Step 6.3. Finally, put all the point cloud data into a pcd file to obtain the final three-dimensional point cloud data of the object surface.
[0131] Figure 3 This is an example of a standard frame of raw point cloud data. Figure 4 This is an example of a frame of noisy point cloud data to be filtered. Figure 5 In order to use the method of the present invention Figure 4 An example of point cloud data after filtering the point cloud in . Figure 3 and Figure 5 ,It can be found that the filtered point cloud data is compared with the ,original point cloud data, and the similarity is very high, which is closer to the original ,state of the object, and greatly improves the acquisition accuracy.
[0132] The present invention builds a Gocaotr sensor scanning platform, and places multiple Gocator sensors E on the scanning platform, so that it can adapt to objects to be measured of various sizes. Even if the size of the object to be measured is large, it only needs to turn on multiple sensors at the same time to obtain complete three-dimensional data of the surface of the object to be measured; the Gocator sensor E of the present invention performs filtering processing on each frame of point cloud data obtained, instead of waiting for the sensor to obtain complete point cloud data before performing filtering processing. This method can greatly reduce computing costs and processing time, can realize real-time acquisition and filtering, and improves acquisition efficiency; the present invention improves guided filtering, introduces a self-set weight calculation formula, substitutes it into the guided filtering formula, solves the problem of over-smoothing caused by fixed filtering parameters, and realizes smoothing of point cloud edges while reducing the degree of passivation of sharp features, can better obtain the original three-dimensional features of the object surface, and improves the accuracy of the acquired three-dimensional point cloud data.
[0133] The protection scope of the present invention includes but is not limited to the above embodiments. The protection scope of the present invention shall be based on the claims. Any replacement, deformation, and improvement of the technology that can be easily thought of by technicians in this field shall fall within the protection scope of the present invention.
Claims
1. A point cloud filtering algorithm based on Gocator, characterized in that: include: Step 1: Build the Gocaotr sensor scanning platform, collect 3D point cloud data on the surface of the object to be tested, and record each frame of point cloud data; Step 2: Calculate the neighborhood set of each frame of point cloud, and remove outliers based on the calculated neighborhood set; Step 3: Based on the point cloud after removing outliers in step 2, calculate the curvature, normal vector and feature distance of each point in each frame of the point cloud; Step 4: Based on the curvature, normal vector and feature distance calculated in step 3, introduce the weight calculation formula, substitute the calculated weight into the guided filtering cost formula, and perform guided filtering after weight allocation on each frame of point cloud; Step 5: During the mobile acquisition process, each time a frame of point cloud data is obtained, steps 2 to 4 are repeated until the acquisition is completed; Step 6: Arrange each frame of filtered data in the X-axis direction according to the parameters of the Gocaotr sensor and the acquisition rate, so as to obtain complete surface point cloud data of the object to be tested.
2. The Gocator-based point cloud filtering algorithm according to claim 1, characterized in that: The step 1 is specifically as follows: Step 1.1, design a front-end data acquisition device, wherein the front-end data acquisition device includes a sensor placement frame, a Y-axis electric linear slide and a Z-axis electric linear slide; a plurality of Gocator sensors are connected to the sensor placement frame; the Y-axis electric linear slide is connected to the Z-axis electric linear slide and the motor in the Z-axis electric linear slide is used to drive the Y-axis electric linear slide to move along the Z-axis direction, the sensor placement frame is connected to the Y-axis electric linear slide and the motor in the Y-axis electric linear slide is used to drive the sensor placement frame to move along the Y-axis direction; and then adjust the position of the Gocator sensor, thereby adjusting the distance between the Gocator sensor and the object to be measured; Step 1.2, connect the front-end data acquisition device to the ground rail, the ground rail is extended along the X-axis direction, a motor is installed on the ground rail, and the motor is used to drive the front-end data acquisition device to move at a uniform speed along the X-axis direction on the ground rail; and then build a Gocaotr sensor scanning platform; Step 1.
3. Adjust the position of the Gocator sensor according to the size of the object to be measured through the Y-axis electric linear slide and the Z-axis electric linear slide. After the position is adjusted, select the number of Gocator sensors to be turned on and set the internal parameters of the Gocator sensor. Step 1.4: The Gocator sensor in the Gocaotr sensor scanning platform starts to collect 3D point cloud data on the surface of the object to be measured. While the Gocator sensor is collecting data, the motor drives the front-end data acquisition device to move at a constant speed along the X-axis direction on the ground track; each frame of point cloud data collected is recorded.
3. The Gocator-based point cloud filtering algorithm according to claim 2, characterized in that: The multiple Gocator sensors in step 1 are arranged vertically and at intervals on the sensor placement rack.
4. The Gocator-based point cloud filtering algorithm according to claim 1, characterized in that: The step 2 is specifically as follows: Step 2.1, when collecting the three-dimensional point cloud data of the surface of the object to be measured, the neighborhood set is calculated for the frame of point cloud data collected in step 1, and the neighboring points within a specified radius around each point in the frame of point cloud data are found by constructing a kd-tree to construct a neighborhood set for each point in the frame of point cloud data; Step 2.2: After dividing the neighborhood of each point, since the X coordinate of each frame of point cloud data is the same, each frame of point cloud data is regarded as a two-dimensional data point set containing Y-axis coordinates and Z-axis coordinates, that is, {(y1, z1), (y2, z2), ..., (y k , z k )}; Step 2.3: Set a threshold m, and consider the points whose number of points in the neighborhood set in a frame of point cloud data is less than m as outliers, and remove them.
5. The Gocator-based point cloud filtering algorithm according to claim 1, characterized in that: The step 3 is specifically as follows: Step 3.1, assuming that the frame of point cloud data after denoising in step 2 is q, calculate the curvature, normal vector and feature distance of all points in the point cloud data q; Step 3.1.1, the i-th point q in the point cloud data q i The characteristic distance for: Among them, |N i | indicates point q i The number of points in the neighborhood of i represents the i-th point in the point cloud data q, y(q i ) represents point q i The y coordinate of z(q i ) represents point q i The z coordinate, y(q ij ) represents point q i The jth point q in the neighborhood of ij The y coordinate of z(q ij ) represents point q i The jth point q in the neighborhood of ij The z coordinate, q ij ∈N i Represents the traversal point q i All points in the neighborhood; Step 3.1.2, calculate the normal vector of the point. Since the X coordinate of each point is the same, the normal vector of the point is calculated using the neighborhood set of the point in two-dimensional space. The i-th point q in the point cloud data q i The normal vector The calculation method is: Point q i The neighborhood of and including point q i The discrete points of the spline are interpolated to obtain the spline interpolation curve. Then calculate the spline interpolation curve The first derivative of to obtain the point q i The tangent vector at point q i The tangent vector at point q is used to calculate the normal vector. i The normal vector Set the direction of the normal vectors of all points to point to the first quadrant or the second quadrant, or set the direction of the normal vectors of all points to point to the third quadrant or the fourth quadrant; Step 3.1.3: Interpolate the curve based on the spline The parametric equation of , using the numerical differentiation method to calculate the spline interpolation curve At point q i The first and second derivatives at point q i The first and second derivatives at point q are calculated. i The curvature of Click q i The curvature value is calculated as: In the formula, k i Indicates point q i The curvature value at y′(q i ) represents the spline interpolation curve At point q i The first derivative value of the parametric equation y(q) at i ) represents the spline interpolation curve At point q i The first derivative value of the parametric equation z(q) at y″(q i ) represents the spline interpolation curve At point q i The second derivative value of the parametric equation y(q) at i ) represents the spline interpolation curve At point q i The second derivative value of the parametric equation z(q) at .
6. The Gocator-based point cloud filtering algorithm according to claim 1, characterized in that: The step 4 is specifically as follows: Step 4.1: Based on the curvature, normal vector and feature distance of all points in the point cloud data q calculated in step 3, a weight calculation formula is introduced; point q i The corresponding weight ω i The calculation formula is: In the formula, α and β are constants, and ω can be adjusted by adjusting the value of α. i Take values within a certain range. For point q i The average distance to the points in its neighborhood, For point q i The average angle between the normal vector of and the normal vectors of the points in its neighborhood; Step 4.2: Assuming that the input point cloud data is q, and the output point cloud data after filtering is q′, the assumed linear model is: q′ i =a i q i +b i (4); In the formula, q i Represents the i-th point q in the point cloud data q i The coordinate vector, q′ i Represents the i-th point q′ in the point cloud data q′ output after filtering i The coordinate vector of i and b i represents the coefficients of the linear model restricted to the neighborhood of the i-th point; By minimizing the cost function, we can obtain a i and b i The value of The cost function is defined as follows: In the formula, q ij For point q i The coordinate vector of the jth point in the neighborhood, ∈ represents the filtering parameters; Find the partial derivative of the cost function, the specific equation is as follows: Make the partial derivatives of formula (6) and formula (7) both 0, and finally get a i and b i The solutions are shown in equations (8) and (9) respectively: Where |N i | for point q i The number of points in the neighborhood; For point q i The coordinate vector of the center point in the neighborhood, specifically point q i All points in the neighborhood including point q i The average value of the coordinate vector itself; Step 4.3: The weight ω calculated in step 4.1 i Introducing the guided filter cost formula (8), we can get a i The latest calculation formula is as follows: The a calculated by formula (10) and formula (9) i and b i Substitute the value of into formula (4) to obtain the filtered point cloud data.
7. The Gocator-based point cloud filtering algorithm according to claim 1, characterized in that: The step 5 is specifically as follows: Step 5.1: When the Gocator sensor moves to collect point cloud data, each time a frame of point cloud data is collected, steps 2 to 4 are repeated until the collection is completed, the Gocaotr sensor scanning platform is turned off, and all data filtering is completed.
8. The Gocator-based point cloud filtering algorithm according to claim 1, characterized in that: The step 6 is specifically as follows: Step 6.1: During acquisition, use PLC to control the front-end data acquisition device to move at a speed of 10 mm / s along the X-axis on the ground rail, set the scanning rate of the Gocator sensor to match the moving speed along the X-axis, and collect a frame of point cloud data every 0.275 mm; assume that k frames of point cloud data are finally acquired, and the k frames of point cloud data are filtered through steps 2 to 4; Step 6.2, assign the X value in each frame of the filtered point cloud data in the order of the collected time, that is, the X value of the first frame of the filtered point cloud data is 0, the X value of the second frame of the filtered point cloud data is 0.275, the X value of the third frame of the filtered point cloud data is 0.55, and so on, the X value of the kth frame of the filtered point cloud data is (k-1)*0.275; Step 6.
3. Finally, put all the point cloud data into a pcd file to obtain the final three-dimensional point cloud data of the object surface.
Citation Information
Patent Citations
Filtering method for cast pipe surface three-dimensional point cloud data
CN117274102A
Sonar image denoising method based on adaptive combined filtering
CN117422622A
Passenger car side wall plate flatness detection method based on three-dimensional point cloud and contour matching
CN117934429A