Point cloud voxelization method and related apparatus

By simplifying the hash value calculation method and using the maximum coordinate value in the voxel space to calculate the hash value, the problem of parallel acceleration of point cloud voxelization on NPU is solved, and efficient point cloud voxelization processing is achieved.

WO2025261311A1PCT designated stage Publication Date: 2025-12-26YINWANG INTELLIGENT TECHNOLOGIES CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/101286
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-06-20
Filing Date
2025-06-16
Publication Date
2025-12-26

AI Technical Summary

Technical Problem

Existing point cloud voxelization schemes are difficult to achieve parallel acceleration on neural network processors (NPUs), and the creation and querying of hash tables are complex, resulting in poor performance.

Method used

A simplified hash value calculation method is adopted, which uses the maximum coordinate value in the voxel space to calculate the hash value. It is suitable for processors with SIMD architecture such as NPU, and accelerates point cloud voxelization in parallel by simplifying the hash value calculation process.

Benefits of technology

Efficient parallel processing of point cloud voxelization was achieved on the NPU, making full use of the computing resources of the heterogeneous computing platform and improving data processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025101286_26122025_PF_FP_ABST
    Figure CN2025101286_26122025_PF_FP_ABST
Patent Text Reader

Abstract

A point cloud voxelization method and a related apparatus, which are applied to the technical field of point cloud processing. During a hash value calculation process involved in point cloud voxelization, the present application introduces the maximum coordinate value of a voxel space to calculate hash values corresponding to voxel coordinates, such that the numerical ranges of the hash values can be limited, and the hash value calculation process is simplified, thus helping to accelerate a point cloud voxelization process. In addition, the hash value calculation method is applicable to processors of SIMD architectures such as an NPU, such that the present application can be deployed on a heterogeneous computing platform of the NPU; using different computing units of the heterogeneous computing platform can deploy different steps in the point cloud voxelization process on suitable computing units, so as to fully utilize computing resources of the heterogeneous computing platform, thus sufficiently exhibiting the capability of heterogeneous computing platforms and accelerating the implementation of point cloud voxelization.
Need to check novelty before this filing date? Find Prior Art

Description

A method and related apparatus for voxelization of point clouds

[0001] This application claims priority to Chinese Patent Application No. 202410808554.8, filed on June 20, 2024, entitled “A Method for Voxelization of Point Clouds and Related Apparatus”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of point cloud processing technology, and in particular to a point cloud voxelization method and related apparatus. Background Technology

[0003] LiDAR (Light Detection and Ranging) is an important sensor in autonomous vehicles, helping them perceive obstacles and achieve applications such as ranging and localization, 3D rendering, and map building. LiDAR scans objects in the 3D environment by emitting laser beams to detect target information. After coordinate transformation and motion distortion compensation, the target information detected by the LiDAR is processed into point cloud data, each point cloud containing information such as 3D spatial position, reflection intensity, and timestamp. Point cloud data can be used for tasks such as point cloud segmentation, target recognition, or target detection and tracking.

[0004] With the continuous evolution of LiDAR technology, LiDAR has developed from the initial mechanical type to the current solid-state type. The number of laser beams is constantly increasing, and the scanning resolution is constantly improving, resulting in a continuous increase in point cloud data. When using artificial intelligence (AI) networks to process point cloud data, the data processing pressure on the AI ​​network is greatly increased, so point cloud voxelization processing has emerged.

[0005] Voxels, short for volumetric pixels, are widely used in computer vision. Voxelization of laser point clouds involves grouping dense point cloud data into regular cubic voxels using a rasterization method, reducing the amount of point cloud data and thus improving data processing efficiency. Due to the downsampling characteristics of voxels, AI networks can extract voxel features more efficiently and complete data processing tasks.

[0006] Current point cloud voxelization schemes typically use hash tables to look up the correspondence between point clouds and voxels. This approach is easily parallelized and accelerated on processors with a single-instruction multiple-threads (SIMT) architecture, such as graphics processing units (GPUs). However, the hash algorithms required to build hash tables are overly complex, and the creation and retrieval of hash tables involve random read / write operations, limiting the applicable architectures. For example, processors with a single-instruction multiple-data (SIMD) architecture, such as neural network processing units (NPUs), struggle to support the random read / write operations involved in hash table creation and retrieval. Consequently, the aforementioned scheme cannot achieve parallel acceleration on NPUs, resulting in poor deployment performance on NPUs and heterogeneous NPU computing platforms. Summary of the Invention

[0007] This application provides a point cloud voxelization method and related apparatus, which can simplify the calculation process involved in point cloud voxelization and can be applied to processors with SIMD architecture such as NPU.

[0008] In a first aspect, embodiments of this application provide a point cloud voxelization method, the method comprising:

[0009] Acquire point cloud data, which includes N point cloud coordinates and N point cloud features, where N is a positive integer;

[0010] Calculate the corresponding N voxel coordinates based on the N point cloud coordinates, and obtain M voxel coordinates based on the N voxel coordinates. The M voxel coordinates are included in the N voxel coordinates, where M is a positive integer and M is less than or equal to N.

[0011] The N voxel coordinates are converted into N corresponding first hash values, which are related to the maximum coordinate value in the voxel space. The M voxel coordinates are converted into M corresponding second hash values, which are related to the maximum coordinate value in the voxel space. The coordinate range of the voxel space includes the N voxel coordinates.

[0012] Based on the N first hash values, the M second hash values, and the N point cloud features, the features of M voxels are obtained, and the M voxels correspond to the coordinates of the M voxels.

[0013] In this context, a point cloud can be understood as a set of points (or sampling points), containing one or more sampling points. Point cloud data can be understood as data including N sampling points. The data of each sampling point includes a point cloud coordinate and a point cloud feature. The point cloud coordinate and point cloud feature of the same sampling point are associated with that same sampling point. In other words, the point cloud coordinate and point cloud feature of the same sampling point correspond to each other, thus there is a one-to-one correspondence between the aforementioned N point cloud coordinates and the aforementioned N point cloud features.

[0014] For each of the N point cloud coordinates mentioned above, the corresponding voxel coordinates can be calculated. One point cloud coordinate yields one voxel coordinate, and thus N point cloud coordinates yield N voxel coordinates. It can be understood that each of the N point cloud coordinates corresponds to one sampling point, and correspondingly, each of the N voxel coordinates also corresponds to one sampling point; that is, there is a one-to-one correspondence between the N voxel coordinates and the N sampling points.

[0015] Since different sampling points (e.g., sampling points that are close together) may be grouped into the same voxel, the calculated voxel coordinates of different point cloud coordinates may be the same. Therefore, there may be duplicate voxel coordinates in the above N voxel coordinates. The above N voxel coordinates can be deduplicated to obtain M voxel coordinates. Here, M refers to the number of voxels, and each voxel coordinate in the above M voxel coordinates corresponds to one voxel, that is, there is a one-to-one correspondence between the above M voxel coordinates and M voxels.

[0016] For each voxel coordinate in the aforementioned N voxel coordinates, a first hash value can be calculated. One voxel coordinate yields one first hash value, thus N voxel coordinates yield N first hash values. It can be understood that when there are duplicate voxel coordinates in the aforementioned N voxel coordinates, correspondingly, there will also be duplicate first hash values ​​among the N first hash values. As mentioned earlier, each voxel coordinate in the aforementioned N voxel coordinates corresponds to one sampling point, and correspondingly, each of the aforementioned N first hash values ​​corresponds to one sampling point; that is, there is a one-to-one correspondence between the aforementioned N first hash values ​​and the aforementioned N sampling points.

[0017] For each voxel coordinate in the aforementioned M voxel coordinates, a second hash value can be calculated. One voxel coordinate yields one second hash value, thus M voxel coordinates yield M second hash values. It can be understood that the aforementioned M voxel coordinates are deduplicated voxel coordinates; correspondingly, there are no duplicate second hash values ​​among the M second hash values. As mentioned earlier, each voxel coordinate in the aforementioned M voxel coordinates corresponds to one voxel, and correspondingly, each of the aforementioned M second hash values ​​corresponds to one voxel; that is, there is a one-to-one correspondence between the aforementioned M second hash values ​​and the aforementioned M voxels.

[0018] Based on the above N first hash values ​​and the above M second hash values, the correspondence between N sampling points and M voxels (or the correspondence between point cloud and voxels) can be obtained. This correspondence can indicate the sampling point corresponding to each voxel. Then, the features of each voxel can be calculated based on the point cloud features of the sampling points corresponding to each voxel, and the M voxel features can be obtained, thereby reducing the N point cloud features to M voxel features and realizing point cloud voxelization.

[0019] In the above embodiments, during the hash value calculation process involved in point cloud voxelization, the maximum coordinate value in the voxel space is introduced to calculate the hash value corresponding to the voxel coordinates. This limits the numerical range of the hash value, simplifies the hash value calculation process, and thus helps to accelerate the point cloud voxelization process. Furthermore, this hash value calculation method is applicable to processors with SIMD architectures such as NPUs. Therefore, the above embodiments can be deployed on NPU heterogeneous computing platforms. By utilizing different computing units on the heterogeneous computing platform, different steps in the point cloud voxelization process can be deployed on suitable computing units. Combining the powerful SIMD parallel computing capabilities of the NPU with the functional flexibility of the heterogeneous computing platform, the computing resources of the heterogeneous computing platform are fully utilized, thereby maximizing the capabilities of the heterogeneous computing platform and accelerating the point cloud voxelization process.

[0020] In one possible implementation, the relationship between the first hash value or the second hash value and the maximum coordinate value in the voxel space is as follows: hash = a * B max *C max +b*C max +c;

[0021] Where a, b, and c represent the voxel coordinates in the first, second, and third dimensions, respectively, and B... max C is greater than or equal to the maximum coordinate value in the second dimension of the voxel space. max The value is greater than or equal to the maximum coordinate value of the voxel space in the third dimension, and hash represents the first hash value or the second hash value corresponding to the voxel coordinate.

[0022] In the above embodiments, the voxel space can be understood as a three-dimensional space composed of individual voxels. The principle of the hash value calculation formula can be understood as reading voxels in the voxel space sequentially along the third, second, and first dimensions. The resulting hash value has a limited range, and the maximum value of the hash value is less than A. max *B max *C maxFurthermore, the hash value calculation formula described above ensures that the hash values ​​calculated using different voxel coordinates are different, thus guaranteeing the uniqueness of the hash values ​​and facilitating subsequent lookup of corresponding relationships. In addition, the hash value calculation formula only involves simple multiplication and addition operations, simplifying the calculation process compared to complex hash algorithms, making it applicable to processors with SIMD architectures such as NPUs.

[0023] In one possible implementation, obtaining the features of M voxels based on the N first hash values, the M second hash values, and the N point cloud features includes:

[0024] Based on the N first hash values ​​and the M second hash values, the correspondence between the N point cloud coordinates and the M voxel coordinates is obtained;

[0025] For each voxel coordinate in the M voxel coordinates, K point cloud coordinates corresponding to the voxel coordinates are obtained according to the correspondence. Based on the K point cloud features corresponding to the K point cloud coordinates, the features of the voxel corresponding to the voxel coordinates are obtained. K is a positive integer, and K is less than or equal to N.

[0026] Since the M voxel coordinates mentioned above are obtained by deduplicating the N voxel coordinates, the N first hash values ​​calculated based on the N voxel coordinates and the M second hash values ​​calculated based on the M voxel coordinates have a matching relationship. These M second hash values ​​can also be understood as the deduplicated results of the N first hash values. In other words, each of the N first hash values ​​can find a matching second hash value among the M second hash values, and each of the M second hash values ​​can find one or more matching first hash values ​​among the N first hash values.

[0027] Specifically, if a first hash value equals a second hash value, then the first hash value matches the second hash value. Correspondingly, the sampling point corresponding to the first hash value corresponds to the voxel corresponding to the second hash value; that is, the point cloud coordinates corresponding to the first hash value correspond to the voxel coordinates corresponding to the second hash value. In this way, the correspondence between N point cloud coordinates and M voxel coordinates can be obtained (or the correspondence between point cloud and voxel).

