Point cloud normal determination method and device based on secondary voting and electronic equipment

Through the method based on quadratic voting, combining different normal determination methods to determine the accuracy of the result and redetermine the neighborhood range, the problem of inaccurate normal calculation in the prior art is solved, and the normal vector accuracy of three-dimensional points in the artifact point cloud is improved.

CN120451193APending Publication Date: 2025-08-08FAIR INNOVATION (SUZHOU) ROBOTIC SYSTEM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510522969.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-24
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing point cloud normal calculation method is low when the normal vector is located at or near the intersection of two planes and at points at three planes in the workpiece point cloud.

Method used

The method based on quadratic voting is adopted to judge the accuracy of the normal determination result through two different normal determination methods, and the neighborhood range of the three-dimensional points is re-determined when it is inaccurate, and the normal vector is re-determined based on the three-dimensional points within the neighborhood range.

Benefits of technology

The accuracy of the three-dimensional point normal vector in the workpiece point cloud is improved, especially the normal calculation accuracy of points at or near complex structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451193A_ABST
    Figure CN120451193A_ABST
Patent Text Reader

Abstract

The invention provides a point cloud normal determination method and device based on secondary voting and electronic equipment, and the method comprises the steps: obtaining a workpiece point cloud of a target workpiece, and employing two different normal determination modes to obtain the normal vectors of three-dimensional points in the workpiece point cloud respectively for each three-dimensional point in the workpiece point cloud; and judging whether the normal determination result of the three-dimensional point is accurate or not based on the two obtained normal vectors. And under the condition that the normal determination result of the three-dimensional point is inaccurate, re-determining the neighborhood range of the three-dimensional point, and re-determining the normal vector of the three-dimensional point by adopting a voting mechanism based on the three-dimensional point in the neighborhood range. In the scheme, whether the normal determination result is accurate or not is judged by combining the normal vectors obtained by different normal determination modes, under the condition that the normal determination result is not accurate, the neighborhood range of the three-dimensional point is determined again, and then the normal vector of the three-dimensional point is determined again, so that the problem that the normal vector of the three-dimensional point in the workpiece point cloud is not accurate can be avoided, and the normal vector accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of point cloud processing, and in particular to a method, device and electronic device for determining a point cloud normal based on quadratic voting. Background Art

[0002] When processing workpiece point clouds, for example, determining planes within a workpiece point cloud, it's often necessary to determine the normal vectors of points within the cloud. Common methods for determining point normals include principal component analysis (PCA) and the Hough method, both of which can calculate the normal vectors of points in a workpiece point cloud.

[0003] However, in actual scenarios, for points in the workpiece point cloud that are located at or near the intersection of two surfaces, or at or near the broken line of three surfaces, when using the existing normal vector calculation method, since the neighborhood of such points contains points on different surfaces, the final determined normal vector is different from the actual normal of the surface where the point is located, and the determined normal vector has low accuracy. Summary of the Invention

[0004] The purpose of the embodiments of the present invention is to provide a method, device and electronic device for determining the normal direction of a point cloud based on quadratic voting, so as to improve the accuracy of normal vector determination.

[0005] In a first aspect, the present invention provides a method for determining a point cloud normal based on quadratic voting, the method comprising:

[0006] Obtaining a workpiece point cloud of a target workpiece, wherein the workpiece point cloud includes a plurality of three-dimensional points;

[0007] For each of the three-dimensional points, two different normal direction determination methods are used to respectively obtain the normal vector of the three-dimensional point;

[0008] Determining whether a normal determination result of the three-dimensional point is accurate based on the two obtained normal vectors;

[0009] If the normal determination result of the 3D point is inaccurate, re-determine the neighborhood range of the 3D point, wherein the proportion of 3D points in the re-determined neighborhood range that are on the same plane as the 3D point is greater than the proportion of 3D points that are not on the same plane as the 3D point;

[0010] A voting mechanism is adopted based on the three-dimensional points within the neighborhood to re-determine the normal vector of the three-dimensional point.

[0011] In an optional embodiment, the step of determining whether the normal determination result of the three-dimensional point is accurate based on the two obtained normal vectors includes:

[0012] Calculate the vector product between the two normal vectors obtained;

[0013] Detect whether the modulus of the vector product is greater than a first preset threshold. If the modulus of the vector product is greater than the first preset threshold, determine that the normal vector result of the three-dimensional point is inaccurate. If the modulus of the vector product is less than or equal to the first preset threshold, determine that the normal vector result of the three-dimensional point is accurate.

[0014] In an optional embodiment, the step of re-determining the neighborhood range of the three-dimensional point includes:

[0015] Constructing a cylinder based on the three-dimensional points and according to a preset radius, wherein the preset radius is determined based on a minimum allowable width of a mid-surface of the workpiece;

[0016] For each other three-dimensional point in the workpiece point cloud except the three-dimensional point, detect whether the other three-dimensional point is within the constructed cylinder. If the other three-dimensional point is within the cylinder, add the other three-dimensional point to the neighborhood range of the three-dimensional point.

