CN116737740A - Method and device for updating three-dimensional point cloud map - Google Patents

Method and device for updating three-dimensional point cloud map Download PDF

Info

Publication number
CN116737740A
CN116737740A CN202310869849.1A CN202310869849A CN116737740A CN 116737740 A CN116737740 A CN 116737740A CN 202310869849 A CN202310869849 A CN 202310869849A CN 116737740 A CN116737740 A CN 116737740A
Authority
CN
China
Prior art keywords
point
subtree
node
added
tree structure
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310869849.1A
Other languages
Chinese (zh)
Inventor
冀磊
程显昱
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
You Can See Beijing Technology Co ltd AS
Original Assignee
You Can See Beijing Technology Co ltd AS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by You Can See Beijing Technology Co ltd AS filed Critical You Can See Beijing Technology Co ltd AS
Priority to CN202310869849.1A priority Critical patent/CN116737740A/en
Publication of CN116737740A publication Critical patent/CN116737740A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/005Tree description, e.g. octree, quadtree
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/05Geographic models

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Remote Sensing (AREA)
  • Computer Graphics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the disclosure discloses a method and a device for updating a three-dimensional point cloud map, wherein the method comprises the following steps: in response to obtaining a new laser data frame, performing downsampling processing on the new laser data frame to obtain a point to be added; adding the points to be added into the original tree structure one by one; in response to the successful addition of a point to be added to the original tree structure, determining a point to be deleted corresponding to the point to be added which is successfully added, and setting a first flag bit of a node where the point to be deleted is located as true, wherein the first flag bit is used for indicating whether a node storage point is deleted or not; recursively updating node information of nodes on paths of points to be added and points to be deleted according to the sequence from bottom to top; and determining a subtree to be rebuilt according to the node information of at least one node in the updated original tree structure, and rebuilding the subtree to be rebuilt. The embodiment of the disclosure can realize long-time acquisition and processing of the SLAM system by dynamically adding, deleting and reconstructing the tree structure through the triangulation method.

Description

