Method for distinguishing inner and outer contours of three-dimensional point cloud

By calculating the angle between the tangent vector and the normal vector in the three-dimensional point cloud, combined with K nearest neighbor search and KD tree technology, the accuracy and efficiency problems of internal and external contour recognition in the three-dimensional point cloud are solved, and an efficient contour distinction method is achieved.

CN118552597APending Publication Date: 2024-08-27SHANDONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410854967.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-08-27

Smart Images

  • Figure CN118552597A
    Figure CN118552597A
Patent Text Reader

Abstract

The invention discloses a three-dimensional point cloud inner and outer contour distinguishing method. The distinguishing method comprises the following steps: sorting disordered point cloud contours by adopting a K-nearest neighbor search mode; one point is taken out every x points in the point cloud contour, and sorting setting is carried out; calculating a tangential vector of each point extracted from the point cloud contour; calculating a normal vector, pointing to the outer side of the point cloud, of each point extracted from the point cloud contour; carrying out cross multiplication on every two adjacent tangential vectors, adding and recording as a vector e; carrying out cross multiplication on each tangential vector and the corresponding normal vector, adding and recording as a vector d; calculating an included angle between the vector e and the vector d, and judging whether the contour of the point cloud is an inner contour or an outer contour according to the value of the included angle; when the included angle value is smaller than 90 degrees, the contour is the inner contour, and when the included angle value is larger than 90 degrees, the contour is the outer contour.
Need to check novelty before this filing date? Find Prior Art

Description

Technical field:

[0001] The invention relates to a method for distinguishing inner and outer contours of a three-dimensional point cloud. Background technology:

[0002] A 3D point cloud is a collection of a large number of 3D points. Each point has X, Y, and Z coordinates, and some contain information such as RGB and laser reflection intensity, which correspond to position, color, and other information in 3D space. Usually, point clouds are obtained from the real world through laser scanning technology or structured light scanning technology, and 3D point cloud technology is widely used in defect detection, 3D reconstruction, autonomous driving, and other tasks.

[0003] In the process of point cloud processing, it is often necessary to identify the contours of the missing parts of the point cloud, but after contour recognition, the inner contour and the outer contour cannot be distinguished; the commonly used identification and distinction methods include: 1. Distinguishing based on the number of contour points; 2. Projecting the point cloud onto a two-dimensional plane and using a two-dimensional processing method for processing and analysis; Due to the limitations of two-dimensional processing, the inner and outer contours of three-dimensional point clouds cannot be accurately identified and distinguished; at the same time, the operation steps are cumbersome and the processing efficiency is low. Summary of the invention:

[0004] An embodiment of the present invention provides a method for distinguishing the inner and outer contours of a three-dimensional point cloud. The method is reasonably designed. Based on the three-dimensional contour of the point cloud, the tangent vector and the normal vector of each point are calculated and processed. The inner contour or outer contour of each point is determined according to the angle between the two calculated vectors. Compared with the existing two-dimensional processing method, the method is more universal. At the same time, the operation steps are simple and resources are saved. The overall processing efficiency is high, which solves the problems existing in the prior art.

[0005] The technical solution adopted by the present invention to solve the above technical problems is:

[0006] A method for distinguishing inner and outer contours of a three-dimensional point cloud, the distinguishing method comprising the following steps:

[0007] S1, sorting the unordered point cloud contours using K nearest neighbor search;

[0008] S2, take out a point every x points in the point cloud contour and sort them;

[0009] S3, calculating the tangent vector of each point taken out from the point cloud contour;

[0010] S4, calculating the normal vector of each point taken out from the point cloud contour pointing to the outside of the point cloud;

[0011] S5, cross-product every two adjacent tangent vectors and add them to be recorded as vector e; cross-product each tangent vector with the corresponding normal vector and add them to be recorded as vector d;

[0012] S6, calculate the angle between vector e and vector d, and determine whether the contour of the point cloud is an inner contour or an outer contour according to the angle value; when the angle value is less than 90°, it is an inner contour, and when the angle value is greater than 90°, it is an outer contour.

[0013] Sorting the unordered point cloud contours using the K nearest neighbor search method includes the following steps:

[0014] S1.1, randomly select a point in the point cloud contour;

[0015] S1.2, search for the nearest point through the KD tree;

[0016] S1.3, based on the new point, continuously search for the nearest point that has not been searched before, until the first point is returned to close the contour.

[0017] The tangent vector includes a vector from the i-th point among the taken points pointing to the i+1-th point, and a vector from the last point pointing to the first point.

[0018] The normal vector is calculated by putting each extracted point back into the complete point cloud, extracting y adjacent points through the KD tree and calculating their mean point, and the normal vector is the vector from the mean point to the point.