[0017] In an optional embodiment, the step of constructing a cylinder based on the three-dimensional points and according to a preset radius includes:

[0018] Obtaining a vector product between the two normal vectors, and determining an edge direction of the three-dimensional point according to the vector product;

[0019] A cylinder is constructed based on a preset radius with the edge direction as the axial direction and the three-dimensional point as a point on the axis.

[0020] In an optional embodiment, the step of detecting whether the other three-dimensional points are within the constructed cylinder includes:

[0021] Calculating a difference vector between the other three-dimensional point and the three-dimensional point;

[0022] Calculating a relative distance based on the difference vector and the vector product;

[0023] Detect whether the relative distance is less than a second preset threshold; if so, determine that the other three-dimensional points are in the constructed cylinder, wherein the second preset threshold is constructed based on the preset radius.

[0024] In an optional embodiment, the step of re-determining the normal vector of the three-dimensional point using a voting mechanism based on the three-dimensional points within the neighborhood includes:

[0025] Randomly selecting at least three three-dimensional points from the neighborhood each time, and constructing a plane based on the selected three-dimensional points;

[0026] Calculate the normal vector of the constructed plane and obtain the vector parameters of the normal vector. When the same vector parameters are obtained, increase the number of votes for the corresponding normal vector by 1;

[0027] When a preset condition is met, voting is stopped, and the normal vector of the three-dimensional point is determined based on the number of votes for each normal vector.

[0028] In an optional embodiment, the step of stopping voting when a preset condition is met includes:

[0029] Sort the number of votes for each normal vector in descending order;

[0030] When the difference between the maximum and the second largest number of votes counted is greater than a preset value, it is determined that the preset condition is met and voting is stopped.

[0031] In an optional embodiment, the step of determining the normal vector of the three-dimensional point based on the number of votes of each normal vector includes:

[0032] Get the vector parameter of the normal vector with the largest number of votes;

[0033] The normal vector of the three-dimensional point is determined based on the vector parameter of the normal vector with the largest number of votes.

[0034] In a second aspect, the present invention provides a point cloud normal determination device based on quadratic voting, the device comprising:

[0035] A first acquisition module is used to obtain a workpiece point cloud of a target workpiece, wherein the workpiece point cloud includes a plurality of three-dimensional points;

[0036] A second obtaining module is configured to obtain, for each of the three-dimensional points, a normal vector of the three-dimensional point using two different normal determination methods;

[0037] A judgment module, configured to judge whether a normal determination result of the three-dimensional point is accurate based on the two obtained normal vectors;

[0038] The determination module is used to redetermine the neighborhood range of the three-dimensional point when the normal determination result of the three-dimensional point is inaccurate, and to redetermine the normal vector of the three-dimensional point using a voting mechanism based on the three-dimensional points in the neighborhood range.

[0039] In a third aspect, the present invention provides an electronic device comprising one or more storage media and one or more processors communicating with the storage media, wherein the one or more storage media store machine-executable instructions executable by the processor. When the electronic device is running, the processor executes the machine-executable instructions to execute the method described in any one of the aforementioned embodiments.

[0040] The present invention provides a point cloud normal determination method, device and electronic device based on quadratic voting. After obtaining the workpiece point cloud of the target workpiece, two different normal determination methods are used to obtain the normal vectors of the three-dimensional points for each three-dimensional point in the workpiece point cloud. Whether the normal determination result of the three-dimensional point is accurate is judged based on the two normal vectors obtained. In the case that the normal determination result of the three-dimensional point is inaccurate, the neighborhood range of the three-dimensional point is re-determined, and the normal vector of the three-dimensional point is re-determined based on the three-dimensional points within the neighborhood range. In this solution, the normal vectors obtained by combining different normal determination methods are used to judge whether the normal determination result is accurate. In the case of inaccuracy, the neighborhood range of the three-dimensional point is re-determined and then the normal vector of the three-dimensional point is re-determined. This can avoid the problem of inaccuracy of the normal vector of the three-dimensional point in the workpiece point cloud and improve the accuracy of the normal vector. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.

[0042] Figure 1 This is a schematic diagram of a point near the intersection line of two surfaces;

[0043] Figure 2 It is a schematic diagram showing that a point is near three polygonal lines;

[0044] Figure 3 is a schematic diagram of the point cloud;

[0045] Figure 4 A schematic diagram of a normal vector determined using an existing PCA algorithm;

[0046] Figure 5 A schematic diagram of a normal vector determined using an existing Hough voting algorithm;

[0047] Figure 6 A flowchart of a method for determining a point cloud normal based on quadratic voting provided in an embodiment of the present invention;

[0048] Figure 7 for Figure 6 Flowchart of the sub-steps included in S13;

[0049] Figure 8 for Figure 6 Flowchart of the sub-steps included in S14;

[0050] Figure 9 for Figure 8Flowchart of the sub-steps included in S141;

[0051] Figure 10 This is a schematic diagram of the normal vector results of points near the intersection line of two surfaces;

[0052] Figure 11 Schematic diagram of the normal vector results of points near the three face polylines;