Method and device for updating three-dimensional point cloud map
Technical Field
The disclosure relates to the technical field of three-dimensional space data processing, in particular to a method and a device for updating a three-dimensional point cloud map.
Background
Real-time localization and mapping (Simultaneous Localization and Mapping, simply SLAM) is a technique that uses information acquired by radar to determine its own spatial coordinates and reconstruct a map of the surrounding environment. In the existing laser SLAM process, a three-dimensional point cloud map generated within a certain time is required to be stored for query and matching update, but the existing data storage structure for storing the three-dimensional point cloud map cannot support operations such as real-time update and reconstruction of the three-dimensional point cloud map, so that long-time acquisition and processing of an SLAM system cannot be supported.
Disclosure of Invention
One technical problem to be solved by the embodiments of the present disclosure is: provided are a method and a device for updating a three-dimensional point cloud map.
According to an aspect of the embodiments of the present disclosure, there is provided a method for updating a three-dimensional point cloud map, the method including:
in response to obtaining a new laser data frame, performing downsampling processing on the new laser data frame to obtain a point to be added;
adding the points to be added into an original tree structure one by one, wherein an origin cloud map is stored in the original tree structure;
in response to the successful addition of a point to be added to the original tree structure, determining a point to be deleted corresponding to the point to be added which is successfully added, and setting a first flag bit of a node where the point to be deleted is located as true, wherein the first flag bit is used for indicating whether a node storage point is deleted or not;
Recursively updating node information of the nodes on the paths of the points to be added and the points to be deleted according to the sequence from bottom to top;
determining a subtree to be rebuilt according to the updated node information of at least one node in the original tree structure;
and reconstructing the subtree to be reconstructed.
In yet another embodiment of the present disclosure, the node information of the node includes:
the first flag bit; a second flag bit for indicating spatial range information of a point stored in a subtree of the node; a third flag bit for indicating whether a subtree of the node is deleted; a fourth flag bit for indicating whether a subtree of the node is being reconstructed; an eighth flag bit for indicating whether a subtree of the node needs reconstruction; a fifth flag bit and a sixth flag bit for indicating the number of points stored in the left subtree and the right subtree of the node; a seventh flag bit for indicating the number of deleted points in the subtree of the node; the nodes store three-dimensional coordinate information of the points and the dividing axes.
In yet another embodiment of the present disclosure, the responding to obtaining a new laser data frame, performing downsampling processing on the new laser data frame to obtain a point to be added includes:
And performing downsampling treatment on the point cloud corresponding to the new laser data frame according to the set point cloud density to obtain the point to be added.
In yet another embodiment of the present disclosure, the determining a point to be deleted corresponding to a point to be added that is successfully added includes:
and determining a point in a down-sampling interval range taking the point to be added as a center as the point to be deleted, wherein the point in the down-sampling interval range comprises the point in the original tree structure, or the point in the down-sampling interval range comprises the point in the original tree structure and the point to be added which is successfully added into the original tree structure.
In yet another embodiment of the present disclosure, adding the points to be added one by one to the original tree structure includes:
starting downwards recursion from a root node of the original tree structure, and determining a target adding position of the point to be added to the original tree structure according to the size relation of the component of the point to be added and a node storage point in the original tree structure on a segmentation axis;
and adding the point to be added at the target adding position, and initializing the value of node information of the corresponding node according to the three-dimensional coordinate information of the point to be added.
In yet another embodiment of the present disclosure, the recursively updating node information of the nodes on the paths of the point to be added and the point to be deleted in the order from bottom to top includes:
starting to recursion upwards from the target adding position, and sequentially updating a fifth flag bit or a sixth flag bit of a node on a path where the point to be added is located;
and starting to recursion upwards from the point to be deleted, and sequentially updating a seventh flag bit of the node on the path where the point to be deleted is located.
In yet another embodiment of the present disclosure, the determining a subtree to be rebuilt according to updated node information of at least one node in the original tree structure includes:
starting upward recursion from leaf nodes of the point to be added and the point to be deleted associated path, and determining whether a subtree of at least one node meets a first reconstruction condition according to a value of a fifth flag bit and a value of a sixth flag bit of the at least one node;
determining whether a subtree of the at least one node meets a second reconstruction condition according to the value of the seventh flag bit, the value of the fifth flag bit and the value of the sixth flag bit of the at least one node;
and determining a subtree meeting the first reconstruction condition and/or the second reconstruction condition as the subtree to be reconstructed.
In yet another embodiment of the present disclosure, the reconstructing the subtree to be reconstructed includes:
determining the number of undeleted points in the subtree to be rebuilt;
responding to the quantity being smaller than a set threshold value, constructing a first tree structure by using undeleted points in the subtrees to be rebuilt, and splicing the first tree structure into the original tree structure;
and setting a fourth flag bit of the subtree to be rebuilt to be true in response to the number not smaller than a set threshold, and executing the rebuilding of the subtree to be rebuilt through a subtree rebuilding thread.
In yet another embodiment of the present disclosure, the performing, by the reconstruction subtree thread, the reconstruction of the subtree to be reconstructed includes:
extracting undeleted points in the subtree to be rebuilt, waking up the rebuilt subtree thread and adding a mutual exclusion lock to the rebuilt subtree thread;
constructing a second tree structure according to the undeleted points in the subtree to be rebuilt by the subtree thread, and splicing the second tree structure into the original tree structure;
releasing the mutual exclusion lock, and setting the fourth flag bit of the subtree to be rebuilt to false.
In yet another embodiment of the present disclosure, after the reconstructing the subtree to be reconstructed, the method further includes:
And correspondingly updating node information of the nodes on the associated paths of the subtrees to be rebuilt.
In yet another embodiment of the present disclosure, the method further comprises:
receiving a search instruction, wherein the search instruction carries three-dimensional coordinate information of a target point;
traversing downwards from the root node, and storing the traversed points with the preset number in a target container, wherein the target container stores three-dimensional coordinate information of the points with the preset number and the maximum distance from the target point;
responsive to traversing to at least one node whose subtree is not being reconstructed, not deleted, calculating a minimum distance of the subtree of the at least one node from the target point according to a value of a second flag bit of the at least one node;
responsive to the minimum distance being less than the maximum distance, calculating a distance of at least one point in a subtree of the at least one node from the target point and replacing a point in the target container corresponding to the maximum distance with at least one point having a distance less than the maximum distance;
updating the maximum distance recorded in the target container;
and returning the target container in response to traversing the nodes in the original tree structure.
According to still another aspect of the embodiments of the present disclosure, there is provided an updating apparatus of a three-dimensional point cloud map, the apparatus including:
The first processing module is used for responding to the acquisition of a new laser data frame, and carrying out downsampling processing on the new laser data frame to obtain a point to be added;
the adding module is used for adding the points to be added into the original tree structure one by one, wherein an origin cloud map is stored in the original tree structure;
the second processing module is used for responding to the successful addition of a point to be added into the original tree structure, determining a point to be deleted corresponding to the point to be added which is successfully added, setting a first flag bit of a node where the point to be deleted is located as true, and indicating whether the node storage point is deleted or not;
the first updating module is used for recursively updating node information of the nodes on the path of the point to be added and the point to be deleted according to the sequence from bottom to top;
the determining module is used for determining a subtree to be rebuilt according to the updated node information of at least one node in the original tree structure;
and the reconstruction module is used for reconstructing the subtree to be reconstructed.
In one embodiment of the present disclosure, the node information of the node includes:
the first flag bit; a second flag bit for indicating spatial range information of a point stored in a subtree of the node; a third flag bit for indicating whether a subtree of the node is deleted; a fourth flag bit for indicating whether a subtree of the node is being reconstructed; an eighth flag bit for indicating whether a subtree of the node needs reconstruction; a fifth flag bit and a sixth flag bit for indicating the number of points stored in the left subtree and the right subtree of the node; a seventh flag bit for indicating the number of deleted points in the subtree of the node; the nodes store three-dimensional coordinate information of the points and the dividing axes.
In yet another embodiment of the present disclosure, the first processing module is specifically configured to perform, in response to obtaining a new laser data frame, a down-sampling process on the new laser data frame to obtain a point to be added, where the processing includes:
and performing downsampling treatment on the point cloud corresponding to the new laser data frame according to the set point cloud density to obtain the point to be added.
In yet another embodiment of the present disclosure, the second processing module is specifically configured to determine, as the point to be deleted, a point in a down-sampling interval range centered on the point to be added, where the point in the down-sampling interval range includes a point in the original tree structure, or where the point in the down-sampling interval range includes a point in the original tree structure and a point to be added that has been successfully added to the original tree structure.
In yet another embodiment of the present disclosure, the adding module includes:
the first processing sub-module is used for starting downward recursion from the root node of the original tree structure, and determining a target adding position of the point to be added to the original tree structure according to the size relation of the components of the point to be added and the node storage point in the original tree structure on a segmentation axis;
And the initialization sub-module is used for adding the point to be added at the target adding position and initializing the value of the node information of the corresponding node according to the three-dimensional coordinate information of the point to be added.
In yet another embodiment of the present disclosure, the first update module includes:
the first updating sub-module is used for starting to recursively upwards from the target adding position and sequentially updating a fifth flag bit or a sixth flag bit of a node on a path where the point to be added is located;
and the second updating sub-module is used for starting the upward recursion from the point to be deleted and sequentially updating the seventh flag bit of the node on the path where the point to be deleted is located.
In yet another embodiment of the present disclosure, the determining module includes:
a first determining submodule, configured to determine, from a leaf node of the to-be-added point and the to-be-deleted point association path, whether a subtree of at least one node meets a first reconstruction condition according to a value of a fifth flag bit and a value of a sixth flag bit of the at least one node;
a second determining submodule, configured to determine whether a subtree of the at least one node meets a second reconstruction condition according to a value of a seventh flag bit, a value of a fifth flag bit, and a value of a sixth flag bit of the at least one node;
And the third determining submodule is used for determining a subtree meeting the first reconstruction condition and/or the second reconstruction condition as the subtree to be reconstructed.
In yet another embodiment of the present disclosure, the reconstruction module includes:
a fourth determining submodule, configured to determine the number of undeleted points in the subtree to be rebuilt;
the second processing sub-module is used for constructing a first tree structure by using undeleted points in the subtrees to be rebuilt in response to the quantity being smaller than a set threshold value, and splicing the first tree structure into the original tree structure;
and the reconstruction sub-module is used for setting the fourth flag bit of the subtree to be reconstructed to be true in response to the number not smaller than a set threshold value, and executing the reconstruction of the subtree to be reconstructed through the thread of the subtree to be reconstructed.
In yet another embodiment of the present disclosure, the reconstruction submodule includes:
the extraction submodule is used for extracting undeleted points in the subtree to be rebuilt, waking up the rebuilt subtree thread and adding a mutual exclusion lock to the rebuilt subtree thread;
the third processing sub-module is used for constructing a second tree structure according to the undeleted points in the subtree to be rebuilt through the subtree thread, and splicing the second tree structure into the original tree structure;
And the fourth processing submodule is used for releasing the mutual exclusion lock and setting the fourth flag bit of the subtree to be rebuilt to be false.
In yet another embodiment of the present disclosure, the apparatus further comprises:
and the second updating module is used for correspondingly updating the node information of the nodes on the path associated with the subtree to be rebuilt.
In yet another embodiment of the present disclosure, the apparatus further comprises:
the receiving module is used for receiving a search instruction, wherein the search instruction carries three-dimensional coordinate information of a target point;
the third processing module is used for traversing downwards from the root node, storing the traversed points with the preset number in a target container, and storing three-dimensional coordinate information of the points with the preset number and the maximum distance between the points and the target point in the target container;
a first calculation module, configured to calculate, in response to traversing to at least one node whose subtree is not being reconstructed and is not deleted, a minimum distance between the subtree of the at least one node and the target point according to a value of a second flag bit of the at least one node;
a second calculation module, configured to calculate, in response to the minimum distance being less than the maximum distance, a distance between at least one point in a subtree of the at least one node and the target point, and replace a point in the target container corresponding to the maximum distance with at least one point having a distance less than the maximum distance;
A third updating module for updating the maximum distance recorded in the target container;
and the return module is used for returning the target container in response to traversing the nodes in the original tree structure.
According to still another aspect of the embodiments of the present disclosure, there is provided an electronic device including:
a memory for storing a computer program;
and the processor is used for executing the computer program stored in the memory, and when the computer program is executed, the method for updating the three-dimensional point cloud map is realized.
According to still another aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the above-described method of updating a three-dimensional point cloud map.
According to yet another aspect of the disclosed embodiments, a computer program product is provided, comprising a computer program/instruction which, when executed by a processor, implements the above-described method of updating a three-dimensional point cloud map.
Based on the method, the device and the storage medium for updating the three-dimensional point cloud map provided by the embodiment of the disclosure, when a new laser data frame is acquired, the new laser data frame can be subjected to downsampling processing to obtain a point to be added; adding the points to be added into the original tree structure one by one; in response to the successful addition of a point to be added to the original tree structure, determining a point to be deleted corresponding to the point to be added which is successfully added, and setting a first flag bit of a node where the point to be deleted is located as true, wherein the first flag bit is used for indicating whether a node storage point is deleted or not; recursively updating node information of the nodes on the paths of the points to be added and the points to be deleted according to the sequence from bottom to top; determining a subtree to be rebuilt according to the updated node information of at least one node in the original tree structure; and reconstructing the subtree to be reconstructed. According to the technical scheme, the point cloud map is stored in the improved tree structure, dynamic addition, deletion and reconstruction of the tree structure can be achieved, long-time acquisition and processing of the SLAM system are achieved, and the problem of resource waste caused by the fact that the whole tree structure needs to be reconstructed when a new laser data frame exists is effectively avoided.
The technical scheme of the present disclosure is described in further detail below through the accompanying drawings and examples.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description, serve to explain the principles of the disclosure.
The disclosure may be more clearly understood from the following detailed description taken in conjunction with the accompanying drawings in which:
FIG. 1 is a flow chart of one embodiment of a method of updating a three-dimensional point cloud map of the present disclosure;
FIG. 2A is a flow chart of reconstructing a subtree to be reconstructed of the present disclosure;
fig. 2B is a schematic diagram of a tree structure in the method for updating a three-dimensional point cloud map of the present disclosure;
FIG. 2C is a flow chart of the present disclosure for performing subtree reconstruction to be reconstructed by a reconstruction subtree thread;
FIG. 3 is a flow chart of one embodiment of a method of finding a three-dimensional point cloud map of the present disclosure;
FIG. 4 is a schematic structural diagram of one embodiment of an update apparatus of a three-dimensional point cloud map of the present disclosure;
FIG. 5 is a schematic structural diagram of another embodiment of an update apparatus of a three-dimensional point cloud map of the present disclosure;
FIG. 6 is a schematic structural diagram of a further embodiment of an update apparatus of a three-dimensional point cloud map of the present disclosure;
fig. 7 is a block diagram of an electronic device provided in an exemplary embodiment of the present disclosure.
Detailed Description
Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless it is specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective parts shown in the drawings are not drawn in actual scale for convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
Embodiments of the present disclosure may be applicable to electronic devices such as computer systems/servers that are operable with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known computing systems, environments, and/or configurations that may be suitable for use with electronic devices, e.g., computer systems/servers, include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, minicomputer systems, mainframe computer systems, and distributed cloud computing technology environments that include any of the above systems, and the like.
An electronic device, such as a computer system/server, may be described in the general context of computer-system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc., that perform particular tasks or implement particular abstract data types. The computer system/server may be implemented in a distributed cloud computing environment in which tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computing system storage media including memory storage devices.
Exemplary embodiments of the invention
FIG. 1 is a flow chart of one embodiment of a method of updating a three-dimensional point cloud map of the present disclosure; the method for updating the three-dimensional point cloud map can be applied to electronic equipment (such as a computer system and a server), and as shown in fig. 1, the method for updating the three-dimensional point cloud map comprises the following steps:
in step 101, in response to obtaining a new laser data frame, downsampling the new laser data frame to obtain a point to be added.
In an embodiment, the origin cloud map is stored in an original tree structure. Referring to fig. 2B, in order to implement the technical solution of the embodiment of the present disclosure, in the tree structure provided by the embodiment of the present disclosure, each node stores not only three-dimensional coordinate information of a storage point (for example, three-dimensional coordinates (x, y, z) of a point P) and a dividing axis of the storage point, but also a first flag bit p_delete for indicating whether the node storage point is deleted; a second flag bit t_area for indicating spatial range information of a point stored in a subtree of the node; a third flag bit t_delete for indicating whether a subtree of a node is deleted; a fourth flag bit t_rebuild for indicating whether a subtree of a node is being rebuilt; an eighth flag bit t_rebuild for indicating whether the subtree of the node needs rebuilding, and fifth and sixth flag bits l_num, r_num for indicating the number of points stored in the left and right subtrees of the node; a seventh flag bit d_num for indicating the number of deleted points in the subtree of the node.
In an embodiment, when the point cloud map is initially constructed, the spatial range of all the point clouds may be calculated, then the spatial range is ordered according to three dimensions of x, y and z, and the dimension with the largest spatial distance difference is selected as the basis of current segmentation, for example, if the range span of all the current point clouds in the z-axis is largest, all the point clouds are ordered according to the size of the z-axis, a point (assumed to be p_middle) in the z-axis direction is taken as a root node of the entire tree structure, the three-dimensional coordinate of the point and the z-axis of the segmentation are stored in node information of the root node, and at the same time, the first flag bit indicating whether the point is deleted may be set as false, the third flag bit indicating whether the subtree of the node is deleted is set as false, and the fourth flag bit indicating whether the subtree of the node is reconstructed is false, the second flag bit t_ea indicating the spatial range information of the point is initialized, and the third flag bit t_m indicating the number of the subtrees stored in the subtrees of the node is updated, and the fifth flag bit r_m indicating the number of the subtrees stored in the subtrees of num and the number of num_m. And then taking all points with the z coordinate smaller than P_middle as a whole, repeating the operations of determining the root node and determining the node information of the root node, constructing a subtree and constructing the subtree as a left subtree of the root node, and constructing a subtree as a right subtree of the root node by using points with the z coordinate larger than P_middle. And performing iterative processing in this way, and finally completing the construction of the whole tree.
In an embodiment, when a new laser data frame is acquired, a point cloud corresponding to the new laser data frame may be determined first, and then downsampling processing is performed on the determined point cloud, that is, according to a set point cloud density, downsampling processing is performed on the point cloud corresponding to the new laser data frame, so as to obtain a point to be added. Wherein the set point cloud density may indicate the density of points to be added, e.g. only one point is reserved in a space unit of arbitrarily set size (k x k cube space), and deleting redundant points, thereby realizing down-sampling of points in the new laser data frame and obtaining points to be added.
In an embodiment, by downsampling a new frame of laser data, the number of points to be added may be reduced, and uniformity of points in the point cloud map may be ensured.
In step 102, the points to be added are added one by one to the original tree structure, wherein the origin cloud map is stored in the original tree structure.
In an embodiment, starting from a root node of the original tree structure, recursively downwards, and determining a target adding position of the point to be added to the original tree structure according to the size relation of the component of the point to be added and a node storage point in the original tree structure on a segmentation axis; and adding the point to be added at the target adding position, and initializing the value of node information of the corresponding node according to the three-dimensional coordinate information of the point to be added.
During specific addition, the size relation between the point to be added and the coordinates on the dividing axis of the root node can be judged, for example, the three-dimensional coordinates of the root node are (11, 21, 31), the dividing axis is the z axis, the three-dimensional coordinates of the point to be added are (12, 22, 11), wherein the coordinates of the point to be added on the dividing axis z axis of the root node are 11 and smaller than the coordinates of the root node on the z axis, so that the point to be added can be continuously searched downwards in the left subtree of the root node, then recursion is sequentially carried out until the leaf node is reached, the target adding position of the point to be added can be determined, the point to be added is used as a child node of the leaf node, and the initialization of information contained in the node is consistent with the initialization.
In an embodiment, when adding a point to the origin cloud map, if the point to be added is found to be repeated with one point in the origin cloud map by recursively starting from the root node of the original tree structure to the lowest leaf node, the point in the origin cloud map can be reserved, and the point to be added is not added again.
In step 103, in response to a successful addition of a point to be added to the original tree structure, determining a point to be deleted corresponding to the point to be added which is successfully added, and setting a first flag bit of a node where the point to be deleted is located as true, where the first flag bit is used for indicating whether a node storage point is deleted or not.
In an embodiment, a point in a down-sampling interval range centered on the point to be added may be determined as the point to be deleted, where the point in the down-sampling interval range includes a point in the original tree structure, or the point in the down-sampling interval range includes a point in the original tree structure and a point to be added that has been successfully added to the original tree structure. For example, all nodes in the downsampling interval range may be set as points to be deleted (excluding the points to be added that are currently successfully added) centering on the points to be added that are currently successfully added. The size of the downsampling interval range may be preset, for example, a range of 1 cm around the point to be added is determined as the downsampling interval range.
In an embodiment, when determining the point to be deleted, all the nodes in the down-sampling interval may be set as the point to be deleted, where the points include the point in the origin cloud map and also include the point in the new laser data frame that was successfully added to the origin cloud map before; alternatively, only the point in the origin cloud map within the down-sampling interval may be set as the point to be deleted, not including the point in the new laser data frame that was previously successfully added to the origin cloud map.
In an embodiment, which points in the downsampling interval are determined as the points to be deleted may be preset by the user.
In an embodiment, the down-sampling and deleting operation of a point in the origin cloud map triggered when the point is added is just to set a first flag bit of the point to be deleted as true, skip the point or a subtree represented by the point when the searching operation occurs, and actually delete the node where the point to be deleted is only when the corresponding subtree is reconstructed. In an embodiment, if the range represented by the second flag bit t_area of a subtree is completely surrounded by the downsampling interval, the third flag bit t_delete of whether the entire subtree is deleted is set to true.
In step 104, the node information of the nodes on the path of the point to be added and the point to be deleted is recursively updated in the order from bottom to top.
In specific implementation, the values of the fifth flag bit and the sixth flag bit of the node on the path where the point to be added is located can be updated sequentially from the target adding position to recursion upwards; and starting to recursion upwards from the point to be deleted, and sequentially updating a seventh flag bit of the node on the path where the point to be deleted is located.
In one embodiment, when a point to be added is added and a point to be deleted in a down-sampling interval is deleted, the flag bits of all nodes on the path are recursively updated from bottom to top. When adding a point, the values of the fifth flag bit, the sixth flag bit L_num and the R_num of the node on the path are required to be correspondingly updated, and when deleting the point, the value of the seventh flag bit D_num of the node on the path is required to be correspondingly updated.
In step 105, a subtree to be reconstructed is determined according to the updated node information of at least one node in the original tree structure.
In one embodiment, when determining whether a subtree needs to be rebuilt, it may be considered from two aspects, one whether the "deleted" point in the subtree of the node is too large in proportion to all points of the subtree, and the other whether the left subtree and the right subtree of the node are out of balance.
In specific implementation, the method may start to recursion upwards from the leaf node of the association path between the point to be added and the point to be deleted, and determine whether the subtree of the at least one node meets a first reconstruction condition according to the value of the fifth flag bit and the value of the sixth flag bit of the at least one node (the first reconstruction condition is used for indicating that the values of the fifth flag bit and the sixth flag bit have a larger difference, that is, the proportion of the left subtree to the right subtree point is unbalanced); determining whether a subtree of the at least one node meets a second reconstruction condition according to the value of the seventh flag bit, the value of the fifth flag bit and the value of the sixth flag bit of the at least one node (the second reconstruction condition is used for indicating that the ratio of the value of the seventh flag bit to the sum of the values of the fifth flag bit and the sixth flag bit is overlarge, that is, the proportion of the point deleted in the subtree of the node to all points of the subtree is overlarge); and determining that the subtree needs to be reconstructed when the subtree meets the first reconstruction condition and/or the second reconstruction condition.
It should be noted that, starting from the leaf node of the association path between the point to be added and the point to be deleted, determining the subtree to be reconstructed and executing the reconstruction operation, it is possible to ensure that the data volume involved in reconstructing the subtree each time is as small as possible, and further shorten the time of reconstructing the subtree each time, because the fewer the subtree is close to the leaf node, the shorter the time required for reconstructing the subtree is, and the point marked as deleted in the subtree is completely deleted, so the number of points of the subtree at the left and right of the upper node is also reduced, and the time of reconstructing the subtree at the upper layer is also shortened.
In an embodiment, the first reconstruction condition may be that a ratio of a larger value to a smaller value in the fifth flag bit and the sixth flag bit is greater than a set value, for example, a ratio of a larger value to a smaller value in the fifth flag bit and the sixth flag bit is greater than 1.5; the first reconstruction condition may also be that a ratio of a smaller value to a larger value of the fifth flag bit and the sixth flag bit is less than a set value, for example, a ratio of a smaller value to a larger value of the fifth flag bit and the sixth flag bit is less than 0.75.
In an embodiment, the second reconstruction condition may be that the ratio of the value indicating the seventh flag bit to the sum of the values of the fifth and sixth flag bits is too large, for example, the ratio of the value of the seventh flag bit to the sum of the values of the fifth and sixth flag bits is greater than 0.5, which may indicate that the proportion of the deleted points is too large and thus that reconstruction thereof is required.
In step 106, the subtree to be reconstructed is reconstructed.
In an embodiment, when the subtree to be rebuilt contains fewer points, all points which are not deleted in the subtree to be rebuilt can be directly extracted to construct a new tree structure, and then the new tree structure is grafted to the subtree to be rebuilt. When the subtree to be rebuilt contains too many points, the root node of the subtree to be rebuilt needs to be saved, and the fourth flag bit of whether the root node is being rebuilt is set to be true, and then a separate process is used for rebuilding. The process is in a dormant state at ordinary times, wakes up when the subtree needs to be rebuilt, and grafts the new tree structure into the original tree structure after the subtree is rebuilt.
It should be noted that, the operation of reconstructing the subtree is not in conflict with other functions of the tree structure, and the corresponding operations of adding, searching, etc. can be continuously performed on the tree structure, but when the subtree being reconstructed is found, the subtree needs to be skipped to search.
In one embodiment, the reconstruction subtree is specifically implemented with reference to the embodiment shown in fig. 2A, which is not described in detail herein.
101-106, when a new laser data frame is obtained, performing downsampling processing on the new laser data frame to obtain a point to be added; adding the points to be added into the original tree structure one by one; in response to the successful addition of a point to be added to the original tree structure, determining a point to be deleted corresponding to the point to be added which is successfully added, and setting a first flag bit of a node where the point to be deleted is located as true, wherein the first flag bit is used for indicating whether a node storage point is deleted or not; recursively updating node information of the nodes on the paths of the points to be added and the points to be deleted according to the sequence from bottom to top; determining a subtree to be rebuilt according to the updated node information of at least one node in the original tree structure; and reconstructing the subtree to be reconstructed. According to the technical scheme, the point cloud map is stored in the improved tree structure, dynamic addition, deletion and reconstruction of the tree structure can be achieved, long-time acquisition and processing of the SLAM system are achieved, and the problem of resource waste caused by the fact that the whole tree structure needs to be reconstructed when a new laser data frame exists is effectively avoided.
To better illustrate the scheme of updating the three-dimensional point cloud map of the present disclosure, another embodiment is described below.
Fig. 2A is a flowchart of reconstructing a subtree to be reconstructed according to the present disclosure, fig. 2B is a schematic diagram of a tree structure in the method for updating a three-dimensional point cloud map according to the present disclosure, and fig. 2C is a flowchart of performing subtree reconstruction to be reconstructed by a subtree reconstruction thread according to the present disclosure; this embodiment is exemplified by how to reconstruct a subtree, as shown in fig. 2A, and includes the following steps:
in step 201, the number of undeleted points in the subtree to be reconstructed is determined.
In an embodiment, after the subtree to be rebuilt is recursively determined from the leaf nodes of the paths associated with the points to be added and the points to be deleted, the number of deleted points can be determined according to the value of the seventh flag bit d_num of each node on the path where each subtree is located, and the number of original storage points of the subtree can be determined according to the value of the fifth flag bit and the value of the sixth flag bit, and further, the number of undeleted points in the subtree to be rebuilt can be determined by calculating the difference between the number of original storage points of the subtree and the number of deleted points, for example, the left subtree and the right subtree store 15 points in total, and if the number of deleted points is 12, the undeleted points are only 3.
In step 202, in response to the number being less than a set threshold, a first tree structure is constructed using undeleted points in the subtree to be reconstructed, and the first tree structure is spliced into the original tree structure.
In an embodiment, the set threshold may be a fixed value, for example, 5, which is preset.
In an embodiment, when the number of undeleted points is smaller than a set threshold, undeleted points in the subtree to be rebuilt can be directly extracted to construct a first tree structure, and then the constructed first tree structure is spliced into the original tree structure. In particular, a point having a false value of the first flag bit indicating whether the point is deleted may be extracted.
In an embodiment, after the construction of the subtree to be reconstructed is completed, node information of the nodes on the path associated with the subtree to be reconstructed, for example, the number of left and right subtrees of the nodes, the number of deleted points of the nodes, and the like, are correspondingly updated. After the subtree is rebuilt, the point marked by the first flag bit as true and not actually deleted in the original subtree is completely deleted after the subtree is rebuilt, so that the node information of the nodes on the upper-layer path of the subtree needs to be updated in sequence.
In step 203, in response to the number not being less than the set threshold, setting a fourth flag bit of the subtree to be reconstructed to true, and executing reconstruction of the subtree to be reconstructed by a subtree reconstruction thread.
In an embodiment, when the number of undeleted points is not less than the set threshold, it is indicated that the points contained in the subtree to be reconstructed are too many, at this time, the root node of the subtree to be reconstructed needs to be saved, and whether the fourth flag bit t_rebuilding is being reconstructed is set to true, and then a separate subtree thread to be reconstructed is used. The thread of the reconstruction subtree is in a dormant state at ordinary times, and can be awakened when the thread needs to be used. The operation of executing the subtree reconstruction to be reconstructed by the subtree reconstruction thread can be seen in the embodiment shown in fig. 2C, for example, fig. 2C, and includes the following steps 231 to 233:
in step 231, the undeleted point in the subtree to be rebuilt is extracted, the rebuilt subtree thread is awakened, and a mutex lock is added to the rebuilt subtree thread.
In an embodiment, the undeleted point in the subtree to be reconstructed may be obtained by extracting a point of each node in the subtree to be reconstructed, where the first flag bit for indicating whether the point is deleted is set to false.
In an embodiment, after waking up the reconstruction subtree thread, since the reconstruction subtree thread is performed separate from the main thread, there is a case that the point to be added just falls on the subtree to be reconstructed, and when the point to be added just falls on the subtree to be reconstructed, the point to be added needs to be added into the subtree to be reconstructed.
In one embodiment, after waking up a reconstructed subtree thread, it is also necessary to add a mutex lock to the reconstructed subtree thread.
In step 232, a second tree structure is constructed according to the undeleted points in the subtree to be rebuilt by the subtree thread, and the second tree structure is spliced into the original tree structure.
In an embodiment, by reconstructing the subtree thread, undeleted points in the subtree to be reconstructed are extracted to construct a second tree structure, and then the constructed second tree structure is grafted to be spliced into the original tree structure.
In one embodiment, it should be noted that the thread of the reconstructed subtree is not in conflict with other functions, so when adding a point to the subtree to be reconstructed, the point to be added can be added to the undeleted point of the subtree to be reconstructed, so that the point to be added is also added to the subtree when reconstructing the subtree; and when the operation of searching the point is executed, if the subtree which is being rebuilt is searched, the subtree can be skipped, and searching is carried out at other nodes of the original tree structure.
In step 233, the mutex lock is released and the fourth flag of the subtree to be reconstructed is set to false.
In an embodiment, after the construction of the subtree to be reconstructed is completed, the mutual exclusion lock needs to be released, the thread of the subtree to be reconstructed is ended, and then the node information of the nodes on the path associated with the subtree to be reconstructed is correspondingly updated.
Through the steps 201 to 203, when a subtree needs to be rebuilt, the subtree to be rebuilt can be rebuilt timely and quickly, so that the problem that the data amount in the original tree structure is possibly larger and larger or the tree structure is unbalanced due to the adding and deleting operation of points is solved; and the mutual exclusivity of the reconstructed subtree and other processing performed on the tree structure can be kept by setting mutual exclusion locks and the like.
FIG. 3 is a flow chart of one embodiment of a method of finding a three-dimensional point cloud map of the present disclosure; the present embodiment is exemplified by how to find a point in a three-dimensional point cloud map, as shown in fig. 3, and includes the following steps:
in step 301, a search instruction is received, where the search instruction carries three-dimensional coordinate information of a target point.
In step 302, traversing downwards from the root node, storing the traversed pre-set number of points in a target container, wherein the target container stores three-dimensional coordinate information of the set number of points and the maximum distance from the target point.
In one embodiment, the pre-set number may be a predetermined value, for example, 5, and in order to find the point that best matches the target point, the root node may be traversed downward, and the found point stored in the target container.
In an embodiment, in order to find the set number of points closest to the target point in the tree structure, before starting the search, a target container K may be applied first, and the nearest neighbor point may be stored using the target container K. Then starting from the root node, the size of the target container K is 0, so that the first 5 traversed points are directly stored in the target container K, meanwhile, the distances between all points in the target container K and the target point are calculated, the points in the target container are ordered from small to large according to the distances, the distances between each point and the target point are stored, and the farthest distance is recorded as d_max.
In step 303, in response to traversing to at least one node whose subtree is not being reconstructed, not deleted, a minimum distance of the subtree of the at least one node from the target point is calculated from a value of a second flag of the at least one node.
In an embodiment, when traversing down to a certain node p_curr, first, it needs to determine that the third flag bit t_delete of p_curr is true, and when the fourth flag bit t_rebuilding of p_curr is true, calculate the minimum distance d_min between the interval where the subtree of this point is located and the target point, because the second flag bit t_area of this node already stores the space size information of this subtree, the distance algorithm from the point to one space in the prior art can be adopted to calculate d_min easily.
In one embodiment, if d_min > =d_max, the subtree is skipped directly for the preamble traversal, which saves time. If d_min < d_max, the subtree is entered for traversal. Firstly checking any node in a subtree, determining a first flag bit P_delete of a corresponding node, if the flag bit is false, calculating the distance d_curr between p_curr and a target point, if d_curr is less than d_max, discarding the point farthest from the target point in a target container, putting the p_curr into the target container, and simultaneously updating the d_max corresponding to the target container; if P_delete is true, the node is skipped to traverse the left subtree and the right subtree until all nodes are traversed, and the searching process is completed.
In step 304, in response to the minimum distance being less than the maximum distance, a distance from at least one point in the subtree of the at least one node to the target point is calculated and at least one point having a distance less than the maximum distance is used to replace a point in the target container corresponding to the maximum distance.
In step 305, the maximum distance recorded in the target container is updated.
In step 306, the target container is returned in response to traversing the nodes in the tree structure.
In steps 303 to 306, when traversing down to a certain node p_curr, it needs to determine that the third flag bit t_delete of p_curr is true, and when the fourth flag bit t_rebuilding of p_curr is true, the minimum distance d_min between the interval where the subtree of this point is located and the target point is calculated, and since the second flag bit t_area of this node already stores the space size information of this subtree, the distance algorithm from the midpoint to one space in the prior art is adopted, so d_min can be easily calculated.
In one embodiment, if d_min > =d_max, the subtree is skipped directly for the preamble traversal, which saves time. If d_min < d_max, the subtree is entered for traversal. Firstly checking any node in a subtree, determining a first flag bit P_delete of a corresponding node, if the flag bit is false, calculating the distance d_curr between p_curr and a target point, if d_curr is less than d_max, discarding the point farthest from the target point in a target container, putting the p_curr into the target container, and simultaneously updating the d_max corresponding to the target container; if P_delete is true, the node is skipped to traverse the left subtree and the right subtree until all nodes are traversed, and the searching process is completed.
Through the steps 301 to 306, when a point needs to be searched, the geometric distance determination is performed on the three-dimensional space where the sub-tree is located during nearest neighbor searching, so that the traversed path is reduced, and the searching efficiency is accelerated.
Corresponding to the embodiment of the method for updating the three-dimensional point cloud map, the disclosure also provides a corresponding embodiment of the device for updating the three-dimensional point cloud map.
Fig. 4 is a schematic structural diagram of an embodiment of an apparatus for updating a three-dimensional point cloud map of the present disclosure, where the apparatus is applied to an electronic device (such as a computer system, a server), and as shown in fig. 4, the apparatus includes:
a first processing module 41, configured to perform downsampling processing on a new laser data frame in response to acquiring the new laser data frame, so as to obtain a point to be added;
an adding module 42, configured to add the points to be added to an original tree structure one by one, where an origin cloud map is stored in the original tree structure;
the second processing module 43 is configured to add the point to be added to the original tree structure, and determine a point to be deleted corresponding to the point to be added that is successfully added in response to successfully adding the point to be added to the original tree structure, and set a first flag bit of a node where the point to be deleted is located to be true, where the first flag bit is used to indicate whether a node storage point is deleted;
A first updating module 44, configured to recursively update node information of the nodes on the path where the point to be added and the point to be deleted are located in a sequence from bottom to top;
a determining module 45, configured to determine a subtree to be rebuilt according to updated node information of at least one node in the original tree structure;
a reconstruction module 46, configured to reconstruct the subtree to be reconstructed.
Fig. 5 is a schematic structural diagram of still another embodiment of an updating apparatus for a three-dimensional point cloud map according to the present disclosure, as shown in fig. 4, on the basis of the embodiment shown in fig. 4, in an embodiment, node information of the node includes:
the first flag bit; a second flag bit for indicating spatial range information of a point stored in a subtree of the node; a third flag bit for indicating whether a subtree of the node is deleted; a fourth flag bit for indicating whether a subtree of the node is being reconstructed; an eighth flag bit for indicating whether a subtree of the node needs reconstruction; a fifth flag bit and a sixth flag bit for indicating the number of points stored in the left subtree and the right subtree of the node; a seventh flag bit for indicating the number of deleted points in the subtree of the node; the nodes store three-dimensional coordinate information of the points and the dividing axes.
In an embodiment, the first processing module 41 is specifically configured to perform, in response to obtaining a new laser data frame, a down-sampling process on the new laser data frame to obtain a point to be added, where the processing includes:
and performing downsampling treatment on the point cloud corresponding to the new laser data frame according to the set point cloud density to obtain the point to be added.
In an embodiment, the second processing module 43 is specifically configured to determine, as the point to be deleted, a point in a down-sampling interval range centered on the point to be added, where the point in the down-sampling interval range includes a point in the original tree structure, or where the point in the down-sampling interval range includes a point in the original tree structure and a point to be added that has been successfully added to the original tree structure
In one embodiment, the adding module 42 includes:
a first processing sub-module 421, configured to start downward recursion from a root node of the original tree structure, determine, according to a size relationship between the point to be added and a component of a node storage point in the original tree structure on a partition axis, a target addition position where the point to be added is added to the original tree structure;
and an initialization submodule 422, configured to add the point to be added at the target adding position, and initialize a value of node information of a corresponding node according to three-dimensional coordinate information of the point to be added.
In one embodiment, the first update module 44 includes:
a first updating sub-module 441, configured to start recursion upwards from the target adding position, and update, in sequence, a fifth flag bit or a sixth flag bit of a node on a path where the point to be added is located;
a second updating sub-module 442, configured to start recursion from the point to be deleted, and update, in sequence, a seventh flag bit of a node on a path where the point to be deleted is located.
In one embodiment, the determining module 45 includes:
a first determining sub-module 451, configured to determine, starting from a leaf node of the to-be-added point and the to-be-deleted point association path, whether a subtree of at least one node meets a first reconstruction condition according to a value of a fifth flag bit and a value of a sixth flag bit of the at least one node;
a second determining sub-module 452, configured to determine whether a subtree of the at least one node meets a second reconstruction condition according to the value of the seventh flag bit, the value of the fifth flag bit, and the value of the sixth flag bit of the at least one node;
a third determining submodule 453 is configured to determine a subtree satisfying the first reconstruction condition and/or the second reconstruction condition as the subtree to be reconstructed.
Fig. 6 is a schematic structural diagram of still another embodiment of the apparatus for updating a three-dimensional point cloud map of the present disclosure, as shown in fig. 6, on the basis of the embodiment shown in fig. 4 and/or fig. 5, in an embodiment, the reconstruction module 46 includes:
a fourth determining submodule 461, configured to determine a number of undeleted points in the subtree to be rebuilt;
a second processing sub-module 462, configured to construct a first tree structure using undeleted points in the subtree to be rebuilt and splice the first tree structure into the original tree structure in response to the number being less than a set threshold;
a reconstruction sub-module 463, configured to respond to the number not less than the set threshold, set the fourth flag bit of the subtree to be reconstructed to true, and execute reconstruction of the subtree to be reconstructed through a thread of the subtree to be reconstructed.
In an embodiment, the reconstruction sub-module 463 includes:
an extraction submodule 4631, configured to extract undeleted points in the subtree to be rebuilt, wake up the rebuilt subtree thread, and add a mutex lock to the rebuilt subtree thread;
a third processing sub-module 4632, configured to construct a second tree structure according to the undeleted points in the subtree to be reconstructed by the subtree thread, and splice the second tree structure into the original tree structure;
A fourth processing sub-module 4633, configured to release the exclusive lock, and set a fourth flag bit of the subtree to be reconstructed to false.
In an embodiment, the device further comprises:
and a second updating module 47, configured to correspondingly update node information of nodes on the path associated with the subtree to be reconstructed after reconstructing the subtree to be reconstructed.
In an embodiment, the device further comprises:
the receiving module 48 is configured to receive a search instruction, where the search instruction carries three-dimensional coordinate information of a target point;
a third processing module 49, configured to traverse downwards from the root node, and store the traversed preset number of points in a target container, where three-dimensional coordinate information of the preset number of points and a maximum distance from the target point are stored;
a first calculation module 50, configured to calculate, in response to traversing to at least one node whose subtree is not being reconstructed and is not deleted, a minimum distance between the subtree of the at least one node and the target point according to a value of a second flag bit of the at least one node;
a second calculation module 51, configured to calculate, in response to the minimum distance being smaller than the maximum distance, a distance between at least one point in the subtree of the at least one node and the target point, and replace a point in the target container corresponding to the maximum distance with at least one point having a distance smaller than the maximum distance;
A third updating module 52 for updating the maximum distance recorded in the target container;
and a return module 53, configured to return the target container in response to traversing the nodes in the original tree structure.
The implementation process of the functions and roles of each unit in the above device is specifically shown in the implementation process of the corresponding steps in the above method, and will not be described herein again.
For the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are merely illustrative, wherein elements illustrated as separate elements may or may not be physically separate, and elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the objectives of the disclosed solution. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
An electronic device according to an embodiment of the present disclosure, in which an apparatus for implementing a method of an embodiment of the present disclosure may be integrated, is described below with reference to fig. 7. Fig. 7 is a block diagram of an electronic device provided in an exemplary embodiment of the present disclosure, as shown in fig. 7, the electronic device including one or more processors 71, memory 72 of one or more computer-readable storage media, and a computer program stored on the memory and executable on the processor. The above-described method of updating the three-dimensional point cloud map may be implemented when the program of the memory 72 is executed.
In particular, in practice, the electronic device may further comprise input means 73, output means 74, etc., which are interconnected by a bus system and/or other form of connection mechanism (not shown). It will be appreciated by those skilled in the art that the structure of the electronic device shown in fig. 7 is not limiting of the electronic device and may include more or fewer components than shown, or certain components, or a different arrangement of components. Wherein:
the processor 71 may be a Central Processing Unit (CPU) or other form of processing unit having data processing and/or instruction execution capabilities, performing various functions and processing data by running or executing software programs and/or modules stored in the memory 72 and invoking data stored in the memory 72 to thereby monitor the electronic device as a whole.
Memory 72 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. Volatile memory can include, for example, random Access Memory (RAM) and/or cache memory (cache) and the like. The non-volatile memory may include, for example, read Only Memory (ROM), hard disk, flash memory, and the like. One or more computer program instructions may be stored on a computer readable storage medium and the processor 71 may execute the program instructions to implement the method of updating a three-dimensional point cloud map and/or other desired functions of the various embodiments of the present disclosure above. Various contents such as an input signal, a signal component, a noise component, and the like may also be stored in the computer-readable storage medium.
The input device 73 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
The output device 74 may output various information to the outside, including the determined distance information, direction information, and the like. The output device 74 may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, among others.
The electronic device may also include a power supply for powering the various components that may be logically connected to the processor 71 via a power management system such that functions such as managing charge, discharge, and power consumption are performed by the power management system. The power supply may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Of course, only some of the components of the electronic device relevant to the present disclosure are shown in fig. 7 for simplicity, components such as buses, input/output interfaces, and the like being omitted. In addition, the electronic device may include any other suitable components depending on the particular application.
In addition to the methods and apparatus described above, embodiments of the present disclosure may also be a computer program product comprising computer program instructions which, when executed by a processor, cause the processor to perform the steps in the method of updating a three-dimensional point cloud map according to the various embodiments of the present disclosure described in the "exemplary methods" section of the present description.
The computer program product may write program code for performing the operations of embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium, having stored thereon computer program instructions, which when executed by a processor, cause the processor to perform the steps in a method of updating a three-dimensional point cloud map according to various embodiments of the present disclosure described in the above "exemplary method" section of the present description.
The computer readable storage medium may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The basic principles of the present disclosure have been described above in connection with specific embodiments, however, it should be noted that the advantages, benefits, effects, etc. mentioned in the present disclosure are merely examples and not limiting, and these advantages, benefits, effects, etc. are not to be considered as necessarily possessed by the various embodiments of the present disclosure. Furthermore, the specific details disclosed herein are for purposes of illustration and understanding only, and are not intended to be limiting, since the disclosure is not necessarily limited to practice with the specific details described.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different manner from other embodiments, so that the same or similar parts between the embodiments are mutually referred to. For system embodiments, the description is relatively simple as it essentially corresponds to method embodiments, and reference should be made to the description of method embodiments for relevant points.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware associated with program instructions, where the foregoing program may be stored in a computer readable storage medium, and when executed, the program performs steps including the above method embodiments; and the aforementioned storage medium includes: various media that can store program code, such as ROM, RAM, magnetic or optical disks.
The methods and apparatus of the present disclosure may be implemented in a number of ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, firmware. The above-described sequence of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the sequence specifically described above unless specifically stated otherwise. Furthermore, in some embodiments, the present disclosure may also be implemented as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
The description of the present disclosure has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the disclosure in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiments were chosen and described in order to best explain the principles of the disclosure and the practical application, and to enable others of ordinary skill in the art to understand the disclosure for various embodiments with various modifications as are suited to the particular use contemplated.