[0019] The vector e is the result of cross-multiplying the i+1th tangent vector by the i-th tangent vector, and the last tangent vector by the first tangent vector, and then adding all of them together.

[0020] The vector d is the result of cross-producting the i-th tangent vector and the i-th normal vector, and finally adding all of them together.

[0021] The present invention adopts the above structure, and sorts the unordered point cloud contour by K nearest neighbor search, by taking out a point every x points in the point cloud contour and sorting and setting it; obtaining the tangent vector through the taken contour point; taking out the adjacent y points through the KD tree and calculating their mean point to obtain the normal vector; obtaining the vector e and the vector d through calculation processing; by calculating the angle between the vector e and the vector d, judging whether the contour of the point cloud is an inner contour or an outer contour according to the angle value, which has the advantages of accuracy, practicality, simplicity and efficiency. Description of the drawings:

[0022] Figure 1 It is a schematic diagram of the process of the present invention.

[0023] Figure 2 is a schematic diagram of an original three-dimensional point cloud after filtering according to an embodiment of the present invention;

[0024] Figure 3 Schematic diagram of contour point cloud extracted in an embodiment of the present invention;

[0025] Figure 4 A schematic diagram of an inner contour point cloud extracted from a contour in an embodiment of the present invention;

[0026] Figure 5 Schematic diagram of the outer contour point cloud extracted from the contour of an embodiment of the present invention. Specific implementation method:

[0027] In order to clearly illustrate the technical features of the present solution, the present invention is described in detail below through specific implementation methods and in conjunction with the accompanying drawings.

[0028] like Figure 1-5 As shown in, a method for distinguishing inner and outer contours of a three-dimensional point cloud, the distinguishing method comprises the following steps:

[0029] S1, sorting the unordered point cloud contours using K nearest neighbor search;

[0030] S2, take out a point every x points in the point cloud contour and sort them;

[0031] S3, calculating the tangent vector of each point taken out from the point cloud contour;

[0032] S4, calculating the normal vector of each point taken out from the point cloud contour pointing to the outside of the point cloud;

[0033] S5, cross-product every two adjacent tangent vectors and add them to be recorded as vector e; cross-product each tangent vector with the corresponding normal vector and add them to be recorded as vector d;

[0034] S6, calculate the angle between vector e and vector d, and determine whether the contour of the point cloud is an inner contour or an outer contour according to the angle value; when the angle value is less than 90°, it is an inner contour, and when the angle value is greater than 90°, it is an outer contour.

[0035] Sorting the unordered point cloud contours using the K nearest neighbor search method includes the following steps:

[0036] S1.1, randomly select a point in the point cloud contour;

[0037] S1.2, search for the nearest point through the KD tree;

[0038] S1.3, based on the new point, continuously search for the nearest point that has not been searched before, until the first point is returned to close the contour.

[0039] The tangent vector includes a vector from the i-th point among the taken points pointing to the i+1-th point, and a vector from the last point pointing to the first point.

[0040] The normal vector is calculated by putting each extracted point back into the complete point cloud, extracting y adjacent points through the KD tree and calculating their mean point, and the normal vector is the vector from the mean point to the point.

[0041] The vector e is the result of cross-multiplying the i+1th tangent vector by the i-th tangent vector, and the last tangent vector by the first tangent vector, and then adding all of them together.

[0042] The vector d is the result of cross-producting the i-th tangent vector and the i-th normal vector, and finally adding all of them together.

[0043] The working principle of a method for distinguishing between inner and outer contours of a three-dimensional point cloud in an embodiment of the present invention is: based on the three-dimensional contour of the point cloud, the tangent vector and normal vector of each point are calculated and obtained, and the tangent vector and normal vector are processed and operated. The inner contour or outer contour of each point is determined according to the angle value between the two calculated vectors. Compared with the existing two-dimensional processing method, it is more universal, and the operation steps are simple, resources are saved, and the overall processing efficiency is high.

[0044] Since the existing method of distinguishing by the number of contour points is prone to deviation, the two-dimensional projection processing method has great limitations, and the overall operation steps are too cumbersome, the present application provides a more versatile and simple distinction method.

[0045] In the overall scheme, the distinguishing method includes the following steps: sorting the unordered point cloud contour using the K nearest neighbor search method; taking out a point every x points in the point cloud contour and sorting and setting it; calculating the tangent vector of each point taken out from the point cloud contour; calculating the normal vector pointing to the outside of the point cloud for each point taken out from the point cloud contour; multiplying each adjacent tangent vector and adding them as vector e; multiplying each tangent vector with the corresponding normal vector and adding them as vector d; calculating the angle between vector e and vector d, and judging whether the point cloud contour is an inner contour or an outer contour according to the value of the angle.