[0053] Figure 12 for Figure 8 Flowchart of the sub-steps included in S142;

[0054] Figure 13 for Figure 6 Flowchart of the sub-steps included in S15;

[0055] Figure 14 A functional module block diagram of a point cloud normal determination device based on quadratic voting provided by an embodiment of the present invention;

[0056] Figure 15 This is a structural block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0057] The existing point cloud normal calculation methods mainly include PCA decomposition method and Hough voting method. In the PCA decomposition method, for the i-th point p in the point cloud, i , use KD tree to find the neighborhood of the point, recorded as N i . Calculate point p based on points in the neighborhood i The covariance matrix of the covariance matrix is decomposed into eigenvalues, and the eigenvector corresponding to the minimum eigenvalue is taken as p i In the Hough voting method, multiple points are selected in the neighborhood of a point each time, the normals of the plane passing through the multiple points are calculated, voting is performed in the normal direction, and the above voting process is repeated. When the normal with the maximum number of votes meets certain requirements, the normal with the maximum number of votes is used as the point p. i Normal direction.

[0058] The two existing normal calculation methods mentioned above each have certain disadvantages. For example, in the first type of normal calculation method mentioned above, when a point is at the intersection or near the intersection of two or more surface structures, the normal calculation result of the point may be inaccurate. Figure 1 As shown in , when a point is at the intersection of two planes, the normal of the point will deviate from the plane where the point is located and the plane intersecting the plane. This is because the essence of PCA decomposition is to iWhen a point's neighborhood is fitted with a plane, if it is at or near the intersection of two planes, the point's neighborhood includes points on both planes. In this case, the plane fitted to the neighborhood may differ from the plane the point is located on, resulting in deviations in the normal calculation results.

[0059] Combine Figure 3 Shown is the input point cloud, which consists of two closely spaced planes and a cylindrical surface. Figure 4 This is the result of normal calculation using the PCA decomposition method. It can be seen that the normal calculation results are inaccurate at the intersection of surface structures.