[0028] Based on the correspondence between the N point cloud coordinates and the M voxel coordinates, the point cloud coordinates corresponding to each voxel coordinate in the M voxel coordinates can be obtained. It can be understood that each voxel coordinate in the M voxel coordinates corresponds to one or more point cloud coordinates.

[0029] Specifically, for each voxel coordinate in the aforementioned M voxel coordinates, the number of point cloud coordinates corresponding to that voxel coordinate is denoted as K, meaning that the voxel coordinate corresponds to K point cloud coordinates, and these K point cloud coordinates are included in the aforementioned N point cloud coordinates. These K point cloud coordinates correspond to K sampling points, and correspondingly, they correspond to K point cloud features. These K point cloud features are also the point cloud features of the K sampling points corresponding to the K point cloud coordinates, and these K point cloud features are included in the aforementioned N point cloud features. Then, based on these K point cloud features, the features of the voxel corresponding to the voxel coordinate can be calculated. For example, the average value of the K point cloud features can be calculated as the feature of the voxel corresponding to the voxel coordinate. Alternatively, the maximum value among the K point cloud features can be selected as the feature of the voxel corresponding to the voxel coordinate.

[0030] In the above implementation, N first hash values ​​correspond one-to-one with N point cloud coordinates (i.e., N sampling points), and M second hash values ​​correspond one-to-one with M voxel coordinates (i.e., M voxels). Based on the N first hash values ​​and M second hash values, the correspondence between the N point cloud coordinates and the M voxel coordinates can be obtained. Based on this correspondence, the N sampling points can be merged into M voxels. Subsequently, the point cloud features of multiple sampling points belonging to the same voxel can be processed into a single voxel feature, thereby reducing the N point cloud features to M voxel features. This reduces the amount of feature data that needs to be processed subsequently.

[0031] In one possible implementation, obtaining the correspondence between the N point cloud coordinates and the M voxel coordinates based on the N first hash values ​​and the M second hash values ​​includes:

[0032] The N first hash values ​​are sorted to obtain N sorted first hash values, and the M second hash values ​​are sorted to obtain M sorted second hash values.

[0033] Select one first hash value from the sorted N first hash values ​​one by one as the current first hash value. For each current first hash value, query the target second hash value that matches the current first hash value from the sorted M second hash values, and determine that the point cloud coordinates corresponding to the current first hash value correspond to the voxel coordinates corresponding to the target second hash value.

[0034] The N sorted first hash values ​​and the M sorted second hash values ​​are arranged either in ascending order or in descending order. Since the M second hash values ​​can also be understood as the deduplicated results of the N first hash values, the first first hash value among the N sorted first hash values ​​is equal to the first second hash value among the M sorted second hash values. Similarly, the Nth first hash value among the N sorted first hash values ​​is also equal to the Mth second hash value among the M sorted second hash values.

[0035] Each of the N sorted first hash values ​​is taken as a current first hash value. Then, a second hash value (denoted as the target second hash value) matching the current first hash value is searched from the M sorted second hash values. Once a target second hash value matching the current first hash value is found, it can be determined that the point cloud coordinates corresponding to the current first hash value correspond to the voxel coordinates corresponding to the target second hash value. After traversing all the N sorted first hash values, the correspondence between the N point cloud coordinates and the M voxel coordinates can be obtained.

[0036] In the above implementation, the N first hash values ​​and M second hash values ​​are first sorted. Then, by traversing the sorted N first hash values, the second hash value matching each first hash value is queried from the sorted M second hash values ​​to obtain the correspondence between point clouds and voxels. Since the first and second hash values ​​are sorted, only one numerical comparison is needed when querying the second hash value matching the first hash value, instead of comparing the first hash value with all M second hash values. This can greatly reduce the query range and improve query efficiency.

[0037] In one possible implementation, the sorted N first hash values ​​and the sorted M second hash values ​​are arranged in ascending order;

[0038] For each current first hash value, querying the M sorted second hash values ​​for a target second hash value that matches the current first hash value includes:

[0039] The first of the sorted M second hash values ​​is taken as the target second hash value that matches the first current first hash value;

[0040] For the i-th current first hash value, compare the i-th current first hash value with the target second hash value that matches the (i-1)-th current first hash value among the sorted M second hash values, where i is a positive integer, 1 < i ≤ N;

[0041] If the i-th current first hash value is equal to the target second hash value that matches the (i-1)-th current first hash value, then the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value.

[0042] If the i-th current first hash value is greater than the target second hash value that matches the (i-1)-th current first hash value, then the next second hash value of the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value.

[0043] For the first current first hash value (i.e. the first first hash value after sorting), since the first first hash value among the above sorted N first hash values ​​is equal to the first second hash value among the above sorted M second hash values, the first second hash value among the above sorted M second hash values ​​can be directly used as the target second hash value that matches the first current first hash value without comparison, thus improving search efficiency.

[0044] Starting with the second current first hash value (i.e., the second sorted first hash value), a matching target second hash value can be found by comparison. Specifically, for the i-th (i is a positive integer, ranging from 2 to N) current first hash value, the i-th current first hash value is compared with the target second hash value (denoted as the candidate second hash value) that matches the (i-1)-th current first hash value among the M sorted second hash values.

[0045] It is understandable that, since the sorted N first hash values ​​and the sorted M second hash values ​​are arranged in ascending order, the i-th current first hash value is greater than or equal to the (i-1)-th current first hash value. The target second hash value (i.e., the candidate second hash value) that matches the (i-1)-th current first hash value is equal to the (i-1)-th current first hash value. Therefore, the i-th current first hash value is greater than or equal to the candidate second hash value.

[0046] In one possible scenario, the i-th current first hash value is equal to the candidate second hash value. In this case, the candidate second hash value is used as the target second hash value to match the i-th current first hash value. In another possible scenario, the i-th current first hash value is greater than the candidate second hash value. In this case, the next second hash value of the candidate second hash value must be equal to the i-th current first hash value. Therefore, the next second hash value of the candidate second hash value is directly used as the target second hash value to match the i-th current first hash value without further comparison.

[0047] Therefore, in both cases, only one comparison is needed (i.e., comparing whether the i-th current first hash value is equal to the candidate second hash value) to determine the target second hash value that matches the i-th current first hash value. This can greatly reduce the search range and improve search efficiency.

[0048] In one possible implementation, the sorted N first hash values ​​and the sorted M second hash values ​​are arranged in descending order;

[0049] For each current first hash value, querying the M sorted second hash values ​​for a target second hash value that matches the current first hash value includes:

[0050] The first of the sorted M second hash values ​​is taken as the target second hash value that matches the first current first hash value;

[0051] For the i-th current first hash value, compare the i-th current first hash value with the target second hash value that matches the (i-1)-th current first hash value among the sorted M second hash values, where i is a positive integer, 1 < i ≤ N;

[0052] If the i-th current first hash value is equal to the target second hash value that matches the (i-1)-th current first hash value, then the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value.

[0053] If the i-th current first hash value is less than the target second hash value that matches the (i-1)-th current first hash value, then the next second hash value of the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value.

[0054] For the first current first hash value (i.e. the first first hash value after sorting), since the first first hash value among the above sorted N first hash values ​​is equal to the first second hash value among the above sorted M second hash values, the first second hash value among the above sorted M second hash values ​​can be directly used as the target second hash value that matches the first current first hash value without comparison, thus improving search efficiency.

[0055] Starting with the second current first hash value (i.e., the second sorted first hash value), a matching target second hash value can be found by comparison. Specifically, for the i-th (i is a positive integer, ranging from 2 to N) current first hash value, the i-th current first hash value is compared with the target second hash value (denoted as the candidate second hash value) that matches the (i-1)-th current first hash value among the M sorted second hash values.

[0056] It is understandable that, since the sorted N first hash values ​​and the sorted M second hash values ​​are arranged in descending order, the i-th current first hash value is less than or equal to the (i-1)-th current first hash value. The target second hash value (i.e., the candidate second hash value) that matches the (i-1)-th current first hash value is equal to the (i-1)-th current first hash value. Therefore, the i-th current first hash value is less than or equal to the candidate second hash value.

[0057] In one possible scenario, the i-th current first hash value is equal to the candidate second hash value. In this case, the candidate second hash value is used as the target second hash value to match the i-th current first hash value. In another possible scenario, the i-th current first hash value is less than the candidate second hash value. In this case, the next second hash value of the candidate second hash value must be equal to the i-th current first hash value. Therefore, the next second hash value of the candidate second hash value is directly used as the target second hash value to match the i-th current first hash value without further comparison.

[0058] Therefore, in both cases, only one comparison is needed (i.e., comparing whether the i-th current first hash value is equal to the candidate second hash value) to determine the target second hash value that matches the i-th current first hash value. This can greatly reduce the search range and improve search efficiency.

[0059] In one possible implementation, obtaining the correspondence between the N point cloud coordinates and the M voxel coordinates based on the N first hash values ​​and the M second hash values ​​includes:

[0060] A one-dimensional table is created, the storage size of which is related to the maximum coordinate value in the voxel space;

[0061] For each of the M second hash values, the voxel identifier corresponding to the second hash value is stored in the position in the one-dimensional table that matches the second hash value;

[0062] For each of the N first hash values, the target location is queried from the one-dimensional table using the first hash value as an index, and the point cloud coordinates corresponding to the first hash value are determined to correspond to the voxel coordinates corresponding to the voxel identifier at the target location.

[0063] Here, voxel identifiers are used to distinguish different voxels, with each voxel identifier corresponding to one voxel. Correspondingly, each voxel identifier corresponds to a second hash value, that is, a voxel coordinate. Optionally, the voxel identifier can be a voxel sequence number. For example, the above M voxel coordinates or M second hash values ​​can be numbered to obtain M voxel sequence numbers, with each voxel sequence number corresponding to one voxel.

[0064] The position in a one-dimensional table that matches the second hash value can be understood as the position's index in the one-dimensional table being equal to the second hash value. For example, if the second hash value is 100, then the position in the one-dimensional table that matches the second hash value 100 is the 100th position in the one-dimensional table, and the voxel identifier corresponding to the second hash value 100 is stored in the 100th position of the one-dimensional table.

[0065] The target location refers to the location that matches the first hash value. It can also be understood as the target location's index in the one-dimensional table being equal to the first hash value. For example, if the first hash value is 100, the target location retrieved from the one-dimensional table using the first hash value 100 as an index is the 100th position in the one-dimensional table. This determines that the point cloud coordinates (or sampling points) corresponding to the first hash value 100 correspond to the voxel coordinates (or voxels) corresponding to the voxel identifier stored at the 100th position in the one-dimensional table.

[0066] In the above implementation, the correspondence between point clouds and voxels is obtained through table creation and lookup indexing. The logic is simple and can be applied to various computing units such as CPU or GPU.

[0067] In one possible implementation, the method further includes:

[0068] The N first hash values ​​are sorted to obtain N sorted first hash values, and the M second hash values ​​are sorted to obtain M sorted second hash values. The N sorted first hash values ​​and the M sorted second hash values ​​are arranged in ascending order or in descending order.

[0069] For each of the M second hash values, storing the voxel index corresponding to the second hash value into the position in the one-dimensional table that matches the second hash value includes:

[0070] Select one second hash value from the sorted M second hash values ​​one by one, and store the voxel identifier corresponding to the second hash value into the position in the one-dimensional table that matches the second hash value;

[0071] The step of querying the target location from the one-dimensional table using the first hash value as an index for each of the N first hash values ​​includes:

[0072] Select one first hash value from the sorted N first hash values ​​one by one, and use the first hash value as an index to query the target position from the one-dimensional table.

[0073] In the above implementation, sorting the hash values ​​before storing and querying the one-dimensional table ensures that the data stored in the one-dimensional table is also ordered, which helps improve query efficiency and thus quickly obtain the correspondence between point clouds and voxels.

[0074] In one possible implementation, calculating the corresponding N voxel coordinates based on the N point cloud coordinates includes:

[0075] For each of the N point cloud coordinates, divide the point cloud coordinate by the step size of the voxel space to obtain the corresponding voxel coordinate.

