Disclosure of Invention
In view of this, the present application provides a high-precision point cloud classification adaptive downsampling method and device for complex environment sensing, so as to solve the above technical problems.
In a first aspect, an embodiment of the present application provides a high-precision point cloud classification adaptive downsampling method for complex environment sensing, including:
acquiring a feature vector of each unordered point in the original point cloud data, and generating a point cloud matrix by taking the feature vector as a row vector;
obtaining the maximum eigenvalue of each column of the point cloud matrix to obtain a first eigenvector representing the key point;
processing the first feature vector representing the key point to obtain a second feature vector representing the unique feature value of the key point;
sorting the elements of the second feature vector to obtain a sorted second feature vector and a corresponding index vector containing all key point indexes;
and acquiring the key points and the corresponding feature vectors thereof from the original point cloud data by using index vectors containing all the key point indexes.
Further, the point cloud data comprises n unordered points, and the feature vector of each point is d-dimensional; the point cloud matrix F S Is a matrix of n rows and d columns.
Further, obtaining the maximum eigenvalue of each column of the point cloud matrix to obtain a first eigenvector representing the key point; comprising the following steps:
acquiring a point cloud matrix F S Obtaining d maximum eigenvalues according to the maximum eigenvalues of each column of the plurality of columns;
combining d maximum eigenvalues into a first eigenvector f max The dimension of the material is d;
and generating an index vector idx by using the corresponding row index of each maximum characteristic value, wherein the point corresponding to the row index is a key point.
Further, the first feature vector representing the key point is processed to obtain a second feature vector representing the unique feature value of the key point; comprising the following steps:
the first characteristic vector f max Adding the characteristic values belonging to the same row index to obtain m unique characteristic values corresponding to the row index;
generating a second eigenvector f from m unique eigenvalues S The method comprises the steps of carrying out a first treatment on the surface of the And generating an index vector uidx by the row indexes corresponding to the m unique characteristic values.
Further, when the plurality of original point cloud data are batched, the method further includes:
acquiring an index vector suidx corresponding to the ordered second feature vector of each original point cloud data;
obtaining the maximum value D of the dimensions of all index vectors suidx max ;
Expanding each index vector suidx to D using nearest neighbor interpolation max Index vector of dimension.
Further, the ordering is in ascending or descending order.
In a second aspect, an embodiment of the present application provides a high-precision point cloud classification adaptive downsampling apparatus for complex environment sensing, including:
the acquisition unit is used for acquiring the characteristic vector of each unordered point in the original point cloud data and generating a point cloud matrix by taking the characteristic vector as a row vector;
the computing unit is used for obtaining the maximum eigenvalue of each column of the point cloud matrix and obtaining a first eigenvector for representing the key point;
the processing unit is used for processing the first characteristic vector representing the key point to obtain a second characteristic vector representing the unique characteristic value of the key point;
the sorting unit is used for sorting the elements of the second feature vector to obtain a third feature vector after sorting and a corresponding index vector containing all the key point indexes;
and the downsampling unit is used for acquiring the key points and the corresponding feature vectors thereof from the original point cloud by utilizing the index vectors containing all the key point indexes.
In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the methods of the embodiments of the present application when executing the computer program.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing computer instructions that, when executed by a processor, implement a method of embodiments of the present application.
The self-adaptive downsampling method and device can realize self-adaptive downsampling of the unordered point cloud, and have the advantage of high efficiency.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, which are generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, as provided in the accompanying drawings, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
First, the design concept of the embodiment of the present application will be briefly described.
In most robotic applications, laser point cloud data plays a key role in sensing the surrounding environment. In particular, autonomous mobile robotic systems utilize point cloud data to train a network model to address various issues such as dynamic target detection, synchronous localization and mapping (SLAM), path planning, and the like. With the introduction of many new methods such as PointNet, the extraction of features from unordered point clouds using deep neural networks in PointNet++, DGCNN, pointCNN, SONet has become a very popular research area. These methods have proven to be quite successful on point cloud classification datasets, such as ModelNet 40.
To address the sparsity of the point cloud, a deep learning algorithm tends to voxel the space and then apply a 3D CNN to the voxels. One problem with this approach is that network size and computational complexity grow rapidly with increasing spatial resolution. On the other hand, a lower spatial resolution means a larger voxel and a higher quantization error. One way to alleviate this problem is to use octree or kd-Tree instead of voxels. For example, a kd-tree of point clouds is built and then traversed by a hierarchical feature extractor, exploiting the invariance of the point clouds in the actual scene. In contrast, a point-based neural network does not require conversion of the point cloud to another format. This avoids resolution loss. A very efficient way to exploit local geometry information is to model the point cloud as a disordered (non-euler) point map, and then apply the CNN on it.
The advantage of point cloud downsampling is that (1) most of the graph convolution methods on point clouds use knn searches to find a neighborhood for each point. Thus, the downsampling operation reduces the computational cost of subsequent convolutional layers. (2) The number of points in the network is reduced, so that the memory usage amount in running is reduced. (3) Downsampling may improve the robustness of certain disturbances in the input data. The current downsampling method cannot adaptively downsample the unordered point cloud.
In order to solve the technical problems, the application provides a high-precision point cloud classification self-adaptive downsampling method for complex environment perception, which not only selects output points from input points, but also downsamples points in a network in a manner that key points are not lost in the process. Unlike the random sampling type layer, the method employs a deterministic layer that produces the same set of points after each run. It is unchanged for the arrangement of the input points, i.e. the order is unchanged. The method learns to downsample the points in the training process, so the method is self-adaptive, is not limited to a global method of neighborhood search, and has the advantage of high efficiency.
After the application scenario and the design idea of the embodiment of the present application are introduced, the technical solution provided by the embodiment of the present application is described below.
As shown in fig. 1, an embodiment of the present application provides a high-precision point cloud classification adaptive downsampling method for complex environment sensing, including:
step 101: acquiring a feature vector of each unordered point in the original point cloud data, and generating a point cloud matrix by taking the feature vector as a row vector;
the point cloud data includes n unordered points, each point represented as a feature vector x ε R d Where R is the real set and d is the dimension of the feature vector. The purpose of the downsampling is to generate a key point subset, wherein the key point subset has m points in total, and m is less than or equal to n, and each point is expressed as a characteristic vector y epsilon R d . The key points of the point cloud are the points where the most information needs to be retained during the down-sampling (or pooling) process. These points may vary from task to task and from application to application. Point cloud matrix F S Is a matrix of n rows (corresponding to n input points) and d columns (corresponding to d-dimensional feature vectors).
Step 102: obtaining the maximum eigenvalue of each column of the point cloud matrix to obtain a first eigenvector representing the key point;
wherein, this step specifically includes:
acquiring a point cloud matrix F s Obtaining d maximum eigenvalues according to the maximum eigenvalues of each column of the plurality of columns;
combining d maximum eigenvalues into a first eigenvector f max The dimension of the material is d;
and generating an index vector idx by using the corresponding row index of each maximum characteristic value, wherein the point corresponding to the row index is a key point.
Wherein,acquiring a point cloud matrix F S The maximum eigenvalue of each column of (a) is the same as the feature dimension maximum pooling operation in PointNet. The key points are the points that should be preserved during the downsampling process.
Step 103: processing the first feature vector representing the key point to obtain a second feature vector representing the unique feature value of the key point;
since the index vector idx may contain multiple identical points at the same time. To avoid these duplicate points, a unique index is extracted from idx and the processed index vector is denoted by uidx. In addition to finding a vector with a unique index, feature vector f max Adding the components belonging to the same row index to obtain a unique characteristic value corresponding to the row index, and generating a characteristic vector f by using the unique characteristic value S A corresponding row index vector uidx;
step 104: sorting the elements of the second feature vector to obtain a sorted second feature vector and a corresponding index vector containing all key point indexes;
for the characteristic vector f S Sorting (sorting in ascending or descending order); performing post-sorting on the corresponding indexes in the uidx based on the sorting output to obtain an index vector suidx;
when a plurality of original point cloud data are batch-processed, the number of elements in suidx may be different for different point clouds in the input batch process, but the number of elements needs to be the same. The method further comprises the steps of:
acquiring an index vector suidx corresponding to the ordered second feature vector of each original point cloud data;
obtaining the maximum value D of the dimensions of all index vectors suidx max ;
Expanding each index vector suidx to D using nearest neighbor interpolation max Index vector rsuidx of dimension;
when the dimension of the index vector suidx is D, for the ith element of the index vector rsuidx, let
Wherein, [. Cndot. ] is an upward rounding symbol;
the i-th element of the index vector rsuidx is the j-th element of the index vector suidx.
For example, there is a known vector 1*5, which is to be expanded into a 1×10 vector, and if a value of the 4 th element in the 1×10 vector is to be obtained, it corresponds to a value of the 4/2=2 element in the original vector, and the 5 th element in the 1×10 vector corresponds to a value of the 5/2=2.5 element in the original vector, and the 3 rd element is rounded up.
Step 105: and acquiring the key points and the corresponding feature vectors thereof from the original point cloud data by using index vectors containing all the key point indexes.
Based on the foregoing embodiments, the embodiment of the present application provides a high-precision point cloud classification adaptive downsampling device for sensing a complex environment, and referring to fig. 2, the high-precision point cloud classification adaptive downsampling device 200 for sensing a complex environment provided in the embodiment of the present application at least includes:
an obtaining unit 201, configured to obtain a feature vector of each unordered point cloud in the original point cloud data, and generate a point cloud matrix with the feature vector as a row vector;
the computing unit 202 is configured to obtain a maximum feature value of each column of the point cloud matrix, and obtain a first feature vector representing the key point;
a processing unit 203, configured to process the first feature vector representing the key point to obtain a second feature vector representing a unique feature value of the key point;
a sorting unit 204, configured to sort the elements of the second feature vector, so as to obtain a sorted third feature vector and a corresponding index vector containing all the key point indexes;
the downsampling unit 205 is configured to obtain key points and corresponding feature vectors from the original point cloud by using index vectors including all the key point indexes.
It should be noted that, the principle of solving the technical problem by the complex environment-aware high-precision point cloud classification adaptive downsampling device 200 provided in the embodiment of the present application is similar to that of the method provided in the embodiment of the present application, so that the implementation of the complex environment-aware high-precision point cloud classification adaptive downsampling device 200 provided in the embodiment of the present application can refer to the implementation of the method provided in the embodiment of the present application, and the repetition is omitted.
Based on the foregoing embodiments, the embodiment of the present application further provides an electronic device, as shown in fig. 3, where the electronic device 300 provided in the embodiment of the present application includes at least: processor 301, memory 302, and a computer program stored on memory 302 and executable on processor 301, processor 301 when executing the computer program implements the complex context aware high precision point cloud classification adaptive downsampling method provided by embodiments of the present application.
The electronic device 300 provided by the embodiments of the present application may also include a bus 303 that connects the different components, including the processor 301 and the memory 302. Bus 303 represents one or more of several types of bus structures, including a memory bus, a peripheral bus, a local bus, and so forth.
The Memory 302 may include readable media in the form of volatile Memory, such as random access Memory (Random Access Memory, RAM) 3021 and/or cache Memory 3022, and may further include Read Only Memory (ROM) 3023.
The memory 302 may also include a program tool 3025 having a set (at least one) of program modules 3024, the program modules 3024 including, but not limited to: an operating subsystem, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
The electronic device 300 may also communicate with one or more external devices 304 (e.g., keyboard, remote control, etc.), one or more devices that enable a user to interact with the electronic device 300 (e.g., cell phone, computer, etc.), and/or any device that enables the electronic device 300 to communicate with one or more other electronic devices 300 (e.g., router, modem, etc.). Such communication may occur through an Input/Output (I/O) interface 305. Also, electronic device 300 may communicate with one or more networks such as a local area network (Local Area Network, LAN), a wide area network (Wide Area Network, WAN), and/or a public network such as the internet via network adapter 306. As shown in fig. 3, the network adapter 306 communicates with other modules of the electronic device 300 over the bus 303. It should be appreciated that although not shown in fig. 3, other hardware and/or software modules may be used in connection with electronic device 300, including, but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, disk array (Redundant Arrays of Independent Disks, RAID) subsystems, tape drives, data backup storage subsystems, and the like.
It should be noted that the electronic device 300 shown in fig. 3 is only an example, and should not impose any limitation on the functions and application scope of the embodiments of the present application.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores computer instructions, and the computer instructions realize the high-precision point cloud classification self-adaptive downsampling method for complex environment perception provided by the embodiment of the application when being executed by a processor. Specifically, the executable program may be built-in or installed in the electronic device 300, so that the electronic device 300 may implement the high-precision point cloud classification adaptive downsampling method for complex environment sensing provided in the embodiments of the present application by executing the built-in or installed executable program.
The high-precision point cloud classification adaptive downsampling method for complex environment awareness provided by the embodiments of the present application may also be implemented as a program product comprising program code for causing an electronic device 300 to perform the high-precision point cloud classification adaptive downsampling method for complex environment awareness provided by the embodiments of the present application when the program product is executable on the electronic device 300.
The program product provided by the embodiments of the present application may employ any combination of one or more readable media, where the readable media may be a readable signal medium or a readable storage medium, and the readable storage medium may be, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof, and more specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a RAM, a ROM, an erasable programmable read-Only Memory (Erasable Programmable Read Only Memory, EPROM), an optical fiber, a portable compact disk read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The program product provided by the embodiments of the present application may be implemented as a CD-ROM and include program code that may also be run on a computing device. However, the program product provided by the embodiments of the present application is not limited thereto, and in the embodiments of the present application, the readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such a division is merely exemplary and not mandatory. Indeed, the features and functions of two or more of the elements described above may be embodied in one element in accordance with embodiments of the present application. Conversely, the features and functions of one unit described above may be further divided into a plurality of units to be embodied.
Furthermore, although the operations of the methods of the present application are depicted in the drawings in a particular order, this is not required to or suggested that these operations must be performed in this particular order or that all of the illustrated operations must be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform.
Finally, it should be noted that the above embodiments are merely illustrative of the technical solution of the present application and not limiting. Although the present application has been described in detail with reference to the embodiments, it should be understood by those skilled in the art that the modifications and equivalents may be made to the technical solutions of the present application without departing from the spirit and scope of the technical solutions of the present application, and all such modifications and equivalents are intended to be encompassed in the scope of the claims of the present application.