[0060] The second type of normal calculation method mentioned above can solve the problem of calculating the normal when the point is at the intersection of two surface structures, but it is difficult to solve the problem of calculating the normal when the point is at or near the broken line of three surface structures (such as Figure 2 The normal calculation problem of (shown in ).

[0061] When point p i When the second plane is located in the three planes and the second plane has a very small height, the voting algorithm is used to calculate the point p i Normal direction, may get wrong normal calculation result. Because point p i The neighborhood of contains points on three planes at the same time, and the points on the first and third planes are in the majority. i The points on the plane where the point is located are in the minority. When voting at this time, more votes will be accumulated in the upward direction, so point p i The normal calculation result is upward, which is consistent with point p i The actual normal direction of the plane does not match.

[0062] Combine Figure 5 The calculation results obtained using the second type of normal calculation method are shown. It can be seen that the normal calculation results of the points on the cylinder are incorrect. The normal of the points on the cylinder is the same as the normal of the adjacent plane and is not perpendicular to the cylinder.

[0063] Based on the above research findings, in order to solve the problems existing in the above-mentioned prior art, the present invention provides a point cloud normal determination method based on quadratic voting, which judges whether the normal determination result is accurate by combining the normal vectors obtained by different normal determination methods. In the case of inaccuracy, the neighborhood range of the three-dimensional point is re-determined and then the normal vector of the three-dimensional point is re-determined. This can avoid the problem of inaccuracy of the normal vector of the three-dimensional point in the workpiece point cloud and improve the accuracy of the normal vector.

[0064] The technical solutions in the embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention.

[0065] See also Figure 6The following is a flowchart of a method for determining a point cloud normal based on quadratic voting, provided in an embodiment of the present invention. This method can be performed by a device for determining a point cloud normal based on quadratic voting. This device can be implemented using software and / or hardware and can be configured in an electronic device, such as a computer, server, or tablet computer. The detailed steps of this method are described below.

[0066] S11 , obtaining a workpiece point cloud of a target workpiece, wherein the workpiece point cloud includes a plurality of three-dimensional points.

[0067] S12: For each of the three-dimensional points, two different normal direction determination methods are used to respectively obtain the normal vector of the three-dimensional point.

[0068] S13: judging whether the normal direction determination result of the three-dimensional point is accurate based on the two obtained normal vectors.

[0069] S14, when the normal determination result of the three-dimensional point is inaccurate, re-determine the neighborhood range of the three-dimensional point, wherein the proportion of three-dimensional points in the re-determined neighborhood range that are on the same plane as the three-dimensional point is greater than the proportion of three-dimensional points that are not on the same plane as the three-dimensional point.

[0070] S15: Re-determine the normal vector of the three-dimensional point by using a voting mechanism based on the three-dimensional points within the neighborhood.

[0071] In this embodiment, the workpiece point cloud can be obtained by taking an image of the target workpiece using a depth camera, and obtaining the workpiece point cloud of the target workpiece based on the depth image obtained by the capture. The workpiece point cloud may include two intersecting surfaces, or three intersecting surfaces. Therefore, the three-dimensional points included in the workpiece point cloud may include points located at the intersection or near the intersection of two intersecting surfaces, and points at the intersection or near the intersection of three intersecting surfaces. The normal of such points has low accuracy when using existing normal calculation methods, and does not match the actual normal of the surface where the point is located. The determination method provided in this embodiment can improve the accuracy of the normal of the point, and in particular can improve the accuracy of the normal of such points located at or near the intersection of two surfaces, or at or near the intersection of three surfaces.

[0072] For any 3D point in the workpiece point cloud, the following solution will focus on the processing of 3D points at or near the intersection of two surfaces, or at or near the intersection of three surfaces as an example.

[0073] For a three-dimensional point, two different normal determination methods can be used to obtain the normal vector of the three-dimensional point. The two different normal determination methods can be the commonly used PCA decomposition method and the Hough voting method.

[0074] By comparing the normal vectors obtained by the two normal determination methods, it is possible to determine whether the normal determination results of the three-dimensional point are accurate. It can be understood that by comparing the normal vectors obtained by the two normal determination methods, the position of the three-dimensional point can be determined. For example, if the normal vectors obtained by the two normal determination methods are not much different, it indicates that the three-dimensional point is in a flat area, rather than at or near the intersection. If the normal vectors obtained by the two normal determination methods are very different, it indicates that the three-dimensional point is likely to be at the intersection or near the intersection of two planes, or at the intersection or near the intersection of three planes.

[0075] On the other hand, if a 3D point is located at or near the intersection of two planes, or at or near the intersection of three planes, then based on the above analysis, the normals calculated using conventional normal calculation methods are inaccurate. Therefore, by comparing the two normal vectors obtained, we can determine whether the normal vector of the 3D point is accurate.

[0076] If the normal determination result of a 3D point is inaccurate, it is most likely because the 3D point is at or near the intersection, resulting in its neighborhood containing 3D points in two or three planes, and the proportion of 3D points in planes other than the plane itself is even greater, thus resulting in inaccurate normal determination result of the 3D point.

[0077] Based on this, in this embodiment, the neighborhood of a 3D point is redefined, and a voting mechanism is used based on the 3D points within this redefined neighborhood to re-determine the normal vector of the 3D point. This redefined neighborhood must ensure that a larger proportion of the 3D points within it are on the same plane as the targeted 3D point, thereby ensuring that the normal vector determined based on this larger proportion of 3D points has a higher accuracy.

[0078] The point cloud normal determination solution based on quadratic voting provided in this embodiment combines the normal vectors obtained by different normal determination methods to determine whether the normal determination result is accurate. In the case of inaccuracy, the neighborhood range of the three-dimensional point is re-determined and then the normal vector of the three-dimensional point is re-determined. This can avoid the problem of inaccurate normal vectors of three-dimensional points in the workpiece point cloud and improve the accuracy of normal vectors.

[0079] In this embodiment, when the PCA algorithm and the Hough algorithm are first used to calculate the normal direction of a 3D point, the normal vectors calculated respectively can be recorded as normal_pca and normal_hough. In actual implementation, i is used to traverse the workpiece point cloud. When i is less than or equal to the number of 3D points in the workpiece point cloud, the normal vector determined by the PCA algorithm and the Hough voting algorithm for point i is obtained, that is, n i,PCA =normal_pca(i),n i,Hough=normal_hough(i).

[0080] See also Figure 7 , when judging whether the normal direction of a 3D point is accurate based on the two normal vectors obtained, this can be achieved in the following ways:

[0081] S131, calculating the vector product between the two normal vectors obtained.

[0082] S132, detect whether the modulus of the vector product is greater than a first preset threshold value. If the modulus of the vector product is greater than the first preset threshold value, execute the following step S133; if the modulus of the vector product is less than or equal to the first preset threshold value, execute the following step S134.

[0083] S133: Determine whether the normal vector result of the three-dimensional point is inaccurate.

[0084] S134: Determine whether the normal vector result of the three-dimensional point is accurate.

[0085] In this embodiment, for point i, the two normal vectors obtained are n i,PCA 、n i,Hough In the case of i Calculated by the following formula:

[0086] c i =n i, PCA×n i, H oug h

[0087] The modulus of the vector product is then compared to a first preset threshold, which can be determined in advance through experimentation. If the modulus of the vector product is greater than the first preset threshold, it indicates that the PCA normal and the Hough normal of the current 3D point have a significant angle, meaning that the current 3D point may be at or near the intersection. In this case, it can be determined that the normal vector result for the 3D point is inaccurate, meaning that both the normal vectors determined by the current PCA algorithm and the Hough algorithm are inaccurate.

[0088] If the current 3D point is in a flat area, the PCA normal and the Hough normal of the 3D point have very similar orientations. In this case, the magnitude of their vector product is small, for example, less than or equal to a first preset threshold. In this case, the normal determination result for the 3D point can be determined to be accurate, and any normal vector can be selected as the normal vector for the 3D point. For example, the normal vector obtained by the Hough algorithm can be selected as the normal vector for the 3D point.

[0089] See also Figure 8When the normal direction of a 3D point is not determined accurately, the steps to redefine the neighborhood range of the 3D point can be achieved by the following methods:

[0090] S141 : constructing a cylinder based on the three-dimensional points and according to a preset radius, wherein the preset radius is determined based on a minimum allowable width of a mid-surface of the workpiece.

[0091] S142, for each other three-dimensional point in the workpiece point cloud except the three-dimensional point, detect whether the other three-dimensional point is within the constructed cylinder. If the other three-dimensional point is within the cylinder, execute the following step S143; if the other three-dimensional point is not within the cylinder, execute the following step S144.

[0092] S143: Add the other three-dimensional points to the neighborhood range of the three-dimensional point.

[0093] S144: Skip the other three-dimensional points and execute the judgment of the next other three-dimensional point.

[0094] In workpieces with two or three intersecting surfaces, the width of the surface is limited and cannot be too small. For example, in a structure consisting of two planes and a cylinder, the width (i.e., height) of the cylinder should not be too small. Therefore, each workpiece generally has a minimum allowable width for each surface.

[0095] When reconstructing the neighborhood of a 3D point, a cylinder can be constructed based on the 3D point. The radius of the cylinder is determined by the minimum allowable width, that is, a cylindrical range is constructed around the 3D point. Other 3D points in the workpiece point cloud, other than the current 3D point, that are within the cylinder can be considered within the neighborhood of the current 3D point. However, if other 3D points are not within the cylinder, they are not considered within the neighborhood of the current 3D point.

[0096] By setting a preset radius based on the minimum allowable width of the workpiece mid-surface, and constructing a cylinder with the preset radius and three-dimensional points, and then reconstructing the neighborhood range of the current three-dimensional point with the three-dimensional points in the cylinder, it is ensured that the majority of the three-dimensional points in the reconstructed neighborhood range are on the same surface as the current three-dimensional point, thereby ensuring that the subsequent normals obtained based on the three-dimensional points in the neighborhood range are basically consistent with the actual normals of the surface where the current three-dimensional point is located.

[0097] See also Figure 9 In this embodiment, when constructing a cylinder based on three-dimensional points and according to a preset radius, it can be achieved in the following ways:

[0098] S1411: Obtain a vector product between the two normal vectors, and determine an edge direction of the three-dimensional point according to the vector product.

[0099] S1412: construct a cylinder based on a preset radius, taking the edge direction as the axial direction and the three-dimensional point as a point on the axis.

[0100] In this embodiment, assuming the current 3D point is near an intersection line, the normal vector obtained by the PCA algorithm points away from the normal of the surface on which the current 3D point lies, while the normal vector obtained by the Hough method points upward. The direction of the normal product between the two normal vectors is perpendicular to both the normal vectors obtained by the PCA algorithm and the normal vector obtained by the Hough algorithm. The direction of this product is the edge direction of the current 3D point, and the edge direction is the direction of the intersection line adjacent to the current 3D point.

[0101] exist Figure 10 Given in p i When a point is located at the intersection of two planes, the normal vector of the point under the PCA algorithm deviates from p i The direction of the plane where the point is located, and perpendicular to p i The edge direction of the point c i , the normal vector obtained by the Hough algorithm points upward, so the direction of the vector product of the two is along p i The edge direction of the point. Figure 11 Given in p i When a point is located at three plane polylines, the normal vector of the point under the PCA algorithm deviates from p i The normal to the plane where the point lies, and perpendicular to p i The edge direction of the point, the normal vector under the Hough algorithm is upward, so the vector product of the two is still along p i The edge direction of the point.

[0102] On this basis, the edge direction is used as the axial direction of the cylinder, the current three-dimensional point is used as a point on the axis, and a cylinder is constructed according to a preset radius.

[0103] See also Figure 12 On the basis of constructing the cylinder, when detecting whether other 3D points in the workpiece point cloud are within the constructed cylinder, this can be achieved by the following methods:

[0104] S1421: Calculate the difference vector between the other three-dimensional point and the three-dimensional point.

[0105] S1422: Calculate a relative distance based on the difference vector and the vector product.

[0106] S1423, detect whether the relative distance is less than a second preset threshold, if it is less than the second preset threshold, execute the following step S1424, if it is greater than or equal to the second preset threshold, execute the following step S1425.

[0107] S1424: Determine whether the other three-dimensional points are within the constructed cylinder, wherein the second preset threshold is constructed based on the preset radius.

[0108] S1425: Determine that the other three-dimensional points are not within the constructed cylinder.

[0109] In this embodiment, the current three-dimensional point is denoted as p i , use j to traverse the neighborhood of the current 3D point, and for other traversed 3D points p j , calculate the difference vector p between the two diff =p j -p i , based on the obtained difference vector and vector product, the relative distance d is calculated according to the following formula:

[0110] d=|p diff -(p diff c i )c i |

[0111] Then, it is determined whether the relative distance is less than a second preset threshold value, which is the preset radius of the cylinder. If the relative distance is less than the second preset threshold value, it indicates that the other 3D point is within the cylinder; otherwise, the other 3D point is not within the cylinder.

[0112] In this embodiment, during actual implementation, the initial neighborhood range of the current three-dimensional point can be first determined using a KD tree search method for the current three-dimensional point, and then whether to add each other three-dimensional point to the neighborhood range of the current three-dimensional point can be determined according to the above method. In this way, the final neighborhood range of the current three-dimensional point is obtained.

[0113] See also Figure 13 , in the case of reconstructing the neighborhood range, the step of re-determining the normal vector of the 3D point using a voting mechanism based on the 3D points in the neighborhood range can be achieved by the following method:

[0114] S151 , randomly selecting at least three three-dimensional points from the neighborhood each time, and constructing a plane based on the selected three-dimensional points.

[0115] S152, calculating the normal vector of the constructed plane and obtaining the vector parameters of the normal vector, and when the same vector parameters are obtained, increasing the number of votes for the corresponding normal vector by 1.

[0116] S153: Stop voting if a preset condition is met, and determine the normal vector of the three-dimensional point based on the number of votes for each normal vector.

[0117] In this embodiment, the normal direction of the current 3D point is determined by performing multiple votes based on its neighborhood. During each vote, at least three 3D points are randomly selected from the neighborhood, for example, three 3D points are selected at a time. Based on the selected 3D points, a plane is determined, and the normal vector of the plane is then determined. The determined normal vector is characterized by vector parameters, including θ and φ. θ represents the angle between the projection of the normal vector on the xy plane and the positive x-axis, and φ represents the angle between the normal vector and the positive z-axis.

[0118] Three three-dimensional points are selected from the neighborhood range multiple times to determine the normal vector and determine the vector parameters. When the vector parameters are the same, it means that the same normal vector is determined, and the number of votes for the normal vector can be increased by 1.

[0119] In this way, after performing multiple votes, voting can be stopped when a preset condition is met. The preset condition can be, for example, the number of votes for a certain normal vector exceeds a set number of times, the total number of votes exceeds a set maximum number of times, etc. Finally, the normal vector of the 3D point is determined based on the final voting results.

[0120] In one possible implementation, the step of stopping voting when a preset condition is met can be implemented in the following manner:

[0121] The number of votes for each normal vector is sorted in descending order; when the difference between the maximum and the second largest number of votes counted is greater than a preset value, it is determined that the preset condition is met and voting is stopped.

[0122] Based on the above, when the normal vector of a three-dimensional point is finally determined based on the number of votes for each normal vector, the vector parameters of the normal vector with the largest number of votes can be obtained, and the normal vector of the three-dimensional point is determined based on the vector parameters of the normal vector with the largest number of votes.

[0123] The point cloud normal determination method based on quadratic voting provided in this embodiment can correctly calculate the normal of a point when it is located at the intersection of two surface structures and at the broken line of three surface structures. It has obvious advantages over the existing normal calculation methods, namely the PCA normal calculation method and the Hough normal calculation method. Existing normal calculation methods, such as the PCA normal calculation method, are not accurate in normal calculation when a point is at the intersection of surface structures, and will deviate from the plane where the point is located. The Hough normal calculation method can correctly calculate the normal of a point when it is at the intersection of two surface structures, but cannot correctly calculate the normal of a point when it is at the broken line of three surface structures. The normal calculation method of this solution has a wider applicability and can handle more complex normal calculation situations.

[0124] Based on the same inventive concept, please refer to Figure 14, an embodiment of the present invention further provides a functional module diagram of a point cloud normal determination device based on quadratic voting. This embodiment can divide the functional modules of the point cloud normal determination device based on quadratic voting according to the above-mentioned method embodiment. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical functional division. There may be other division methods in actual implementation.

[0125] For example, when each functional module is divided into corresponding functional modules, Figure 14 The illustrated device for determining a point cloud normal based on quadratic voting is merely a schematic diagram. The device can include a first acquisition module, a second acquisition module, a judgment module, a first determination module, and a second determination module. The functions of each module of the device are described in detail below.

[0126] A first acquisition module is used to obtain a workpiece point cloud of a target workpiece, wherein the workpiece point cloud includes a plurality of three-dimensional points;

[0127] A second obtaining module is configured to obtain, for each of the three-dimensional points, a normal vector of the three-dimensional point using two different normal determination methods;

[0128] A judgment module, configured to judge whether a normal determination result of the three-dimensional point is accurate based on the two obtained normal vectors;

[0129] a first determining module configured to, when a normal determination result of the 3D point is inaccurate, redetermine a neighborhood range of the 3D point, wherein a proportion of 3D points in the redetermined neighborhood range that are on the same plane as the 3D point is greater than a proportion of 3D points that are not on the same plane as the 3D point;

[0130] The second determining module is configured to re-determine the normal vector of the three-dimensional point by adopting a voting mechanism based on the three-dimensional points within the neighborhood.

[0131] It can be understood that the above-mentioned first acquisition module, second acquisition module, judgment module, first determination module and second determination module can be used to execute the above-mentioned S11 to S15. For the detailed implementation method of the first acquisition module, the second acquisition module, judgment module, first determination module and second determination module, please refer to the relevant content of the above-mentioned S11 to S15.

[0132] In a possible implementation, the above-mentioned determination module may be used to:

[0133] Calculate the vector product between the two normal vectors obtained;

[0134] Detect whether the modulus of the vector product is greater than a first preset threshold. If the modulus of the vector product is greater than the first preset threshold, determine that the normal vector result of the three-dimensional point is inaccurate. If the modulus of the vector product is less than or equal to the first preset threshold, determine that the normal vector result of the three-dimensional point is accurate.

[0135] In a possible implementation, the first determining module may be configured to:

[0136] Constructing a cylinder based on the three-dimensional points and according to a preset radius, wherein the preset radius is determined based on a minimum allowable width of a mid-surface of the workpiece;

[0137] For each other three-dimensional point in the workpiece point cloud except the three-dimensional point, detect whether the other three-dimensional point is within the constructed cylinder. If the other three-dimensional point is within the cylinder, add the other three-dimensional point to the neighborhood range of the three-dimensional point.

[0138] In a possible implementation, the first determining module may be used to construct a cylinder in the following manner:

[0139] Obtaining a vector product between the two normal vectors, and determining an edge direction of the three-dimensional point according to the vector product;

[0140] A cylinder is constructed based on a preset radius with the edge direction as the axial direction and the three-dimensional point as a point on the axis.

[0141] In a possible implementation, the first determination module may be configured to detect whether other three-dimensional points are within the constructed cylinder in the following manner:

[0142] Calculating a difference vector between the other three-dimensional point and the three-dimensional point;

[0143] Calculating a relative distance based on the difference vector and the vector product;

[0144] Detect whether the relative distance is less than a second preset threshold; if so, determine that the other three-dimensional points are in the constructed cylinder, wherein the second preset threshold is constructed based on the preset radius.

[0145] In a possible implementation, the second determining module may be configured to:

[0146] Randomly selecting at least three three-dimensional points from the neighborhood each time, and constructing a plane based on the selected three-dimensional points;

[0147] Calculate the normal vector of the constructed plane and obtain the vector parameters of the normal vector. When the same vector parameters are obtained, increase the number of votes for the corresponding normal vector by 1;

[0148] When a preset condition is met, voting is stopped, and the normal vector of the three-dimensional point is determined based on the number of votes for each normal vector.

[0149] In a possible implementation, the second determining module may be configured to:

[0150] Sort the number of votes for each normal vector in descending order;

[0151] When the difference between the maximum and the second largest number of votes counted is greater than a preset value, it is determined that the preset condition is met and voting is stopped.

[0152] In a possible implementation, the second determining module may be specifically configured to:

[0153] Get the vector parameter of the normal vector with the largest number of votes;

[0154] The normal vector of the three-dimensional point is determined based on the vector parameter of the normal vector with the largest number of votes.

[0155] See also Figure 15 , is a block diagram of the structure of an electronic device provided in an embodiment of the present invention. The electronic device may be a computer, server, tablet computer, or other device. The electronic device includes a memory, a processor, and a communication module. The memory, processor, and communication module are electrically connected to each other directly or indirectly to enable data transmission or exchange. For example, these components may be electrically connected to each other via one or more communication buses or signal lines.

[0156] Memory is used to store computer programs or data. Memory can be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), and electrically erasable programmable read-only memory (EEPROM).