Claims (12)

1. A method for updating a three-dimensional point cloud map, the method comprising:
in response to obtaining a new laser data frame, performing downsampling processing on the new laser data frame to obtain a point to be added;
adding the points to be added into an original tree structure one by one, wherein an origin cloud map is stored in the original tree structure;
in response to the successful addition of a point to be added to the original tree structure, determining a point to be deleted corresponding to the point to be added which is successfully added, and setting a first flag bit of a node where the point to be deleted is located as true, wherein the first flag bit is used for indicating whether a node storage point is deleted or not;
recursively updating node information of the nodes on the paths of the points to be added and the points to be deleted according to the sequence from bottom to top;
Determining a subtree to be rebuilt according to the updated node information of at least one node in the original tree structure;
and reconstructing the subtree to be reconstructed.
2. The method of claim 1, wherein the node information of the node comprises:
the first flag bit; a second flag bit for indicating spatial range information of a point stored in a subtree of the node; a third flag bit for indicating whether a subtree of the node is deleted; a fourth flag bit for indicating whether a subtree of the node is being reconstructed; an eighth flag bit for indicating whether a subtree of the node needs reconstruction; a fifth flag bit and a sixth flag bit for indicating the number of points stored in the left subtree and the right subtree of the node; a seventh flag bit for indicating the number of deleted points in the subtree of the node; the nodes store three-dimensional coordinate information of the points and the dividing axes.
3. The method according to claim 2, wherein the step of performing downsampling on the new laser data frame in response to acquiring the new laser data frame to obtain the point to be added includes:
and performing downsampling treatment on the point cloud corresponding to the new laser data frame according to the set point cloud density to obtain the point to be added.
4. The method according to claim 2, wherein the determining the point to be deleted corresponding to the point to be added that is successfully added includes:
and determining a point in a down-sampling interval range taking the point to be added as a center as the point to be deleted, wherein the point in the down-sampling interval range comprises the point in the original tree structure, or the point in the down-sampling interval range comprises the point in the original tree structure and the point to be added which is successfully added into the original tree structure.
5. The method according to claim 2, wherein adding the points to be added one by one to an original tree structure comprises:
starting downwards recursion from a root node of the original tree structure, and determining a target adding position of the point to be added to the original tree structure according to the size relation of the component of the point to be added and a node storage point in the original tree structure on a segmentation axis;
and adding the point to be added at the target adding position, and initializing the value of node information of the corresponding node according to the three-dimensional coordinate information of the point to be added.
6. The method of claim 5, wherein recursively updating node information of nodes on paths of the points to be added and the points to be deleted in the order from bottom to top comprises:
Starting to recursion upwards from the target adding position, and sequentially updating a fifth flag bit or a sixth flag bit of a node on a path where the point to be added is located;
and starting to recursion upwards from the point to be deleted, and sequentially updating a seventh flag bit of the node on the path where the point to be deleted is located.
7. The method of claim 5, wherein determining the subtree to be rebuilt based on the updated node information for the at least one node in the original tree structure comprises:
starting upward recursion from leaf nodes of the point to be added and the point to be deleted associated path, and determining whether a subtree of at least one node meets a first reconstruction condition according to a value of a fifth flag bit and a value of a sixth flag bit of the at least one node;
determining whether a subtree of the at least one node meets a second reconstruction condition according to the value of the seventh flag bit, the value of the fifth flag bit and the value of the sixth flag bit of the at least one node;
and determining a subtree meeting the first reconstruction condition and/or the second reconstruction condition as the subtree to be reconstructed.
8. The method of claim 7, wherein reconstructing the subtree to be reconstructed comprises:
Determining the number of undeleted points in the subtree to be rebuilt;
responding to the quantity being smaller than a set threshold value, constructing a first tree structure by using undeleted points in the subtrees to be rebuilt, and splicing the first tree structure into the original tree structure;
and setting a fourth flag bit of the subtree to be rebuilt to be true in response to the number not smaller than a set threshold, and executing the rebuilding of the subtree to be rebuilt through a subtree rebuilding thread.
9. The method of claim 8, wherein the performing the reconstruction of the subtree to be reconstructed by the reconstruction subtree thread comprises:
extracting undeleted points in the subtree to be rebuilt, waking up the rebuilt subtree thread and adding a mutual exclusion lock to the rebuilt subtree thread;
constructing a second tree structure according to the undeleted points in the subtree to be rebuilt by the subtree thread, and splicing the second tree structure into the original tree structure;
releasing the mutual exclusion lock, and setting the fourth flag bit of the subtree to be rebuilt to false.
10. The method of claim 1, wherein after reconstructing the subtree to be reconstructed, the method further comprises:
And correspondingly updating node information of the nodes on the associated paths of the subtrees to be rebuilt.
11. The method according to claim 2, wherein the method further comprises:
receiving a search instruction, wherein the search instruction carries three-dimensional coordinate information of a target point;
traversing downwards from the root node, and storing the traversed points with the preset number in a target container, wherein the target container stores three-dimensional coordinate information of the points with the preset number and the maximum distance from the target point;
responsive to traversing to at least one node whose subtree is not being reconstructed, not deleted, calculating a minimum distance of the subtree of the at least one node from the target point according to a value of a second flag bit of the at least one node;
responsive to the minimum distance being less than the maximum distance, calculating a distance of at least one point in a subtree of the at least one node from the target point and replacing a point in the target container corresponding to the maximum distance with at least one point having a distance less than the maximum distance;
updating the maximum distance recorded in the target container;
and returning the target container in response to traversing the nodes in the original tree structure.
12. An apparatus for updating a three-dimensional point cloud map, the apparatus comprising:
the first processing module is used for responding to the acquisition of a new laser data frame, and carrying out downsampling processing on the new laser data frame to obtain a point to be added;
the adding module is used for adding the points to be added into the original tree structure one by one, wherein an origin cloud map is stored in the original tree structure;
the second processing module is used for responding to the successful addition of a point to be added into the original tree structure, determining a point to be deleted corresponding to the point to be added which is successfully added, setting a first flag bit of a node where the point to be deleted is located as true, and indicating whether the node storage point is deleted or not;
the first updating module is used for recursively updating node information of the nodes on the path of the point to be added and the point to be deleted according to the sequence from bottom to top;
the determining module is used for determining a subtree to be rebuilt according to the updated node information of at least one node in the original tree structure;
and the reconstruction module is used for reconstructing the subtree to be reconstructed.
CN202310869849.1A 2023-07-14 2023-07-14 Method and device for updating three-dimensional point cloud map Pending CN116737740A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310869849.1A CN116737740A (en) 2023-07-14 2023-07-14 Method and device for updating three-dimensional point cloud map

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310869849.1A CN116737740A (en) 2023-07-14 2023-07-14 Method and device for updating three-dimensional point cloud map

