A Method and Device for Dynamic Hash Partitioning of Point Clouds
By adopting a dynamic hash division method in the point cloud, the number of hash tables and the number of divisions is determined based on the node layer information of the tree structure, the problem of high hash conflict frequency is solved, and the insertion and query efficiency of hash tables is improved.
Patent Information
- Application Number
- CN202010593384.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-27
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2040-06-27
AI Technical Summary
In the prior art, the frequency of hash collisions is high, resulting in low efficiency of hash table insertion and query.
The point cloud dynamic hash division method is used to determine the total number of divisions by the total number of nodes occupied by the current node layer of the tree structure and the average number of nodes in the single hash table after division, and the total number of divisions is determined based on the total number of divisions and the number of divisions of each coordinate component. Finally, the hash table sequence number corresponding to the node is determined and the node is added to the corresponding hash table.
By configuring multiple hash tables and determining the hash table sequence number of the node based on point cloud location data, hash conflicts are avoided, thereby optimizing the access performance of the hash table and improving the efficiency of hash table insertion and query.
Smart Images

Figure CN113849495B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of point clouds, and particularly to a method and device for dynamically hashing and partitioning point clouds. Background Art
[0002] Three-dimensional point clouds are an important manifestation of the digitalization of the real world. With the rapid development of three-dimensional scanning devices (such as lasers, radars, etc.), the accuracy and resolution of point clouds have become higher. High-precision point clouds are widely used in the construction of urban digital maps and play a technical support role in many popular research fields such as smart cities, autonomous driving, and cultural relic protection. Point clouds are obtained by sampling the surface of an object with a three-dimensional scanning device. The number of points in a single frame of point cloud is generally in the millions. Each point contains geometric information and attribute information such as color and reflectivity, and the data volume is extremely large. The huge data volume of three-dimensional point clouds poses great challenges to data storage, transmission, etc. Therefore, it is very important to compress point clouds.
[0003] In the prior art, for dense or large-scale point clouds, the number of elements in a single hash table is too large, and the frequency of hash conflicts is high, which affects the efficiency of inserting and querying the hash table.
[0004] Therefore, the prior art still needs to be improved and developed. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a method and device for dynamically hashing and partitioning point clouds in view of the above-mentioned defects of the prior art, aiming to solve the problem that the low efficiency of inserting and querying the hash table is caused by the high frequency of hash conflicts in the prior art.
[0006] The technical solution adopted by the present invention to solve the technical problem is as follows:
[0007] A method for dynamically hashing and partitioning point clouds, wherein the position data of the point clouds is stored based on a tree structure; the method for dynamically hashing and partitioning point clouds includes the steps of:
[0008] Determine the total number of partitions corresponding to the current node layer according to the total number of occupied nodes in the current node layer of the tree structure and the average number threshold of nodes in a single hash table after partitioning;
[0009] Determine the number of hash tables corresponding to the current node layer according to the total number of partitions;
[0010] Determine the number of partitions of each coordinate component according to the total number of partitions and the position data of the occupied nodes in the current node layer;
[0011] Determine the hash table number corresponding to the node according to the number of hash tables corresponding to the current node layer, the number of partitions of the coordinate component, and the position data of the occupied nodes in the current node layer, and add the node to the hash table corresponding to the node.
[0012] The described point cloud dynamic hashing partitioning method, wherein determining the total number of partitions corresponding to the current node layer of the tree structure according to the total number of occupied nodes in the current node layer of the tree structure and the average number of nodes threshold in a single hash table after partitioning specifically includes:
[0013] For the distribution-based partitioning method, the total number of partitions is:
[0014] Or
[0015] For the average-based partitioning method, the total number of partitions is:
[0016]
[0017] Wherein, E represents the total number of partitions, N j represents the total number of occupied nodes in the j-th node layer, T represents the average number of nodes threshold in a single hash table after partitioning, represents the floor function, and K is a positive integer greater than 1.
[0018] The described point cloud dynamic hashing partitioning method, wherein the number of hash tables is:
[0019] N hash = 2 E
[0020] Wherein, E represents the total number of partitions, N hash represents the number of hash tables.
[0021] The described point cloud dynamic hashing partitioning method, wherein determining the number of partitions for each coordinate component according to the total number of partitions and the occupied node position data of the current node layer includes the steps:
[0022] For the average-based partitioning method:
[0023] Evenly distribute the total number of partitions to each coordinate component to obtain the number of partitions for each coordinate component;
[0024] Or, for the distribution-based partitioning method:
[0025] Obtain the distribution range of each coordinate component according to the occupied node position data of the current node layer;
[0026] Arrange the distribution ranges of each coordinate component in descending order to obtain the ranking order of each coordinate component;
[0027] Determine the number of partitions for each coordinate component according to the total number of partitions and the ranking order of each coordinate component.
[0028] The described point cloud dynamic hashing partitioning method, wherein determining the partitioning times of each coordinate component according to the total partitioning times and the sequence order of each coordinate component includes the steps:
[0029] If the tree structure is an octree, the partitioning times of each coordinate component are respectively:
[0030]
[0031]
[0032]
[0033] If the tree structure is a quadtree, the partitioning times of each coordinate component are:
[0034]
[0035]
[0036] If the tree structure is a binary tree, the partitioning times of the coordinate component are:
[0037] E x = E;
[0038] where E is the total partitioning times, P x , P y , P z are respectively the sequence order of the x - coordinate component, the sequence order of the y - coordinate component, the sequence order of the z - coordinate component, cmp(·) is a comparison function, E x , E y , E z are respectively the partitioning times of the x - coordinate component, the partitioning times of the y - coordinate component, the partitioning times of the z - coordinate component; a and b are both intermediate variables, and mod represents the remainder function.
[0039] The described point cloud dynamic hashing partitioning method, wherein determining the hash table number corresponding to a node according to the number of hash tables corresponding to the current node layer, the partitioning times of the coordinate component, and the occupied node position data of the current node layer specifically includes:
[0040] If the tree structure is an octree, the hash table number corresponding to the node is:
[0041]
[0042] If the tree structure is a quadtree, the hash table number corresponding to the node is:
[0043]
[0044] If the tree structure is a binary tree, the hash table serial number corresponding to the node is:
[0045]
[0046] Where C represents the hash table serial number, and LA, LB, and LC are a certain permutation of the X, Y, and Z coordinate axes, and E a , E b , E c respectively represent the number of divisions corresponding to LA, LB, and LC, respectively represent the value of the (N - E a )-th bit of the k-th node on the LA coordinate axis, the value of the (N - E b )-th bit of the k-th node on the LB coordinate axis, and the value of the (N - E c )-th bit of the k-th node on the LC coordinate axis, where N represents the number of bits of the Morton code.
[0047] The point cloud dynamic hash partitioning method described above, wherein the point cloud dynamic hash partitioning method further includes:
[0048] Traverse the neighbor nodes of the node, determine the hash table serial number corresponding to the neighbor node, and add the node to the hash table corresponding to the neighbor node; or
[0049] Traverse the neighbor nodes of the node, and add the neighbor nodes to the hash table corresponding to the node; or
[0050] Traverse the neighbor nodes of the node, determine the hash table serial number corresponding to the neighbor node, and save the corresponding relationship between the neighbor node position and the hash table serial number.
[0051] The point cloud dynamic hash partitioning method described above, wherein the tree structure includes one or more of: binary tree, quadtree, or octree.
[0052] A point cloud dynamic hash partitioning device, including a memory and a processor, where the memory stores a computer program, and wherein when the processor executes the computer program, the steps of the point cloud dynamic hash partitioning method described in any one of the above are implemented.
[0053] A storage medium, on which a computer program is stored, and wherein when the computer program is executed by a processor, the steps of the point cloud dynamic hash partitioning method described in any one of the above are implemented.
[0054] Beneficial effects: Since several hash tables are configured on the node layer, the hash table corresponding to a node is determined according to the position data of the point cloud on the node, and the node is added to the hash table corresponding to the node, and there will be no hash collision among the nodes in different hash tables. Thus, without sacrificing performance, the access performance of the hash table is optimized, and the efficiency of inserting and querying the hash table is improved. Description of the Drawings
[0055] Figure 1 is the first flowchart of the point cloud dynamic hash partitioning method of the present invention.
[0056] Figure 2 is the second flowchart of the point cloud dynamic hash partitioning method of the present invention.
[0057] Figure 3 is the functional principle block diagram of the point cloud dynamic hash partitioning device of the present invention. Detailed Embodiments
[0058] To make the objectives, technical solutions and advantages of the present invention clearer and more explicit, the following further describes the present invention in detail with reference to the accompanying drawings and by way of examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0059] Please also refer to Figures 1 - 3 , the present invention provides some embodiments of a point cloud dynamic hash partitioning method.
[0060] The inventor found that in the test platform PCEM, the geometric information in the three-dimensional point cloud is quantified, converted into a Morton code, and organized into an octree according to the Morton code. Before encoding a certain layer of the octree, a hash table is newly created, and all the nodes in this layer are put into this hash table. During the encoding process, when establishing a context reference, the occupancy of a node at a certain position can be quickly queried through this hash table. However, in the face of dense or large-scale point clouds in the above related technologies, the number of elements in a single hash table is too large. Problems such as a high frequency of hash collisions and the need for the hash table to be expanded multiple times are likely to occur, which affects the efficiency of inserting and querying the hash table.
[0061] Point cloud data refers to the data type obtained through a 3D scanner. In addition to geometric positions, point cloud data also has intensity information. The acquisition of intensity information is the echo intensity collected by the receiving device of the laser scanner. This intensity information is related to the surface material, roughness, incident angle direction of the target, as well as the emission energy and laser wavelength of the instrument. Of course, it can also have attribute information such as color and reflectivity. The point cloud dynamic hashing partitioning method of this application is applied to point cloud data processing, specifically applied to the compression process of point cloud data, such as encoding or decoding. The execution entity of the point cloud dynamic hashing partitioning method of this application can be a terminal, a computer, an encoding end, or a decoding end.
[0062] As Figure 1 shown, in a point cloud dynamic hashing partitioning method of the present invention, the position data of the point cloud is stored based on a tree structure, and there are multiple nodes with parent-child relationships in the tree structure.
[0063] Specifically, the geometric position of a point in the point cloud is represented by three-dimensional Cartesian coordinates (X, Y, Z). Each coordinate value is represented by N bits, and the coordinates (X k , Y k , Z k ) of the k-th point can be expressed as:
[0064]
[0065]
[0066]
[0067] For example, X k = (01011000), Y k = (10000100), Z k = (01111000), N is 8, is 0, is 1, and so on, is 0, is 0. is 1, is 0, is 0, is 0. is 0, is 1, is 0, is 0. Of course, other bit positions can also be used to represent the coordinate values.
[0068] The Morton code corresponding to the k-th point can be expressed as follows:
[0069]
[0070] Represent every three bits in octal notation Then the Morton code corresponding to the k-th point can be expressed as According to the Morton code, starting from the root node in breadth-first order (the 0th layer) construct a geometric K-ary tree, where K is an integer greater than 1. As an example, the K can be 2, 4, or 8, etc. That is to say, according to the geometric positions of the points in the point cloud, a binary tree, a quadtree, an octree, or a mixed tree structure of these three can be constructed.
[0071] In this embodiment, taking the construction of an octree as an example, specifically, first divide all the points into eight child nodes according to the 0th octal digit of the Morton code : all the points are divided into the 0th child node , all the points are divided into the 1st child node , and so on. All the points are divided into the 7th child node . Then, the nodes in the first layer of the octree are composed of these eight nodes. Eight bits represent whether the eight child nodes of the root node are occupied. The root node refers to the topmost node of the tree structure. If it contains at least one point in the point cloud, its corresponding bit b k = 1; if this child node does not contain any points, b k = 0. A child node refers to a node in the tree structure that is other than the root node and has nodes connected below itself. According to the 1st octal digit of the Morton code of the geometric position further divide the occupied nodes in the first layer into eight child nodes; and use eight bits to represent the occupancy information of its child nodes (l n is the serial number of the occupied node, n = 0,..., N 1 -1, N 1 represents the number of occupied nodes in the first layer.) Then, according to the jth octal digit in the Morton code of the geometric position for j = 2, 3,..., N - 2, further divide the occupied nodes in these layers into eight child nodes; and use eight bits to represent the occupancy information of their child nodes. (l n is the serial number of the occupied node, n = 0,..., N j -1, N jIndicates the number of occupied nodes in the j-th layer. ) For the j = N - 1 layer, all nodes become leaf nodes. A leaf node is a node that has no further nodes connected below itself, i.e., the end. If the encoder configuration allows duplicate points, the number of duplicate points on each occupied leaf node needs to be recorded in the bitstream.
[0072] In this example implementation, the following steps S100 - S400 are performed at the encoding end or the decoding end to implement the point cloud dynamic hashing partitioning method. The point cloud dynamic hashing partitioning method includes the following steps:
[0073] Step S100: Determine the total number of partitions corresponding to the current node layer of the tree structure according to the total number of occupied nodes in the current node layer of the tree structure and the average number of nodes threshold in a single hash table after partitioning.
[0074] Specifically, the point cloud dynamic hashing partitioning method in this application can perform hierarchical traversal through breadth - first search. Before encoding or decoding the nodes in the j-th node layer, according to the total number of occupied nodes in this node layer and the average number of nodes threshold in a single hash table after partitioning, determine the total number of partitions corresponding to this node layer. The total number of partitions is a natural number.
[0075] Specifically, there are two calculation methods for the total number of partitions. For the distribution - based partitioning method, the total number of partitions is:
[0076]
[0077] where E represents the total number of partitions, N j represents the total number of nodes in the j-th node layer, T represents the average number of nodes threshold in a single hash table after partitioning, represents the floor function.
[0078] For the average - based partitioning method, the total number of partitions is:
[0079]
[0080] where E represents the total number of partitions, N j represents the total number of occupied nodes in the current j-th node layer, T represents the average number of nodes threshold in a single hash table after partitioning, represents the floor function, and K is a positive integer greater than 1. For example, when partitioning based on an octree, K is 8. When partitioning based on a quadtree, K is 4. When partitioning based on a binary tree, K is 2.
[0081] For example, let the total number of nodes N j in the j-th node layer be 180000, and T be 10000. For the distribution - based partitioning method where, log 2 (18)≈4.16. For the octree - based partitioning method, where log 2 (8) = 3.
[0082] Step S200: Determine the number of hash tables corresponding to the current node layer according to the total number of divisions.
[0083] Specifically, based on the total number of divisions, determine the number of hash tables. For one node layer, the number of hash tables can be 1 or more, and the number of hash tables in different node layers can be the same or different.
[0084] Specifically, the number of hash tables is:
[0085] N hash = 2 E
[0086] where E represents the total number of divisions and N hash represents the number of hash tables.
[0087] For example, when E is 4, N hash is 16, that is, 16 hash tables need to be established. Another example, when E is 0, N hash is 1, that is, 1 hash table needs to be established.
[0088] When the number of hash tables corresponding to the node layer is greater than 1, it is necessary to determine the hash tables corresponding to the nodes in this node layer. When the number of hash tables corresponding to the node layer is equal to 1, all nodes in the node layer can be directly added to the hash table.
[0089] Specifically, use H c to represent the Cth hash table, where C is the hash table serial number and C is a natural number. Determining C determines the hash table H c corresponding to the node.
[0090] Step S300: Determine the number of divisions of each coordinate component according to the total number of divisions and the occupied node position data of the current node layer.
[0091] Specifically, to calculate the hash table corresponding to the node, it is necessary to know the number of divisions of each coordinate component.
[0092] There are two methods to calculate the number of divisions of each coordinate component. One is the division method based on average, and the other is the division method based on distribution.
[0093] Step S300: Determine the number of divisions of each coordinate component according to the total number of divisions and the occupied node position data of the current node layer, including:
[0094] Step S310a. For the average-based partitioning method, evenly distribute the total number of partitioning times to each coordinate component to obtain the number of partitioning times for each coordinate component.
[0095] For example, for an octree, evenly distribute the total number of partitioning times to 3 coordinate components to obtain the number of partitioning times for each coordinate component. For a quadtree, evenly distribute the total number of partitioning times to 2 coordinate components to obtain the number of partitioning times for each coordinate component. For a binary tree, distribute the total number of partitioning times to 1 coordinate component to obtain the number of partitioning times for that coordinate component.
[0096] Specifically, step S300. Determine the number of partitioning times for each coordinate component according to the total number of partitioning times and the occupied node position data of the current node layer, including:
[0097] Step S310b. For the distribution-based partitioning method, obtain the distribution range of each coordinate component according to the occupied node position data of the current node layer.
[0098] Specifically, traverse the coordinates of all vertices, find the minimum value and the maximum value on each coordinate component, and calculate the distribution range on each coordinate component:
[0099] D x = X max - X min ,D y = Y max - Y min ,D z = Z max - Z min ,
[0100] where X min ,X max ,Y min ,Y max ,Z min ,Z max are the minimum value and the maximum value on each coordinate component, and D x ,D y ,D z are the distribution ranges of the x coordinate component, the y coordinate component, and the z coordinate component respectively.
[0101] For example, assume X min = 10,X max = 20,Y min = 5,Y max = 25,Z min = 3,Z max = 13, then D x = 20 - 10 = 10,D y = 25 - 5 = 20,Dz = 13 - 3 = 10.
[0102] Step S320b. Arrange according to the distribution ranges of each coordinate component in descending order to obtain the ranking order of each coordinate component.
[0103] Step S330b. Determine the division times of each coordinate component according to the total number of divisions and the ranking order of each coordinate component.
[0104] Specifically, if the tree structure is an octree, then D x , D y , D z are arranged in descending order, and it is recorded that D x is in the P x th ranking, D y is in the P y th ranking, D z is in the P z th ranking. Then the division times of the three coordinate components are:
[0105]
[0106]
[0107]
[0108] where cmp is a comparison function, and its form is E x , E y , E z are the division times of the x - coordinate component, the y - coordinate component, and the z - coordinate component respectively; a and b are both intermediate variables, and mod represents the remainder function.
[0109] Specifically, if the tree structure is a quadtree, D x , D y are arranged in descending order to obtain that D x is in the P x th ranking, D y is in the P y th ranking. Then the division times of the two coordinate components are:
[0110]
[0111]
[0112] Specifically, if the tree structure is a binary tree, then the division times E x = E.
[0113] For example, for the average-based partitioning method: Let the tree be an octree, and let E = 6, then:
[0114] For the distribution-based partitioning method: Let the tree be an octree, E = 4, D x = 20, D y = 15, D z = 10, then: P x = 1, P y = 2, P z = 3.
[0115]
[0116]
[0117]
[0118] Step S400: Determine the hash table number corresponding to the current node layer, the partitioning times of the coordinate components, and the occupied node position data of the current node layer, and add the node to the hash table corresponding to the node.
[0119] Determine the hash table number corresponding to the node according to the partitioning times of the coordinate components and the occupied node position data of the current node layer. Of course, the hash table number C is less than the number of hash tables N hash , it should be noted that the hash table number C is a natural number, starting from 0. The number of hash tables N hash is a positive integer, starting from 1. For example, when the hash table number C is 0, the number of hash tables N hash is 1, which means there is only one hash table, and this hash table is H 0 . Again, when the hash table numbers C are 0, 1, 2, the number of hash tables N hash is 3, that is to say, there are 3 hash tables, namely H 0 , H 1 , H 2 .
[0120] Specifically, if the tree structure is an octree, the hash table number corresponding to the node is:[[]]
[0121]
[0122] where C represents the hash table number, and LA, LB, LC are a certain permutation of the three coordinate axes X, Y, Z. That is to say, LA, LB, LC can be the X, Y, Z coordinate axes, or the Y, X, Z coordinate axes, or the Z, X, Y coordinate axes, etc. There are a total of 6 permutation methods. E α , Eb , E c respectively represent the number of divisions corresponding to LA, LB, and LC, respectively represent the value of the k-th node in the LA coordinate axis (N - E a ) bits, the value of the k-th node in the LB coordinate axis (N - E b ) bits, and the value of the k-th node in the LC coordinate axis (N - E c ) bits, where N represents the number of bits of the coordinate value.
[0123] Specifically, if the tree structure is a quadtree, the hash table serial number corresponding to the node is:
[0124]
[0125] where C represents the hash table serial number, LA and LB are any permutation of two of the X, Y, and Z coordinate axes, and E a , E b respectively represent the number of divisions corresponding to LA and LB, respectively represent the value of the k-th node in the LA coordinate axis (N - E a ) bits and the value of the k-th node in the LB coordinate axis (N - E b ) bits, where N represents the number of bits of the coordinate value.
[0126] Specifically, if the tree structure is a binary tree, the hash table serial number is:
[0127]
[0128] where C represents the hash table serial number, LA is any one of the X, Y, and Z coordinate axes, and E a respectively represent the number of divisions corresponding to LA, respectively represent the value of the k-th node in the LA coordinate axis (N - E a ) bits, where N represents the number of bits of the coordinate value.
[0129] For example, assume the tree is an octree, E = 4, E a = 2, E b = 1, E c = 1, X k = (1100100), Y k = (0100010), Z k = (1000001), LA is the X-axis, LB is the Y-axis, LC is the Z-axis, then
[0130] N = 7, E a = E x = 2, E b= E y = 1, E c = E z = 1,
[0131] That is, the node should be placed into the hash table H of No. 13 13 .
[0132] Add the said node to the hash table corresponding to the said node. Specifically, add the node to the hash table corresponding to this node. For example, if the hash table corresponding to the node is H 2 , then this node is added to H 2 in the hash table.
[0133] When the number of the said hash tables is equal to 1, add all the nodes in the said node layer to the said hash table.
[0134] Specifically, if the node layer only corresponds to 1 hash table, that is to say, there is only one optional hash table for the nodes in this node layer and only this hash table can be selected, then add all the nodes in this node layer to the hash table corresponding to this node layer.
[0135] Step S500: Traverse the neighbor nodes of the said node, determine the hash table serial numbers corresponding to the neighbor nodes, and associate the said node and the neighbor nodes.
[0136] Specifically, if the k1-th node and the k2-th node satisfy the following conditions, then the k1-th node and the k2-th node are called neighbor nodes:
[0137] |X k1 - X k2 | ≤ 1, |Y k1 - Y k2 | ≤ 1, |Z k1 - Z k2 | ≤ 1
[0138] where X k1 , Y k1 , Z k1 are the coordinates of the k1-th node respectively, and X k2 , Y k2 , Z k2 are the coordinates of the k2-th node respectively. That is to say, when the distances between the X coordinates, the Y coordinates and the Z coordinates of two nodes are all less than or equal to 1, then the two nodes are neighbor nodes.
[0139] There are several neighbor nodes for each node in each node layer. To facilitate finding the occupancy status of the neighbor nodes of a certain node in the hash table, the node can be added to the hash table corresponding to the neighbor nodes, so that the occupancy status of the neighbor nodes can be obtained only by looking up the node; or the neighbor nodes can be added to the hash table corresponding to the node; or the corresponding relationship between the neighbor nodes and the hash tables they belong to can be recorded, and when querying the occupancy status of the neighbor nodes, query in the corresponding hash table.
[0140] Specifically, step 500, traverse the neighbor nodes of the node, determine the hash table serial number corresponding to the neighbor nodes, and associate the node and the neighbor nodes, including:
[0141] Step S510, traverse the neighbor nodes of the node, determine the hash table serial number corresponding to the neighbor nodes, and add the node to the hash table corresponding to the neighbor nodes.
[0142] Specifically, if the value of N hash is greater than 1, traverse the neighbor nodes of the same layer of the node (the hash table serial number corresponding to this node is C), and calculate the hash table serial numbers to which the neighbor nodes belong. The different hash table serial numbers to which the neighbor nodes of the same layer belong are C0, C1,..., Ci, and these numbers are all different from C. Put the current node into H C0 , H C1 , …, H Ci . The flowchart of using this method is shown in Figure 2 .
[0143] For example, assume that the hash table to which the current node should be put is H 0 , and it has only one neighbor node, and the hash table serial number to which the neighbor node belongs is 1. The current node will be put into H 0 and H 1 hash tables.
[0144] Step S520, traverse the neighbor nodes of the node, and add the neighbor nodes to the hash table corresponding to the node.
[0145] Specifically, if the value of N hash is greater than 1, traverse the neighbor nodes of the same layer of the current node (the hash table serial number corresponding to this node is C). Put the neighbor nodes into the hash table H C corresponding to the current node.
[0146] For example, assume that the current node should be put into the hash table H C . When querying the neighbor nodes of the current node, only query in the hash table H C corresponding to this node.
[0147] Step S530: Traverse the neighbor nodes of the said node, determine the hash table serial numbers corresponding to the neighbor nodes, and save the correspondence between the positions of the neighbor nodes and the hash table serial numbers.
[0148] Specifically, if the value of N hash is greater than 1, traverse the neighbor nodes of the same layer of the node (the hash table serial number corresponding to this node is C), and calculate the hash table serial numbers corresponding to the neighbor nodes. The hash table serial numbers to which the neighbor nodes of the same layer belong are C0, C1,..., Ci. Save the neighbor nodes and their corresponding hash table serial numbers.
[0149] For example, assume that the hash table where the current node should be placed is H 0 , and it has only one neighbor node. The hash table serial number to which this node belongs is 1, and record the hash table number to which this neighbor node belongs. When querying the neighbor of the current node, it is known from the record that the query needs to be performed in H 1 .
[0150] To verify the effect of the present invention, compare the performance of the point cloud dynamic hash partitioning method of the present invention with the benchmark results of the test platform PCEM. For geometric positions, under limited lossy geometric conditions, the present invention will not cause quality loss. For encoding speed, when encoding small-scale models, the performance of this algorithm is equivalent to the benchmark. When encoding large-scale models, this algorithm saves approximately 2% of the geometric encoding time compared to the benchmark.
[0151] The present invention also provides a preferred embodiment of a point cloud dynamic hash partitioning device:
[0152] As Figure 3 shown, the point cloud dynamic hash partitioning device of the embodiment of the present invention includes a memory 20 and a processor 10. The memory 20 stores a computer program, and when the processor 10 executes the computer program, it implements the steps of the point cloud dynamic hash partitioning method described in any of the above embodiments. Specifically, as described above.
[0153] The present invention also provides a preferred embodiment of a storage medium:
[0154] The storage medium of the embodiment of the present invention stores a computer program, and when the computer program is executed by a processor, it implements the steps of the point cloud dynamic hash partitioning method described in any of the above embodiments. Specifically, as described above.
[0155] In summary, a method and device for dynamic hashing partitioning of point clouds provided by the present invention. The method for dynamic hashing partitioning of point clouds includes the steps of: determining the total number of partitioning times corresponding to the current node layer according to the total number of occupied nodes in the current node layer of the tree structure and the average number of nodes threshold in a single hash table after partitioning; determining the number of hash tables corresponding to the current node layer according to the total number of partitioning times; determining the number of partitioning times for each coordinate component according to the total number of partitioning times and the occupied node position data of the current node layer; determining the hash table serial number corresponding to the node according to the number of hash tables corresponding to the current node layer, the number of partitioning times of the coordinate component, and the occupied node position data of the current node layer, and adding the node to the hash table corresponding to the node. Since a number of hash tables are configured on the node layer, and the hash table corresponding to the node is determined according to the position data of the point cloud on the node, and the node is added to the hash table corresponding to the node, there will be no hash collision for the nodes in different hash tables. Thus, without sacrificing performance, the access performance of the hash table is optimized, and the efficiency of inserting and querying the hash table is improved.
[0156] It should be understood that the application of the present invention is not limited to the above examples. For those of ordinary skill in the art, improvements or transformations can be made according to the above description. All such improvements and transformations should fall within the protection scope of the appended claims of the present invention.
Claims
1. A method for dynamic hash partitioning of point clouds, wherein the position data of the point clouds is stored based on a tree structure. Characterized in that, It includes the steps: Determine the total number of partitioning times corresponding to the current node layer of the tree structure according to the total number of occupied nodes in the current node layer of the tree structure and the average number of nodes threshold in a single hash table after partitioning; Determine the number of hash tables corresponding to the current node layer according to the total number of partitioning times; Determine the number of partitioning times for each coordinate component according to the total number of partitioning times and the position data of the occupied nodes in the current node layer; Determine the hash table serial number corresponding to the node according to the number of hash tables corresponding to the current node layer, the number of partitioning times of the coordinate component, and the position data of the occupied nodes in the current node layer, and add the node to the hash table corresponding to the node; The determining the hash table serial number corresponding to the node according to the number of hash tables corresponding to the current node layer, the number of partitioning times of the coordinate component, and the position data of the occupied nodes in the current node layer specifically includes: If the tree structure is an octree, the hash table serial number corresponding to the node is: If the tree structure is a quadtree, the hash table serial number corresponding to the node is: If the tree structure is a binary tree, the hash table serial number corresponding to the node is: Among them, C represents the hash table serial number, and LA, LB, and LC are a certain permutation of the X, Y, and Z coordinate axes, E a , E b , E c respectively represent the number of divisions corresponding to LA, LB, and LC, respectively represent the values of the (N - E a )-th bit of the k-th node on the LA coordinate axis, the values of the (N - E b )-th bit on the LB coordinate axis, and the values of the (N - E c )-th bit on the LC coordinate axis. N represents the number of bits of the coordinate value.
2. The method for dynamic hash partitioning of point clouds according to claim 1, Characterized in that, The determining the total number of partitioning times corresponding to the current node layer according to the total number of occupied nodes in the current node layer of the tree structure and the average number of nodes threshold in a single hash table after partitioning specifically includes: For the partitioning method based on distribution, the total number of partitioning times is: or For the partitioning method based on average, the total number of partitioning times is: Among them, E represents the total number of divisions, and N j represents the total number of occupied nodes in the current j-th node layer, T represents the average number of nodes threshold in a single hash table after division, represents the floor function, and K is a positive integer greater than 1.
3. The method for dynamic hash partitioning of point clouds according to claim 1, Characterized in that, The determining the number of hash tables corresponding to the current node layer according to the total number of partitioning times is specifically: N hash =2 E Among them, E represents the total number of divisions, and N hash represents the number of hash tables corresponding to the current node layer.
4. The method for dynamic hash partitioning of point clouds according to claim 1, Characterized in that, The determining the number of partitioning times for each coordinate component according to the total number of partitioning times and the position data of the occupied nodes in the current node layer includes the steps: For the partitioning method based on average: Evenly distribute the total number of partitioning times to each coordinate component to obtain the number of partitioning times for each coordinate component; Or, for the partitioning method based on distribution: Obtain the distribution range of each coordinate component according to the position data of the occupied nodes in the current node layer; Arrange the distribution ranges of each coordinate component in descending order to obtain the ranking order of each coordinate component; Determine the number of partitioning times for each coordinate component according to the total number of partitioning times and the ranking order of each coordinate component.
5. The method for dynamic hash partitioning of point clouds according to claim 4, Characterized in that, The determining the number of partitioning times for each coordinate component according to the total number of partitioning times and the ranking order of each coordinate component includes the steps: If the tree structure is an octree, the number of partitioning times for each coordinate component is respectively: If the tree structure is a quadtree, the number of partitioning times for each coordinate component is: If the tree structure is a binary tree, the number of partitioning times for each coordinate component is: E x = E; Among them, E is the total number of divisions, P x , P y , P z are the sequence orders of the x - coordinate component, the y - coordinate component, and the z - coordinate component respectively, cmp(·) is a comparison function, E x , E y , E z are the number of divisions of the x - coordinate component, the number of divisions of the y - coordinate component, and the number of divisions of the z - coordinate component respectively; a and b are both intermediate variables, and mod represents the remainder function.
6. The point cloud dynamic hashing partitioning method according to claim 1, wherein, the point cloud dynamic hashing partitioning method further includes: traversing the neighbor nodes of the node, determining the hash table serial numbers corresponding to the neighbor nodes, and adding the node to the hash tables corresponding to the neighbor nodes; or traversing the neighbor nodes of the node, and adding the neighbor nodes to the hash table corresponding to the node; or traversing the neighbor nodes of the node, determining the hash table serial numbers corresponding to the neighbor nodes, and saving the correspondence between the positions of the neighbor nodes and the hash table serial numbers.
7. The point cloud dynamic hashing partitioning method according to any one of claims 1-6, wherein, the tree structure includes one or more of: binary tree, quadtree or octree.
8. A point cloud dynamic hashing partitioning device, comprising a memory and a processor, the memory storing a computer program, wherein, when the processor executes the computer program, the steps of the point cloud dynamic hashing partitioning method according to any one of claims 1 to 7 are implemented.
9. A storage medium, on which a computer program is stored, wherein, when the computer program is executed by a processor, the steps of the point cloud dynamic hashing partitioning method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Efficient neighborhood searching method for large-scale three-dimensional point cloud data
CN108920574A
Efficient and scalable three-dimensional point cloud segmentation for navigation in autonomous vehicles
US20190310378A1