[0157] The processor is used to read / write data or programs stored in the memory and execute the point cloud normal determination method based on quadratic voting provided by any embodiment of the present invention.

[0158] The communication module is used to establish a communication connection between the electronic device and other communication terminals through the network, and is used to send and receive data through the network.

[0159] It should be understood that Figure 15 The structure shown is only a schematic diagram of the structure of the electronic device. The electronic device may also include Figure 15 More or fewer components than shown, or with Figure 15 Different configurations shown.

[0160] Furthermore, an embodiment of the present invention also provides a computer-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are executed, the point cloud normal determination method based on quadratic voting provided in the above embodiment is implemented.

[0161] Specifically, the computer-readable storage medium can be a general-purpose storage medium, such as a removable disk or hard disk. When the computer program on the computer-readable storage medium is executed, the aforementioned method for determining point cloud normals based on quadratic voting can be executed. Regarding the processes involved in executing the computer-readable storage medium and its executable instructions, please refer to the relevant description in the aforementioned method embodiment and will not be detailed here.

[0162] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interface, the indirect coupling or communication connection of the device or unit may be electrical, mechanical or other forms.

[0163] In addition, the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0164] Furthermore, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

[0165] It should be noted that if the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0166] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any actual relationship or order between these entities or operations.

[0167] The foregoing description is merely an embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Those skilled in the art will readily appreciate that the present invention is susceptible to various modifications and variations. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.

