Straight line feature extraction method, device, equipment and storage medium
By filtering and sorting the scan points of the laser point cloud, collinear straight line feature points are extracted, which solves the problem of low accuracy of straight line features in the existing technology and improves the positioning accuracy of the mobile robot.
Patent Information
- Application Number
- CN202211339011.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-28
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2042-10-28
AI Technical Summary
The accuracy of straight line features extracted from laser point clouds in existing technologies is low, which affects the positioning accuracy of mobile robots.
Candidate point clouds are selected based on the curvature values of the scan points of the laser point cloud, sorted into ordered candidate point clouds, continuous scan points are extracted as candidate line segment point clouds, collinearity conditions are determined, adjacent collinear point clouds are fused, and converted into discrete straight line feature points.
It improves the efficiency and accuracy of straight line feature extraction, enhances the matching accuracy of subsequent point clouds and maps, and improves the localization accuracy of mobile robots.
Smart Images

Figure CN117948968B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of mobile robots, and particularly relates to a straight line feature extraction method and device, equipment and a storage medium. BACKGROUND
[0002] Positioning is the premise and key of autonomous navigation of a mobile robot. The mobile robot generally matches real-time laser point cloud with a pre-constructed environment map, and fuses movement data collected by an inertial measurement unit and a wheeled odometer to perform positioning. For a mobile robot operating indoors, since there are a large number of straight line structures in an indoor environment, if straight line features in the laser point cloud are extracted and matched with straight lines in the environment map, the straight line structure constraint of the environment is fully utilized, and the positioning accuracy can be effectively improved.
[0003] In the prior art, a straight line segment is extracted from the point cloud by a random sampling fitting algorithm or a least square fitting algorithm. However, the data amount of the point cloud is large, the data processing efficiency of the random sampling fitting algorithm and the least square fitting algorithm is low, and the extracted straight line feature has low accuracy, which affects the subsequent matching accuracy. SUMMARY
[0004] The present application provides a straight line feature extraction method, device, equipment and storage medium to solve the problem of low accuracy of the extracted straight line feature in the prior art, and improve the matching accuracy of subsequent point cloud and map.
[0005] In a first aspect, the present application provides a straight line feature extraction method, comprising:
[0006] extracting a candidate point cloud from the laser point cloud according to a curvature value of each scan point of the laser point cloud, and sorting scan points of the candidate point cloud according to corresponding scan angles to obtain an ordered candidate point cloud;
[0007] extracting a preset number of continuous scan points from the ordered candidate point cloud as a candidate line segment point cloud, and determining a candidate line segment point cloud satisfying a first preset collinear condition as a candidate straight line point cloud;
[0008] fusing adjacent candidate straight line point clouds satisfying a second preset collinear condition into the same straight line point cloud, and dividing adjacent candidate straight line point clouds not satisfying the second preset collinear condition into different straight line point clouds;
[0009] determining a straight line point cloud satisfying a third preset collinear condition, and converting the straight line point cloud satisfying the third preset collinear condition into a discrete straight line feature point.
[0010] In a second aspect, the present application provides a straight line feature extraction device, comprising:
[0011] The candidate point cloud determination module is configured to extract a candidate point cloud from the laser point cloud according to a curvature value of each scanning point of the laser point cloud, and sort the scanning points of the candidate point cloud according to corresponding scanning angles to obtain an ordered candidate point cloud.
[0012] The candidate straight line determination module is configured to extract a preset number of continuous scanning points from the ordered candidate point cloud as a candidate line segment point cloud, and determine the candidate line segment point cloud satisfying a first preset collinear condition as a candidate straight line point cloud.
[0013] The candidate straight line fusion module is configured to fuse adjacent candidate straight line point clouds satisfying a second preset collinear condition into the same straight line point cloud, and divide adjacent candidate straight line point clouds not satisfying the second preset collinear condition into different straight line point clouds.
[0014] The straight line feature point generation module is configured to determine a straight line point cloud satisfying the third preset collinear condition, and convert the straight line point cloud satisfying the third preset collinear condition into discrete straight line feature points.
[0015] In a third aspect, the present application provides a straight line feature extraction device, comprising:
[0016] one or more processors; a storage device storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the straight line feature extraction method as described in the first aspect.
[0017] In a fourth aspect, the present application provides a storage medium containing computer executable instructions for executing the straight line feature extraction method as described in the first aspect when executed by a computer processor.
[0018] The application eliminates a large number of non-straight line point clouds by the curvature values of each scanning point in the laser point cloud, and retains the candidate point cloud which may constitute a straight line, thereby improving the efficiency of subsequent extraction of the straight line point cloud. The candidate point cloud is sorted into an ordered candidate point cloud according to the scanning angle of the scanning point, and the ordered candidate point cloud is traversed once to extract the candidate line segment point cloud composed of a preset number of continuous scanning points, and the collinearity of the candidate line segment point cloud is judged to determine the candidate straight line point cloud, thereby avoiding global search of the candidate straight line point cloud and improving the extraction efficiency of the straight line point cloud. The collinearity of adjacent candidate straight line point clouds is judged, and the adjacent candidate straight line point clouds which are collinear are fused into a straight line point cloud, thereby avoiding global fitting of the straight line point cloud and improving the extraction efficiency of the straight line point cloud. The collinearity of the straight line point cloud is judged to avoid fitting multiple short line segments into a long line segment, thereby improving the straight line extraction precision. The collinear straight line point clouds are converted into discrete straight line feature points, so as to represent more accurate straight line structure features through the straight line feature points, which is beneficial to subsequent matching operation of the straight line feature points and the straight line structure in the map, improves the matching precision of the point cloud and the map, and further improves the positioning precision of the mobile robot. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 is a flowchart of a straight line feature extraction method provided by an embodiment of the application;
[0020] Figure 2 is a schematic diagram of laser point cloud collected by a laser radar provided by an embodiment of the application;
[0021] Figure 3 is a flowchart of extraction of candidate point cloud from laser point cloud provided by an embodiment of the application;
[0022] Figure 4 is a flowchart of judging whether the candidate line segment point cloud meets a first preset collinearity condition provided by an embodiment of the application;
[0023] Figure 5 is a schematic diagram of candidate line segment point cloud provided by an embodiment of the application;
[0024] Figure 6 is a flowchart of determining a first covariance matrix provided by an embodiment of the application;
[0025] Figure 7 is a flowchart of judging whether adjacent candidate straight line point clouds meet a second preset collinearity condition provided by an embodiment of the application;
[0026] Figure 8 is a flowchart of judging whether the straight line point cloud meets a third preset collinearity condition provided by an embodiment of the application;
[0027] Figure 9 is a flowchart of converting the straight line point cloud into a straight line feature point provided by an embodiment of the application;
[0028] Figure 10 is a structural schematic diagram of a straight line feature extraction device provided by an embodiment of the present application;
[0029] Figure 11 is a structural schematic diagram of a straight line feature extraction device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical scheme and advantages of the present application more clear, the specific embodiments of the present application are described in more detail below in combination with the drawings. It can be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, but not all the contents. Before discussing the example embodiments in more detail, it should be mentioned that some example embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when the operations are completed, but can also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, etc.
[0031] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than that illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally a class, not limited to the number of objects, for example, the first object can be one or more. In addition, the specification and claims "and / or" indicate at least one of the connected objects, and the character " / ", generally indicates that the objects before and after are in a "or" relationship.
[0032] The straight line feature extraction method provided in the embodiment can be executed by a straight line feature extraction device, which can be realized by software and / or hardware, and can be composed of two or more physical entities or one physical entity. For example, the straight line feature extraction device can be a mobile robot equipped with a laser radar, or a processor of a mobile robot.
[0033] The linear feature extraction device is installed with at least one operating system, wherein the operating system includes but is not limited to an Android system, a Linux system and a Windows system. The linear feature extraction device can install at least one application program based on the operating system, and the application program can be an application program provided by the operating system or an application program downloaded from a third-party device or server. In this embodiment, the linear feature extraction device has at least an application program that can execute the linear feature extraction method.
[0034] For the convenience of understanding, the embodiment takes a mobile robot as an example to describe the subject of executing the linear feature extraction method.
[0035] In an embodiment, the mobile robot collects a laser point cloud of a current frame through laser radar scanning for one round, matches the laser point cloud of the current frame with a pre-constructed environment map, and determines the pose information of the mobile robot of the current frame by fusing the movement data collected by an inertial measurement unit and a wheeled odometer. Before matching the laser point cloud of the current frame with the pre-constructed environment map, a global search is performed on the laser point cloud of the current frame, a linear candidate point cloud is searched out, and a linear fitting is performed on the linear candidate point cloud by a least square fitting algorithm to obtain a linear point cloud, so as to match the linear point cloud with a linear structure in the environment map and improve the matching accuracy. However, the data amount of the laser point cloud is large, the data processing efficiency of the global search and the least square fitting algorithm is low, and when there are noise points or breaks in the point cloud, the same long linear feature is easily extracted into multiple short linear features, the extracted linear feature has low accuracy, and the subsequent matching accuracy and positioning accuracy are affected.
[0036] To solve the above problems, the embodiment provides a linear feature extraction method to solve the problem of low accuracy of the extracted linear feature in the prior art.
[0037] Figure 1 A flowchart of the linear feature extraction method provided by the embodiment of the application is given. Referring to Figure 1 , the linear feature extraction method specifically includes:
[0038] S110, extracting a candidate point cloud from the laser point cloud according to the curvature value of each scanning point of the laser point cloud, and sorting the scanning points of the candidate point cloud according to the corresponding scanning angle to obtain an ordered candidate point cloud.
[0039] Figure 2 is a schematic diagram of the laser radar collecting a laser point cloud of a current frame. As Figure 2As shown, the mobile robot controls the laser radar 11 to emit a laser beam 12, and the laser radar 11 collects corresponding scanning points 13 when the laser beam 12 scans an obstacle. The laser beam 12 of the laser radar scans a circle according to a preset scanning resolution, and all scanning points 13 collected by scanning a circle are taken as a frame of laser point cloud. In this embodiment, straight line feature extraction is performed on the frame of laser point cloud to obtain straight line point cloud in the frame of laser point cloud.
[0040] Since the curvature value of the scanning point can represent the degree of deviation of the scanning point from the straight line, that is, the greater the curvature value, the smaller the possibility that the corresponding scanning point is a straight line point, and the smaller the curvature value, the greater the possibility that the corresponding scanning point is a straight line point. Therefore, the curvature value of the scanning point is used to first screen a batch of candidate point clouds that may be straight line points in this embodiment, so as to eliminate a large number of non-straight line points in the laser point cloud and improve the straight line feature extraction efficiency.
[0041] In an embodiment, Figure 3 is a flowchart for extracting candidate point clouds from a laser point cloud provided by the embodiment. As shown in Figure 3 , the step of extracting candidate point clouds from the laser point cloud specifically includes S1101-S1103:
[0042] S1101, sorting the scanning points of the laser point cloud according to the corresponding scanning angles to obtain an ordered laser point cloud.
[0043] The scanning angle of the scanning point refers to the included angle between the laser beam of the scanning point and the first laser beam. Referring to Figure 2 , after the laser radar emits the first laser beam 14, a laser beam is emitted every scanning resolution interval until the scanning is completed for 360 degrees to obtain the frame of laser point cloud. The included angle between the laser beam of the scanning point A and the first laser beam is the scanning angle of the scanning point A. The laser point cloud of the frame is sorted according to the scanning angle to obtain an ordered laser point cloud. The order of the scanning points in the ordered laser point cloud is equivalent to the order of the scanning points collected by the laser radar, and therefore the continuous scanning points in the ordered laser point cloud can represent the real structure of the obstacle.
[0044] S1102, determining the curvature value of the scanning point according to the depth difference between the scanning point of the ordered laser point cloud and the scanning points in the corresponding neighborhood.
[0045] Referring to Figure 2When the laser beam scans a straight obstacle, it continuously acquires multiple collinear scan points. When it scans a broken obstacle, it continuously acquires multiple non-collinear scan points. The depth variation of a scan point and its neighboring collinear scan points is continuous and in the same direction, with a small depth difference and a small curvature value. Conversely, the depth variation of a scan point and its neighboring scan points are in different directions, with a larger depth difference and a larger curvature value. Therefore, the depth difference between a scan point and its neighboring scan points can characterize the curvature of the surface of the environment where that scan point is located. Here, the depth of the scan point refers to the distance from the scan point to the lidar.
[0046] This embodiment describes the process using four scan points before and after the scan point as corresponding neighborhood scan points. (See reference...) Figure 2 The sorting of scan points in an ordered laser point cloud is equivalent to Figure 2 The order of the scan points from left to right is used to obtain the curvature value of scan point A. Figure 2 The four points before and four points after scan point A are taken as the scan points in the corresponding neighborhood of scan point A. The depth difference between scan point A and each scan point in the corresponding neighborhood is calculated, and the sum of the depth differences is taken as the curvature value of scan point A.
[0047] S1103. Compare the curvature value of the scan point with the preset curvature threshold, and select the scan points with curvature values less than or equal to the preset curvature threshold as the scan points of the candidate point cloud; the preset curvature threshold is determined based on the number of scan points of the laser point cloud.
[0048] The preset curvature threshold can be understood as the maximum curvature value set in this embodiment when the scan point is a straight line point. For example, if the curvature value of the scan point is greater than the curvature threshold, it indicates that the scan point is not a straight line point; if the curvature value of the scan point is less than or equal to the curvature threshold, it indicates that the scan point may be a straight line point. Therefore, scan points with curvature values less than or equal to the preset curvature threshold are selected as candidate point cloud scan points.
[0049] Since the number of scanned points in the laser point cloud varies across different frames, a preset curvature threshold can be adaptively adjusted based on the number of scanned points to obtain a sufficient number of candidate point clouds. For example, the number of scanned points in the laser point cloud is compared to a preset threshold. When the number of scanned points is greater than or equal to the preset threshold, the preset threshold is used as the number of candidate point clouds. When the number of scanned points is less than the preset threshold, the number of scanned points is multiplied by a preset percentage threshold to obtain the number of candidate point clouds.
[0050] In this embodiment, the scanning points and corresponding curvature values are sequentially stored in the curvature vector in order of the curvature values of the scanning points from small to large, and the scanning points with the number of candidate point clouds in the front of the curvature vector are obtained as the candidate point clouds. At this time, the candidate point clouds obtained are unordered candidate point clouds, and the candidate point clouds are sorted according to the scanning angles of each scanning point of the candidate point clouds to obtain ordered candidate point clouds.
[0051] S120, extracting a preset number of continuous scanning points from the ordered candidate point clouds as candidate line segment point clouds, and determining the candidate line segment point clouds that satisfy the first preset collinear condition as candidate straight line point clouds.
[0052] In an embodiment, a preset number of continuous scanning points are uniformly extracted from the ordered candidate point clouds as candidate line segment point clouds, for example, when the preset number is 6, the first 6 scanning points in the ordered candidate point clouds are taken as the first candidate line segment point cloud, the 7th to 12th scanning points are taken as the second candidate line segment point cloud, and the like to obtain a plurality of ordered candidate line segment point clouds. In another embodiment, a preset number of continuous scanning points are extracted from the ordered candidate point clouds with an interval of one scanning point as candidate line segment point clouds, for example, the first 6 scanning points in the ordered candidate point clouds are taken as the first candidate line segment point cloud, the 2nd to 7th scanning points in the ordered candidate point clouds are taken as the second candidate line segment point cloud, and the like to obtain a plurality of candidate line segment point clouds. Although the second method can obtain complete line segment point clouds in the ordered candidate point clouds, the number of generated candidate line segment point clouds is larger, and the processing efficiency is lower.
[0053] This embodiment is described by taking the example of uniformly extracting a preset number of continuous scanning points from the ordered candidate point clouds as candidate line segment point clouds. In this embodiment, the first preset collinear condition refers to a condition that needs to be satisfied when the scanning points in the candidate line segment point cloud are collinear. When the candidate line segment point cloud satisfies the first preset collinear condition, it indicates that the candidate line segment point cloud may be a straight line point cloud, and therefore the candidate line segment point cloud that satisfies the first preset collinear condition can be taken as a candidate straight line point cloud.
[0054] Figure 4 is a flowchart provided by the embodiment of the present application for judging whether the candidate line segment point cloud satisfies the first preset collinear condition. As shown in Figure 4 , the judgment of whether the candidate line segment point cloud satisfies the first preset collinear condition specifically includes S1201-S1204:
[0055] S1201, determining a first distance between the start point and the end point of the candidate line segment point cloud, and determining that the candidate line segment point cloud does not satisfy the first preset collinear condition in the case that the first distance is greater than a first preset distance threshold.
[0056] Figure 5 is a schematic diagram of the candidate line segment point cloud provided by the embodiment of the present application. As shown in Figure 5As shown, the scanning points d1-d6 constitute a first candidate line segment point cloud, the scanning points b1-b6 constitute a second candidate line segment point cloud, and the scanning points c1-c6 constitute a third candidate line segment point cloud. The order of the scanning points in the candidate line segment point cloud is sorted according to the scanning angle, i.e., the order of the scanning points is as follows Figure 5 The order of the scanning points in the candidate line segment point cloud is sorted according to the scanning angle, i.e., the order of the scanning points is as follows
[0057] In this embodiment, the first preset distance threshold refers to the maximum length of a preset number of continuous scanning points collected on a straight structure obstacle after filtering noise points. Referring to FIG. 4, the first preset distance threshold is 0.5 m. Figure 5 When the candidate line segment point cloud is a straight line point cloud, the first distance is the length of the candidate line segment point cloud. If the first distance of the candidate line segment point cloud is less than or equal to the first preset distance threshold, it indicates that the candidate line segment point cloud is likely to be scanning points collected on a straight structure obstacle. If the first distance of the candidate line segment point cloud is greater than the first preset distance threshold, it indicates that the candidate line segment point cloud has other structures, i.e., the candidate line segment point cloud is not a straight line point cloud. Therefore, in the case where the first distance of the candidate line segment point cloud is greater than the first preset distance threshold, it is determined that the candidate line segment point cloud does not satisfy the first preset collinearity condition.
[0058] It should be noted that the first preset distance threshold in this embodiment considers the maximum length of the candidate line segment point cloud after filtering noise points when the noise points are likely to be collinear, and the candidate line segment point cloud satisfying the first preset distance threshold includes the line segment where the noise points are located, i.e., a long straight line will not be extracted into multiple short straight lines due to the presence of noise points, thereby ensuring the accuracy of straight line extraction.
[0059] In S1202, in the case where the first distance is less than the first preset distance threshold, a first covariance matrix of the candidate line segment point cloud is determined, and eigenvalue decomposition is performed on the first covariance matrix to obtain the maximum eigenvalue and the second largest eigenvalue of the first covariance matrix.
[0060] It should be noted that in the case where the first distance of the candidate line segment point cloud is less than the first preset distance, the candidate line segment point cloud can also be scanning points collected on a polyline structure obstacle. For example, if Figure 5 In the case where the first distance of the candidate line segment point cloud is less than the first preset distance threshold, it is determined whether the scanning points of the candidate line segment point cloud are collinear.
[0061] In this embodiment, the first covariance matrix can characterize the geometric distribution of each scan point in the candidate line segment point cloud. Therefore, it can be used to determine whether the scan points in the candidate line segment point cloud are collinear. For example, Figure 6 This is a flowchart illustrating the determination of the first covariance matrix provided in an embodiment of this application. For example... Figure 6 As shown, the steps for determining the first covariance matrix specifically include S12021-S12023:
[0062] S12021. Add the coordinates of each scan point in the candidate line segment point cloud and divide by a preset number to obtain the centroid coordinates of the candidate line segment point cloud.
[0063] For example, the average value of the coordinates of each scan point in the candidate line segment point cloud is used as the centroid coordinates of the candidate line segment point cloud. .
[0064] S12022. Determine the difference vector between the coordinates of each scan point and the centroid coordinates of the candidate line segment point cloud, and determine the covariance matrix of the corresponding scan point based on the difference vector and the corresponding transpose vector.
[0065] For example, the coordinates of the i-th scan point of the candidate line segment point cloud with centroid coordinates Subtracting them yields the difference vector. The difference vector Its transpose Obtain the covariance matrix of the i-th scan point. Each element in the covariance matrix of the i-th scan point represents the coordinates of the i-th scan point. with centroid coordinates The covariance between the coordinate values of the i-th scan point. Therefore, the covariance matrix of the i-th scan point can be understood as the coordinates of the i-th scan point. Energy distribution in various directions of XYZ space.
[0066] S12023. Based on the covariance matrix of each scan point of the candidate line segment point cloud, determine the average covariance matrix and use the average covariance matrix as the first covariance matrix of the candidate line segment point cloud.
[0067] For example, the covariance matrices of all scanned points in the candidate line segment point cloud are summed and divided by a preset number to obtain the first covariance matrix of the candidate line segment point cloud. Each element in the first covariance matrix represents the average covariance between the coordinates of each scanned point and the coordinates of the centroid. Therefore, the first covariance matrix can be understood as the coordinates of each scanned point in the candidate line segment point cloud. Energy distribution in various directions of XYZ space.
[0068] S1203, in a case where the maximum eigenvalue of the first covariance matrix is less than the second largest eigenvalue by a preset multiple, determining that the candidate line segment point cloud does not satisfy the first preset collinear condition.
[0069] S1204, in a case where the maximum eigenvalue of the first covariance matrix is greater than or equal to the second largest eigenvalue by a preset multiple, determining that the candidate line segment point cloud satisfies the first preset collinear condition.
[0070] For example, the Eigen is used to perform eigenvalue decomposition on the first covariance matrix to obtain the maximum eigenvalue and the second largest eigenvalue of the first covariance matrix, and an eigenvector corresponding to each eigenvalue.
[0071] It can be understood that the eigenvector of the first covariance matrix actually finds a specific direction in the XYZ space, and the energy of each scanning point of the candidate line segment point cloud is concentrated in the specific direction, and the size of the eigenvalue reflects the energy size of the scanning point in the corresponding specific direction. Therefore, when the maximum eigenvalue of the first covariance matrix is much larger than the second largest eigenvalue, it indicates that each scanning point of the candidate line segment point cloud is distributed in the same direction, i.e., each scanning point of the candidate line segment point cloud is collinear, and the eigenvector of the maximum eigenvalue is the direction vector of the candidate line segment point cloud. In this embodiment, the preset multiple is generally set to 1000.
[0072] In this embodiment, the ordered candidate point cloud is traversed to extract the candidate line segment point cloud, and it is judged whether each extracted candidate line segment point cloud satisfies the first preset collinear condition. If the candidate line segment point cloud satisfies the first preset collinear condition, the candidate line segment point cloud and the corresponding direction vector are associated and stored in the line segment point cloud vector. Until the traversal of the ordered candidate point cloud is completed, the line segment point cloud vector of the scanning points sorted according to the scanning angle is obtained. In this embodiment, the ordered candidate point cloud is traversed once to extract the candidate line segment point cloud composed of a preset number of continuous scanning points, and the collinearity of the candidate line segment point cloud is judged to determine the candidate straight line point cloud, thereby avoiding global search of the candidate straight line point cloud and improving the extraction efficiency of the straight line point cloud.
[0073] S130, merging adjacent candidate straight line point clouds satisfying the second preset collinear condition into the same straight line point cloud, and dividing adjacent candidate straight line point clouds not satisfying the second preset collinear condition into different straight line point clouds.
[0074] Exemplarily, the line segment point cloud vector is traversed, a first candidate straight line point cloud is placed into a first straight line point cloud vector and the first candidate straight line point cloud is taken as a current straight line point cloud. A second candidate straight line point cloud is obtained from the line segment point cloud vector as a current candidate straight line point cloud, and it is determined whether the current straight line point cloud and the current candidate straight line point cloud satisfy a second preset collineation condition. The second preset collineation condition is a condition satisfied when two adjacent candidate straight line point clouds are collinear. If the current straight line point cloud and the current candidate straight line point cloud satisfy the second preset collineation condition, the current candidate straight line point cloud can be stored in the straight line point cloud vector in which the current straight line point cloud is located, so as to fuse the collinear current candidate straight line point cloud and the current straight line point cloud into the same straight line point cloud, and take the current candidate straight line point cloud as the current straight line point cloud, and read a next candidate straight line point cloud from the line segment point cloud vector as the current candidate straight line point cloud. If the current straight line point cloud and the current candidate straight line point cloud do not satisfy the second preset collineation condition, the current candidate straight line point cloud is stored in a new straight line point cloud vector, so as to divide the non-collinear current candidate straight line point cloud and the current straight line point cloud into different straight line point clouds, and take the current candidate straight line point cloud as the current straight line point cloud, and read a next candidate straight line point cloud from the line segment point cloud vector as the current candidate straight line point cloud. In this embodiment, collineation of adjacent candidate straight line point clouds is judged, and adjacent candidate straight line point clouds that are collinear are fused into a straight line point cloud, so that global fitting of a straight line point cloud is avoided, and the extraction efficiency of the straight line point cloud is improved.
[0075] In this embodiment, Figure 7 is a flowchart for judging whether adjacent candidate straight line point clouds satisfy a second preset collineation condition, provided in the embodiments of the present application. As shown in Figure 7 , the step of judging whether adjacent candidate straight line point clouds satisfy a second preset collineation condition specifically includes S1301-S1305:
[0076] S1301, determine a second distance between the two farthest scanning points in the adjacent candidate straight line point clouds, and in a case where the second distance is greater than a second preset distance threshold, determine that the adjacent candidate straight line point clouds do not satisfy the second preset collineation condition.
[0077] Reference is made to Figure 5, the first candidate line segment point cloud d1~d6, the second candidate line segment point cloud b1~b6 and the third candidate line segment point cloud c1~c6 all satisfy the first preset collinear condition, the first candidate line segment point cloud d1~d6, the second candidate line segment point cloud b1~b6 and the third candidate line segment point cloud c1~c6 can be determined as the first straight line candidate point cloud d1~d6, the second straight line candidate point cloud b1~b6 and the third straight line candidate point cloud c1~c6 respectively. The first straight line candidate point cloud and the second straight line candidate point cloud are adjacent candidate straight line point clouds, and the second straight line candidate point cloud and the third straight line candidate point cloud are adjacent candidate straight line point clouds. Assuming that the first straight line candidate point cloud is a current straight line point cloud, and the second straight line candidate point cloud is a current candidate straight line point cloud. The start point d1 of the first straight line candidate point cloud and the end point b6 of the second straight line candidate point cloud are the two farthest scanning points in the two point clouds, and the second distance can be calculated according to the three-dimensional coordinates of the start point d1 and the end point b6.
[0078] In the embodiment, the second preset distance threshold refers to the maximum length of the twice preset number of continuous scanning points after filtering the noise points collected on the straight line structure obstacle. Referring to Figure 5 When the two adjacent candidate straight line point clouds are the same straight line point cloud, the second distance is the total length of the two adjacent candidate straight line point clouds. If the second distance of the two adjacent candidate straight line point clouds is less than or equal to the second preset distance threshold, it indicates that the two adjacent candidate straight line point clouds are likely to be scanning points collected on the straight line structure obstacle. If the second distance of the two adjacent candidate straight line point clouds is greater than the second preset distance threshold, it indicates that there are other structures between the two adjacent candidate straight line point clouds, that is, the two adjacent candidate straight line point clouds are not the same straight line point cloud. Therefore, in the case that the second distance of the two adjacent candidate straight line point clouds is greater than the second preset distance threshold, it is determined that the two adjacent candidate straight line point clouds do not satisfy the second preset collinear condition.
[0079] It should be noted that the second preset distance threshold in the embodiment considers the maximum length when the adjacent candidate straight line point clouds after removing the noise points are likely to be collinear, and the point cloud fused by the adjacent candidate straight line point clouds satisfying the second preset distance threshold contains the line segment where the noise points are located, that is, the long straight line will not be extracted into multiple short straight lines due to the presence of noise points, thereby ensuring the accuracy of straight line extraction.
[0080] In the case that the second distance is less than the second preset distance threshold, the included angle of the direction vectors of the adjacent candidate straight line point clouds is determined, and in the case that the included angle is greater than or equal to a preset angle threshold, it is determined that the adjacent candidate straight line point clouds do not satisfy the second preset collinear condition. The direction vector of the candidate straight line point cloud is the eigenvector corresponding to the maximum eigenvalue of the first covariance matrix.
[0081] It should be noted that, in the case that the second distance between two adjacent candidate straight line point clouds is less than the second preset distance, the two adjacent candidate straight line point clouds can also be points on different straight lines, such as Figure 5 The scanning points d1~d6 and b1~b6 are in the same straight line, and therefore it is also necessary to determine whether the two adjacent candidate straight line point clouds are in the same straight line.
[0082] The included angle between two collinear line segments is 0 degrees, and correspondingly, the included angle between the direction vectors of the two collinear line segments is also 0 degrees. However, due to various external factors, the included angle between the direction vectors of the two line segment point clouds generated by the laser radar scanning straight line structure can not be 0 degrees. Therefore, a preset angle threshold is set in this embodiment, and the preset angle threshold is used as the minimum included angle between the direction vectors of the two non-collinear line segment point clouds. When the included angle between the direction vectors of the two adjacent candidate straight line point clouds is less than the preset angle threshold, it indicates that the two adjacent candidate straight line point clouds can be collinear. When the included angle between the direction vectors of the two adjacent candidate straight line point clouds is greater than or equal to the preset angle threshold, it indicates that the two adjacent candidate straight line point clouds are not collinear.
[0083] For example, the direction vectors of the first candidate straight line point cloud and the second candidate straight line point cloud are obtained from the line segment point cloud vector, and the included angle between the two direction vectors is determined. The included angle is compared with the preset angle threshold, and it is determined that the first candidate straight line point cloud and the second candidate straight line point cloud do not satisfy the second preset sharing condition. The second candidate straight line point cloud is saved to a new straight line point cloud vector, and the second candidate straight line point cloud is taken as the current straight line point cloud. The third straight line candidate point cloud is read from the line segment point cloud vector as the current candidate straight line point cloud. The second distance from the starting point of the second candidate straight line point cloud to the ending point of the third straight line candidate point cloud is calculated, and the second distance is compared with the second preset distance threshold. It is determined that the second distance is less than the second preset distance threshold. Then the direction vectors of the second candidate straight line point cloud and the third candidate straight line point cloud are obtained from the line segment point cloud vector, and the included angle between the two direction vectors is determined. The included angle is compared with the preset angle threshold, and it is determined that the included angle between the direction vectors of the second candidate straight line point cloud and the third candidate straight line point cloud is less than the preset angle threshold.
[0084] In the case that the included angle is less than the preset angle threshold, the perpendicular distance from the ending point and the starting point of the candidate straight line point cloud to the corresponding adjacent candidate straight line point cloud is determined.
[0085] It should be noted that when the included angle between the direction vectors of the two adjacent candidate straight line point clouds is less than the preset angle threshold, the two adjacent candidate straight line point clouds can be collinear line segments caused by scanning errors due to external factors, or can be two non-collinear line segments with small included angles. For this purpose, this embodiment also proposes to determine whether the two adjacent candidate straight line point clouds are collinear based on the perpendicular distance between the two adjacent candidate straight line point clouds.
[0086] The perpendicular distance from any point of a line segment to another collinear line segment is 0, and correspondingly, the perpendicular distance from the end point and the start point of the candidate straight line point cloud to the adjacent collinear candidate straight line point cloud is also 0. However, due to various external factors, the perpendicular distance between the two line segment point clouds generated by the laser radar scanning straight line structure may not be 0. Therefore, a third preset distance threshold is set in this embodiment, and the third preset distance threshold is used as the maximum perpendicular distance of the two collinear line segment point clouds. If the perpendicular distance from the start point and the end point of the candidate straight line point cloud to the adjacent candidate straight line point cloud is less than or equal to the third preset distance threshold, it indicates that the two adjacent candidate straight line point clouds are collinear; if the perpendicular distance from the start point and the end point of the candidate straight line point cloud to the adjacent candidate straight line point cloud is greater than the third preset distance threshold, it indicates that the two adjacent candidate straight line point clouds are not collinear.
[0087] For example, the perpendicular distance from the start point and the end point of the second candidate straight line point cloud to the third candidate straight line point cloud is calculated. The perpendicular distance is compared with the third preset distance threshold to determine that the perpendicular distance of the start point and the end point is less than the third preset distance threshold.
[0088] S1304, in the case where the perpendicular distance is greater than the third preset distance threshold, it is determined that the adjacent candidate straight line point clouds do not meet the second preset collinear condition.
[0089] S1305, in the case where the perpendicular distance is less than or equal to the third preset distance threshold, it is determined that the adjacent candidate straight line point clouds meet the second preset collinear condition.
[0090] For example, in the case where the perpendicular distance from the start point and the end point of the second candidate straight line point cloud to the third candidate straight line point cloud is less than the third preset distance threshold, it is determined that the second candidate straight line point cloud and the third candidate straight line point cloud meet the second preset collinear condition. The third candidate straight line point cloud is saved to the straight line point cloud vector in which the second candidate straight line point cloud is located, and at this time, the scanning points b1~b6 and the scanning points c1~c6 are points in the same straight line point cloud.
[0091] S140, determining the straight line point cloud that meets the third preset collinear condition, and converting the straight line point cloud that meets the third preset collinear condition into discrete straight line feature points.
[0092] The third preset collinear condition refers to a condition that needs to be met when the scanning points in the straight line point cloud are collinear. When the straight line point cloud meets the third preset collinear condition, it is indicated that the straight line point cloud is the point cloud collected when the laser radar scans the straight line structure obstacle, and therefore the straight line point cloud meeting the third preset collinear condition can be regarded as a straight line feature point in the laser point cloud. When the straight line point cloud does not meet the third preset collinear condition, it is indicated that the straight line point cloud is a long line segment fitted by a plurality of short line segments, and is not the point cloud collected when the laser radar scans the straight line structure obstacle, and therefore the straight line point cloud not meeting the third preset collinear condition is not regarded as a straight line feature point, and the straight line extraction precision is improved.
[0093] In this embodiment, Figure 8 is a flowchart for judging whether the straight line point cloud meets the third preset collinear condition provided by the embodiment. As shown in the figure, Figure 8 the step of judging whether the straight line point cloud meets the third preset collinear condition specifically includes S1401-S1403:
[0094] S1401, determine the second covariance matrix of the straight line point cloud, and perform eigenvalue decomposition on the second covariance matrix to obtain the maximum eigenvalue and the second largest eigenvalue of the second covariance matrix.
[0095] It should be noted that for the straight line point cloud fused with a plurality of candidate straight line point clouds, although the adjacent candidate straight line point clouds are determined to meet the second preset collinear condition through the angle and the perpendicular distance, in order to improve the precision of the straight line feature, the embodiment further verifies the collinearity of the scanning points in the straight line point cloud through the second covariance matrix of the straight line point cloud, and the direction vector of the straight line point cloud is obtained.
[0096] For example, the determination process of the second covariance matrix is similar to the determination process of the first covariance matrix, and can be referred to steps S1202 and S1203.
[0097] S1402, in the case where the maximum eigenvalue of the second covariance matrix is less than the second largest eigenvalue of the preset multiple, it is determined that the straight line point cloud does not meet the third preset collinear condition.
[0098] S1403, in the case where the maximum eigenvalue of the second covariance matrix is greater than or equal to the second largest eigenvalue of the preset multiple, it is determined that the straight line point cloud meets the third preset collinear condition.
[0099] Similarly, when the maximum eigenvalue of the second covariance is much larger than the second largest eigenvalue, it is indicated that the scanning points of the straight line point cloud are distributed in the same direction, i.e., the scanning points of the straight line point cloud are collinear, and the eigenvector of the maximum eigenvalue is the direction vector of the straight line point cloud.
[0100] The straight line point cloud satisfying the third preset collinear condition is collected by the laser radar scanning straight line structure obstacle. However, due to the influence of external factors, the straight line point cloud does not fit the straight line structure obstacle. In order to obtain the straight line feature fitting the straight line structure obstacle, the straight line point cloud satisfying the third preset collinear condition is converted to obtain the straight line feature point with the direction vector consistent with the direction of the straight line structure obstacle and uniformly distributed.
[0101] In this embodiment, Figure 9 is a flowchart for converting the straight line point cloud into the straight line feature point provided by the present application. As shown in Figure 9 , the step of converting the straight line point cloud into the straight line feature point specifically includes S1404-S1405:
[0102] S1404, determining the length of the corresponding straight line point cloud according to the starting point and the ending point of the straight line point cloud satisfying the third preset collinear condition.
[0103] S1405, generating the discrete straight line feature point uniformly according to the resolution of the preset length and the direction vector of the straight line point cloud, and replacing the corresponding straight line point cloud in the laser point cloud with the discrete straight line feature point.
[0104] For example, the length of the straight line point cloud satisfying the third preset collinear condition is approximately equal to the length of the corresponding straight line structure obstacle, and the direction of the straight line point cloud satisfying the third preset collinear condition is approximately equal to the direction of the corresponding straight line structure obstacle. A straight line feature point is arranged every interval of the preset length along the direction of the straight line point cloud to obtain the uniformly distributed discrete straight line feature point, which is approximately equal to the point on the straight line structure obstacle, and the high-precision straight line feature point is obtained. The discrete straight line feature point is replaced with the corresponding straight line point cloud in the laser point cloud, and the direction vector of the straight line point cloud is associated with the straight line feature point and saved, so as to be applied to the subsequent straight line matching and optimization process. In this embodiment, the preset length is generally set to 0.1 m.
[0105] In summary, the linear feature extraction method provided in the embodiments of the present application removes a large number of non-linear point clouds and retains candidate point clouds that may constitute a straight line by using the curvature values of each scanning point in the laser point cloud, thereby improving the efficiency of subsequent extraction of linear point clouds. The candidate point clouds are sorted into ordered candidate point clouds according to the scanning angles of the scanning points, and the ordered candidate point clouds are iterated once to extract candidate line segment point clouds composed of a preset number of continuous scanning points, and the candidate line segment point clouds are subjected to collinearity judgment to determine candidate linear point clouds, thereby avoiding global search for candidate linear point clouds and improving the extraction efficiency of linear point clouds. The collinearity of adjacent candidate linear point clouds is judged, and the adjacent candidate linear point clouds that are collinear are fused into linear point clouds, thereby avoiding global fitting of linear point clouds and improving the extraction efficiency of linear point clouds. The collinearity of linear point clouds is judged to avoid fitting multiple short line segments into long line segments, thereby improving the linear extraction accuracy. The linear point clouds that are collinear are converted into discrete linear feature points, so as to represent more accurate linear structure features through the linear feature points, which is conducive to subsequent matching operations of the linear feature points and linear structures in a map, improves the matching accuracy of the point cloud and the map, and further improves the positioning accuracy of the mobile robot.
[0106] On the basis of the above embodiments, Figure 10 FIG. 1 is a structural schematic diagram of a linear feature extraction device provided in an embodiment of the present application. As shown in FIG. 1, Figure 10 The linear feature extraction device provided in the embodiment specifically includes a candidate point cloud determination module 21, a candidate linear determination module 22, a candidate linear fusion module 23, and a linear feature point generation module 24.
[0107] The candidate point cloud determination module is configured to extract candidate point clouds from the laser point cloud according to the curvature values of each scanning point of the laser point cloud, and sort the scanning points of the candidate point clouds according to the corresponding scanning angles to obtain ordered candidate point clouds.
[0108] The candidate linear determination module is configured to extract a preset number of continuous scanning points from the ordered candidate point clouds as candidate line segment point clouds, and determine candidate line segment point clouds that satisfy a first preset collinearity condition as candidate linear point clouds.
[0109] The candidate linear fusion module is configured to fuse adjacent candidate linear point clouds that satisfy a second preset collinearity condition into the same linear point cloud, and divide adjacent candidate linear point clouds that do not satisfy the second preset collinearity condition into different linear point clouds.
[0110] The linear feature point generation module is configured to determine linear point clouds that satisfy a third preset collinearity condition, and convert the linear point clouds that satisfy the third preset collinearity condition into discrete linear feature points.
[0111] On the basis of the above-mentioned embodiments, the candidate point cloud determination module comprises: a first sorting unit configured to sort the scanning points of the laser point cloud according to the corresponding scanning angles to obtain an ordered laser point cloud; a curvature value determination unit configured to determine the curvature value of the scanning points according to the depth difference between the scanning points of the ordered laser point cloud and the scanning points in the corresponding neighborhood; and a candidate point cloud screening unit configured to compare the curvature value of the scanning points with a preset curvature threshold, and take the scanning points with a curvature value less than or equal to the preset curvature threshold as the scanning points of the candidate point cloud; and the preset curvature threshold is determined based on the number of scanning points of the laser point cloud.
[0112] On the basis of the above-mentioned embodiments, the candidate straight line determination module comprises: a first judgment unit configured to determine the first distance between the start point and the end point of the candidate line segment point cloud, and determine that the candidate line segment point cloud does not satisfy the first preset collinear condition if the first distance is greater than a first preset distance threshold; a first covariance determination unit configured to determine the first covariance matrix of the candidate line segment point cloud and perform eigenvalue decomposition on the first covariance matrix to obtain the maximum eigenvalue and the second largest eigenvalue of the first covariance matrix if the first distance is less than or equal to the first preset distance threshold; a second judgment unit configured to determine that the candidate line segment point cloud does not satisfy the first preset collinear condition if the maximum eigenvalue of the first covariance matrix is less than the preset multiple of the second largest eigenvalue; and a third judgment unit configured to determine that the candidate line segment point cloud satisfies the first preset collinear condition if the maximum eigenvalue of the first covariance matrix is greater than or equal to the preset multiple of the second largest eigenvalue.
[0113] On the basis of the above-mentioned embodiments, the first covariance determination unit comprises: a barycenter coordinate determination subunit configured to add the coordinates of each scanning point of the candidate line segment point cloud and divide by a preset number to obtain the barycenter coordinate of the candidate line segment point cloud; a scanning point covariance determination subunit configured to determine the difference vector between the coordinate of each scanning point of the candidate line segment point cloud and the barycenter coordinate, and determine the covariance matrix of the corresponding scanning point based on the difference vector and the corresponding transposed vector; and a first covariance determination subunit configured to determine the average covariance matrix based on the covariance matrix of each scanning point of the candidate line segment point cloud, and take the average covariance matrix as the first covariance matrix of the candidate line segment point cloud.
[0114] On the basis of the above-mentioned embodiments, the candidate straight line fusion module comprises: a fourth judging unit configured to determine a second distance between the two farthest scanning points in the adjacent candidate straight line point cloud, and determine that the adjacent candidate straight line point cloud does not satisfy the second preset collinear condition in the case that the second distance is greater than a second preset distance threshold; a fifth judging unit configured to determine an included angle of the direction vector of the adjacent candidate straight line point cloud in the case that the second distance is less than or equal to the second preset distance threshold, and determine that the adjacent candidate straight line point cloud does not satisfy the second preset collinear condition in the case that the included angle is greater than or equal to a preset angle threshold; the direction vector of the candidate straight line point cloud is the eigenvector corresponding to the maximum eigenvalue of the first covariance matrix; a sixth judging unit configured to determine the perpendicular distance from the end point and the start point of the candidate straight line point cloud to the adjacent candidate straight line point cloud in the case that the included angle is less than the preset angle threshold; a seventh judging unit configured to determine that the adjacent candidate straight line point cloud does not satisfy the second preset collinear condition in the case that the perpendicular distance is greater than a third preset distance threshold; and an eighth judging unit configured to determine that the adjacent candidate straight line point cloud satisfies the second preset collinear condition in the case that the perpendicular distance is less than or equal to the third preset distance threshold.
[0115] On the basis of the above-mentioned embodiments, the straight line feature point generation module comprises: a second covariance determination unit configured to determine a second covariance matrix of the straight line point cloud, and perform eigenvalue decomposition on the second covariance matrix to obtain the maximum eigenvalue and the second largest eigenvalue of the second covariance matrix; a ninth judging unit configured to determine that the straight line point cloud does not satisfy the third preset collinear condition in the case that the maximum eigenvalue of the second covariance matrix is less than the preset multiple of the second largest eigenvalue; and a tenth judging unit configured to determine that the straight line point cloud satisfies the third preset collinear condition in the case that the maximum eigenvalue of the second covariance matrix is greater than or equal to the preset multiple of the second largest eigenvalue.
[0116] On the basis of the above-mentioned embodiments, the straight line feature point generation module comprises: a straight line point cloud length determination unit configured to determine the length of the corresponding straight line point cloud according to the start point and the end point of the straight line point cloud satisfying the third preset collinear condition; and a straight line feature point generation unit configured to generate discrete straight line feature points uniformly according to the preset length resolution and the direction vector of the straight line point cloud, and replace the corresponding straight line point cloud in the laser point cloud with the discrete straight line feature points.
[0117] According to the linear feature extraction device provided in the embodiments of the present application, the curvature values of the scanning points in the laser point cloud are used to remove a large number of non-linear point clouds and retain candidate point clouds that may constitute a straight line, thereby improving the efficiency of subsequent extraction of linear point clouds. The candidate point clouds are sorted into ordered candidate point clouds according to the scanning angles of the scanning points, and the ordered candidate point clouds are iterated once to extract candidate line segment point clouds composed of a preset number of continuous scanning points, and the candidate line segment point clouds are subjected to collinearity determination to determine candidate linear point clouds, thereby avoiding global search of the candidate linear point clouds and improving the extraction efficiency of the linear point clouds. The adjacent candidate linear point clouds are subjected to collinearity determination, and the adjacent candidate linear point clouds that are collinear are fused into linear point clouds, thereby avoiding global fitting of the linear point clouds and improving the extraction efficiency of the linear point clouds. The linear point clouds are subjected to collinearity determination, thereby avoiding fitting of multiple short line segments into long line segments and improving the linear extraction precision. The linear point clouds that are collinear are converted into discrete linear feature points, so as to represent more accurate linear structural features through the linear feature points, which is beneficial to subsequent matching operations of the linear feature points and the linear structures in a map, improves the matching precision of the point cloud and the map, and further improves the positioning precision of a mobile robot.
[0118] The linear feature extraction device provided in the embodiments of the present application can be used to execute the linear feature extraction method provided in the above embodiments, and has corresponding functions and beneficial effects.
[0119] Figure 11 FIG. 1 is a structural schematic diagram of a linear feature extraction device provided in the embodiments of the present application, referring to Figure 11 The linear feature extraction device includes a processor 31, a memory 32, a communication device 33, an input device 34, and an output device 35. The number of the processors 31 in the linear feature extraction device can be one or more, and the number of the memories 32 in the linear feature extraction device can be one or more. The processor 31, the memory 32, the communication device 33, the input device 34, and the output device 35 of the linear feature extraction device can be connected through a bus or other means.
[0120] The memory 32, as a computer readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the straight line feature extraction method of any embodiment of the present application (for example, the candidate point cloud determination module 21, the candidate straight line determination module 22, the candidate straight line fusion module 23 and the straight line feature point generation module 24 in the straight line feature extraction device). The memory 32 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required by a function; the data storage area can store data created according to the use of the device, etc. In addition, the memory 32 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device or other non-volatile solid-state storage device. In some examples, the memory can further include a memory remotely arranged with respect to the processor, which can be connected to the device through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0121] The communication device 33 is used for data transmission.
[0122] The processor 31 executes various function applications and data processing of the device by running the software programs, instructions and modules stored in the memory 32, that is, implements the above-mentioned straight line feature extraction method.
[0123] The input device 34 can be used to receive input digital or character information, and generate key signal input related to the user settings and function control of the device. The output device 35 can include a display device such as a display screen.
[0124] The straight line feature extraction device provided above can be used to execute the straight line feature extraction method provided by the above-mentioned embodiments, and has corresponding functions and beneficial effects.
[0125] The embodiment of the present application also provides a storage medium containing computer executable instructions, which are used to execute a straight line feature extraction method when executed by a computer processor. The straight line feature extraction method comprises the following steps: extracting a candidate point cloud from a laser point cloud according to the curvature value of each scanning point of the laser point cloud, and sorting the scanning points of the candidate point cloud according to the corresponding scanning angle to obtain an ordered candidate point cloud; extracting a preset number of continuous scanning points from the ordered candidate point cloud as a candidate line segment point cloud, and determining the candidate line segment point cloud satisfying a first preset collinear condition as a candidate straight line point cloud; fusing adjacent candidate straight line point clouds satisfying a second preset collinear condition into the same straight line point cloud, and dividing adjacent candidate straight line point clouds not satisfying the second preset collinear condition into different straight line point clouds; determining a straight line point cloud satisfying a third preset collinear condition, and converting the straight line point cloud satisfying the third preset collinear condition into a discrete straight line feature point.
[0126] Storage medium – any type of memory device or storage device. The term “storage medium” is intended to include: mounting media, such as CD-ROM, floppy disk, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. Storage medium may also include other types of memory or combinations thereof. Furthermore, storage medium may reside in a first computer system in which the program is executed, or it may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term “storage medium” can include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). Storage medium may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.
[0127] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the line feature extraction method described above, but can also execute related operations in the line feature extraction method provided in any embodiment of this application.
[0128] The line feature extraction device, storage medium, and line feature extraction equipment provided in the above embodiments can execute the line feature extraction method provided in any embodiment of this application. For technical details not described in detail in the above embodiments, please refer to the line feature extraction method provided in any embodiment of this application.
[0129] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application. The scope of this application is determined by the scope of the claims.
Claims
1. A straight line feature extraction method characterized by, The method comprises the following steps: extracting a candidate point cloud from the laser point cloud according to the curvature value of each scanning point of the laser point cloud, and sorting the scanning points of the candidate point cloud according to the corresponding scanning angle to obtain an ordered candidate point cloud; extracting a preset number of continuous scanning points from the ordered candidate point cloud as a candidate line segment point cloud, and determining the candidate line segment point cloud that meets the first preset collinear condition as a candidate straight line point cloud; fusing adjacent candidate straight line point clouds that meet the second preset collinear condition into the same straight line point cloud, and dividing adjacent candidate straight line point clouds that do not meet the second preset collinear condition into different straight line point clouds; determining the straight line point cloud that meets the third preset collinear condition, and converting the straight line point cloud that meets the third preset collinear condition into discrete straight line feature points.
2. The straight line feature extraction method of claim 1, wherein, The method comprises the following steps: sorting the scanning points of the laser point cloud according to the corresponding scanning angle to obtain an ordered laser point cloud; determining the curvature value of each scanning point of the laser point cloud according to the depth difference between the scanning point and the scanning point in the corresponding neighborhood; comparing the curvature value of the scanning point with the preset curvature threshold, and taking the scanning point with the curvature value less than or equal to the preset curvature threshold as the scanning point of the candidate point cloud; the preset curvature threshold is determined based on the number of scanning points of the laser point cloud.
3. The straight line feature extraction method of claim 1, wherein, The method comprises the following steps: determining the first distance between the start point and the end point of the candidate line segment point cloud, and determining that the candidate line segment point cloud does not meet the first preset collinear condition when the first distance is greater than the first preset distance threshold; when the first distance is less than or equal to the first preset distance threshold, determining the first covariance matrix of the candidate line segment point cloud, and performing eigenvalue decomposition on the first covariance matrix to obtain the maximum eigenvalue and the second largest eigenvalue of the first covariance matrix; when the maximum eigenvalue of the first covariance matrix is less than the preset multiple of the second largest eigenvalue, it is determined that the candidate line segment point cloud does not meet the first preset collinear condition; when the maximum eigenvalue of the first covariance matrix is greater than or equal to the preset multiple of the second largest eigenvalue, it is determined that the candidate line segment point cloud meets the first preset collinear condition.
4. The straight line feature extraction method of claim 3, wherein, The method comprises the following steps: adding the coordinates of each scanning point of the candidate line segment point cloud and dividing by a preset number to obtain the barycentric coordinates of the candidate line segment point cloud; determining the difference vector between the coordinates of each scanning point of the candidate line segment point cloud and the barycentric coordinates, and determining the covariance matrix of the corresponding scanning point based on the difference vector and the corresponding transpose vector; determining the average covariance matrix based on the covariance matrix of each scanning point of the candidate line segment point cloud, and taking the average covariance matrix as the first covariance matrix of the candidate line segment point cloud.
5. The straight line feature extraction method of claim 1, wherein, The method comprises the following steps: determining a second distance between two farthest scanning points in the adjacent candidate straight line point cloud, and determining that the adjacent candidate straight line point cloud does not satisfy the second preset collinear condition when the second distance is greater than a second preset distance threshold; determining an included angle of direction vectors of the adjacent candidate straight line point cloud when the second distance is less than or equal to the second preset distance threshold, and determining that the adjacent candidate straight line point cloud does not satisfy the second preset collinear condition when the included angle is greater than or equal to a preset angle threshold; the direction vector of the candidate straight line point cloud is a characteristic vector corresponding to a maximum eigenvalue of a first covariance matrix; determining a perpendicular distance from an end point and a start point of the candidate straight line point cloud to the adjacent candidate straight line point cloud when the included angle is less than the preset angle threshold; determining that the adjacent candidate straight line point cloud does not satisfy the second preset collinear condition when the perpendicular distance is greater than a third preset distance threshold; determining that the adjacent candidate straight line point cloud satisfies the second preset collinear condition when the perpendicular distance is less than or equal to the third preset distance threshold.
6. The straight line feature extraction method of claim 1, wherein, The determining of the straight line point cloud satisfying the third preset collinear condition comprises: determining a second covariance matrix of the straight line point cloud, and performing eigenvalue decomposition on the second covariance matrix to obtain a maximum eigenvalue and a second largest eigenvalue of the second covariance matrix; determining that the straight line point cloud does not satisfy the third preset collinear condition when the maximum eigenvalue of the second covariance matrix is less than a preset multiple of the second largest eigenvalue; determining that the straight line point cloud satisfies the third preset collinear condition when the maximum eigenvalue of the second covariance matrix is greater than or equal to the preset multiple of the second largest eigenvalue.
7. The straight line feature extraction method of claim 1, wherein, The converting of the straight line point cloud satisfying the third preset collinear condition into discrete straight line feature points comprises: determining a length of the corresponding straight line point cloud according to a start point and an end point of the straight line point cloud satisfying the third preset collinear condition; generating discrete straight line feature points according to a preset length resolution and a direction vector of the straight line point cloud, and replacing the corresponding straight line point cloud in the laser point cloud with the discrete straight line feature points.
8. A straight line feature extraction apparatus characterized by comprising: It comprises: a candidate point cloud determination module configured to extract a candidate point cloud from the laser point cloud according to a curvature value of each scanning point of the laser point cloud, and sort scanning points of the candidate point cloud according to corresponding scanning angles to obtain an ordered candidate point cloud; a candidate straight line determination module configured to extract a preset number of continuous scanning points from the ordered candidate point cloud as a candidate line segment point cloud, and determine a candidate line segment point cloud satisfying a first preset collinear condition as a candidate straight line point cloud; a candidate straight line fusion module configured to fuse adjacent candidate straight line point clouds satisfying a second preset collinear condition into the same straight line point cloud, and divide adjacent candidate straight line point clouds not satisfying the second preset collinear condition into different straight line point clouds; a straight line feature point generation module configured to determine a straight line point cloud satisfying a third preset collinear condition, and convert the straight line point cloud satisfying the third preset collinear condition into discrete straight line feature points.
9. A line feature extraction device, characterized by, It comprises: one or more processors; A storage device storing one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the straight line feature extraction method as claimed in any one of claims 1-7.
10. A storage medium containing computer-executable instructions, wherein: The computer executable instructions, when executed by a computer processor, perform the straight line feature extraction method as claimed in any one of claims 1-7.
Citation Information
Patent Citations
Edge point extraction method and device based on line structure laser point cloud
CN110619650A
Compression method, decompression method and related device of laser point cloud
CN115035206A