[0076] In this context, voxel space refers to the three-dimensional space composed of voxels. Each voxel can be considered as a cube, and the step size of the voxel space can be understood as the side length of the cube-shaped voxel. The difference in point cloud coordinates merged into the same voxel is within this step size. It should be understood that the step size of the voxel space can be predefined or preset, or it can be determined based on the actual point cloud coordinates.

[0077] In the above embodiments, the corresponding voxel coordinates are obtained by dividing the point cloud coordinates by the step size of the voxel space. This makes the voxel coordinates corresponding to different point cloud coordinates that are close to each other the same, so that dense point clouds can be merged into voxels. The calculation method is simple and easy to implement.

[0078] Secondly, embodiments of this application provide a point cloud voxelization apparatus, which includes modules or units for performing the methods described in the first aspect or any possible implementation thereof.

[0079] In one possible implementation, the device includes:

[0080] The first unit is used to acquire point cloud data, which includes N point cloud coordinates and N point cloud features, where N is a positive integer;

[0081] The second unit is used to calculate the corresponding N voxel coordinates based on the N point cloud coordinates, and to obtain M voxel coordinates based on the N voxel coordinates. The M voxel coordinates are included in the N voxel coordinates, where M is a positive integer and M is less than or equal to N.

[0082] The third unit is used to convert the N voxel coordinates into N corresponding first hash values, the first hash values ​​being related to the maximum coordinate value in the voxel space, and to convert the M voxel coordinates into M corresponding second hash values, the second hash values ​​being related to the maximum coordinate value in the voxel space, wherein the coordinate range of the voxel space includes the N voxel coordinates.

[0083] The fourth unit is used to obtain the features of M voxels based on the N first hash values, the M second hash values ​​and the N point cloud features, wherein the M voxels correspond to the coordinates of the M voxels.

[0084] In one possible implementation, the relationship between the first hash value or the second hash value and the maximum coordinate value in the voxel space is as follows: hash = a * B max *C max +b*C max +c;

[0085] Where a, b, and c represent the voxel coordinates in the first, second, and third dimensions, respectively, and B... max C is greater than or equal to the maximum coordinate value in the second dimension of the voxel space. max The value is greater than or equal to the maximum coordinate value of the voxel space in the third dimension, and hash represents the first hash value or the second hash value corresponding to the voxel coordinate.

[0086] In one possible implementation, when the fourth unit obtains the features of M voxels based on the N first hash values, the M second hash values, and the N point cloud features, it is specifically used for:

[0087] Based on the N first hash values ​​and the M second hash values, the correspondence between the N point cloud coordinates and the M voxel coordinates is obtained;

[0088] For each voxel coordinate in the M voxel coordinates, K point cloud coordinates corresponding to the voxel coordinates are obtained according to the correspondence. Based on the K point cloud features corresponding to the K point cloud coordinates, the features of the voxel corresponding to the voxel coordinates are obtained. K is a positive integer, and K is less than or equal to N.

[0089] In one possible implementation, when the fourth unit obtains the correspondence between the N point cloud coordinates and the M voxel coordinates based on the N first hash values ​​and the M second hash values, it is specifically used for:

[0090] The N first hash values ​​are sorted to obtain N sorted first hash values, and the M second hash values ​​are sorted to obtain M sorted second hash values. The N sorted first hash values ​​and the M sorted second hash values ​​are arranged in ascending order or in descending order.

[0091] Select one first hash value from the sorted N first hash values ​​as the current first hash value. For each current first hash value, query the target second hash value that matches the current first hash value from the sorted M second hash values. Determine that the point cloud coordinates corresponding to the current first hash value correspond to the voxel coordinates corresponding to the target second hash value.

[0092] The first first hash value among the sorted N first hash values ​​is equal to the first second hash value among the sorted M second hash values.

[0093] In one possible implementation, the sorted N first hash values ​​and the sorted M second hash values ​​are arranged in ascending order;

[0094] When the fourth unit queries the sorted M second hash values ​​for each current first hash value to find a target second hash value that matches the current first hash value, it is specifically used for:

[0095] The first of the sorted M second hash values ​​is taken as the target second hash value that matches the first current first hash value;

[0096] For the i-th current first hash value, compare the i-th current first hash value with the target second hash value that matches the (i-1)-th current first hash value among the sorted M second hash values, where i is a positive integer, 1 < i ≤ N;

[0097] If the i-th current first hash value is equal to the target second hash value that matches the (i-1)-th current first hash value, then the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value.

[0098] If the i-th current first hash value is greater than the target second hash value that matches the (i-1)-th current first hash value, then the next second hash value of the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value.

[0099] In one possible implementation, the sorted N first hash values ​​and the sorted M second hash values ​​are arranged in descending order;

[0100] When the fourth unit queries the sorted M second hash values ​​for each current first hash value to find a target second hash value that matches the current first hash value, it is specifically used for:

[0101] The first of the sorted M second hash values ​​is taken as the target second hash value that matches the first current first hash value;

[0102] For the i-th current first hash value, compare the i-th current first hash value with the target second hash value that matches the (i-1)-th current first hash value among the sorted M second hash values, where i is a positive integer, 1 < i ≤ N;

[0103] If the i-th current first hash value is equal to the target second hash value that matches the (i-1)-th current first hash value, then the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value.

[0104] If the i-th current first hash value is less than the target second hash value that matches the (i-1)-th current first hash value, then the next second hash value of the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value.

[0105] In one possible implementation, when the fourth unit obtains the correspondence between the N point cloud coordinates and the M voxel coordinates based on the N first hash values ​​and the M second hash values, it is specifically used for:

[0106] A one-dimensional table is created, the storage size of which is related to the maximum coordinate value in the voxel space;

[0107] For each of the M second hash values, the voxel identifier corresponding to the second hash value is stored in the position in the one-dimensional table that matches the second hash value;

[0108] For each of the N first hash values, the target location is queried from the one-dimensional table using the first hash value as an index, and the point cloud coordinates corresponding to the first hash value are determined to correspond to the voxel coordinates corresponding to the voxel identifier at the target location.

[0109] In one possible implementation, the fourth unit is further configured to:

[0110] The N first hash values ​​are sorted to obtain N sorted first hash values, and the M second hash values ​​are sorted to obtain M sorted second hash values. The N sorted first hash values ​​and the M sorted second hash values ​​are arranged in ascending order or in descending order.

[0111] When the fourth unit stores the voxel index corresponding to each of the M second hash values ​​into the position matching the second hash value in the one-dimensional table for each second hash value, it is specifically used for:

[0112] Select one second hash value from the sorted M second hash values ​​one by one, and store the voxel identifier corresponding to the second hash value into the position in the one-dimensional table that matches the second hash value;

[0113] When the fourth unit queries the target location from the one-dimensional table using the first hash value as an index for each of the N first hash values, it is specifically used for:

[0114] Select one first hash value from the sorted N first hash values ​​one by one, and use the first hash value as an index to query the target position from the one-dimensional table.

[0115] In one possible implementation, when the second unit calculates the corresponding N voxel coordinates based on the N point cloud coordinates, it is specifically used for:

[0116] For each of the N point cloud coordinates, divide the point cloud coordinate by the step size of the voxel space to obtain the corresponding voxel coordinate.

[0117] Thirdly, embodiments of this application provide an electronic device including a processor coupled to a memory, which can be used to execute computer programs or instructions in the memory to implement the methods described in the first aspect or any possible implementation thereof. Optionally, the electronic device further includes a memory. Optionally, the electronic device further includes a communication interface, and the processor is coupled to the communication interface.

[0118] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program or instructions that, when executed, cause the method described in the first aspect or any possible implementation thereof to be implemented.

[0119] Fifthly, embodiments of this application provide a computer program product, the computer program product including a computer program or instructions, which, when executed, cause the method described in the first aspect or any possible implementation thereof to be implemented.

[0120] Optionally, the computer program product can be a software installation package or an image package. If the aforementioned method is required, the computer program product can be downloaded and executed on a computing device.

[0121] Sixthly, embodiments of this application provide a chip including a processor for executing computer programs or instructions. When the processor executes the computer programs or instructions, the chip causes it to perform the method described in the first aspect or any possible implementation thereof. Optionally, the chip further includes a communication interface for receiving or transmitting signals.

[0122] In a seventh aspect, embodiments of this application provide a heterogeneous computing platform, which includes a first processor and a second processor, wherein the first processor and the second processor are used to execute the method described in the first aspect or any possible implementation thereof.

[0123] Optionally, the first processor is an NPU, and the second processor includes a CPU and / or a GPU.

[0124] The beneficial effects of the technical solutions provided in the second to seventh aspects above can be referred to the beneficial effects of the technical solutions in the first aspect, and will not be repeated here. Attached Figure Description

[0125] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly described below.

[0126] Figure 1 is a flowchart illustrating a possible point cloud voxelization method;

[0127] Figure 2 is a schematic diagram of an application scenario of a point cloud voxelization method provided in an embodiment of this application;

[0128] Figure 3 is a flowchart illustrating a point cloud voxelization method provided in an embodiment of this application;

[0129] Figure 4 is a schematic diagram of a correspondence provided in an embodiment of this application;

[0130] Figure 5 is a schematic diagram of a point cloud voxelization device provided in an embodiment of this application;

[0131] Figure 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0132] Figure 7 is a schematic diagram of the structure of a chip provided in an embodiment of this application. Detailed Implementation

[0133] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described below with reference to the accompanying drawings.

[0134] In this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or illustration. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0135] The terms "first" and "second," etc., used in the embodiments of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0136] The term "embodiment" as used herein means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that, unless otherwise specified or logically conflicting, the terminology and / or descriptions between the various embodiments of this application are consistent and can be mutually referenced, and technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships.

[0137] It should be understood that in this application, "at least one (item)" means one or more, "more than one" means two or more, "at least two (items)" means two or three or more, and "and / or" is used to describe the relationship between related objects, indicating that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the related objects before and after are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0138] Currently, most point cloud voxelization methods used in the industry are based on graphics processing units (GPUs). These methods leverage the GPU's single instruction multiple threads (SIMT) processing mode to improve the parallelism of data processing and accelerate the point cloud voxelization process. SIMT distributes a single instruction to multiple independent computing units via multiple threads. Each computing unit can independently select different data segments for processing. Once all threads have completed their tasks, the instruction task is finished. Based on this approach, the GPU can simultaneously distribute the point cloud voxelization data processing task to various computing units, assigning different point cloud data segments to each unit. After completing their tasks, the computing units return voxel data.

[0139] Please refer to Figure 1, which is a flowchart of a possible point cloud voxelization method, including the following steps S101 to S106.

[0140] S101, acquire point cloud data.

[0141] S102, calculate the corresponding voxel coordinates based on the point cloud data.

[0142] S103 uses a hash algorithm to calculate the corresponding hash value based on the point cloud coordinates and the corresponding hash value based on the voxel coordinates.

[0143] S104. Establish a point cloud hash table based on the hash value and sequence number of the point cloud coordinates, and establish a voxel hash table based on the hash value and sequence number of the voxel coordinates.

[0144] S105, find the correspondence between point cloud and voxel based on the point cloud hash table and the voxel hash table.

[0145] S106, Calculate the features of the voxels based on the correspondence between point clouds and voxels.

[0146] The above process uses the same treatment method for each point cloud data, allowing direct segmentation of the point cloud data before distribution to various computing units. A hash table is a data structure that supports fast access. Each computing unit stores the hash values ​​of point clouds and voxels using a hash table. Once the hash table is established, the corresponding hash value can be quickly looked up to obtain the mapping between point clouds and voxels.

[0147] The aforementioned scheme of using a hash table to find the correspondence between point clouds and voxels is easily parallelized and accelerated on GPUs and other SIMT architecture processors. However, the hash algorithm required to build the hash table is too complex, and the creation and querying of the hash table are random read / write operations, which limits its applicability to certain architectures.

[0148] For example, on processors with a single instruction multiple data (SIMD) architecture, such as neural network processing units (NPUs), operations generally require data to be regular and to use the same logic processing. This makes it impossible to support random read and write operations such as hash table creation and lookup. Therefore, the above-mentioned solutions cannot achieve parallel acceleration on the NPU alone.