Claims

1. A method for determining point cloud normal based on quadratic voting, characterized in that: The method comprises: Obtaining a workpiece point cloud of a target workpiece, wherein the workpiece point cloud includes a plurality of three-dimensional points; For each of the three-dimensional points, two different normal direction determination methods are used to respectively obtain the normal vector of the three-dimensional point; Determining whether a normal determination result of the three-dimensional point is accurate based on the two obtained normal vectors; If the normal determination result of the 3D point is inaccurate, re-determine the neighborhood range of the 3D point, wherein the proportion of 3D points in the re-determined neighborhood range that are on the same plane as the 3D point is greater than the proportion of 3D points that are not on the same plane as the 3D point; A voting mechanism is adopted based on the three-dimensional points within the neighborhood to re-determine the normal vector of the three-dimensional point.

2. The method for determining point cloud normal based on quadratic voting according to claim 1, characterized in that: The step of judging whether the normal determination result of the three-dimensional point is accurate based on the two obtained normal vectors includes: Calculate the vector product between the two normal vectors obtained; Detect whether the modulus of the vector product is greater than a first preset threshold. If the modulus of the vector product is greater than the first preset threshold, determine that the normal vector result of the three-dimensional point is inaccurate. If the modulus of the vector product is less than or equal to the first preset threshold, determine that the normal vector result of the three-dimensional point is accurate.

