Normal vector calculation method, system, medium and device based on multi-angle projection
By introducing multi-angle projection and multi-scale radius search methods in PCA normal vector calculation, combined with L1 median endobranch extraction algorithm, the problem of difficulty in retaining sharp features of point clouds in the existing technology is solved, and a more accurate description of point cloud features is achieved.
Patent Information
- Application Number
- CN202411150568.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-08-21
AI Technical Summary
Existing PCA normal vector calculation methods are difficult to effectively retain point cloud sharp features, resulting in insufficient accurate description of point cloud sharp features.
Using a normal vector calculation method based on multi-angle projection, the first and second projection processing are performed on the set of nearest points at any point in the point cloud, combined with the neighborhood search of multi-scale radius and the L1 median endoskeleton extraction algorithm, feature points are extracted and line fitted, and the angle bisector is calculated to divide the set of nearest points, and the normal vector is recalculated.
The sharp features in point clouds are effectively retained, the ability to accurately describe sharp features of point clouds is improved, and the support for computer vision and graphics applications is enhanced.
Smart Images

Figure CN119206386B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of computer image recognition, and in particular to a normal vector calculation method, system, medium and device based on multi-angle projection. Background Art
[0002] Point cloud normals play an important role in computer vision and graphics, and are used for tasks such as surface reconstruction, point cloud registration, and object recognition. One of the most commonly used normal estimation methods is PCA (Principal Component Analysis) based on local surface fitting, which was first used for surface reconstruction. This method assumes that the point cloud surface is smooth, selects a set of neighboring points in the neighborhood of each point, and calculates the normal vector by least squares plane fitting. Specifically, it uses the eigenvector corresponding to the minimum eigenvalue of each point as the estimate of the normal vector. However, traditional PCA methods tend to smooth the point cloud surface and cannot effectively retain sharp features.
[0003] Related technologies have also proposed some improved methods for the PCA algorithm, such as the weighted PCA normal vector calculation method that introduces Gaussian weights, the PCA normal vector calculation method based on moving least squares, and the iterative weighted plane fitting normal vector calculation method based on optimization. Although these methods can improve the robustness and accuracy of the PCA algorithm to a certain extent, they do not change the essence of the PCA low-pass filtering properties, resulting in unsatisfactory retention of sharp features of the point cloud.
[0004] Therefore, it is necessary to provide an improved technical solution to address the above-mentioned deficiencies in the prior art. Summary of the invention
[0005] In response to the problem that it is difficult to effectively retain sharp features in PCA normal vector calculation, the present application provides a normal vector calculation method, system, medium and device based on multi-angle projection, aiming to improve the ability to accurately describe the sharp features of point clouds and provide important technical support for various computer vision and graphics applications.
[0006] In order to achieve the above objectives, this application provides the following technical solutions:
[0007] In a first aspect, the present application provides a normal vector calculation method based on multi-angle projection, the method comprising:
[0008] For any point p in the point cloud P, the principal component analysis method is used to calculate the eigenvalue and eigenvector of point p based on the neighboring point set of point p, and the eigenvector corresponding to the minimum eigenvalue is used. As the initial normal vector of point p;
[0009] Determine whether point p is a sharp point. If so, perform the first projection processing and the second projection processing on the neighboring point set of point p respectively and convert the projected coordinates into plane coordinates with point p as the origin, and obtain the first projection point set V 2 ″ D and the second projection point set
[0010] The first projection process is to project the neighboring point set of point p onto the first direction, and the second projection process is to project the neighboring point set of point p onto the second direction; the first direction is the normal direction of point p, and the second direction is the axial direction of point p;
[0011] Taking point p as the center, use multiple different scale radii in the first projection point set V 2 ″ D Start the neighborhood search and determine the first feature point set F based on the search results max and the second feature point set F min ; Use L1 median endoskeleton extraction algorithm to extract the second projection point set The endoskeleton is obtained to obtain the endoskeleton point set;
[0012] Search the first feature point set F in the endoskeleton point set max The second feature point set F min The corresponding points of the third feature point set are obtained And the fourth feature point set And use the least squares fitting method to respectively and the fourth feature point set Perform straight line fitting to obtain the first straight line equation and the second straight line equation;
[0013] Based on the first straight line equation and the second straight line equation, the angle bisector of the two straight lines is calculated; and the neighbor point set of point p is divided into two point sets using the angle bisector as a dividing line, and the point set on the same side as point p is selected as a new neighbor point set of point p, and then the normal vector of point p is recalculated based on the new neighbor point set;
[0014] Repeat the above steps until all points in the point cloud P are calculated.
[0015] In combination with the first aspect, in some possible implementations, whether point p is a sharp point is determined as follows:
[0016] According to the eigenvalue of point p, the curvature of point p is calculated according to the following formula:
[0017]
[0018] Where σ(p) is the curvature of point p, λ0 , 1 , 2 is the eigenvalue, and λ 0 ≤λ 1 ≤λ 2 ;
[0019] If the curvature is greater than the preset curvature threshold Ω f , then point p is determined to be a sharp point, otherwise, point p is determined to be a plane point.
[0020] In combination with the first aspect, in some possible implementations, the method further includes: if point p is a plane point, taking the initial normal vector of point p as its final normal vector.
[0021] In combination with the first aspect, in some possible implementations, projecting the neighboring point set of point p onto the first direction specifically includes:
[0022] Project the neighboring point set of point p onto the first plane, where the first projection plane is the eigenvector corresponding to the minimum eigenvalue is the plane with normal vector passing through point p;
[0023] The projecting of the neighboring point set of point p onto the second direction is specifically:
[0024] Project the neighboring point set of point p onto the second projection plane, which is the eigenvector corresponding to the maximum eigenvalue. is the plane with normal vector through point p.
[0025] In conjunction with the first aspect, in some possible implementations, the first feature point set F max Determine as follows:
[0026] For each search result under a scale radius, find the point with the largest y coordinate value in the search result to obtain the maximum coordinate point under the scale radius; and form the maximum coordinate points under all scale radii into the first feature point set F max ;
[0027] The second feature point set is determined according to the following steps:
[0028] For each search result under a scale radius, find the point with the smallest y coordinate value in the search result to obtain the minimum coordinate point under the scale radius; the minimum coordinate points under all scale radii are combined into the second feature point set F min .
[0029] In combination with the first aspect, in some possible implementations, the multiple different scale radii include three different scale radii, and the three different scale radii are determined according to the following steps:
[0030] Calculate the first projection point set V 2 ″ D The maximum distance d on the y axis max ;
[0031] The maximum distance d max Multiplying by 3 predefined scale factors results in 3 different scale radii.
[0032] In combination with the first aspect, in some possible implementations, an L1 median endoskeleton extraction algorithm is used to extract the second projection point set The endoskeleton of , get the endoskeleton point set, specifically:
[0033] In the second projection point set Randomly select points in the initialization of a potential endoskeleton point set X;
[0034] Based on the second projection point set And the internal skeleton point set X, establish the objective function:
[0035]
[0036] In the formula, x i is the i-th point in X, v j The second projection point set The jth point in X, I is the number of points in X, and k is the second projection point set The number of midpoints, and k = I, θ is the weight function, γ i is the balance coefficient, x i′ is the i′th point in X, and i′≠i, σ i It is point x i The degree of linearity at the location; ||.|| represents the L1 norm of the matrix, that is, the absolute value sum of all elements of the matrix is calculated, i′∈I\{i} represents the range of i′, which is the set of all values of I after removing i;
[0037] The objective function is solved by continuously adjusting the position of the midpoint of the endoskeleton point set X until the change of the objective function is less than a preset error threshold, and the iteration is stopped to obtain the final endoskeleton point set.
[0038] In a second aspect, this embodiment provides a normal vector calculation system based on multi-angle projection, the system comprising:
[0039] The computing unit is configured to calculate the eigenvalue and eigenvector of any point p in the point cloud P based on the neighboring point set of point p by using the principal component analysis method, and take the eigenvector corresponding to the maximum eigenvalue as As the initial normal vector of point p;
[0040] The projection unit is configured to determine whether point p is a sharp point. If so, the first projection processing and the second projection processing are performed on the neighboring point set of point p respectively, and the projected coordinates are converted into plane coordinates with point p as the origin, and the first projection point set V is obtained accordingly. 2 ″ D and the second projection point set
[0041] The first projection process is to project the neighboring point set of point p onto the first direction, and the second projection process is to project the neighboring point set of point p onto the second direction; the first direction is the normal direction of point p, and the second direction is the axial direction of point p;
[0042] The extraction unit is configured to use a plurality of different scale radii with point p as the center, in the first projection point set V 2 ″ D Start the neighborhood search and determine the first feature point set F based on the search results max and the second feature point set F min ; Use L1 median endoskeleton extraction algorithm to extract the second projection point set The endoskeleton is obtained to obtain the endoskeleton point set;
[0043] A fitting unit is configured to search the endoskeleton point set for the first feature point set F max The second feature point set F min The corresponding points of the third feature point set are obtained And the fourth feature point set And use the least squares fitting method to respectively and the fourth feature point set Perform straight line fitting to obtain the first straight line equation and the second straight line equation;
[0044] a segmentation unit configured to calculate an angle bisector of two straight lines based on the first straight line equation and the second straight line equation; and to segment the neighboring point set of point p into two point sets using the angle bisector as a segmentation line, and to select a point set on the same side as point p as a new neighboring point set of point p, and then to recalculate the normal vector of point p based on the new neighboring point set;
[0045] The repeating unit is configured to repeatedly execute the above steps until all points in the point cloud P are calculated.
[0046] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the normal vector calculation method based on multi-angle projection described in any of the above embodiments is implemented.
[0047] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: a memory, a processor, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the normal vector calculation method based on multi-angle projection described in any of the above embodiments is implemented.
[0048] The technical solution of the embodiment of the present application has the following beneficial effects:
[0049] By calculating the initial normal vectors of all points in the point cloud P and judging whether point p is a sharp point, if so, projecting its neighboring point sets to different directions respectively, and then using the multi-scale radius neighborhood search method to search the first projection point set V in the first direction. 2 ″ D Search to obtain the feature point set, and use the L1 median endoskeleton extraction algorithm to extract the second projection point set in the second direction. Extraction is performed to obtain the endoskeleton point set, the feature point set is mapped to the endoskeleton point set and a straight line is fitted to obtain the first straight line equation and the second straight line equation, and then the angle bisector of the first straight line equation and the second straight line equation is used to segment the neighboring point set of point p, and the point set on the same side as point p is selected as the new neighboring point set of point p, and the normal vector of point p is recalculated. This method effectively retains the sharp features in the point cloud and improves the ability to accurately describe the sharp features of the point cloud. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A schematic flow chart of a normal vector calculation method based on multi-angle projection according to some embodiments of the present application.
[0051] Figure 2 A schematic diagram of cube point cloud data and a local magnification of a neighborhood of point p provided according to some embodiments of the present application.
[0052] Figure 3 This is a schematic diagram of a new normal vector of a point p calculated using the method provided in this embodiment.
[0053] Figure 4 A schematic diagram of projection processing and feature point extraction provided according to some embodiments of the present application.
[0054] Figure 5 A schematic diagram of coordinate system transformation and angle bisector calculation provided according to some embodiments of the present application.
[0055] Figure 6 A schematic diagram of the result of dividing neighboring points by angle dividing lines according to some embodiments of the present application.
[0056] Figure 7Schematic diagram comparing the normal vector results calculated by the traditional PCA method and the normal vector results calculated by the method provided in this embodiment.
[0057] Figure 8 A structural block diagram of a normal vector calculation system based on multi-angle projection according to some embodiments of the present application.
[0058] Fig. 9 It is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present application.
[0059] Fig.10 The hardware structure diagram of the electronic device provided according to the embodiment of the present application.
[0060] Fig.11 This is another schematic diagram of the process of the normal vector calculation method based on multi-angle projection provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0061] The terms "first", "second", "third" and "fourth" etc. in the specification and claims of the present application and the drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0062] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0063] "Multiple" means two or more. "And / or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0064] The embodiments of the present application are described below in conjunction with the accompanying drawings.
[0065] Embodiment 1:
[0066] This embodiment provides a normal vector calculation method based on multi-angle projection, and the execution subject of the method is a personal computer, a smart phone, a tablet computer, a server and other electronic devices, such as Figure 1 As shown, the method includes steps S101 to S106, which are specifically as follows:
[0067] Step S101: For any point p in the point cloud P, the eigenvalue and eigenvector of point p are calculated using the principal component analysis method based on the neighboring point set of point p, and the eigenvector corresponding to the minimum eigenvalue is used. As the initial normal vector of point p.
[0068] In this embodiment, point cloud, also known as point cloud data, is a common three-dimensional data representation form, consisting of a large number of discrete points, each point has a clear position coordinate in three-dimensional space, usually represented by three components (x, y, z).
[0069] In this embodiment, the point cloud P can be obtained through a variety of sensors or in a variety of ways, for example, it can be collected by a laser radar (LiDAR), or it can be obtained by a depth camera, a three-dimensional scanner, or multi-view stereo vision. This embodiment does not limit the method for obtaining the point cloud P.
[0070] In some scenarios, point clouds may also include attributes such as color and texture. The specific type of attribute data that needs to be collected can be determined based on the requirements for describing the three-dimensional shape and surface characteristics of the rock mass, or based on the requirements for extracting the geometric parameters of the rock mass structural surface.
[0071] After acquiring the point cloud P, the point cloud P may be read into a computer memory as raw point cloud data for further processing.
[0072] In this embodiment, point p is any point in the point cloud P, and the point has a clear coordinate value in the three-dimensional space. In the process of processing the point cloud P, point p can be selected from the point cloud P by random selection, or according to some preset rules (such as from top to bottom, from left to right), which is not limited in this embodiment.
[0073] Furthermore, the neighbor point set of point p is defined as a set of points in the point cloud that are close to the point.
[0074] In this embodiment, the neighbor point set of point p can be obtained by a k-nearest neighbors (k-NN) algorithm or a radius neighbors (Radius Neighbors) algorithm or other search algorithms. The specific steps of the k-nearest neighbors algorithm and the radius neighbors algorithm can be implemented with reference to the prior art. For the sake of brevity, this embodiment will not elaborate on them.
[0075] In the neighbor point search in the subsequent steps of this embodiment, the k-nearest neighbor algorithm is used as an example for explanation, that is, for point p, the number of its neighbor points is set to k, and the k-nearest neighbor algorithm is used to obtain the neighbor point set N of point p. k (p).
[0076] In this embodiment, after obtaining the neighboring point set of point p, the principal component analysis method is used to calculate the eigenvalue and eigenvector of point p. The specific steps are as follows:
[0077] First, calculate the neighbor point set N according to the following formula k The covariance matrix C of (p) 3×3 :
[0078]
[0079] In the formula, k is the neighbor point set N k The number of points in (p), p i ∈N k (p) = {p 1 ,p 2 ,…p k} is the neighbor point set N k The i-th point in (p), is the set of neighboring points N k The center point of (p), T represents the transpose operation of the matrix.
[0080] Then, the covariance matrix C 3×3 Perform eigenvalue decomposition and obtain the eigenvalue λ 0 ≤λ 1 ≤λ 2 and the corresponding eigenvector Among them, the smallest eigenvalue The corresponding eigenvector is the initial normal vector of the point.
[0081] Step S102: Determine whether point p is a sharp point. If so, perform the first projection process and the second projection process on the neighboring point set of point p and convert the projected coordinates into plane coordinates with point p as the origin, and obtain the first projection point set V correspondingly. 2 ″ D and the second projection point set
[0082] Among them, the first projection processing is to project the neighboring point set of point p into the first direction, and the second projection processing is to project the neighboring point set of point p into the second direction; the first direction is the normal direction of point p, and the second direction is the axial direction of point p.
[0083] Sharp points, also called edge points, usually refer to places where certain surface features in a point cloud change significantly, such as contours or other significant geometric changes. To determine whether a point p is a sharp point, edge detection methods based on normal vector changes, edge detection methods based on point density changes, or edge detection methods based on curvature can be used.
[0084] Among them, the edge detection method based on normal vector change can include the following steps: first, estimate the normal vector of each point in the point cloud based on the neighborhood of the point; then, calculate the normal vector difference: for each pair of points in the neighborhood of a given point, calculate the normal vector difference between them; finally, judge the edge point: if the size of the difference exceeds a certain threshold, at least one of the pair of points is regarded as an edge point.
[0085] In some optional implementations, it is also possible to determine whether point p is a sharp point based on an edge detection method based on point density changes. This method is based on the principle that the point density in the edge area of the point cloud is usually low, and detects edge points by analyzing the change in point density. Specifically, it includes the following steps: First, calculate the local point density: for each point, calculate the number of points in its neighborhood, that is, the local point density. Then, determine the edge point: if the local point density of a point is significantly lower than the average density of its neighborhood, then the point is determined to be a sharp point. Specifically, this can be determined by setting a density threshold and comparing the local point density of each point with the density threshold.
[0086] In some other optional implementations, a curvature-based edge detection method may be used to determine whether point p is a sharp point. Curvature is a measure of the change in the geometric features of the point cloud. Determining whether point p is a sharp point includes the following steps:
[0087] Step S112: Curvature calculation: According to the characteristic value of point p, the curvature of point p is calculated according to the following formula:
[0088]
[0089] Where σ(p) is the curvature of point p, λ 0 , 1 , 2 is the eigenvalue, and λ 0 ≤λ 1 ≤λ 2 .
[0090] Step S122: Sharp point determination: If the curvature is greater than the preset curvature threshold Ω f , then point p is determined to be a sharp point, otherwise, point p is determined to be a plane point.
[0091] Among them, the curvature threshold Ω fThe threshold is preset and may be set based on expert experience or other methods, which is not limited in this embodiment.
[0092] For all points in the point cloud P, according to the curvature of each point and the curvature threshold Ω f , all points in the point cloud P can be divided into plane points p F and sharp point p S There are two categories, and the classification formula is as follows:
[0093]
[0094] According to formula (3), if the point p is a plane point, it belongs to category p F , then the initial normal vector of point p is used as its final normal vector. Return to step S101 and reselect the next point p.
[0095] If the point p is a sharp point, it belongs to category p S , then the first projection processing and the second projection processing are performed on the neighboring point set of point p respectively, and the neighboring point set is projected to different directions respectively using the double projection method.
[0096] The first projection process is to project the neighboring point set of point p onto the first direction, and the second projection process is to project the neighboring point set of point p onto the second direction; the first direction is the normal direction of point p (i.e., the eigenvector corresponding to the minimum eigenvalue) The second direction is the axial direction of point p (i.e. the eigenvector corresponding to the maximum eigenvalue). Then, the projected coordinates are converted into plane coordinates with point p as the origin, and the first projection point set V is obtained. 2 ″ D and the second projection point set
[0097] By projecting the neighboring points of the sharp point to the direction of the normal vector, the convex or concave features of the point cloud in the local surface can be effectively retained, and the local geometric properties of the edge points can be analyzed more clearly, laying the foundation for the subsequent feature point extraction. By projecting the neighboring points of the sharp point to the axial direction, the understanding of the overall geometric shape can be enhanced, which helps to identify the main contours and shapes, enhance the geometric feature extraction effect, and lay the foundation for the subsequent endoskeleton extraction. At the same time, the projected sharp points can reflect the different geometric characteristics of the point cloud data in different directions. Converting the projected three-dimensional coordinates into plane coordinates can also greatly simplify the data processing and analysis process and improve processing efficiency.
[0098] Step S103: Taking point p as the center, use multiple different scale radii to project points on the first projection point set V 2 ″ DStart the neighborhood search and determine the first feature point set F based on the search results max and the second feature point set F min ; Use L1 median skeleton extraction algorithm to extract the second projection point set The endoskeleton is obtained by performing an endoskeleton point set.
[0099] Among them, the first feature point set F max and the second feature point set F min The feature points in the first feature point set F can be selected from the search results under different scale radii according to a preset rule. There are multiple feature points in each point set (greater than or equal to 2), so that the first feature point set F can be used in step S104. max and the second feature point set F min The corresponding points are fitted with a straight line.
[0100] The L1 median endoskeleton extraction algorithm is a processing technique for extracting the skeleton (i.e., the centerline of the shape) of a three-dimensional object (such as a rock mass) from a point cloud. 1 The energy function of the norm is used to find the center line of the object. This embodiment uses the L1 median endoskeleton extraction algorithm to extract the second projection point set The endoskeleton is obtained to obtain the endoskeleton point set in order to recognize the shape and contour features of the point cloud.
[0101] Step S104: Search the endoskeleton point set for the first feature point set F max , the second feature point set F mln The corresponding points of the third feature point set are obtained And the fourth feature point set And use the least squares fitting method to fit the third feature point set And the fourth feature point set Perform straight line fitting to obtain the first straight line equation and the second straight line equation.
[0102] It should be noted that, since point p is a sharp point, it is usually distributed in places where some surface features in the point cloud change significantly. Therefore, there is a cross-plane problem in the points in its neighbor point set, that is, some points in the neighbor point set are on a certain plane, and other points may be on other planes. The traditional algorithm calculates the normal vector of these cross-plane points as a whole, resulting in insufficient reliability and accuracy of the calculation results. In this embodiment, the idea of segmenting the neighbor point set by the double projection method is adopted. The double projection method is used to extract feature points on one projection plane and skeletons on another projection plane. After the feature points correspond, the coordinates are transformed, and two straight lines are fitted. The angular bisector is calculated, and the angular bisector is used to segment the neighbor point set, and the neighbor points on the same side of the angular bisector as point p are retained as a new feature point set to retain the sharp information of the point cloud and improve the calculation accuracy of the normal vector of the sharp point.
[0103] In order to achieve the above technical purpose, after obtaining the endoskeleton point set, it is necessary to convert the first feature point set F max , the second feature point set F min Corresponding to the points in the endoskeleton point set, a straight line is then fitted.
[0104] Specifically, in step S103, the first feature point set F is extracted. max , the second feature point set F min Afterwards, the first feature point set F is found according to the pre-saved index information (the index information can be the unique code of each point, or other information with unique identification). max , the second feature point set F min The corresponding points of each point in the endoskeleton point set are recorded as: the third feature point set And the fourth feature point set And use the least squares fitting method to fit the third feature point set And the fourth feature point set Perform straight line fitting to obtain the first straight line equation and the second straight line equation.
[0105] Step S105: Based on the first straight line equation and the second straight line equation, calculate the angle bisector of the two straight lines; and use the angle bisector as the dividing line to divide the neighbor point set of point p into two point sets, select the point set on the same side as point p as the new neighbor point set of point p, and then recalculate the normal vector of point p based on the new neighbor point set.
[0106] The calculation of the angle bisectors of the two straight lines may be implemented with reference to the prior art, and the method of step S101 may be used to recalculate the normal vector of the point p. For the sake of brevity, this embodiment will not elaborate on this.
[0107] Step S106: Repeat the above steps until all points in the point cloud P are calculated.
[0108] In summary, the method provided in this embodiment uses the double projection method to segment the neighbor point set to obtain a highly reliable neighbor point set when performing PCA normal vector calculation for sharp points in the point cloud, thereby improving the accuracy of normal vector calculation and well preserving the sharp information of the point cloud.
[0109] In some embodiments, in step S102, the neighbor point set of point p is projected onto a first direction, specifically: the neighbor point set of point p is projected onto a first plane, and the first projection plane is the eigenvector corresponding to the minimum eigenvalue is the plane with normal vector through point p.
[0110] Project the neighboring point set of point p onto the second direction, specifically: project the neighboring point set of point p onto the second projection plane, the second projection plane is the eigenvector corresponding to the maximum eigenvalue is the plane with normal vector through point p.
[0111] The following uses the rock mass as a cube point cloud as an example to illustrate the technical solution of the present application.
[0112] Figure 2 A schematic diagram of the cube point cloud data is shown in FIG. Figure 2 As shown in the left figure (a), the cube point cloud data is used as the original point cloud P, the gray points represent the points contained in the point cloud P, and an edge point (sharp point) is selected as the target point (represented by a blue five-pointed star) for analysis (i.e. point p). The red circle (the red dotted circle in the left figure) is the neighbor point domain of point p, and the red solid circle is the neighbor point set of point p. The normal vector of point p is calculated using the traditional PCA algorithm based on the neighbor point set of point p, and the result is shown by the red arrow in the left figure (a). As can be seen from the left figure (a), point p is located on the side of the cube close to the Y axis, but the direction pointed by the normal vector of point p calculated by the traditional PCA algorithm obviously deviates from the direction of the Y axis and points to the direction of the X axis. The neighbor point domain (red dotted circle) of point p in the left figure (a) is partially enlarged to obtain the local enlarged image shown in the right figure (b). Referring to the local enlarged image shown in the right figure (b), the red solid circle is the neighbor point, and the initial normal vector of point p is The red arrow indicates the eigenvector corresponding to the maximum eigenvalue. Indicated by the purple arrow, the eigenvector Indicated by the blue arrow, Point to different directions respectively. For the convenience of description, the normal vector The direction pointed is called the first direction, and the eigenvector The direction pointed is called the third direction, and the eigenvector The direction pointed is called the second direction. As the normal vector, a plane perpendicular to it is made through point p, which is called the first plane, i.e. the S1 plane shown in the right figure (b); is the normal vector, and a plane perpendicular to it is drawn through point p, which is called the second plane, that is, the S2 plane shown in the right figure (b).
[0113] The first projection process is to project the neighboring point set of point p onto the first direction. Specifically, the neighboring point set of point p (the red solid dots in the figure) is projected onto the S1 plane (i.e. The first projection processing and coordinate transformation are performed as follows:
[0114] Step a: Perform projection processing according to the following formula:
[0115]
[0116] Where V is the neighbor point set N k The coordinate matrix of (p) is a k×3 matrix. I k =[1 1 … 1] T is a k-dimensional column vector of all 1s, represents the Kronecker product, o = [xyz] T is the coordinate of point p, V′ is the set of neighboring points N k (p) The three-dimensional coordinates after projection, T is the transpose operation of the matrix.
[0117] Step b: Convert the projected coordinates into plane coordinates with point p as the origin, that is, convert the projected coordinates V′ into a plane coordinate system with point p as the origin. The conversion formula is:
[0118]
[0119] Where M is the basis of the first plane, V 3 ″ D is the transformed k×3 coordinate matrix, and taking its x and y components can get the plane coordinate V″ 2D , that is, the first projection point set V″ 2D .
[0120] The second projection process is to project the neighboring point set of point p onto the second direction, specifically: project the neighboring point set of point p onto the S2 plane (i.e., The second projection point set is finally obtained by completing the coordinate transformation. The specific projection processing and coordinate conversion method can be performed with reference to the above steps a and b, which will not be described in detail here.
[0121] To improve the feature expression capability of feature points, in some embodiments, in step S103, the first feature point set F max Determine as follows: for each search result under each scale radius, find the point with the largest y coordinate value in the search result to obtain the maximum coordinate point under the scale radius; form the maximum coordinate points under all scale radii into the first feature point set F max The second feature point set F min Determine as follows: for each search result under each scale radius, find the point with the smallest y coordinate value in the search result to obtain the minimum coordinate point under the scale radius; form the second feature point set F with the minimum coordinate points under all scale radii.min .
[0122] As an example, the multiple different scale radii include 3 different scale radii, and the 3 different scale radii are determined according to the following steps: Calculate the first projection point set V 2 ″ D The maximum distance d on the Y axis max ; Set the maximum distance d max Multiplying by 3 predefined scale factors results in 3 different scale radii.
[0123] Specifically, for the first projection point set V obtained in step S102 2 ″ D , calculate the first projection point set V 2 ″ D The maximum distance on the Y axis is calculated as:
[0124] d max =max{|y i ||y i ∈v i (x i ,y i ),v i ∈V″ 2D} (6)
[0125] Where, d max is the maximum distance, v i is the first projection point set V 2 ″ D The i-th point in the i ,y i ),|y i | is point v i The distance to the Y axis, max refers to the maximum value operation.
[0126] Three different scaling factors are predefined: r 0 、r 1 、r 2 , the value range of each proportional coefficient can be a real number from 0 to 1, and satisfy: r 0 <r 1 <r 2 . The three different proportional coefficients r 0 、r 1 、r 2 With the maximum distance d max Multiply them to get 3 different scale radii: d 0 =r 0 ·d max ,d 1 =r 1 ·dmax ,d 2 =r 2 ·d max , and d 0 <d 1 <d 2 .
[0127] With point p (i.e. the origin of the first plane) as the center and d 0 ,d 1 ,d 2 is the radius at the first projection point set V 2 ″ D In the neighborhood search, we can get the search results under different scale radii, that is, there are 3 search results, each of which is a set of neighboring points, and each set of neighboring points is related to d 0 ,d 1 ,d 2 For each search result under each scale radius, find the point with the largest y coordinate value in the search result to obtain the maximum coordinate point under the scale radius, where the radius is d 0 In the search results, the point with the largest y coordinate value is recorded as: Similarly, the radius d 1 ,d 2 In the search results, the points with the largest y coordinate values are recorded as: Will Combine to get the first feature point set
[0128] Similarly, for each search result under a scale radius, find the point with the smallest y coordinate value in the search result to obtain the minimum coordinate point under the scale radius; the minimum coordinate points under all scale radii form the second feature point set
[0129] As an example, Figure 4 An example of coordinate system transformation and feature point extraction after projection processing is shown. Figure 4 The left part of the figure (1) shows the coordinates of the neighboring point set of point p in three-dimensional space after forward projection (i.e., projection into the first direction) (red solid dots). The projected coordinates are converted into plane coordinates with point p (represented by a blue five-pointed star in the figure) as the origin to obtain the first projection point set V 2 ″ DThe result is shown in the right figure (2). In the plane coordinate system, three different scale radii are shown, namely, three dotted circles in red, green and orange, also called range 1, range 2 and range 3, indicating that the neighbor search range of each scale radius is different. In the search results corresponding to range 1, the y coordinate value of feature point 1 is the largest and the y coordinate value of feature point 4 is the smallest. Therefore, feature point 1 and feature point 4 (the yellow triangle points in the figure) are the points with the largest y coordinate values in range 1. and the point with the smallest y coordinate value Correspondingly, feature point 2 and feature point 5 (the green triangle points in the figure) are the points with the largest y coordinate values in range 2. and the point with the smallest y coordinate value Feature point 3 and feature point 6 (the red triangle points in the figure) are the points with the largest y coordinate values in range 3. and the point with the smallest y coordinate value Feature points 1, 2, and 3 form the first feature point set F max ; Feature points 4, 5, and 6 form the second feature point set F min , thus completing the feature point extraction operation.
[0130] It should be noted that searching for neighboring points and extracting feature points according to three different scale radii is only an exemplary description, which can take into account both the performance of computational efficiency and the accuracy of straight line fitting and achieve a better segmentation effect. In practice, the number of scale radii can also be set to 4, 5, 6...N as needed. In this way, the first feature point set F max , the second feature point set F min The number of feature points in the image is also 4, 5, 6, ... N, and these different numbers of feature points can be used for straight line fitting in subsequent steps.
[0131] In some embodiments, an L1 median endoskeleton extraction algorithm is used to extract the second projection point set The internal skeleton is obtained by: Randomly select points in the initialization of a potential endoskeleton point set
[0132] Based on the second projection point set And the internal skeleton point set X, establish the objective function:
[0133]
[0134] In the formula, x i is the i-th point in X, v j The second projection point set The jth point in X, I is the number of points in X, and k is the second projection point set The number of midpoints, and k = I, θ is the weight function, r is the input variable, h is the parameter indicating the range, γ i is the balance coefficient, i∈I, x i′ is the i′th point in X, and i′≠i, σ i It is point x i The linearity of the location, It is point x i The eigenvalues are arranged from small to large; ||.|| represents the L1 norm of the matrix, that is, the absolute value and sum of all elements of the matrix are calculated, i′∈I\{i} represents the range of i′, which is the set of all values of I after removing i.
[0135] In formula (7), the purpose of the first term on the right side of the equation is to approximate the points in X as much as possible according to the distance weight (i.e., weight function θ) The linearity is large in the region, and a certain distance is maintained between the points in X. The second term is the penalty term.
[0136] By solving the objective function, the update formula of the midpoint of X can be obtained as:
[0137]
[0138] in, μ, are constant parameters, are all constants, k is the second projection point set The number of midpoints, k 1 is the number of iterations. The meanings of the other parameters refer to formula (7) and will not be repeated here.
[0139] The objective function is solved by continuously adjusting the position of the midpoint of the endoskeleton point set X through the update formula shown in formula (8) until the change of the objective function is less than the preset error threshold, so that it is distributed in The iteration is stopped at the skeleton position to obtain the final endoskeleton point set.
[0140] After obtaining the final endoskeleton point set X, based on the first feature point set The second feature point set According to the index information, find the corresponding point in the endoskeleton point set X and get the third feature point set And the fourth feature point set
[0141] The least squares fitting method was used to For straight line fitting, the calculation formula is as follows:
[0142]
[0143] In the formula, m and c are the parameters of the straight line equation. The purpose of the least squares fitting method is to minimize the sum of the squares of the vertical distances from a given feature point to the straight line; y 1,i is the y coordinate value of the i-th feature point, x 1,i is the x-coordinate value of the i-th feature point.
[0144] The third feature point set And the fourth feature point set As input data, the first straight line equation and the second straight line equation are calculated using formula (9). The expression of the first straight line equation is: max =m 1 x+c 1 , the expression of the second straight line equation is: min =m 2 x+c 2 .
[0145] Since point p is a sharp point, the two planes (the first plane and the second plane) where its neighboring point set is located intersect at the straight line passing through point p. Then, the straight lines fitted in two directions after the neighboring point set is projected are intersecting straight lines at a specific angle and not parallel lines. When the two straight lines intersect, they will form an intersection on the plane and divide the second plane where the endoskeleton point set is located into four regions. According to the expressions of the first straight line equation and the second straight line equation, calculate the intersection point p of the two straight lines. intersection (x intersection ,y intersection ), the calculation formula is:
[0146]
[0147] Calculate the angle bisector, split the neighbor point set into two parts (i.e. two point sets), and select the point set on the same side of the angle bisector as point p as the new neighbor point set N of point p new (p), and based on the new neighbor point set N new (p), recalculate the normal vector of point p using the method in step S101 to obtain the eigenvector corresponding to the new minimum eigenvalue As the current normal vector of point p.
[0148] Figure 5 A schematic diagram showing the coordinate system transformation and angle bisector calculation is shown. Figure 6 The figure shows the result of dividing the neighboring points by the angle dividing line. Figure 5As shown, the left figure (1) shows the position of the neighboring points of point p (blue five-pointed star) in three-dimensional space after projection, and the right figure (2) shows the endoskeleton point set (green solid dots) and the positions of feature points 1, 2, 3, 4, 5, and 6 (represented by triangles of different colors) after the coordinate system is transformed into a two-dimensional plane. Fitting line 1 (the first straight line) is represented by a red solid line, fitting line 2 (the second straight line) is represented by a blue solid line, and the angle bisector is represented by a green dotted line. Figure 6 , through the angle bisector, divide the neighboring points of point p into two types (type 1 is purple solid dots, type 2 is orange solid dots). Figure 5 , Figure 6 It can be seen from the figure that point p is located on the right side of the angle bisector, that is, close to the fitting line 1. Then the neighboring points on the right side of the angle bisector should be selected as the new neighboring point set N of point p. new (p), that is, the neighboring points represented by type 1 in the figure will be used as the new neighboring point set N of point p new (p).
[0149] On this basis, the normal vector of point p is recalculated using the method in step S101 to obtain the eigenvector corresponding to the new minimum eigenvalue As the current normal vector of point p.
[0150] Figure 3 FIG. 4 is a schematic diagram showing a new normal vector of a point p calculated using the method provided in this embodiment. Figure 3 As shown, after the angle bisector is segmented, the new neighbor point set N of point p new (p) Only the points in the same plane as point p are retained, and the points in the other plane are eliminated. Figure 2 In the left figure (a), point p itself is indeed located on the surface of the point cloud close to the Y axis. Figure 3 , the direction of the new normal vector changes from pointing to the X-axis side to pointing to the Y-axis side. Therefore, compared with the normal vector calculated using the traditional PCA method, the normal vector calculated in this embodiment can be closer to the geometric features of the point cloud and can better reflect the sharp information of the point cloud at the edge position.
[0151] Figure 7 The schematic diagram of the comparison between the normal vector result calculated by the traditional PCA method and the normal vector result calculated by the method provided in this embodiment is shown as a whole. Figure 7The left figure (1) is the normal vector result calculated by PCA, and the right figure (2) is the normal vector result calculated by the method provided in this embodiment. The blue lines are the normal vectors of each point in the point cloud. By locally zooming in on the upper left corner of the cube point cloud (red dotted box), it can be seen that there is a significant difference between the normal vector result calculated by the traditional PCA method and the normal vector result calculated by the method provided in this embodiment, and the normal vector result calculated by the method provided in this embodiment can be closer to the actual point cloud shape and contour features, indicating that this method can accurately describe the sharp features of the point cloud and improve the accuracy of the point cloud normal vector calculation.
[0152] As an example, Fig.11 As shown, the method provided by this application can be implemented according to the following steps:
[0153] Step 1, read point cloud data. Read the original point cloud data into the computer memory;
[0154] Step 2: Initial calculation of point cloud normal vector. Use KNN-PCA normal vector calculation method to obtain the neighboring point set of any point and calculate the principal component information λ of the point. 0 ≤λ 1 ≤λ 2 And the corresponding
[0155] Step 3: Classification of point geometric features. Based on the principal component information obtained in step 2, the curvature of the point is calculated using the curvature calculation formula, and the points are divided into plane points and sharp points.
[0156] Step 4: Normal projection and coordinate transformation. Project the neighboring points of the sharp point obtained in step 3 to On the plane with normal direction, the coordinates of the projection point are transformed into the coordinate system with center;
[0157] Step 5: Feature point selection. Take any sharp point as the center point and use different radius scales to select feature points;
[0158] Step 6: Axial projection and coordinate transformation. According to step 4, the neighboring points in the neighboring point set obtained in step 2 are projected to On the plane with normal direction, and complete the coordinate system transformation;
[0159] Step 7: Extract the internal skeleton of the projection point. Use the L1 median internal skeleton extraction algorithm to extract the internal skeleton of the projection point;
[0160] Step 8: Neighbor point segmentation. After completing step 7, the projected endoskeleton is obtained. According to the feature points obtained in step 5, find their positions on the endoskeleton, fit two straight lines, and get the intersection point. Make an angle bisector at the intersection point to split the point set into two parts, and select the points on the same side as the current point as the new neighbor point set.
[0161] Step 9: Recalculate the normal vector. Use the new set of neighboring points obtained in step 8 to recalculate the normal vector, and use the obtained normal vector as the normal vector of the current point.
[0162] Step 10: Repeat steps 1 to 9 until all points are calculated.
[0163] In summary, the normal vector calculation method based on multi-angle projection provided in this embodiment effectively alleviates the problem of unsatisfactory retention of sharp features of point clouds in the prior art by reading the original point cloud data into computer memory, calculating the initial normal vector of the point cloud, classifying point geometric features (dividing the points into plane points and sharp points), normal and axial projection and coordinate transformation, feature point selection, skeleton extraction in projection points, neighbor point segmentation, normal vector recalculation and other steps, improves the ability to accurately describe the sharp features of point clouds, and provides important technical support for various computer vision and graphics applications.
[0164] Embodiment 2:
[0165] This embodiment provides a normal vector calculation system based on multi-angle projection, such as Figure 8 As shown, the system includes: a calculation unit 801, a projection unit 802, an extraction unit 803, a fitting unit 804, a segmentation unit 805 and a repeating unit 806. Among them:
[0166] The calculation unit 801 is configured to calculate the eigenvalue and eigenvector of any point p in the point cloud P based on the neighboring point set of the point p by using the principal component analysis method, and take the eigenvector corresponding to the maximum eigenvalue as As the initial normal vector of point p;
[0167] The projection unit 802 is configured to determine whether the point p is a sharp point. If so, the first projection processing and the second projection processing are respectively performed on the neighboring point set of the point p and the projected coordinates are converted into plane coordinates with the point p as the origin, and the first projection point set V is obtained accordingly. 2 ″ D and the second projection point set
[0168] The first projection process is to project the neighboring point set of point p onto the first direction, and the second projection process is to project the neighboring point set of point p onto the second direction; the first direction is the normal direction of point p, and the second direction is the axial direction of point p;
[0169] The extraction unit 803 is configured to use a plurality of different scale radii with point p as the center, and to extract the first projection point set V 2 ″ D Start the neighborhood search and determine the first feature point set F based on the search results max and the second feature point set F min ; Use L1 median skeleton extraction algorithm to extract the second projection point set The endoskeleton is obtained to obtain the endoskeleton point set;
[0170] The fitting unit 804 is configured to search for the first feature point set F in the endoskeleton point set max , the second feature point set F min The corresponding points of the third feature point set are obtained And the fourth feature point set And use the least squares fitting method to fit the third feature point set And the fourth feature point set Perform straight line fitting to obtain the first straight line equation and the second straight line equation;
[0171] The segmentation unit 805 is configured to calculate the angle bisector of the two straight lines based on the first straight line equation and the second straight line equation; and use the angle bisector as the segmentation line to segment the neighboring point set of point p into two point sets, select the point set on the same side as point p as the new neighboring point set of point p, and then recalculate the normal vector of point p based on the new neighboring point set;
[0172] The repeating unit 806 is configured to repeatedly execute the above steps until all points in the point cloud P are calculated.
[0173] The normal vector calculation system based on multi-angle projection provided in this embodiment can implement the steps and processes of the normal vector calculation method based on multi-angle projection provided in any of the above embodiments, and achieve the same technical effects, which will not be repeated here one by one.
[0174] Embodiment three:
[0175] Fig. 9 Schematic diagram of the structure of an electronic device provided according to some embodiments of the present application; Fig. 9 As shown, the electronic device includes:
[0176] One or more processors 901;
[0177] The computer-readable storage medium may be configured to store one or more programs 902. When one or more processors 901 execute one or more programs 902, the following steps are implemented:
[0178] For any point p in the point cloud P, the principal component analysis method is used to calculate the eigenvalue and eigenvector of point p based on the neighboring point set of point p, and the eigenvector corresponding to the minimum eigenvalue is used. As the initial normal vector of point p;
[0179] Determine whether point p is a sharp point. If so, perform the first projection processing and the second projection processing on the neighboring point set of point p respectively and convert the projected coordinates into plane coordinates with point p as the origin, and obtain the first projection point set V 2 ″ D and the second projection point set
[0180] The first projection process is to project the neighboring point set of point p onto the first direction, and the second projection process is to project the neighboring point set of point p onto the second direction; the first direction is the normal direction of point p, and the second direction is the axial direction of point p;
[0181] Taking point p as the center, use multiple different scale radii to project point set V in the first projection point set 2 ″ D Start the neighborhood search and determine the first feature point set F based on the search results max and the second feature point set F min ; Use L1 median skeleton extraction algorithm to extract the second projection point set The endoskeleton is obtained to obtain the endoskeleton point set;
[0182] Find the first feature point set F in the endoskeleton point set max , the second feature point set F min The corresponding points of the third feature point set are obtained And the fourth feature point set And use the least squares fitting method to fit the third feature point set And the fourth feature point set Perform straight line fitting to obtain the first straight line equation and the second straight line equation;
[0183] Based on the equation of the first straight line and the equation of the second straight line, the angle bisector of the two straight lines is calculated; and the neighboring point set of point p is divided into two point sets using the angle bisector as the dividing line, and the point set on the same side as point p is selected as the new neighboring point set of point p, and then the normal vector of point p is recalculated based on the new neighboring point set;
[0184] Repeat the above steps until all points in the point cloud P are calculated.
[0185] Fig.10 The hardware structure of the electronic device provided according to some embodiments of the present application; Fig.10As shown, the hardware structure of the electronic device may include: a processor 1001 , a communication interface 1002 , a computer-readable storage medium (also referred to as a memory) 1003 and a communication bus 1004 .
[0186] The processor 1001 , the communication interface 1002 , and the computer-readable storage medium 1003 communicate with each other via a communication bus 1004 .
[0187] The computer-readable storage medium 1003 may be configured to store one or more programs.
[0188] Optionally, the communication interface 1002 may be an interface of a communication module, such as an interface of a GSM module.
[0189] The processor 1001 executes one or more programs, which implement the following steps:
[0190] For any point p in the point cloud P, the principal component analysis method is used to calculate the eigenvalue and eigenvector of point p based on the neighboring point set of point p, and the eigenvector corresponding to the minimum eigenvalue is used. As the initial normal vector of point p;
[0191] Determine whether point p is a sharp point. If so, perform the first projection processing and the second projection processing on the neighboring point set of point p respectively and convert the projected coordinates into plane coordinates with point p as the origin, and obtain the first projection point set V 2 ″ D and the second projection point set
[0192] The first projection process is to project the neighboring point set of point p onto the first direction, and the second projection process is to project the neighboring point set of point p onto the second direction; the first direction is the normal direction of point p, and the second direction is the axial direction of point p;
[0193] Taking point p as the center, use multiple different scale radii to project point set V in the first projection point set 2 ″ D Start the neighborhood search and determine the first feature point set F based on the search results max and the second feature point set F min ; Use L1 median skeleton extraction algorithm to extract the second projection point set The endoskeleton is obtained to obtain the endoskeleton point set;
[0194] Find the first feature point set F in the endoskeleton point set max , the second feature point set F min The corresponding points of the third feature point set are obtained And the fourth feature point set And use the least squares fitting method to fit the third feature point set And the fourth feature point set Perform straight line fitting to obtain the first straight line equation and the second straight line equation;
[0195] Based on the equation of the first straight line and the equation of the second straight line, the angle bisector of the two straight lines is calculated; and the neighboring point set of point p is divided into two point sets using the angle bisector as the dividing line, and the point set on the same side as point p is selected as the new neighboring point set of point p, and then the normal vector of point p is recalculated based on the new neighboring point set;
[0196] Repeat the above steps until all points in the point cloud P are calculated.
[0197] The processor 1001 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0198] The electronic device of the embodiment of the present application exists in various forms, including but not limited to:
[0199] (1) Mobile communication devices: These devices are characterized by their mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (e.g., iPhone), multimedia phones, functional phones, and low-end phones.
[0200] (2) Ultra-mobile personal computer devices: These devices fall into the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, such as iPad.
[0201] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as iPods), handheld game consoles, e-books, smart toys, and portable car navigation devices.
[0202] (4) Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to a general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.
[0203] (5) Other electronic devices with data interaction functions.
[0204] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.
[0205] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine storage medium downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor or programmable or dedicated hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the normal vector calculation method based on multi-angle projection described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the method shown herein.
[0206] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A normal vector calculation method based on multi-angle projection, characterized in that: include: Point Cloud Any point in , based on point The neighboring point set of The eigenvalues and eigenvectors of As a point The initial normal vector of Judgment Point Is it a sharp point? If so, then The neighboring point set performs the first projection processing and the second projection processing respectively and converts the projected coordinates into point is the plane coordinate of the origin, corresponding to the first projection point set and the second projection point set ; The first projection process is to transform the point The neighbor point set is projected into the first direction, and the second projection process is to project the point The neighbor point set of is projected onto the second direction; the first direction is point The second direction is the normal direction of the point Axial direction; By point As the center, use multiple different scale radii on the first projection point set Start a neighborhood search and determine the first feature point set based on the search results and the second feature point set ; Use L1 median endoskeleton extraction algorithm to extract the second projection point set The endoskeleton is obtained to obtain the endoskeleton point set; Search the first feature point set in the endoskeleton point set The second feature point set The corresponding points of the third feature point set are obtained And the fourth feature point set , and use the least squares fitting method to fit the third feature point set and the fourth feature point set Perform straight line fitting to obtain the first straight line equation and the second straight line equation; Based on the first straight line equation and the second straight line equation, the angle bisector of the two straight lines is calculated; and the angle bisector is used as the dividing line. The neighbor point set of is divided into two point sets, and the point The set of points on the same side as points The new set of neighboring points is then used to recalculate the point The normal vector of Repeat the above steps until the point cloud All points in are calculated; Judgment Point Whether it is a sharp point, specifically: According to the point The eigenvalue of is calculated according to the following formula Curvature: , In the formula, Yes The curvature of is the eigenvalue, and ; If the curvature is greater than the preset curvature threshold , then the decision point is a sharp point, otherwise, the decision point is a plane point; The second projection point set is extracted using the L1 median endoskeleton extraction algorithm. The endoskeleton of , get the endoskeleton point set, specifically: In the second projection point set Randomly select points in the initialization of a potential endoskeleton point set X ; Based on the second projection point set and the endoskeleton point set X , establish the objective function: , In the formula, for X The i Points, The second projection point set The j Points, I yes X The number of midpoints, is the second projection point set The number of midpoints, and , θ is the weight function, is the balance coefficient, yes X The points, and , Yes The degree of linearity at the location; ||.|| represents the L1 norm of the matrix, that is, the absolute value and sum of all elements of the matrix are calculated. express The range is I Remove all values of The collection after By continuously adjusting the endoskeleton point set X The objective function is solved by the position of the midpoint until the change of the objective function is less than a preset error threshold, and the iteration is stopped to obtain the final endoskeleton point set.
2. The method according to claim 1, characterized in that Also includes: If point is a plane point, then the point The initial normal vector of is used as its final normal vector.
3. The method according to claim 1, characterized in that The point The neighbor point set of is projected into the first direction, specifically: Point The neighboring point set is projected onto the first projection plane, which is the eigenvector corresponding to the minimum eigenvalue is the normal vector and passes through the point plane; The point The neighbor point set of is projected into the second direction, specifically: Point The neighbor point set of is projected onto the second projection plane, which is the eigenvector corresponding to the maximum eigenvalue is the normal vector and passes through the point plane.
4. The method according to claim 1, characterized in that The first feature point set Determine as follows: For each search result in the scale radius, find the y The point with the largest coordinate value is obtained as the maximum coordinate point under the scale radius; the maximum coordinate points under all scale radii are combined into the first feature point set ; The second feature point set is determined according to the following steps: For each search result in the scale radius, find the y The point with the smallest coordinate value is the point with the smallest coordinate value under the scale radius; the minimum coordinate points under all scale radii are combined into the second feature point set .
5. The method according to claim 4, characterized in that The multiple different scale radii include 3 different scale radii, and the 3 different scale radii are determined according to the following steps: Calculate the first projection point set exist y Maximum distance on axis ; The maximum distance Multiplying by 3 predefined scale factors results in 3 different scale radii.
6. A normal vector calculation system based on multi-angle projection, characterized in that: include: A computing unit configured to compute a point cloud Any point in , based on point The neighboring point set of The eigenvalues and eigenvectors of As a point The initial normal vector of Projection unit, configured as a judgment point Is it a sharp point? If so, then The neighboring point set performs the first projection processing and the second projection processing respectively and converts the projected coordinates into point is the plane coordinate of the origin, corresponding to the first projection point set and the second projection point set ; The first projection process is to transform the point The neighbor point set is projected into the first direction, and the second projection process is to project the point The neighbor point set of is projected onto the second direction; the first direction is point The second direction is the normal direction of the point Axial direction; Extraction unit, configured as point As the center, use multiple different scale radii, in the first projection point set Start a neighborhood search and determine the first feature point set based on the search results and the second feature point set ; Use L1 median endoskeleton extraction algorithm to extract the second projection point set The endoskeleton is obtained to obtain the endoskeleton point set; A fitting unit is configured to search the endoskeleton point set for the first feature point set. The second feature point set The corresponding points of the third feature point set are obtained And the fourth feature point set , and use the least squares fitting method to fit the third feature point set and the fourth feature point set Perform straight line fitting to obtain the first straight line equation and the second straight line equation; The segmentation unit is configured to calculate the angle bisector of the two straight lines based on the first straight line equation and the second straight line equation; and divide the point The neighbor point set of is divided into two point sets, and the point The set of points on the same side as points The new set of neighboring points is then used to recalculate the point The normal vector of Repeating unit, configured to repeat the above steps until the point cloud All points in are calculated; Judgment Point Whether it is a sharp point, specifically: According to the point The eigenvalue of is calculated according to the following formula Curvature: , In the formula, Yes The curvature of is the eigenvalue, and ; If the curvature is greater than the preset curvature threshold , then the decision point is a sharp point, otherwise, the decision point is a plane point; The second projection point set is extracted using the L1 median endoskeleton extraction algorithm. The endoskeleton of , get the endoskeleton point set, specifically: In the second projection point set Randomly select points in the initialization of a potential endoskeleton point set X ; Based on the second projection point set and the endoskeleton point set X , establish the objective function: , In the formula, for X The i Points, The second projection point set The j Points, I yes X The number of midpoints, is the second projection point set The number of midpoints, and , θ is the weight function, is the balance coefficient, yes X The points, and , Yes The degree of linearity at the location; ||.|| represents the L1 norm of the matrix, that is, the absolute value and sum of all elements of the matrix are calculated. express The range is I Remove all values of The collection after By continuously adjusting the endoskeleton point set X The objective function is solved by the position of the midpoint until the change of the objective function is less than a preset error threshold, and the iteration is stopped to obtain the final endoskeleton point set.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
8. An electronic device, characterized in that: include: A memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 5 when executing the program.
Citation Information
Patent Citations
Rock mass local point cloud coplanar judgment method and system based on multi-scale perception, medium and electronic equipment
CN118230055A