[0149] For example, on an NPU heterogeneous computing platform, although the creation and lookup operations of hash tables can be offloaded to other computing units on the platform, the following problems exist: First, the parallelism of the central processing unit (CPU) is poor, making the creation and lookup operations for large amounts of point cloud data too slow; second, the main computing unit of the NPU heterogeneous computing platform is the NPU, and considering cost factors, the performance of the GPU will not be very strong. Therefore, the above solution has poor deployment performance on the NPU heterogeneous computing platform and cannot fully utilize the computing power of the NPU heterogeneous computing platform.

[0150] In view of this, embodiments of this application provide a point cloud voxelization method and related apparatus, which can simplify the calculation process involved in point cloud voxelization and can be applied to processors with SIMD architecture such as NPU.

[0151] Please refer to Figure 2, which is a schematic diagram of an application scenario for a point cloud voxelization method provided in an embodiment of this application. The application scenario is an NPU heterogeneous computing platform, including an NPU, a CPU and / or a GPU, and optionally memory (MEM). The NPU, CPU, GPU and MEM can communicate with each other to exchange data or information.

[0152] The dashed line in Figure 2 illustrates a possible data processing flow: the MEM loads point cloud data, the NPU reads the point cloud data from the MEM and calculates the voxel coordinates and corresponding hash values ​​based on the point cloud data, and then transmits the calculated data to the CPU / GPU. The CPU / GPU obtains the correspondence between the point cloud and the voxels based on the data, and then transmits the correspondence to the NPU. The NPU calculates the voxel features based on the correspondence and stores the voxel features in the MEM.

[0153] It should be understood that the NPU heterogeneous computing platform shown in Figure 2 is merely an example, and the system architecture applicable to the embodiments of this application is not limited thereto. For example, the embodiments of this application can also be applied to SIMT architectures (e.g., GPUs), or computing platforms with similar NPU architectures.

[0154] The point cloud voxelization method provided in the embodiments of this application is described below.

[0155] Please refer to Figure 3, which is a flowchart illustrating a point cloud voxelization method provided in an embodiment of this application. This point cloud voxelization method can be applied to the NPU heterogeneous computing platform shown in Figure 2 above, and includes, but is not limited to, the following steps S301 to S304.

[0156] S301, acquire point cloud data, which includes N point cloud coordinates and N point cloud features. Where N is a positive integer.

[0157] A point cloud can be understood as a collection of points (or sampling points), containing one or more sampling points. Each sampling point in this collection is associated with a set of data, which may include the coordinates (referred to as point cloud coordinates for distinction) and features (referred to as point cloud features for distinction). The point cloud coordinates are three-dimensional coordinates, and the point cloud features may include, but are not limited to, features such as distance, intensity, velocity, reflectivity, or color.

[0158] Point cloud data can be understood as data comprising N sampling points. Each sampling point includes a point cloud coordinate and a point cloud feature, thus the point cloud data includes N point cloud coordinates and N point cloud features. The point cloud coordinates and point cloud features of the same sampling point are associated with that same sampling point; that is, the point cloud coordinates and point cloud features of the same sampling point correspond to each other, thus there is a one-to-one correspondence between the aforementioned N point cloud coordinates and N point cloud features.

[0159] S302, calculate the corresponding N voxel coordinates based on the N point cloud coordinates, and obtain M voxel coordinates based on the N voxel coordinates. The M voxel coordinates are contained within the N voxel coordinates. Here, M is a positive integer, and M is less than or equal to N.

[0160] For each point cloud coordinate in the N point cloud coordinates, the corresponding voxel coordinates can be calculated. These voxel coordinates can also be understood as the coordinates of the voxel to which the sampling point represented by the point cloud coordinate belongs. Through this calculation, one point cloud coordinate yields one voxel coordinate, and thus N point cloud coordinates yield N voxel coordinates. It can be understood that each of the N point cloud coordinates corresponds to one sampling point, and correspondingly, each of the N voxel coordinates also corresponds to one sampling point; that is, there is a one-to-one correspondence between the N voxel coordinates and the N sampling points.

[0161] Since different sampling points (e.g., sampling points that are close together) may be grouped into the same voxel, the calculated voxel coordinates of different point cloud coordinates may be the same. Therefore, there may be duplicate voxel coordinates in the above N voxel coordinates. The above N voxel coordinates can be deduplicated to obtain M voxel coordinates. Here, M refers to the number of voxels, and each voxel coordinate in the above M voxel coordinates corresponds to one voxel, that is, there is a one-to-one correspondence between the above M voxel coordinates and M voxels.

[0162] In one possible implementation, for each of the N point cloud coordinates, the corresponding voxel coordinate is obtained by dividing the point cloud coordinate by the step size of the voxel space.

[0163] Voxel space can be understood as a three-dimensional space composed of voxels, and the coordinate range of this voxel space includes the aforementioned N voxel coordinates. Each voxel can be regarded as a cube, and the step size of the voxel space can be understood as the side length of the cube-shaped voxel. The difference in point cloud coordinates merged into the same voxel is within this step size. It should be understood that the step size of the voxel space can be predefined or preset, or it can be determined based on the actual point cloud coordinates.