3. The method for determining point cloud normal based on quadratic voting according to claim 1, characterized in that: The step of re-determining the neighborhood range of the three-dimensional point includes: Constructing a cylinder based on the three-dimensional points and according to a preset radius, wherein the preset radius is determined based on a minimum allowable width of a mid-surface of the workpiece; For each other three-dimensional point in the workpiece point cloud except the three-dimensional point, detect whether the other three-dimensional point is within the constructed cylinder. If the other three-dimensional point is within the cylinder, add the other three-dimensional point to the neighborhood range of the three-dimensional point.

4. The method for determining point cloud normal based on quadratic voting according to claim 3, characterized in that: The step of constructing a cylinder based on the three-dimensional points and according to a preset radius includes: Obtaining a vector product between the two normal vectors, and determining an edge direction of the three-dimensional point according to the vector product; A cylinder is constructed based on a preset radius with the edge direction as the axial direction and the three-dimensional point as a point on the axis.

5. The method for determining point cloud normal based on quadratic voting according to claim 3, characterized in that: The step of detecting whether the other three-dimensional points are within the constructed cylinder comprises: Calculating a difference vector between the other three-dimensional point and the three-dimensional point; Calculating a relative distance based on the difference vector and the vector product; Detect whether the relative distance is less than a second preset threshold; if so, determine that the other three-dimensional points are in the constructed cylinder, wherein the second preset threshold is constructed based on the preset radius.