[0046] In general, the value of x can be adjusted according to the density of the actual point cloud. The greater the point cloud density, the larger the value of x.

[0047] Furthermore, the K nearest neighbor search method is used to sort the unordered point cloud contour, including the following steps: randomly selecting a point in the point cloud contour; searching for the nearest point through the KD tree; and continuously searching for the nearest and unsearched point based on the new point search distance until the first point is returned to close the contour.

[0048] The obtained sorted point cloud contour is the data basis of the distinguishing method, and the KD tree is a tree data structure that stores instance points in k-dimensional space for fast retrieval. It is a balanced binary tree used to organize point sets in k-dimensional space in order to efficiently perform operations such as nearest neighbor search.

[0049] Preferably, the tangent vector includes the vector from the i-th point among the taken points pointing to the i+1-th point, and the vector from the last point pointing to the first point; the normal vector is calculated by putting each taken point back into the complete point cloud, taking out the adjacent y points through the KD tree and calculating their mean point, and the normal vector is the vector from the mean point to the point.

[0050] Preferably, vector e is the result of cross-multiplying the i+1th tangent vector by the i-th tangent vector, cross-multiplying the last tangent vector by the first tangent vector, and then adding all of them together; vector d is the result of cross-multiplying the i-th tangent vector by the i-th normal vector, and finally adding all of them together.

[0051] Regarding the determination of the angle value, when the angle value is less than 90°, it is an inner contour, and when the angle value is greater than 90°, it is an outer contour; the method of determining based on the angle value can ensure the accuracy and uniqueness of the distinction method.

[0052] To sum up, a method for distinguishing between inner and outer contours of a three-dimensional point cloud in an embodiment of the present invention is based on the three-dimensional contour of the point cloud, calculates the tangent vector and normal vector of each point, and processes the tangent vector and the normal vector, and determines the inner contour or outer contour of each point based on the angle between the two calculated vectors. Compared with the existing two-dimensional processing method, it is more universal, and the operation steps are simple, resources are saved, and the overall processing efficiency is high.

[0053] The above specific implementation manner cannot be used as a limitation on the protection scope of the present invention. For those skilled in the art, any substitution, improvement or change made to the implementation manner of the present invention falls within the protection scope of the present invention.

[0054] The matters not described in detail in the present invention are all known technologies to those skilled in the art.

Claims

1. A method for distinguishing inner and outer contours of a three-dimensional point cloud, characterized in that: The distinguishing method comprises the following steps: S1, sorting the unordered point cloud contours using K nearest neighbor search; S2, take out a point every x points in the point cloud contour and sort them; S3, calculating the tangent vector of each point taken out from the point cloud contour; S4, calculating the normal vector of each point taken out from the point cloud contour pointing to the outside of the point cloud; S5, cross-product every two adjacent tangent vectors and add them to be recorded as vector e; cross-product each tangent vector with the corresponding normal vector and add them to be recorded as vector d; S6, calculate the angle between vector e and vector d, and determine whether the contour of the point cloud is an inner contour or an outer contour according to the angle value; when the angle value is less than 90°, it is an inner contour, and when the angle value is greater than 90°, it is an outer contour.

2. A method for distinguishing inner and outer contours of a three-dimensional point cloud according to claim 1, characterized in that: Sorting the unordered point cloud contours using the K nearest neighbor search method includes the following steps: S1.1, randomly select a point in the point cloud contour; S1.2, search for the nearest point through the KD tree; S1.3, based on the new point, continuously search for the nearest point that has not been searched before, until the first point is returned to close the contour.

3. A method for distinguishing inner and outer contours of a three-dimensional point cloud according to claim 1, characterized in that: The tangent vector includes a vector from the i-th point among the taken points pointing to the i+1-th point, and a vector from the last point pointing to the first point.

4. A method for distinguishing inner and outer contours of a three-dimensional point cloud according to claim 1, characterized in that: The normal vector is calculated by putting each extracted point back into the complete point cloud, extracting y adjacent points through the KD tree and calculating their mean point, and the normal vector is the vector from the mean point to the point.

5. A method for distinguishing inner and outer contours of a three-dimensional point cloud according to claim 1, characterized in that: The vector e is the result of cross-multiplying the i+1th tangent vector by the i-th tangent vector, and the last tangent vector by the first tangent vector, and then adding all of them together.

6. A method for distinguishing inner and outer contours of a three-dimensional point cloud according to claim 1, characterized in that: The vector d is the result of cross-producting the i-th tangent vector and the i-th normal vector, and finally adding all of them together.