[0164] For example, point cloud coordinates are represented by (x pcl y pcl , z pcl ) represents the voxel coordinates, which are represented by (x vxl y vxl , z vxl The following is an example of a formula for calculating the corresponding voxel coordinates based on point cloud coordinates (denoted as Formula 1):

[0165] Where, x pcl y pcl and z pcl These represent the point cloud coordinates along the X, Y, and Z axes, respectively. vxl y vxl and z vxlThese represent the voxel coordinates along the X, Y, and Z axes, respectively. Δx, Δy, and Δz represent the step size in voxel space along the X, Y, and Z axes, respectively; optionally, Δx, Δy, and Δz are all equal. || represents the integer division sign. The X, Y, and Z axes can be predefined or preset.

[0166] In Formula 1 above, dividing the point cloud coordinates by the step size of the voxel space yields the voxel position corresponding to those coordinates. Multiplying by the step size of the voxel space ensures that the units of measurement in the voxel space and the point cloud space are consistent.

[0167] It should be noted that in other examples, after dividing the point cloud coordinates by the voxel space step size, it is not necessary to multiply by the voxel space step size; that is, the units of measurement for voxel space and point cloud space can be different. Below is another example of the formula for calculating the corresponding voxel coordinates from the point cloud coordinates (denoted as Formula Two):

[0168] In Formula 2 above, dividing the point cloud coordinates by the step size of the voxel space yields the voxel coordinates corresponding to the point cloud coordinates.

[0169] In the above embodiments, the corresponding voxel coordinates are obtained by dividing the point cloud coordinates by the step size of the voxel space. This makes the voxel coordinates corresponding to different point cloud coordinates that are close to each other the same, so that dense point clouds can be merged into voxels. The calculation method is simple and easy to implement.

[0170] S303, convert N voxel coordinates into N corresponding first hash values, the first hash values ​​are related to the maximum coordinate value in the voxel space, and convert M voxel coordinates into M corresponding second hash values, the second hash values ​​are related to the maximum coordinate value in the voxel space.

[0171] The coordinate range of the voxel space includes the aforementioned N voxel coordinates. Since the aforementioned M voxel coordinates are obtained by removing duplicates from the aforementioned N voxel coordinates, the coordinate range of the voxel space also includes the aforementioned M voxel coordinates. The maximum coordinate value in the voxel space may include, but is not limited to, the maximum coordinate value in the three dimensions (X-axis, Y-axis, and Z-axis).

[0172] In one possible implementation, the range of coordinates in voxel space and / or the maximum coordinate value in voxel space can be predefined or pre-set.

[0173] In another possible implementation, the coordinate range of the voxel space and / or the maximum coordinate value of the voxel space can be determined based on the detection range of the sensing device, which refers to the device that generates the point cloud data mentioned above.

[0174] Optionally, the sensing device is a lidar. The detection range (or scanning range) of the lidar is fixed for the same platform. Therefore, a spatial limit can be determined based on the scanning range of the lidar. The point cloud generated by the lidar is located within this spatial limit, which can also be understood as the coordinate range of the point cloud space.

[0175] As a possible example, if the units of measurement of the voxel space and the point cloud space are the same (e.g., the voxel coordinates are calculated using Formula 1 above), then the coordinate range of the voxel space can be determined to be the same as the coordinate range of the point cloud space, and the maximum coordinate value of the voxel space can be determined based on the coordinate range of the voxel space.

[0176] As another possible example, if the units of measurement of the voxel space and the point cloud space are not the same (for example, the voxel coordinates are calculated by formula 2 above), the coordinate range of the voxel space can be determined by dividing the coordinate range of the point cloud space by the step size of the voxel space, and then the maximum coordinate value of the voxel space can be determined based on the coordinate range of the voxel space.

[0177] Optionally, for the coordinate range of voxel space in each dimension, the maximum coordinate value of voxel space in that dimension can be added to the step size of voxel space to obtain the maximum coordinate value of voxel space in that dimension. For example, assuming the coordinate range of voxel space in the X-axis, Y-axis, and Z-axis directions is [0, 9], [0, 9], and [0, 9] respectively, and the step size of voxel space is 1, then the maximum coordinate values ​​of voxel space in the X-axis, Y-axis, and Z-axis directions are 10, 10, and 10 respectively.

[0178] For each voxel coordinate in the aforementioned N voxel coordinates, a three-dimensional coordinate position calculation method can be used to calculate the corresponding hash value (referred to as the first hash value here for clarity). This three-dimensional coordinate position calculation method introduces a parameter related to the maximum coordinate value in the voxel space to limit the numerical range of the first hash value and ensures that the first hash value calculated from different voxel coordinates is different. Through this calculation, one voxel coordinate can obtain one first hash value, thus N voxel coordinates can obtain N first hash values. It can be understood that when there are duplicate voxel coordinates in the aforementioned N voxel coordinates, correspondingly, there are also duplicate first hash values ​​in the N first hash values. As mentioned earlier, each voxel coordinate in the aforementioned N voxel coordinates corresponds to one sampling point, and correspondingly, each of the aforementioned N first hash values ​​corresponds to one sampling point, that is, the aforementioned N first hash values ​​correspond one-to-one with the aforementioned N sampling points.

[0179] For each voxel coordinate in the aforementioned M voxel coordinates, a three-dimensional coordinate position calculation method can be used to calculate the corresponding hash value (referred to as the second hash value here for clarity). This three-dimensional coordinate position calculation method introduces a parameter related to the maximum coordinate value in the voxel space to limit the numerical range of the second hash value and ensures that the second hash value calculated from different voxel coordinates is different. Through this calculation, one voxel coordinate can yield one second hash value, thus M voxel coordinates can yield M second hash values. It can be understood that the aforementioned M voxel coordinates are deduplicated voxel coordinates, and correspondingly, there are no duplicate second hash values ​​among the M second hash values. As mentioned earlier, each voxel coordinate in the aforementioned M voxel coordinates corresponds to one voxel, and correspondingly, each second hash value in the aforementioned M second hash values ​​corresponds to one voxel, that is, the aforementioned M second hash values ​​correspond one-to-one with the aforementioned M voxels.

[0180] In one possible implementation, the hash value (either the first hash value or the second hash value mentioned above) can be calculated using the following formula: hash = a * B max *C max +b*C max +c

[0181] Where `hash` represents the hash value. `a`, `b`, and `c` represent the voxel coordinates in the first, second, and third dimensions, respectively. It can be understood that when `hash` represents the first hash value, the voxel coordinates represented by `a`, `b`, and `c` are the voxel coordinates among the aforementioned N voxel coordinates; when `hash` represents the second hash value, the voxel coordinates represented by `a`, `b`, and `c` are the voxel coordinates among the aforementioned M voxel coordinates. B max and C max This represents a parameter related to the maximum coordinate value in voxel space; specifically, B max C is greater than or equal to the maximum coordinate value in the second dimension of voxel space. max It is greater than or equal to the maximum coordinate value in the third dimension of the voxel space.

[0182] It should be noted that in the above formula for calculating the hash value, the maximum value of 'a' is less than A. max A max A represents the parameter associated with the maximum coordinate value in voxel space. max The maximum value of b is greater than or equal to the maximum coordinate value in the first dimension of voxel space, and the maximum value of b is less than B. max The maximum value of c is less than C. max This ensures that the hash values ​​calculated from different voxel coordinates at the edge do not conflict.

[0183] In the above embodiments, the voxel space can be understood as a three-dimensional space composed of individual voxels. The principle of the hash value calculation formula can be understood as reading voxels in the voxel space sequentially along the third, second, and first dimensions. The resulting hash value has a limited range, and the maximum value of the hash value is less than A. max *B max *C max Furthermore, the hash value calculation formula described above ensures that the hash values ​​calculated using different voxel coordinates are different, thus guaranteeing the uniqueness of the hash values ​​and facilitating subsequent lookup of corresponding relationships. In addition, the hash value calculation formula only involves simple multiplication and addition operations, simplifying the calculation process compared to complex hash algorithms, making it applicable to processors with SIMD architectures such as NPUs.

[0184] The following uses B max Equals the maximum coordinate value of the voxel space in the second dimension, C max The above formula is illustrated using the example of the maximum coordinate value in the third dimension of voxel space. Optionally, the formula for calculating the hash value can include the following cases:

[0185] In the first case, the first dimension is the X-axis, the second dimension is the Y-axis, and the third dimension is the Z-axis. In this case, the formula for calculating the hash value can be expressed as follows (denoted as Formula #1): hash = x * Y max *Z max +y*Z max +z

[0186] Where x, y, and z represent the voxel coordinates along the X, Y, and Z axes, respectively. max and Z max These represent the maximum coordinate values ​​in voxel space along the Y and Z axes, respectively. The maximum value of x is less than x. max X max This represents the maximum coordinate value in voxel space along the X-axis, where the maximum value of y is less than that of Y. max The maximum value of z is less than Z. max The maximum value of the hash value is less than X. max *Y max *Z max This is a general explanation, and will not be repeated here.

[0187] The principle of the above formula #1 can be understood as reading voxels in the voxel space sequentially along the Z-axis, Y-axis and X-axis.

[0188] In the second scenario, the first dimension is the X-axis, the second dimension is the Z-axis, and the third dimension is the Y-axis. In this case, the formula for calculating the hash value can be expressed as follows (denoted as Formula #2): hash = x * Y max *Z max +y+z*Y max

[0189] The principle of the above formula #2 can be understood as reading voxels in the voxel space sequentially along the Y-axis, Z-axis and X-axis.

[0190] In the third case, the first dimension is the Y-axis, the second dimension is the X-axis, and the third dimension is the Z-axis. In this case, the formula for calculating the hash value can be expressed as follows (denoted as Formula #3): hash = x * Z max +y*X max *Z max +z

[0191] The principle of the above formula #3 can be understood as reading voxels in the voxel space sequentially along the Z-axis, X-axis and Y-axis.

[0192] In the fourth case, the first dimension is the Y-axis, the second dimension is the Z-axis, and the third dimension is the X-axis. In this case, the formula for calculating the hash value can be expressed as follows (denoted as Formula #4): hash = x + y * X max *Z max +z*X max

[0193] The principle of the above formula #4 can be understood as reading voxels in the voxel space sequentially along the X-axis, Z-axis and Y-axis.

[0194] In the fifth case, the first dimension is the Z-axis, the second dimension is the X-axis, and the third dimension is the Y-axis. In this case, the formula for calculating the hash value can be expressed as follows (denoted as Formula #5): hash = x * Y max +y+z*X max *Y max

[0195] The principle of the above formula #5 can be understood as reading voxels in the voxel space sequentially along the Y-axis, X-axis and Z-axis.

[0196] In the sixth case, the first dimension is the Z-axis, the second dimension is the Y-axis, and the third dimension is the X-axis. In this case, the formula for calculating the hash value can be expressed as follows (denoted as Formula #6): hash = x + y * X max +z*X max *Y max

[0197] The principle of the above formula #6 can be understood as reading voxels in the voxel space sequentially along the X-axis, Y-axis and Z-axis.

[0198] Optionally, both the first hash value and the second hash value can be calculated using any one of the above formulas #1, #2, #3, #4, #5, or #6. The formula for calculating the first hash value is the same as the formula for calculating the second hash value.

[0199] S304. Based on N first hash values, M second hash values ​​and N point cloud features, obtain the features of M voxels, and M voxels correspond to M voxel coordinates.

[0200] Here, the N first hash values ​​correspond to the N sampling points, which are the N point cloud coordinates mentioned above. The M second hash values ​​correspond to the M voxels, which are the M voxel coordinates mentioned above.

[0201] Specifically, based on N first hash values ​​and M second hash values, the correspondence between N sampling points and M voxels (or the correspondence between point clouds and voxels) can be obtained. This correspondence can indicate the sampling point corresponding to each voxel. Then, based on the point cloud features of the sampling points corresponding to each voxel, the features of each voxel can be calculated, thereby obtaining the features of the M voxels.

[0202] In the above embodiments, during the hash value calculation process involved in point cloud voxelization, the maximum coordinate value in the voxel space is introduced to calculate the hash value corresponding to the voxel coordinates. This limits the numerical range of the hash value, simplifies the hash value calculation process, and thus helps to accelerate the point cloud voxelization process. Furthermore, this hash value calculation method is applicable to processors with SIMD architectures such as NPUs, allowing the above embodiments to be deployed on NPU heterogeneous computing platforms to achieve parallel acceleration of point cloud voxelization.

[0203] In the above embodiments, steps S301 to S303 can be deployed on the NPU of the NPU heterogeneous computing platform shown in Figure 2. That is, steps S301 to S303 can be executed by the NPU. Step S304 can be deployed on both the NPU and CPU / GPU of the NPU heterogeneous computing platform shown in Figure 2. That is, step S304 can be executed jointly by the NPU and CPU / GPU. In this way, different computing units of the heterogeneous computing platform can be utilized to deploy different steps in the point cloud voxelization process on suitable computing units. Combining the powerful SIMD parallel computing capability of the NPU and the functional flexibility of the heterogeneous computing platform, the computing resources of the heterogeneous computing platform can be fully utilized, thereby giving full play to the capabilities of the heterogeneous computing platform and accelerating the realization of point cloud voxelization.

[0204] In one possible implementation, the step S304 above, which describes obtaining the features of M voxels based on N first hash values, M second hash values, and N point cloud features, may specifically include, but is not limited to, the following steps S304a to S304b.

[0205] S304a: Based on N first hash values ​​and M second hash values, obtain the correspondence between N point cloud coordinates and M voxel coordinates.

[0206] Specifically, for each of the N first hash values, a matching second hash value can be found from the M second hash values. The point cloud coordinates corresponding to the first hash value are then determined to correspond to the voxel coordinates corresponding to its matching second hash value. In this way, the correspondence between the N point cloud coordinates and the M voxel coordinates can be obtained (or the correspondence between point clouds and voxels).

[0207] Since the M voxel coordinates mentioned above are obtained by deduplicating the N voxel coordinates, the N first hash values ​​calculated based on the N voxel coordinates and the M second hash values ​​calculated based on the M voxel coordinates have a matching relationship. These M second hash values ​​can also be understood as the deduplicated results of the N first hash values. In other words, each of the N first hash values ​​can find a matching second hash value among the M second hash values, and each of the M second hash values ​​can find one or more matching first hash values ​​among the N first hash values.

[0208] Specifically, if a first hash value is equal to a second hash value, then the first hash value matches the second hash value. Accordingly, the sampling point corresponding to the first hash value corresponds to the voxel corresponding to the second hash value, that is, the point cloud coordinates corresponding to the first hash value correspond to the voxel coordinates corresponding to the second hash value.

[0209] S304b, for each voxel coordinate in the M voxel coordinates, obtain the K point cloud coordinates corresponding to that voxel coordinate according to the above correspondence, and obtain the voxel features corresponding to that voxel coordinate according to the K point cloud features corresponding to those K point cloud coordinates. Here, K is a positive integer, and K is less than or equal to N.

[0210] Based on the correspondence between the N point cloud coordinates and the M voxel coordinates, the point cloud coordinates corresponding to each voxel coordinate in the M voxel coordinates can be obtained. It can be understood that each voxel coordinate in the M voxel coordinates corresponds to one or more point cloud coordinates.

[0211] Specifically, for each voxel coordinate in the aforementioned M voxel coordinates, the number of point cloud coordinates corresponding to that voxel coordinate is denoted as K, meaning that the voxel coordinate corresponds to K point cloud coordinates, and these K point cloud coordinates are included in the aforementioned N point cloud coordinates. These K point cloud coordinates correspond to K sampling points, and correspondingly, they correspond to K point cloud features. These K point cloud features are also the point cloud features of the K sampling points corresponding to the K point cloud coordinates, and these K point cloud features are included in the aforementioned N point cloud features. Then, based on these K point cloud features, the features of the voxel corresponding to the voxel coordinate can be calculated. For example, the average value of the K point cloud features can be calculated as the feature of the voxel corresponding to the voxel coordinate. Alternatively, the maximum value among the K point cloud features can be selected as the feature of the voxel corresponding to the voxel coordinate.

[0212] In the above implementation, N first hash values ​​correspond one-to-one with N point cloud coordinates (i.e., N sampling points), and M second hash values ​​correspond one-to-one with M voxel coordinates (i.e., M voxels). Based on the N first hash values ​​and M second hash values, the correspondence between the N point cloud coordinates and the M voxel coordinates can be obtained. Based on this correspondence, the N sampling points can be merged into M voxels. Subsequently, the point cloud features of multiple sampling points belonging to the same voxel can be processed into a single voxel feature, thereby reducing the N point cloud features to M voxel features. This reduces the amount of feature data that needs to be processed subsequently.

[0213] In the above embodiments, step S304a can be deployed on the CPU / GPU of the NPU heterogeneous computing platform shown in Figure 2, that is, step S304a can be executed by the CPU / GPU. Step S304b can be deployed on the NPU of the NPU heterogeneous computing platform shown in Figure 2, that is, step S304b can be executed by the NPU. In this way, the step of finding the correspondence between point clouds and voxels, which is difficult for the NPU to handle, can be deployed on processors such as CPUs or GPUs, thereby giving full play to the capabilities of heterogeneous computing platforms.

[0214] In one possible implementation, the step S304a above, which describes obtaining the correspondence between N point cloud coordinates and M voxel coordinates based on N first hash values ​​and M second hash values, can be achieved by a sorting comparison method. This sorting comparison method may include, but is not limited to, the following steps A1 to A2.

[0215] A1, sort the N first hash values ​​to obtain the sorted N first hash values, and sort the M second hash values ​​to obtain the sorted M second hash values.

[0216] The sorted N first hash values ​​and the sorted M second hash values ​​can be arranged in ascending order or descending order. Since the M second hash values ​​can also be understood as the deduplicated results of the N first hash values, the first first hash value among the sorted N first hash values ​​is equal to the first second hash value among the sorted M second hash values. Similarly, the Nth first hash value among the sorted N first hash values ​​is also equal to the Mth second hash value among the sorted M second hash values.

[0217] A2. Select one first hash value from the sorted N first hash values ​​as the current first hash value. For each current first hash value, query the target second hash value that matches the current first hash value from the sorted M second hash values. Determine that the point cloud coordinates corresponding to the current first hash value correspond to the voxel coordinates corresponding to the target second hash value.

[0218] Each of the N sorted first hash values ​​is taken as a current first hash value. Then, a second hash value (denoted as the target second hash value) matching the current first hash value is searched from the M sorted second hash values. Once a target second hash value matching the current first hash value is found, it can be determined that the sampling point corresponding to the current first hash value corresponds to the voxel corresponding to the target second hash value; that is, the point cloud coordinates corresponding to the current first hash value correspond to the voxel coordinates corresponding to the target second hash value. After traversing all the N sorted first hash values, the correspondence between the N point cloud coordinates and the M voxel coordinates can be obtained.

[0219] In the above implementation, the N first hash values ​​and M second hash values ​​are first sorted. Then, by traversing the sorted N first hash values, the second hash value matching each first hash value is queried from the sorted M second hash values ​​to obtain the correspondence between point clouds and voxels. Since the first and second hash values ​​are sorted, only one numerical comparison is needed when querying the second hash value matching the first hash value, instead of comparing the first hash value with all M second hash values. This can greatly reduce the query range and improve query efficiency.

[0220] In the above embodiments, step A1 can be deployed on the NPU of the NPU heterogeneous computing platform shown in Figure 2. That is, step A1 can be executed by the NPU. For example, the sorting operation can be implemented on the NPU using a recursive sorting method. Step A2 can be deployed on the CPU / GPU of the NPU heterogeneous computing platform shown in Figure 2. That is, step A2 can be executed by the CPU / GPU. Accordingly, using NPU-type computing units to perform sorting operations is beneficial for accelerating the lookup of corresponding relationships. On CPU-type computing units, sorting results in a better cache hit rate, and on GPU-type computing units, sorting can narrow down the search range, thereby improving search efficiency.

[0221] As one possible implementation, the sorted N first hash values ​​and the sorted M second hash values ​​are arranged in ascending order.

[0222] For each current first hash value, query the target second hash value that matches the current first hash value from the sorted M second hash values. This can be achieved in the following way:

[0223] For the first current first hash value (i.e. the first first hash value after sorting), since the first first hash value among the above sorted N first hash values ​​is equal to the first second hash value among the above sorted M second hash values, the first second hash value among the above sorted M second hash values ​​can be directly used as the target second hash value that matches the first current first hash value without comparison, thus improving search efficiency.

[0224] Starting with the second current first hash value (i.e., the second sorted first hash value), a matching target second hash value can be found by comparison. Specifically, for the i-th (i is a positive integer, ranging from 2 to N) current first hash value, the i-th current first hash value is compared with the target second hash value that matches the (i-1)-th current first hash value among the M sorted second hash values. For simplicity, the target second hash value that matches the (i-1)-th current first hash value is denoted as the candidate second hash value.

[0225] It is understandable that, since the sorted N first hash values ​​and the sorted M second hash values ​​are arranged in ascending order, the i-th current first hash value is greater than or equal to the (i-1)-th current first hash value. The target second hash value (i.e., the candidate second hash value) that matches the (i-1)-th current first hash value is equal to the (i-1)-th current first hash value. Therefore, the i-th current first hash value is greater than or equal to the candidate second hash value.

[0226] In one possible scenario, the i-th current first hash value is equal to the candidate second hash value. In this case, the candidate second hash value is used as the target second hash value to match the i-th current first hash value. In another possible scenario, the i-th current first hash value is greater than the candidate second hash value. In this case, the next second hash value of the candidate second hash value must be equal to the i-th current first hash value. Therefore, the next second hash value of the candidate second hash value is directly used as the target second hash value to match the i-th current first hash value without further comparison.

[0227] Therefore, in both cases, only one comparison is needed (i.e., comparing whether the i-th current first hash value is equal to the candidate second hash value) to determine the target second hash value that matches the i-th current first hash value. This can greatly reduce the search range and improve search efficiency.

[0228] As another possible implementation, the sorted N first hash values ​​and the sorted M second hash values ​​are arranged in descending order.

[0229] For each current first hash value, query the target second hash value that matches the current first hash value from the sorted M second hash values. This can be achieved in the following way:

[0230] For the first current first hash value (i.e. the first first hash value after sorting), since the first first hash value among the above sorted N first hash values ​​is equal to the first second hash value among the above sorted M second hash values, the first second hash value among the above sorted M second hash values ​​can be directly used as the target second hash value that matches the first current first hash value without comparison, thus improving search efficiency.

[0231] Starting with the second current first hash value (i.e., the second sorted first hash value), a matching target second hash value can be found by comparison. Specifically, for the i-th (i is a positive integer, ranging from 2 to N) current first hash value, the i-th current first hash value is compared with the target second hash value that matches the (i-1)-th current first hash value among the M sorted second hash values. For simplicity, the target second hash value that matches the (i-1)-th current first hash value is denoted as the candidate second hash value.

[0232] It is understandable that, since the sorted N first hash values ​​and the sorted M second hash values ​​are arranged in descending order, the i-th current first hash value is less than or equal to the (i-1)-th current first hash value. The target second hash value (i.e., the candidate second hash value) that matches the (i-1)-th current first hash value is equal to the (i-1)-th current first hash value. Therefore, the i-th current first hash value is less than or equal to the candidate second hash value.

[0233] In one possible scenario, the i-th current first hash value is equal to the candidate second hash value. In this case, the candidate second hash value is used as the target second hash value to match the i-th current first hash value. In another possible scenario, the i-th current first hash value is less than the candidate second hash value. In this case, the next second hash value of the candidate second hash value must be equal to the i-th current first hash value. Therefore, the next second hash value of the candidate second hash value is directly used as the target second hash value to match the i-th current first hash value without further comparison.

[0234] Therefore, in both cases, only one comparison is needed (i.e., comparing whether the i-th current first hash value is equal to the candidate second hash value) to determine the target second hash value that matches the i-th current first hash value. This can greatly reduce the search range and improve search efficiency.

[0235] Please refer to Figure 4, which is a schematic diagram of a correspondence provided in an embodiment of this application. As shown in Figure 4, the left side represents the sorted N first hash values ​​(corresponding one-to-one with the aforementioned N point cloud coordinates), and the right side represents the sorted M second hash values ​​(corresponding one-to-one with the aforementioned M voxel coordinates). The first hash values ​​and second hash values ​​at both ends of the arrows are equal. The following explanation will take the example where the N first hash values ​​on the left and the M second hash values ​​on the right are both sorted in ascending order.

[0236] For the first hash value, the first hash value is equal to the first hash value. Therefore, the first hash value points to the first hash value, and it can be determined that the point cloud coordinates (or sampling points) corresponding to the first hash value correspond to the voxel coordinates (or voxels) corresponding to the first hash value.

[0237] For the second first hash value, compare it with the second hash value pointed to by the first first hash value (i.e., the first second hash value). In one case (as shown in Figure 4), if the second first hash value is equal to the first second hash value, then the second first hash value also points to the first second hash value, thus determining that the point cloud coordinates (or sampling points) corresponding to the second first hash value correspond to the voxel coordinates (or voxels) corresponding to the first second hash value. In another case, if the second first hash value is greater than the first second hash value, then the second first hash value points to the next second hash value (i.e., the second second hash value), thus determining that the point cloud coordinates (or sampling points) corresponding to the second first hash value correspond to the voxel coordinates (or voxels) corresponding to the second second hash value.

[0238] For the third first hash value, compare it with the second hash value pointed to by the second first hash value (Figure 4 shows the first second hash value). In one case, if the third first hash value is equal to the first second hash value, then the third first hash value also points to the first second hash value, thus determining that the point cloud coordinates (or sampling points) corresponding to the third first hash value correspond to the voxel coordinates (or voxels) corresponding to the first second hash value. In another case (as shown in Figure 4), if the third first hash value is greater than the first second hash value, then the third first hash value points to the next second hash value (i.e., the second second hash value), thus determining that the point cloud coordinates (or sampling points) corresponding to the third first hash value correspond to the voxel coordinates (or voxels) corresponding to the second second hash value.

[0239] This process continues until all N first hash values ​​have been traversed, at which point each first hash value will point to a second hash value. It can be understood that multiple first hash values ​​pointing to the same second hash value are identical, but the point cloud coordinates (or sampling points) corresponding to these multiple first hash values ​​are different. In other words, multiple sampling points correspond to one voxel, thus allowing N sampling points to be merged into M voxels, reducing the overall data volume.

[0240] In another possible implementation, the above step S304a, which describes obtaining the correspondence between N point cloud coordinates and M voxel coordinates based on N first hash values ​​and M second hash values, can be achieved by a lookup table method. This lookup table method may include, but is not limited to, the following steps B1 to B3.

[0241] B1. Create a one-dimensional table. The storage size of the one-dimensional table is related to the maximum coordinate value in the voxel space.

[0242] Specifically, assuming the maximum coordinate values ​​in the three dimensions of voxel space are represented by A... max B max and C max If this is the case, then the storage size of a one-dimensional table can be set to A. max *B max *C max In other words, there is A in the one-dimensional table. max *B max *C max There are 10 locations that can be used to store A. max *B max *C max A number.

[0243] B2. For each of the M second hash values, store the voxel identifier corresponding to the second hash value in the position of the matching second hash value in the one-dimensional table.

[0244] Among them, the voxel identifier is used to distinguish different voxels. Each voxel identifier corresponds to one voxel, and correspondingly, each voxel identifier corresponds to a second hash value, that is, a voxel coordinate.

[0245] The position in a one-dimensional table that matches the second hash value can be understood as the position's index in the one-dimensional table being equal to the second hash value. For example, if the second hash value is 100, then the position in the one-dimensional table that matches the second hash value 100 is the 100th position in the one-dimensional table, and the voxel identifier corresponding to the second hash value 100 is stored in the 100th position of the one-dimensional table.

[0246] B3. For each of the N first hash values, use the first hash value as an index to query the target location from the one-dimensional table, and determine whether the point cloud coordinates corresponding to the first hash value correspond to the voxel coordinates corresponding to the voxel identifier at the target location.

[0247] Here, the target location refers to the location that matches the first hash value. It can also be understood as the target location's index in the one-dimensional table being equal to the first hash value. For example, if the first hash value is 100, then the target location retrieved from the one-dimensional table using the first hash value 100 as an index is the 100th position in the one-dimensional table. This determines that the point cloud coordinates (or sampling points) corresponding to the first hash value 100 correspond to the voxel coordinates (or voxels) corresponding to the voxel identifier stored at the 100th position in the one-dimensional table.

[0248] Optionally, the voxel identifier can be a voxel number. Specifically, the M voxel coordinates or M second hash values ​​mentioned above can be numbered to obtain M voxel numbers, with each voxel number corresponding to one voxel. Storing the voxel numbers in a one-dimensional table helps save storage space.

[0249] For example, storing the voxel index corresponding to the second hash value in the position that matches the second hash value in a one-dimensional table can be represented by the following formula: Table[hash2[idx]]=idx

[0250] Where hash2[idx] represents the second hash value, and the voxel index corresponding to this second hash value is idx. Table[hash2[idx]] represents the position in the one-dimensional table that matches the second hash value (hash2[idx]). The above formula means that the voxel index (i.e., idx) corresponding to the second hash value (hash2[idx]) is stored at the position in the one-dimensional table that matches the second hash value (hash2[idx]).

[0251] For example, if the second hash value corresponding to the first voxel (voxel number 1) is 100, then 1 is stored in the 100th position of the one-dimensional table. As another example, if the second hash value corresponding to the second voxel (voxel number 2) is 200, then 2 is stored in the 200th position of the one-dimensional table.

[0252] For example, the correspondence between point clouds and voxels obtained by querying a one-dimensional table using the first hash value can be expressed as the following formula: Pcl[num] = Table[hash1[num]]

[0253] Where hash1[num] represents the first hash value, and the index (denoted as the sampling point index) corresponding to this first hash value is num. It can be understood that each sampling point index corresponds to a sampling point, and correspondingly, each sampling point index corresponds to a first hash value, which is also a point cloud coordinate. Table[hash1[num]] represents the target location found in the one-dimensional table using the first hash value (hash1[num]) as an index. Pcl[num] represents the point cloud coordinates (or sampling point) corresponding to the first hash value (hash1[num]). The above formula indicates that the point cloud coordinates (or sampling point) corresponding to the first hash value (hash1[num]) correspond to the voxel coordinates (or voxel) corresponding to the voxel index stored at the target location (Table[hash1[num]]) that matches the first hash value (hash1[num]).

[0254] For example, suppose the 100th position in a one-dimensional table is stored as 1. If the first hash value corresponding to the first sampling point is 100, then the 100th position in the one-dimensional table is located using the first hash value 100 as an index, meaning the first sampling point corresponds to the first voxel. As another example, suppose the 200th position in a one-dimensional table is stored as 2. If the first hash value corresponding to the third sampling point is 200, then the 200th position in the one-dimensional table is located using the first hash value 200 as an index, meaning the third sampling point corresponds to the second voxel.

[0255] In the above implementation, the correspondence between point clouds and voxels is obtained through table creation and lookup indexing. The logic is simple and can be applied to various computing units such as CPU or GPU.

[0256] Optionally, before step B2 above, the N first hash values ​​and M second hash values ​​can be sorted. Specifically, the N first hash values ​​are sorted to obtain N sorted first hash values, and the M second hash values ​​are sorted to obtain M sorted second hash values. The N sorted first hash values ​​and the M sorted second hash values ​​are arranged in ascending order or in descending order.

[0257] Specifically, step B2 above can involve selecting one second hash value from the sorted M second hash values ​​one by one, and storing the voxel identifier corresponding to the second hash value in the position of the matching second hash value in a one-dimensional table. Specifically, step B3 above can involve selecting one first hash value from the sorted N first hash values ​​one by one, and using the first hash value as an index to query the target position in the one-dimensional table.

[0258] Therefore, sorting the hash values ​​before storing and querying the one-dimensional table ensures that the data stored in the one-dimensional table is also ordered, which helps improve query efficiency and thus quickly obtain the correspondence between point clouds and voxels.

[0259] In the above embodiments, steps B1 to B3 can be deployed on the CPU / GPU of the NPU heterogeneous computing platform shown in Figure 2. That is, steps B1 to B3 can be executed by the CPU / GPU. The sorting operation before step B2 can be deployed on the NPU of the NPU heterogeneous computing platform shown in Figure 2. In other words, the sorting operation can be executed by the NPU. Therefore, by utilizing NPU-type computing units to implement the sorting operation and utilizing CPU or GPU-type computing units to implement table creation and lookup operations, the capabilities of the heterogeneous computing platform can be fully utilized to adapt to different application scenarios.

[0260] The methods of the embodiments of this application have been described in detail above. The following provides an apparatus for implementing any one of the methods in the embodiments of this application.

[0261] Please refer to Figure 5, which is a schematic diagram of a point cloud voxelization device provided in an embodiment of this application. This point cloud voxelization device 500 can be implemented through hardware, software, or a combination of both. As shown in Figure 5, the point cloud voxelization device 500 includes: a first unit 501, a second unit 502, a third unit 503, and a fourth unit 504. The descriptions of each unit are as follows:

[0262] The first unit 501 is used to acquire point cloud data, which includes N point cloud coordinates and N point cloud features, where N is a positive integer;

[0263] The second unit 502 is used to calculate the corresponding N voxel coordinates based on the N point cloud coordinates, and to obtain M voxel coordinates based on the N voxel coordinates. The M voxel coordinates are included in the N voxel coordinates, where M is a positive integer and M is less than or equal to N.

[0264] The third unit 503 is used to convert the N voxel coordinates into N corresponding first hash values, the first hash values ​​being related to the maximum coordinate value in the voxel space, and to convert the M voxel coordinates into M corresponding second hash values, the second hash values ​​being related to the maximum coordinate value in the voxel space, wherein the coordinate range of the voxel space includes the N voxel coordinates.

[0265] The fourth unit 504 is used to obtain the features of M voxels based on the N first hash values, the M second hash values ​​and the N point cloud features, wherein the M voxels correspond to the coordinates of the M voxels.

[0266] In one possible implementation, the relationship between the first hash value or the second hash value and the maximum coordinate value in the voxel space is as follows: hash = a * B max *C max +b*C max +c;

[0267] Where a, b, and c represent the voxel coordinates in the first, second, and third dimensions, respectively, and B... max C is greater than or equal to the maximum coordinate value in the second dimension of the voxel space. max The value is greater than or equal to the maximum coordinate value of the voxel space in the third dimension, and hash represents the first hash value or the second hash value corresponding to the voxel coordinate.

[0268] In one possible implementation, when the fourth unit 504 obtains the features of M voxels based on the N first hash values, the M second hash values, and the N point cloud features, it is specifically used for:

[0269] Based on the N first hash values ​​and the M second hash values, the correspondence between the N point cloud coordinates and the M voxel coordinates is obtained;

[0270] For each voxel coordinate in the M voxel coordinates, K point cloud coordinates corresponding to the voxel coordinates are obtained according to the correspondence. Based on the K point cloud features corresponding to the K point cloud coordinates, the features of the voxel corresponding to the voxel coordinates are obtained. K is a positive integer, and K is less than or equal to N.

[0271] In one possible implementation, when the fourth unit 504 obtains the correspondence between the N point cloud coordinates and the M voxel coordinates based on the N first hash values ​​and the M second hash values, it is specifically used for:

[0272] The N first hash values ​​are sorted to obtain N sorted first hash values, and the M second hash values ​​are sorted to obtain M sorted second hash values. The N sorted first hash values ​​and the M sorted second hash values ​​are arranged in ascending order or in descending order.

[0273] Select one first hash value from the sorted N first hash values ​​as the current first hash value. For each current first hash value, query the target second hash value that matches the current first hash value from the sorted M second hash values. Determine that the point cloud coordinates corresponding to the current first hash value correspond to the voxel coordinates corresponding to the target second hash value.

[0274] The first first hash value among the sorted N first hash values ​​is equal to the first second hash value among the sorted M second hash values.

[0275] In one possible implementation, the sorted N first hash values ​​and the sorted M second hash values ​​are arranged in ascending order;

[0276] When the fourth unit 504 queries the sorted M second hash values ​​for each current first hash value to find a target second hash value that matches the current first hash value, it is specifically used for:

[0277] The first of the sorted M second hash values ​​is taken as the target second hash value that matches the first current first hash value;

[0278] For the i-th current first hash value, compare the i-th current first hash value with the target second hash value that matches the (i-1)-th current first hash value among the sorted M second hash values, where i is a positive integer, 1 < i ≤ N;

[0279] If the i-th current first hash value is equal to the target second hash value that matches the (i-1)-th current first hash value, then the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value.

[0280] If the i-th current first hash value is greater than the target second hash value that matches the (i-1)-th current first hash value, then the next second hash value of the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value.

[0281] In one possible implementation, the sorted N first hash values ​​and the sorted M second hash values ​​are arranged in descending order;

[0282] When the fourth unit 504 queries the sorted M second hash values ​​for each current first hash value to find a target second hash value that matches the current first hash value, it is specifically used for:

[0283] The first of the sorted M second hash values ​​is taken as the target second hash value that matches the first current first hash value;

[0284] For the i-th current first hash value, compare the i-th current first hash value with the target second hash value that matches the (i-1)-th current first hash value among the sorted M second hash values, where i is a positive integer, 1 < i ≤ N;

[0285] If the i-th current first hash value is equal to the target second hash value that matches the (i-1)-th current first hash value, then the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value.

[0286] If the i-th current first hash value is less than the target second hash value that matches the (i-1)-th current first hash value, then the next second hash value of the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value.

[0287] In one possible implementation, when the fourth unit 504 obtains the correspondence between the N point cloud coordinates and the M voxel coordinates based on the N first hash values ​​and the M second hash values, it is specifically used for:

[0288] A one-dimensional table is created, the storage size of which is related to the maximum coordinate value in the voxel space;

[0289] For each of the M second hash values, the voxel identifier corresponding to the second hash value is stored in the position in the one-dimensional table that matches the second hash value;

[0290] For each of the N first hash values, the target location is queried from the one-dimensional table using the first hash value as an index, and the point cloud coordinates corresponding to the first hash value are determined to correspond to the voxel coordinates corresponding to the voxel identifier at the target location.

[0291] In one possible implementation, the fourth unit 504 is further configured to:

[0292] The N first hash values ​​are sorted to obtain N sorted first hash values, and the M second hash values ​​are sorted to obtain M sorted second hash values. The N sorted first hash values ​​and the M sorted second hash values ​​are arranged in ascending order or in descending order.

[0293] When the fourth unit 504 stores the voxel index corresponding to each of the M second hash values ​​into the position matching the second hash value in the one-dimensional table, it is specifically used for:

[0294] Select one second hash value from the sorted M second hash values ​​one by one, and store the voxel identifier corresponding to the second hash value into the position in the one-dimensional table that matches the second hash value;

[0295] When the fourth unit 504 queries the target location from the one-dimensional table using the first hash value as an index for each of the N first hash values, it is specifically used for:

[0296] Select one first hash value from the sorted N first hash values ​​one by one, and use the first hash value as an index to query the target position from the one-dimensional table.

[0297] In one possible implementation, when the second unit 502 calculates the corresponding N voxel coordinates based on the N point cloud coordinates, it is specifically used for:

[0298] For each of the N point cloud coordinates, divide the point cloud coordinate by the step size of the voxel space to obtain the corresponding voxel coordinate.

[0299] According to embodiments of this application, the various units in the device shown in FIG5 can be individually or entirely merged into one or more other units, or some of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effect of the embodiments of this application. The above units are based on logical function division. In practical applications, the function of one unit can also be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the above device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.

[0300] It should be noted that the implementation of each unit can also refer to the corresponding description in the above method embodiments.

[0301] Please refer to Figure 6, which is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 600 may include a processor 601. Optionally, the electronic device 600 may also include a memory 602. Further optionally, the electronic device 600 may also include a communication interface 603 and a bus 604. The processor 601, memory 602, and communication interface 603 are interconnected via the bus 604. The communication interface 603 is used for data interaction with other devices.

[0302] The processor 601 is a module that performs arithmetic and logical operations. It can be one or a combination of processing modules such as a central processing unit (CPU), a graphics processing unit (GPU), or a microprocessor unit (MPU). The processor 601 can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0303] The memory 602 is used to provide storage space, in which data such as the operating system and computer programs can be stored. The memory 602 includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM).

[0304] The processor 601 calls the computer program stored in the memory 602, which can execute the method steps in the above method embodiments. For details, please refer to the previous method embodiments, which will not be repeated here.

[0305] Optionally, the electronic device 600 can be a chip or a chip system. For the case where the electronic device 600 is a chip or a chip system, please refer to the schematic diagram of the chip structure shown in Figure 7.

[0306] As shown in Figure 7, chip 700 includes processor 701 and interface 702. There can be one or more processors 701, and multiple interfaces 702. It should be noted that the functions of processor 701 and interface 702 can be implemented through hardware design, software design, or a combination of both; no restrictions are placed here.

[0307] Optionally, the chip 700 may also include a memory 703 for storing necessary program instructions and data.

[0308] In this application, processor 701 can be used to call an implementation program of the point cloud voxelization method provided in one or more embodiments of this application in an electronic device from memory 703, and execute the instructions contained in the program. Interface 702 can be used to output the execution results of processor 701. In this application, interface 702 can be specifically used to output various messages or information of processor 701.

[0309] The point cloud voxelization method provided in one or more embodiments of this application can be referred to the above-described method embodiments, which will not be repeated here.

[0310] According to the method provided in the embodiments of this application, the embodiments of this application also provide a computer-readable storage medium storing a computer program that, when run on one or more processors, can implement the method shown in the above-described method embodiments.

[0311] According to the method provided in the embodiments of this application, the embodiments of this application also provide a computer program product, which includes a computer program that can implement the method shown in the above-described method embodiments when the computer program is run on a processor.

[0312] It should be understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be a hard disk drive (HDD), a solid-state drive (SSD), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memories described herein are intended to include, but are not limited to, these and any other suitable types of memory.

[0313] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the processes or functions described in the embodiments of this application are performed entirely or partially. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user equipment, or other programmable device. The computer program or instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; it can also be an optical medium, such as a digital video optical disc; or it can be a semiconductor medium, such as a solid-state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include both types of storage media.

[0314] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments provided herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0315] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0316] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

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

[0318] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0319] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the technology, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0320] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A point cloud voxelization method, characterized in that, include: Acquire point cloud data, which includes N point cloud coordinates and N point cloud features, where N is a positive integer; Calculate the corresponding N voxel coordinates based on the N point cloud coordinates, and obtain M voxel coordinates based on the N voxel coordinates. The M voxel coordinates are included in the N voxel coordinates, where M is a positive integer and M is less than or equal to N. The N voxel coordinates are converted into N corresponding first hash values, which are related to the maximum coordinate value in the voxel space. The M voxel coordinates are converted into M corresponding second hash values, which are related to the maximum coordinate value in the voxel space. The coordinate range of the voxel space includes the N voxel coordinates. Based on the N first hash values, the M second hash values, and the N point cloud features, the features of M voxels are obtained, and the M voxels correspond to the coordinates of the M voxels.

2. The method according to claim 1, characterized in that, The relationship between the first hash value or the second hash value and the maximum coordinate value in voxel space is as follows: hash = a * B max *C max +b*C max +c; Where a, b, and c represent the voxel coordinates in the first, second, and third dimensions, respectively, and B... max C is greater than or equal to the maximum coordinate value in the second dimension of the voxel space. max The value is greater than or equal to the maximum coordinate value of the voxel space in the third dimension, and hash represents the first hash value or the second hash value corresponding to the voxel coordinate.

3. The method according to claim 1 or 2, characterized in that, The step of obtaining the features of M voxels based on the N first hash values, the M second hash values, and the N point cloud features includes: Based on the N first hash values ​​and the M second hash values, the correspondence between the N point cloud coordinates and the M voxel coordinates is obtained; For each voxel coordinate in the M voxel coordinates, K point cloud coordinates corresponding to the voxel coordinates are obtained according to the correspondence. Based on the K point cloud features corresponding to the K point cloud coordinates, the features of the voxel corresponding to the voxel coordinates are obtained. K is a positive integer, and K is less than or equal to N.

4. The method according to claim 3, characterized in that, The step of obtaining the correspondence between the N point cloud coordinates and the M voxel coordinates based on the N first hash values ​​and the M second hash values ​​includes: The N first hash values ​​are sorted to obtain N sorted first hash values, and the M second hash values ​​are sorted to obtain M sorted second hash values. The N sorted first hash values ​​and the M sorted second hash values ​​are arranged in ascending order or in descending order. Select one first hash value from the sorted N first hash values ​​as the current first hash value. For each current first hash value, query the target second hash value that matches the current first hash value from the sorted M second hash values. Determine that the point cloud coordinates corresponding to the current first hash value correspond to the voxel coordinates corresponding to the target second hash value. The first first hash value among the sorted N first hash values ​​is equal to the first second hash value among the sorted M second hash values.

5. The method according to claim 4, characterized in that, The sorted N first hash values ​​and the sorted M second hash values ​​are arranged in ascending order; For each current first hash value, querying the M sorted second hash values ​​for a target second hash value that matches the current first hash value includes: The first of the sorted M second hash values ​​is taken as the target second hash value that matches the first current first hash value; For the i-th current first hash value, compare the i-th current first hash value with the target second hash value that matches the (i-1)-th current first hash value among the sorted M second hash values, where i is a positive integer, 1 < i ≤ N; If the i-th current first hash value is equal to the target second hash value that matches the (i-1)-th current first hash value, then the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value. If the i-th current first hash value is greater than the target second hash value that matches the (i-1)-th current first hash value, then the next second hash value of the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value.

6. The method according to claim 4, characterized in that, The sorted N first hash values ​​and the sorted M second hash values ​​are arranged in descending order; For each current first hash value, querying the M sorted second hash values ​​for a target second hash value that matches the current first hash value includes: The first of the sorted M second hash values ​​is taken as the target second hash value that matches the first current first hash value; For the i-th current first hash value, compare the i-th current first hash value with the target second hash value that matches the (i-1)-th current first hash value among the sorted M second hash values, where i is a positive integer, 1 < i ≤ N; If the i-th current first hash value is equal to the target second hash value that matches the (i-1)-th current first hash value, then the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value. If the i-th current first hash value is less than the target second hash value that matches the (i-1)-th current first hash value, then the next second hash value of the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value.

7. The method according to claim 3, characterized in that, The step of obtaining the correspondence between the N point cloud coordinates and the M voxel coordinates based on the N first hash values ​​and the M second hash values ​​includes: A one-dimensional table is created, the storage size of which is related to the maximum coordinate value in the voxel space; For each of the M second hash values, the voxel identifier corresponding to the second hash value is stored in the position in the one-dimensional table that matches the second hash value; For each of the N first hash values, the target location is queried from the one-dimensional table using the first hash value as an index, and the point cloud coordinates corresponding to the first hash value are determined to correspond to the voxel coordinates corresponding to the voxel identifier at the target location.

8. The method according to claim 7, characterized in that, The method further includes: The N first hash values ​​are sorted to obtain N sorted first hash values, and the M second hash values ​​are sorted to obtain M sorted second hash values. The N sorted first hash values ​​and the M sorted second hash values ​​are arranged in ascending order or in descending order. For each of the M second hash values, storing the voxel index corresponding to the second hash value into the position in the one-dimensional table that matches the second hash value includes: Select one second hash value from the sorted M second hash values ​​one by one, and store the voxel identifier corresponding to the second hash value into the position in the one-dimensional table that matches the second hash value; The step of querying the target location from the one-dimensional table using the first hash value as an index for each of the N first hash values ​​includes: Select one first hash value from the sorted N first hash values ​​one by one, and use the first hash value as an index to query the target position from the one-dimensional table.

9. The method according to any one of claims 1 to 8, characterized in that, The step of calculating the corresponding N voxel coordinates based on the N point cloud coordinates includes: For each of the N point cloud coordinates, divide the point cloud coordinate by the step size of the voxel space to obtain the corresponding voxel coordinate.

10. A point cloud voxelization device, characterized in that, include: The first unit is used to acquire point cloud data, which includes N point cloud coordinates and N point cloud features, where N is a positive integer; The second unit is used to calculate the corresponding N voxel coordinates based on the N point cloud coordinates, and to obtain M voxel coordinates based on the N voxel coordinates. The M voxel coordinates are included in the N voxel coordinates, where M is a positive integer and M is less than or equal to N. The third unit is used to convert the N voxel coordinates into N corresponding first hash values, the first hash values ​​being related to the maximum coordinate value in the voxel space, and to convert the M voxel coordinates into M corresponding second hash values, the second hash values ​​being related to the maximum coordinate value in the voxel space, wherein the coordinate range of the voxel space includes the N voxel coordinates. The fourth unit is used to obtain the features of M voxels based on the N first hash values, the M second hash values ​​and the N point cloud features, wherein the M voxels correspond to the coordinates of the M voxels.

11. The apparatus according to claim 10, characterized in that, The relationship between the first hash value or the second hash value and the maximum coordinate value in voxel space is as follows: hash = a * B max *C max +b*C max +c; Where a, b, and c represent the voxel coordinates in the first, second, and third dimensions, respectively, and B... max C is greater than or equal to the maximum coordinate value in the second dimension of the voxel space. max The value is greater than or equal to the maximum coordinate value of the voxel space in the third dimension, and hash represents the first hash value or the second hash value corresponding to the voxel coordinate.

12. The apparatus according to claim 10 or 11, characterized in that, When the fourth unit obtains the features of M voxels based on the N first hash values, the M second hash values, and the N point cloud features, it is specifically used for: Based on the N first hash values ​​and the M second hash values, the correspondence between the N point cloud coordinates and the M voxel coordinates is obtained; For each voxel coordinate in the M voxel coordinates, K point cloud coordinates corresponding to the voxel coordinates are obtained according to the correspondence. Based on the K point cloud features corresponding to the K point cloud coordinates, the features of the voxel corresponding to the voxel coordinates are obtained. K is a positive integer, and K is less than or equal to N.

13. The apparatus according to claim 12, characterized in that, When the fourth unit obtains the correspondence between the N point cloud coordinates and the M voxel coordinates based on the N first hash values ​​and the M second hash values, it is specifically used for: The N first hash values ​​are sorted to obtain N sorted first hash values, and the M second hash values ​​are sorted to obtain M sorted second hash values. The N sorted first hash values ​​and the M sorted second hash values ​​are arranged in ascending order or in descending order. Select one first hash value from the sorted N first hash values ​​as the current first hash value. For each current first hash value, query the target second hash value that matches the current first hash value from the sorted M second hash values. Determine that the point cloud coordinates corresponding to the current first hash value correspond to the voxel coordinates corresponding to the target second hash value. The first first hash value among the sorted N first hash values ​​is equal to the first second hash value among the sorted M second hash values.

14. The apparatus according to claim 13, characterized in that, The sorted N first hash values ​​and the sorted M second hash values ​​are arranged in ascending order; When the fourth unit queries the sorted M second hash values ​​for each current first hash value to find a target second hash value that matches the current first hash value, it is specifically used for: The first of the sorted M second hash values ​​is taken as the target second hash value that matches the first current first hash value; For the i-th current first hash value, compare the i-th current first hash value with the target second hash value that matches the (i-1)-th current first hash value among the sorted M second hash values, where i is a positive integer, 1 < i ≤ N; If the i-th current first hash value is equal to the target second hash value that matches the (i-1)-th current first hash value, then the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value. If the i-th current first hash value is greater than the target second hash value that matches the (i-1)-th current first hash value, then the next second hash value of the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value.

15. The apparatus according to claim 13, characterized in that, The sorted N first hash values ​​and the sorted M second hash values ​​are arranged in descending order; When the fourth unit queries the sorted M second hash values ​​for each current first hash value to find a target second hash value that matches the current first hash value, it is specifically used for: The first of the sorted M second hash values ​​is taken as the target second hash value that matches the first current first hash value; For the i-th current first hash value, compare the i-th current first hash value with the target second hash value that matches the (i-1)-th current first hash value among the sorted M second hash values, where i is a positive integer, 1 < i ≤ N; If the i-th current first hash value is equal to the target second hash value that matches the (i-1)-th current first hash value, then the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value. If the i-th current first hash value is less than the target second hash value that matches the (i-1)-th current first hash value, then the next second hash value of the target second hash value that matches the (i-1)-th current first hash value is taken as the target second hash value that matches the i-th current first hash value.

16. The apparatus according to claim 12, characterized in that, When the fourth unit obtains the correspondence between the N point cloud coordinates and the M voxel coordinates based on the N first hash values ​​and the M second hash values, it is specifically used for: A one-dimensional table is created, the storage size of which is related to the maximum coordinate value in the voxel space; For each of the M second hash values, the voxel identifier corresponding to the second hash value is stored in the position in the one-dimensional table that matches the second hash value; For each of the N first hash values, the target location is queried from the one-dimensional table using the first hash value as an index, and the point cloud coordinates corresponding to the first hash value are determined to correspond to the voxel coordinates corresponding to the voxel identifier at the target location.

17. The apparatus according to claim 16, characterized in that, The fourth unit is also used for: The N first hash values ​​are sorted to obtain N sorted first hash values, and the M second hash values ​​are sorted to obtain M sorted second hash values. The N sorted first hash values ​​and the M sorted second hash values ​​are arranged in ascending order or in descending order. When the fourth unit stores the voxel index corresponding to each of the M second hash values ​​into the position matching the second hash value in the one-dimensional table for each second hash value, it is specifically used for: Select one second hash value from the sorted M second hash values ​​one by one, and store the voxel identifier corresponding to the second hash value into the position in the one-dimensional table that matches the second hash value; When the fourth unit queries the target location from the one-dimensional table using the first hash value as an index for each of the N first hash values, it is specifically used for: Select one first hash value from the sorted N first hash values ​​one by one, and use the first hash value as an index to query the target position from the one-dimensional table.

18. The apparatus according to any one of claims 10 to 17, characterized in that, The second unit, when calculating the corresponding N voxel coordinates based on the N point cloud coordinates, is specifically used for: For each of the N point cloud coordinates, divide the point cloud coordinate by the step size of the voxel space to obtain the corresponding voxel coordinate.

19. An electronic device, characterized in that, Includes a processor for executing a computer program or instructions, which, when executed, cause the method as described in any one of claims 1 to 9 to be implemented.

20. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program or instructions that, when executed, cause the method as described in any one of claims 1 to 9 to be implemented.

21. A computer program product, characterized in that, It includes a computer program or instructions that, when executed, cause the method as described in any one of claims 1 to 9 to be implemented.

Citation Information

Patent Citations

  • Target detection method and device for automatic driving, medium and vehicle

    CN114943951A

  • Local sensitive hashing-based laser radar point cloud quick query matching method

    CN116737978A

  • Target detection method for autonomous driving, and apparatus, medium and vehicle

    WO2023222062A1