6. The method for determining point cloud normal based on quadratic voting according to claim 1, characterized in that: The step of re-determining the normal vector of the three-dimensional point by using a voting mechanism based on the three-dimensional points within the neighborhood range includes: Randomly selecting at least three three-dimensional points from the neighborhood each time, and constructing a plane based on the selected three-dimensional points; Calculate the normal vector of the constructed plane and obtain the vector parameters of the normal vector. When the same vector parameters are obtained, increase the number of votes for the corresponding normal vector by 1; When a preset condition is met, voting is stopped, and the normal vector of the three-dimensional point is determined based on the number of votes for each normal vector.

7. The method for determining point cloud normal based on quadratic voting according to claim 6, characterized in that: The step of stopping voting when a preset condition is met includes: Sort the number of votes for each normal vector in descending order; When the difference between the maximum and the second largest number of votes counted is greater than a preset value, it is determined that the preset condition is met and voting is stopped.

8. The method for determining point cloud normal based on quadratic voting according to claim 6, characterized in that: The step of determining the normal vector of the three-dimensional point based on the number of votes of each normal vector comprises: Get the vector parameter of the normal vector with the largest number of votes; The normal vector of the three-dimensional point is determined based on the vector parameter of the normal vector with the largest number of votes.

9. A point cloud normal determination device based on quadratic voting, characterized in that: The device comprises: A first acquisition module is used to obtain a workpiece point cloud of a target workpiece, wherein the workpiece point cloud includes a plurality of three-dimensional points; A second obtaining module is configured to obtain, for each of the three-dimensional points, a normal vector of the three-dimensional point using two different normal determination methods; A judgment module, configured to judge whether a normal determination result of the three-dimensional point is accurate based on the two obtained normal vectors; a first determining module configured to, when a normal determination result of the 3D point is inaccurate, redetermine a neighborhood range of the 3D point, wherein a proportion of 3D points in the redetermined neighborhood range that are on the same plane as the 3D point is greater than a proportion of 3D points that are not on the same plane as the 3D point; The second determining module is configured to re-determine the normal vector of the three-dimensional point by adopting a voting mechanism based on the three-dimensional points within the neighborhood.

10. An electronic device, characterized in that: The electronic device comprises one or more storage media and one or more processors communicating with the storage media, wherein the one or more storage media store machine-executable instructions executable by the processors. When the electronic device is running, the processor executes the machine-executable instructions to perform the method described in any one of claims 1 to 8.