Publications (1)

Publication Number Publication Date
CN116737740A true CN116737740A (en) 2023-09-12

Family

ID=87904623

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310869849.1A Pending CN116737740A (en) 2023-07-14 2023-07-14 Method and device for updating three-dimensional point cloud map

Country Status (1)

Country Link
CN (1) CN116737740A (en)

Similar Documents

Publication Publication Date Title
CN107402955B (en) Method and apparatus for determining index grid of geo-fence
US11557088B2 (en) Generating space models from map files
CN113209633A (en) Mirror image processing method and device, electronic equipment and readable storage medium
CN111931097A (en) Information display method and device, electronic equipment and storage medium
Nguyen et al. Spatio-semantic comparison of large 3D city models in CityGML using a graph database
CN109997123B (en) Methods, systems, and apparatus for improved space-time data management
EP3470992A1 (en) Efficient storage and utilization of a hierarchical data set
CN116414559A (en) Method for modeling and distributing unified computing power identification, storage medium and electronic equipment
US20090112567A1 (en) Preliminary data representations of a deployment activity model
CN105843809B (en) Data processing method and device
CN109614140B (en) Configuration data processing method and device, electronic equipment and storage medium
CN116737740A (en) Method and device for updating three-dimensional point cloud map
CN115408547A (en) Dictionary tree construction method, device, equipment and storage medium
CN111339245B (en) Data storage method, device, storage medium and equipment
US11327793B2 (en) Garbage collection work stealing mechanism
CN113902310A (en) Method, system, equipment and storage medium for generating shortest path
CN116187463B (en) Quantum measurement mode-to-quantum circuit compiling method and device and electronic equipment
CN116187458B (en) Quantum circuit processing method and device and electronic equipment
CN116187464B (en) Blind quantum computing processing method and device and electronic equipment
CN112463214B (en) Data processing method and device, computer readable storage medium and electronic equipment
Zhang et al. Distributed processing practice of the 3D city model based on HBase
CN116149725A (en) Correlation method, device, equipment and medium for collaborative development codes in three-dimensional engine
Zhang et al. Parallel construction and rendering of multi-resolution representation for massive meshes with GPU
CN114691735A (en) Resource inventory query method and device, storage medium and electronic equipment
CN114418205A (en) Method, system, equipment and storage medium for generating shortest path

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination