CN116630571A - Neighbor searching method and device, mobile tool and storage medium - Google Patents
Neighbor searching method and device, mobile tool and storage medium Download PDFInfo
- Publication number
- CN116630571A CN116630571A CN202210135399.9A CN202210135399A CN116630571A CN 116630571 A CN116630571 A CN 116630571A CN 202210135399 A CN202210135399 A CN 202210135399A CN 116630571 A CN116630571 A CN 116630571A
- Authority
- CN
- China
- Prior art keywords
- index
- target
- target point
- space
- neighbor
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 101
- 238000013507 mapping Methods 0.000 claims description 17
- 238000004364 calculation method Methods 0.000 claims description 13
- 238000012545 processing Methods 0.000 claims description 13
- 238000010606 normalization Methods 0.000 claims description 8
- 238000010276 construction Methods 0.000 claims description 7
- 238000004891 communication Methods 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 6
- 230000008569 process Effects 0.000 description 11
- 230000006870 function Effects 0.000 description 10
- 238000010586 diagram Methods 0.000 description 8
- 230000000694 effects Effects 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 5
- 241001417527 Pempheridae Species 0.000 description 4
- 238000011160 research Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000010295 mobile communication Methods 0.000 description 3
- 238000010408 sweeping Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000004140 cleaning Methods 0.000 description 2
- 230000005484 gravity Effects 0.000 description 2
- 230000008447 perception Effects 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000013144 data compression Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000003909 pattern recognition Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000010845 search algorithm Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
- G06T17/20—Finite element generation, e.g. wire-frame surface description, tesselation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9537—Spatial or temporal dependent retrieval, e.g. spatiotemporal queries
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- General Physics & Mathematics (AREA)
- Computer Graphics (AREA)
- Geometry (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Processing Or Creating Images (AREA)
Abstract
The invention discloses a neighbor searching method and a device, wherein the method comprises the following steps: setting a target space to be checked for a given three-dimensional point cloud; creating a spatial index for the target space to be checked by using a pseudo-Hilbert curve; and carrying out neighbor query on the target point according to the given target point, the set target space to be checked and the space index created for the target space to be checked. The scheme of the invention realizes approximate neighbor search of the target point in the three-dimensional point cloud based on the pseudo-Hilbert curve, can perform rapid neighbor search on the three-dimensional point cloud under the scene with certain accuracy tolerance, and improves the speed and efficiency of neighbor search.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a neighbor searching method, a neighbor searching device, a mobile tool, and a storage medium.
Background
In a space with practical physical significance, there is often a search requirement based on the distance between the space position and the distance, for example, in a geographic information system, related position information may need to be searched, and space data relationship may also need to be analyzed; for another example, in three-dimensional point cloud processing, it is also very common to find nearest neighbors; as another example, in the fields of image retrieval, data compression, pattern recognition, machine learning, etc., data are often represented in high dimensions, and queries based on similarity/distance between data are very common. As can be seen, the neighbor search has become an important research topic in the information age due to the wide technical application scenarios.
In the neighbor search, nearest neighbor or K-nearest neighbor search is a solution for solving the problem of searching one or more points nearest to a certain point in a given spatial range, and is generally divided into accurate search and approximate search, wherein the accurate search can ensure the accuracy of a query result, but the cost is that the calculation amount and time consumption of the query are larger; the approximate search relaxes the precision requirement of the result, and the search can be accelerated by some methods on the premise of sacrificing a certain precision.
The current common accurate search algorithm is a search method represented by kdtree, but for the problem of neighbor search in three-dimensional space, the computational complexity required by the accurate search method is O (log (N)), where N is the number of data points in the target space to be searched. In practical applications, a fast approximate neighbor query is often required for a large number of three-dimensional points, which can be easily accurate, but requires very simple calculation to achieve the effect of fast retrieval and response. Based on this, research and proposal of an effective approximate neighbor search scheme in three-dimensional space have become a problem to be solved in the industry.
Disclosure of Invention
The embodiment of the invention provides a neighbor searching scheme to solve the problem that a large number of three-dimensional points in a three-dimensional space cannot be quickly searched out to approximate neighbors of a target point on the premise of ensuring certain accuracy tolerance in the prior art.
In a first aspect, an embodiment of the present invention provides a neighbor searching method, where the method includes:
setting a target space to be checked for a given three-dimensional point cloud;
creating a spatial index for the target space to be checked by using a pseudo-Hilbert curve; and
and carrying out neighbor query on the target point according to the three-dimensional coordinates of the given target point, the set target space to be checked and the space index created for the target space to be checked.
In a second aspect, an embodiment of the present invention provides a neighbor search device for neighbor searching of a three-dimensional point cloud, including
The target space construction module is used for setting a target space to be checked for a given three-dimensional point cloud;
the index construction module is used for creating a spatial index for the target space to be checked by using the pseudo-Hilbert curve; and
and the neighbor query module is used for performing neighbor query on the target point according to the three-dimensional coordinates of the given target point, the set target space to be checked and the space index created for the target space to be checked.
In a third aspect, an embodiment of the present invention provides another neighbor search device, including:
a memory for storing executable instructions; and
a processor for executing executable instructions stored in a memory, which when executed by the processor implement the method steps provided by the first aspect of the invention.
In a fourth aspect, an embodiment of the present invention provides a neighbor searching method, including:
receiving a neighbor search request containing a target point;
performing neighbor query on the target point according to the target point, a set target space to be checked and a space index created for the target space in advance; the spatial index of the target space to be checked is created by utilizing a pseudo-Hilbert curve in advance.
In a fifth aspect, an embodiment of the present invention provides a neighbor search device, including:
the communication unit is used for receiving a neighbor search request containing the target point and sending the neighbor search request to the processor;
the processor is used for carrying out neighbor query on the target point according to the target point, the target space to be checked, which is read from the memory, and a space index which is created for the target space to be checked in advance; the spatial index of the target space to be checked is created by utilizing a pseudo-Hilbert curve in advance.
In a sixth aspect, an embodiment of the present invention provides a moving tool, including:
a controller for performing a neighbor query for a given target point according to the method provided in the first or fourth aspect of the present invention.
In a seventh aspect, the present invention provides a storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method provided in the first or fourth aspect above.
The embodiment of the invention has the beneficial effects that: the method provided by the embodiment of the invention realizes approximate neighbor search of the target point in the three-dimensional point cloud based on the pseudo-Hilbert curve, can perform rapid neighbor search on the three-dimensional point cloud under the scene with certain accuracy tolerance, improves the speed and efficiency of neighbor search, and has wide practical application scene.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a neighbor searching method according to an embodiment of the present invention;
fig. 2 is a diagram showing an effect of a target space to be checked set for a given three-dimensional point cloud according to an embodiment of the present invention;
FIG. 3 schematically shows a flow chart of a method of implementing step S11 in FIG. 1 according to an embodiment of the invention;
fig. 4 schematically illustrates an effect display diagram obtained after the display effect illustrated in fig. 2 is subjected to the process of step S112 according to an embodiment of the present invention;
FIG. 5 schematically shows a flow chart of a method of implementing step S12 of FIG. 1 in accordance with an embodiment of the present invention;
FIG. 6 schematically shows a flow chart of a method of implementing step S123 in FIG. 5 according to an embodiment of the present invention;
FIG. 7 schematically shows a flow chart of a method of implementing step S123 in FIG. 5 in accordance with an embodiment of the present invention;
fig. 8 is a flow chart of a neighbor searching method according to an embodiment of the present invention;
fig. 9 schematically shows a functional block diagram of a neighbor search device according to an embodiment of the present invention;
fig. 10 is a schematic block diagram of a neighbor search device according to another embodiment of the present invention;
fig. 11 is a schematic block diagram of a neighbor search device according to another embodiment of the present invention;
Fig. 12 is a schematic block diagram of a neighbor search device according to another embodiment of the present application;
fig. 13 is a schematic block diagram of an automatic driving apparatus according to an embodiment of the present application;
fig. 14 is a schematic structural diagram of a neighbor searching apparatus according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In the present invention, "module," "device," "system," and the like refer to a related entity, either hardware, a combination of hardware and software, or software in execution, as applied to a computer. In particular, for example, an element may be, but is not limited to being, a process running on a processor, an object, an executable, a thread of execution, a program, and/or a computer. Also, the application or script running on the server, the server may be an element. One or more elements may be in processes and/or threads of execution, and elements may be localized on one computer and/or distributed between two or more computers, and may be run by various computer readable media. The elements may also communicate by way of local and/or remote processes in accordance with a signal having one or more data packets, e.g., a signal from one data packet interacting with another element in a local system, distributed system, and/or across a network of the internet with other systems by way of the signal.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," comprising, "or" includes not only those elements but also other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The neighbor searching method in the embodiment of the invention can be applied to any product needing to use a neighbor searching technology, in particular to a product using a laser point cloud neighbor searching technology, so that an intelligent product can realize neighbor searching by utilizing the scheme of the embodiment of the invention to acquire the nearest neighbor and/or k neighbor of a target point. Such products requiring the use of neighbor search technology include, for example, but are not limited to, mobile tools capable of automated or semi-automated driving, such as automated vehicles (passenger cars, buses, vans, trucks, etc.), unmanned floor sweepers, unmanned cleaning vehicles, robots, unmanned floor sweepers, sweeping robots, other robots, and other intelligent mobile platforms, as the present invention is not limited in this regard.
Fig. 1 schematically illustrates a neighbor searching method according to an embodiment of the present invention, where an execution subject of the method may be a searcher or a controller on an autopilot vehicle, a processor of a neighbor searching device such as an intelligent tablet, a personal PC, a computer, a cloud server, or a processor of an intelligent mobile platform such as an unmanned cleaning vehicle, an unmanned sweeping vehicle, a sweeping robot, an autopilot vehicle, or a semiautomatic driving device, which is not limited by the embodiment of the present invention. The embodiment of the invention is preferably described in detail by taking the execution subject as a controller on an automatic driving vehicle as an example. As shown in fig. 1, the method of the embodiment of the present invention includes:
Step S10: setting a target space to be checked for a given three-dimensional point cloud;
step S11: creating a spatial index for the target space to be checked by using a pseudo-Hilbert curve;
step S12: and carrying out neighbor query on the target point according to the given target point, the set target space to be checked and the space index created for the target space to be checked.
The three-dimensional laser sensor can emit a plurality of laser beams to scan the surrounding environment, and the emitted laser beams are reflected by the surface of an environmental object and return to the laser receiver, so that the distance and the angle between the point of the reflected laser beams on the object and the laser beams can be calculated. Based on this, a polar coordinate system is established with the laser as the center, and through the angle and the distance, a series of spatial points of the reflected laser, which are generally called point clouds, can be determined. The point cloud may reflect approximate information of the surrounding objects.
In the embodiment of the invention, the three-dimensional point cloud can be point cloud data from a laser radar or a laser sensor, or can be point cloud data from any sensor capable of obtaining similar 3D data, such as 3D point cloud data provided by an RGBD camera. The neighbor searching in the point cloud refers to searching a point closest to a given target point (referred to as nearest neighbor in the embodiment of the present invention) or k points (referred to as k neighbor in the embodiment of the present invention) in the given three-dimensional point cloud.
In step S10, the embodiment of the present application sets a target space to be checked for a given three-dimensional point cloud. The target space to be checked set in the embodiment of the application can be an outer surrounding frame with any size capable of surrounding a given three-dimensional point cloud, such as a cuboid, a cube, a sphere and the like, and the shape of the outer surrounding frame is not strictly limited. In a preferred embodiment of the present application, in order to improve the efficiency of the neighbor search method, the target space to be searched is set to be the smallest circumscribed cuboid surrounding all points in the three-dimensional point cloud. In an exemplary embodiment, the method for determining the target space to be checked may be to count the maximum value and the minimum value of the spatial coordinates of all points in the three-dimensional point cloud in the spatial coordinate system, an origin is taken as a starting point, a smallest outer bounding box capable of bounding all points is selected in the spatial coordinate system as the target space to be checked, an x side length of the selected outer bounding box is a, a y side length is b, and a z side length is c, and fig. 2 illustrates the target space to be checked set for a given three-dimensional point cloud, as shown in fig. 2, where the x side length enclosed by a dotted line is a, the y side length is b, and the z side length is c.
In step S11, the created spatial index is a spatial index of the target space to be inspected in a one-dimensional space. Since the Hilbert curve is a special space-filling curve, it builds a mapping from points in the one-dimensional [0,1] interval to the [0,1] X [0,1] planar region, and it can map not only one dimension to two dimensions, but also to high dimensions, such as to the [0,1] X [0,1] three-dimensional interval to obtain a three-dimensional Hilbert curve. Wherein the finite order hilbert curve is also referred to as pseudo-hilbert curve. The inventors of the present application found that the hilbert curve has such a property in the course of studying the hilbert curve that: points that are close in distance on a one-dimensional curve, after folding mapping, are also close in distance in the high-dimensional space and vice versa. Based on the finding, the inventor thinks that the Hilbert curve is applied to the neighbor searching to realize the dimension reduction processing of the neighbor searching in the high-dimensional space, so that the quick approximate searching in the low-dimensional space is realized under the condition of ensuring certain accuracy tolerance, and the calculation complexity and the time complexity of the neighbor searching in the high-dimensional space are reduced. As a preferred embodiment, the embodiment of the application reduces the neighbor search in three-dimensional space to an approximate neighbor search in one-dimensional space. Illustratively, the spatial index implementation may be created in one-dimensional space for the object space to be examined by a three-dimensional k-th order hilbert curve. Fig. 3 schematically illustrates a specific implementation method for creating a spatial index for a target space to be checked by using a pseudo-hilbert curve, and as shown in fig. 3, the implementation method includes the following steps:
Step S111: performing grid division on the target space to be checked to form a plurality of grid units;
step S112: filling the target space to be checked by using a pseudo Hilbert curve, and distributing index codes of the grid units in a one-dimensional space for the grid units;
step S113: the data points contained in each grid cell are stored using the index code.
As a preferred embodiment, in step S111, the object space to be examined is rasterized in an equidistant subdivision manner, and the number of grid units divided in each dimension of the object space to be examined by equidistant subdivision may be set equal and to the power of 2 k, for example. Of course, the person skilled in the art may also implement this equidistant subdivision instead.
In step S112, each grid cell may be assigned an index code by performing normalization processing on the grid cell in step S111 and performing inverse mapping on the normalization processing result of the grid cell using a pseudo-hilbert curve. Specifically, it may be implemented as: firstly, respectively carrying out normalization processing on each grid unit, and calculating the normalization coordinates of each grid unit; then, carrying out inverse mapping of the pseudo Hilbert curve according to the normalized coordinates of each grid unit; and finally, distributing index codes to each grid unit according to the inverse mapping result.
In step S113, a spatial index is constructed based on the index codes assigned to the respective grid units and the data points included in the grid units. Wherein, preferably, the constructed spatial index comprises an index code and data points contained in grid units correspondingly associated with the index code. In the embodiment of the invention, the data points included in the grid unit are the points in the given three-dimensional point cloud, and because the target space to be checked is set according to the three-dimensional point cloud, the points in the three-dimensional point cloud are distributed in the target space to be checked, and therefore, by dividing the grid of the target space to be checked, the points in the three-dimensional point cloud are distributed in at least a part of the grid units. In step S113, the data points contained in each grid unit may be determined according to the points distributed in each grid unit, and the data points are encoded by the indexes of each grid unit and stored in association.
Therefore, the embodiment of the invention can realize the clustering of the given three-dimensional point cloud in one-dimensional space through index coding by creating the spatial index for the target space to be checked, so as to map the data points in the three-dimensional point cloud under the one-dimensional spatial index coding of each grid unit, thereby realizing the dimension-reducing mapping of the three-dimensional point cloud.
Taking the three-dimensional point cloud shown in fig. 2 and the set target space to be checked as an example, the following is an exemplary description of the method process shown in fig. 3 with reference to the display effect shown in fig. 4:
first, in step S111, the space in the outer peripheral frame shown in fig. 2 (i.e., the target space to be inspected set for the three-dimensional point cloud) is divided into individual small grids to form grid units. Wherein, when grid division is performed, the number of grid units in each dimension in the three-dimensional plane is preferably made equal and is a power of k of 2; for the sake of convenience in observation, in the display effect shown in fig. 4, k=2 is taken as an example for explaining the embodiment of the present invention, and in other embodiments, k may be set to other appropriate values according to the requirement and the set size of the target space to be examined, which is not limited in the embodiment of the present invention. The set k value and the set size of the target space to be searched can influence the searching accuracy, the memory space and the calculated amount, for example, when grid division is performed in an equidistant subdivision mode, the smaller the set k value is, the larger the subdivided grid units are, and the searching inaccuracy is increased; but as the k value is larger, the memory and computation increases.
Next, in step S112, a three-dimensional k-order pseudo-hilbert curve H is used k 3 filling the three-dimensional surrounding frame space (namely the target space to be checked) to ensure thatEach grid cell has an index number. Taking the example of filling with a three-dimensional second-order pseudo-hilbert curve, in this step, the coordinates of each grid cell may be normalized first, and the coordinate area of the target space to be inspected may be converted into [0,1 ] by dividing the position of each grid cell by the side length of the target space to be inspected]X[0,1]X[0,1]And each grid cell has a normalized coordinate (l, m, n), wherein 0<l,m,n<=1; then, for the normalized coordinates of each grid cell, inverse mapping by a three-dimensional second-order Hilbert curveConversion is performed to obtain a point coordinate i of the grid unit mapped between the one-dimensional intervals (0, 1), and then an index code of the grid unit is determined according to the point coordinate i. Illustratively, for ease of indexing, one may scale i by 2 3k Multiple to determine the index encoding of the trellis unit. Taking k=2 as an example, for the three-dimensional point cloud shown in fig. 2, the result shown in fig. 4 can be obtained through the processing of step S112, and as shown in fig. 4, the normalized coordinates of the grid unit located at the upper right corner in the plane of the target space yoz to be checked are (0, 0), and the result is obtained through the inverse mapping of the three-dimensional second-order pseudo-hilbert curve Magnification is 64 times 0, so that the grid unit can be assigned an index code of 0; and the normalized coordinates of the grid units positioned at the lower left corner in the plane of the target space yoz to be checked are (0, 1), and the +_ is obtained through the inverse mapping of the three-dimensional second-order pseudo-Hilbert curve>The magnification is 21 times, so that the index code can be allocated to the grid unit to be 21, and the result shown in fig. 4 can be obtained by respectively allocating the index codes to all the grid units, and after the index codes are allocated to all the grid units, each grid unit corresponds to one index code as shown in fig. 4, because the method comprises the following steps ofIn the embodiment of the invention, the index codes are allocated by taking k=2 and amplifying the inverse mapping result by 64 times as an example, so that the index code values of the grid units in fig. 4 are distributed between 0 and 64, and the number numbers on each grid unit in the figure are the index codes of each grid unit obtained by calculation. Therefore, each grid unit is allocated with an index code by utilizing the pseudo-Hilbert curve, the target space to be checked in the three-dimensional space is converted into a small grid unit marked in the one-dimensional space, and the three-dimensional point cloud is clustered in the one-dimensional space through the index code and the divided grid units. It should be noted that, the mapping relationship of the n-dimensional k-order hilbert curve may be generally calculated by a table established in advance or by an iterative method, and the specific calculation method may refer to related research data, which is not described herein.
Because the three-dimensional point cloud is scattered in the target space to be checked, the divided partial grid units contain data points, and the partial grid units do not contain data points, so that the number of data points and data points corresponding to the mapped grid units is different, and the three-dimensional point cloud can be correspondingly stored according to index codes so as to realize the cluster storage of the three-dimensional point cloud in a one-dimensional space. Illustratively, in a specific implementation, a Hash table may be employed for data point storage, such as for data points in grid cells with index encoded as i, all stored in nodes represented by Hash (i) in the Hash table. By converting the three-dimensional point cloud into index-code-based hash storage nodes in one-dimensional space, subsequent queries can be very rapid due to the operation that the hash table queries are of constant level.
In step S12, a neighbor query is preferably performed on the basis of the spatial index created in step S11. Illustratively, fig. 5 shows a method procedure of performing a neighbor search according to an embodiment of the present invention, as shown in fig. 5, taking as an example that a neighbor query is performed for a given target point in a spatial index of a one-dimensional space clustered by index coding, the method includes:
Step S121: determining the normalized coordinates of the target point according to the three-dimensional coordinates of the given target point and the set target space to be checked;
step S122: determining an index code to which the target point belongs according to the normalized coordinates of the target point;
step S123: and carrying out neighbor query on the target point according to the index code of the target point and the space index created for the target space to be checked.
In step S121, the three-dimensional coordinates of the target point may be normalized by dividing the three-dimensional coordinates by the side length of the target space to be examined, and converted into normalized three-dimensional space coordinates over the (0, 1) X (0, 1) section. Taking the three-dimensional coordinates of a given target point p as (x, y, z) as an example, in the target space to be examined shown in fig. 2, normalized coordinates (x_norm, y_norm, z_norm) of the target point p can be calculated by x_norm=x/a, y_norm=y/b, z_norm=z/c. It should be noted that, in other embodiments of the present invention, when a target point is given, as an alternative to directly giving the three-dimensional coordinates of the target point, the normalized coordinates based on the space of the target to be examined may also be directly given.
As a preferred embodiment, in step S122, the index code to which the target point belongs refers to the index code of the grid unit in which the target point belongs, that is, the index code corresponds to the index code allocated to each grid unit. Therefore, the index code to which the target point belongs can be determined by determining the grid unit to which the target point belongs and by determining the index code of the grid unit. Specifically, it can be realized as: firstly, determining the normalized coordinate of a grid unit where a target point is located according to the normalized coordinate of the target point, and then calculating the index code of the grid unit by using a pseudo-Hilbert curve according to the normalized coordinate of the grid unit where the target point is located. According to the method of dividing the grid units, the normalized coordinates of each grid unit are determined, and for the grid units with normalized coordinates of (0, 0), the three-dimensional coordinates of each grid unit are controlled to be in the range of [0,1/4] X [0,1/4] by taking the preferred dividing method described in the embodiment as an example. Based on the above, the grid unit where the target point p is located can be determined according to the coordinate range governed by the grid unit and the normalized coordinates of the grid unit by determining the normalized coordinates of the target point p. Illustratively, taking an example that the number of grid cells divided in each dimension of the target space to be examined is set equal and is the power of 2 to k, for a target point p with normalized coordinates (x_norm, y_norm, z_norm), the normalized coordinates (x_cell, y_cell, z_cell) of the grid cell where it is located can be specifically calculated by:
x_cell=CEIL(x_norm*2 k )/2 k ;
y_cell=CEIL(y_norm*2 k )/2 k ;
z_cell=CEIL(z_norm*2 k )/2 k Wherein CEIL is an upward rounding function.
And then, according to the calculated normalized coordinates of the grid unit, performing inverse mapping by using a pseudo-Hilbert curve, and calculating the index code of the grid unit and taking the index code as the index code of the target point. Taking the example of space filling with three-dimensional k-th order pseudo-hilbert curves as described in the above embodiments, in this step, inverse mapping is also performed with corresponding three-dimensional k-th order pseudo-hilbert curves to calculate an index code, for example, byThe index code index_p is calculated.
In step S123, the nearest neighbor query may be performed, or the k nearest neighbor query may be performed, or the nearest neighbor query and the k nearest neighbor query may be both included. The nearest neighbor query refers to a set C formed by a query point p in a given N-dimensional space and a series of points in the space, and a point q closest to the point p needs to be quickly found in the set C. k-nearest neighbor query refers to a set C consisting of a query point p in a given N-dimensional space and a series of points in the space, and k points close enough to the point p need to be quickly found in the set C. In the embodiment of the invention, the set C is a given three-dimensional point cloud, and the query point p is a given target point.
Taking the spatial index created by the embodiment of the invention includes index codes and data points included in grid units corresponding to the index codes as examples, for example, the data points corresponding to different grid units are indexed and stored in a hash table mode, and the nearest neighbor or k nearest neighbor of the target point can be determined according to the data points in the grid units corresponding to the index codes corresponding to the target point or/and the data points in other grid units nearest to the target point, wherein the other grid units nearest to the target point refer to the other grid units including the data points determined according to the order that the difference value between the index codes and the index codes of the target point is the smallest priority. Illustratively, the nearest neighbor or k-nearest neighbor of the target point is determined according to the index code corresponding to the target point or/and the data points in other grid units closest to the target point, which may be determined based on the distance between the data points and the target point, or may be implemented by means of downsampling or fuzzy matching of the data points if the precision tolerance allows. Fig. 6 schematically shows a specific implementation of the nearest neighbor query in step S123, taking as an example the determination of the nearest neighbor or k-nearest neighbor based on the distance calculation result of the data point from the target point, as shown in fig. 6, which may be implemented as including:
Step 60: judging whether the grid unit corresponding to the index code to which the target point belongs contains data points or not, executing step S61 when the data points are contained according to the judging result, and executing step S62 and step S63 when the data points are not contained;
step S61: determining nearest neighbor data points of the target point according to the distance between the data points in the grid unit and the target point stored in the spatial index;
step S62: according to the difference value between the index codes of other grid units and the index code to which the target point belongs, determining the grid unit containing the data point from the spatial index according to the order of minimum difference priority;
step S63: and determining nearest neighbor data points of the target point according to the determined distance between the data points in the grid unit and the target point.
Fig. 7 schematically shows a specific implementation of the K-nearest neighbor query in step S123, which may be implemented as shown in fig. 7, including:
step S70: judging whether the grid unit corresponding to the index code to which the target point belongs contains data points or not, executing the step S71 when the data points are contained and more than k data points are contained according to the judging result, and executing the step S72 when the data points are not contained or the data points are less than k data points;
Step S71: determining a k neighbor of the target point according to the distance between the data point of the grid unit and the target point stored in the spatial index;
step S72: and determining the k neighbor of the target point from the grid unit corresponding to the index code of the target point and/or other grid units with smaller difference from the index code according to the difference between the index code of the target point and the index codes of other grid units and in the order of minimum difference priority.
Therefore, the embodiment of the invention can determine the nearest neighbor and/or k nearest neighbor of the target point according to the index code corresponding to the target point and the distance between the data point in the associated grid unit or/and the data point in other grid units closest to the target point and the target point. In the preferred embodiment of the present invention, the other grid units closest to the target point are other grid units containing data points determined according to the order of the smallest difference between the index code and the index code to which the target point belongs.
The method processes of fig. 6 and 7 are further described below, taking as an example the data points contained in the corresponding storage grid cells encoded by indexes in the hash table.
When the nearest neighbor is obtained, taking index determined for the target point p as index_p as an example, the data point contained in the corresponding grid unit where the target point p is located can be obtained by indexing through Hash (index_p) in the Hash table. If there are data points in the grid unit Hash (index_p) where the target point p is located, the nearest point is returned as the nearest neighbor data point by traversing the data points and calculating the distance between the data points and the target point p. If there are no data points in the grid unit Hash (index_p) where the target point p is located, the grid units with data points in index_p-1, index_p+1, index_p-2, index_p+2 are searched according to the order of the minimum priority of index codes, and the data points are traversed and the distance between the data points and the target point p is calculated until the nearest neighbor is obtained.
On the basis of obtaining the nearest neighbor, continuously searching the data points in the grid unit where the target point p is located according to the sequence of searching other grid units according to the priority sequence with the minimum priority of index coding, traversing the data points and calculating the distance between the data points and the target point p until k neighbor data points are obtained, and obtaining the k nearest neighbor.
In other preferred embodiments, when the nearest neighbor query is performed under the condition of the error range, the distance between the data point in the grid unit and the target point is not calculated through traversal, but the nearest neighbor or k nearest neighbor is determined through fuzzy matching of the data point, for example, any point in the corresponding grid unit is returned directly as the nearest neighbor or k nearest neighbor, so that the calculated amount is further reduced, and the query speed is improved. Illustratively, if a data point exists in the grid unit Hash (index_p) where the target point p is located, any point in the Hash (index_p) is directly returned as the nearest neighbor; when it is determined that no data point exists in the grid unit Hash (index_p) where the target point p is located, any point in the other nearest grid unit which has the smallest index code phase difference and contains the data point is returned to be the nearest neighbor. Similarly, when k neighbor judgment is performed, k points in the corresponding grid unit can be directly returned to serve as k neighbors under the condition that the error range allows.
In another preferred embodiment, the grid unit can be downsampled under the condition of tolerable precision, so that the calculation complexity and the time complexity are further reduced, and the speed and the efficiency of neighbor query are improved. Illustratively, downsampling a grid cell may be accomplished by replacing the locations of other points in the grid cell with one spatial point (e.g., the center of gravity of a point within the grid cell, or the center location of the grid cell), i.e., considering that all points within the grid cell are located at that spatial point. In this case, when the nearest neighbor and k-nearest neighbor are searched, the grid unit is determined directly according to the index code, and the spatial point corresponding to the grid unit is returned as the nearest neighbor or k-nearest neighbor data point. The implementation concept of the neighbor query process is the same as that of the above embodiment, so that the description thereof is omitted here.
Therefore, the embodiment of the invention realizes approximate neighbor search based on the pseudo-Hilbert curve, and can rapidly perform neighbor search on the three-dimensional point cloud under the scene with certain accuracy tolerance. In addition, the embodiment of the invention uses the pseudo-Hilbert curve to perform dimension reduction mapping on the three-dimensional space, reduces the high-dimensional space to one dimension, uses the neighbor searching approximation in the one-dimensional space to replace the neighbor searching approximation in the high-dimensional space, and provides a fast and efficient approximation searching method for the neighbor searching of the three-dimensional point cloud based on the good property that the Hilbert curve has the approximate point with the approximate distance on the one-dimensional curve and the approximate distance in the high-dimensional space after folding mapping. The approximate neighbor search method of the embodiment of the invention can be further applied to three-dimensional point cloud clustering, three-dimensional point cloud registration and the like, and the embodiment of the invention is not limited to the above.
In specific practice, it will be understood by those skilled in the art that the neighbor searching method of the above embodiment of the present invention may be directly applied to a product requiring use of a neighbor searching technology, so that an intelligent product to which the above neighbor searching method is applied has a neighbor searching function, or key parts of the above neighbor searching method, such as a part for setting a target space to be searched and creating a spatial index for the set target space to be searched, may be deployed in a cloud server or other intelligent devices, and provide access interfaces for different terminal devices, so that the terminal devices may perform the neighbor searching function by using the above neighbor searching method deployed in the cloud server or other intelligent devices. Taking the deployment of the key part of the above-mentioned neighbor searching method on a cloud server or other intelligent devices as an example, fig. 8 schematically shows a method flow of performing neighbor searching by applying the above-mentioned searching method on a terminal device, as shown in fig. 8, in this application scenario, the neighbor searching method performed on the terminal device includes:
Step S80: receiving a neighbor search request containing a target point;
step S81: performing neighbor query on the target point according to the target point, a set target space to be checked and a space index created for the target space in advance; the spatial index of the target space to be checked is created by utilizing a pseudo-Hilbert curve in advance.
Thus, in step S80, the terminal device only needs to receive a neighbor search request to determine the target point at the time of neighbor search. In step S81, the terminal device only needs to obtain the set target space to be checked and the spatial index created for the target space to be checked in advance from the cloud server or other intelligent devices, and execute the neighbor query according to the target point carried in the search request and the obtained target space to be checked and the spatial index, and the terminal device itself or the main body module itself executing the method step does not need to perform the setting of the target space to be checked and the creation process of the spatial index. Therefore, the terminal equipment can simply execute the search function according to the requirement, the performance requirement on the terminal equipment is reduced, the multiplexing of the related modules for setting the space of the target to be checked and creating the space index can be realized, and the research, development and maintenance cost is reduced. In step S81, the specific method for performing the neighbor query is described in the foregoing method section, and will not be described herein.
In a specific implementation, the target space to be checked and the created spatial index set in the step S81 may not be obtained from a cloud server or other intelligent devices, may be preconfigured and stored in a storage module of the terminal device, or may be implemented by another module on the terminal device, which is independent of a module for executing the methods of the step S80 and the step S81, where the method in the embodiment of the present invention does not limit the obtaining manner of the target space to be checked and the spatial index or the execution subject thereof, so long as the method in the embodiment of the present invention can be applied to implement a neighbor search function for the terminal device, such as a vehicle terminal.
Fig. 9 schematically shows a neighbor searching apparatus according to an embodiment of the present invention, which can be applied to an intelligent mobile platform such as an automatic/semi-automatic driving vehicle, an unmanned sweeper, a robot, etc. for neighbor searching of a three-dimensional point cloud. As shown in fig. 9, the apparatus includes:
a target space construction module 90, configured to set a target space to be checked for a given three-dimensional point cloud;
an index construction module 91, configured to create a spatial index for the target space to be checked using a pseudo-hilbert curve; and
And the neighbor query module 92 is configured to perform neighbor query on a given target point according to the target point, a set target space to be queried, and a spatial index created for the target space to be queried.
In a preferred embodiment, the spatial index created for the target space to be checked is a spatial index of the target space to be checked in a one-dimensional space, and the spatial index clusters given three-dimensional point clouds in the one-dimensional space through index coding.
Fig. 10 schematically illustrates a neighbor searching apparatus according to a preferred embodiment of the present invention, and as a preferred embodiment, as shown in fig. 10, a neighbor query module 92 is implemented to include:
a target point normalization unit 920, configured to determine a normalized coordinate of the target point according to the three-dimensional coordinate of the given target point and the set target space to be checked;
an index calculation unit 921, configured to determine an index code to which the target point belongs according to the normalized coordinate of the target point; and
a query unit 922, configured to perform neighbor query on the target point according to an index code to which the target point belongs and a spatial index created for the target space to be queried;
the index construction module 91 is specifically implemented to include:
A space dividing unit 910, configured to perform grid division on the target space to be inspected to form a plurality of grid units;
a coding unit 911, configured to fill the target space to be checked by using a pseudo-hilbert curve, and allocate index codes of each grid unit in a one-dimensional space; and
an index unit 912 for storing the data points contained in each grid unit using the index code.
Preferably, the index code of the target point is an index code of a grid unit where the target point is located, and the index calculating unit 921 is specifically configured to determine a normalized coordinate of the grid unit where the target point is located according to the normalized coordinate of the target point, and calculate the index code of the grid unit by using a pseudo-hilbert curve according to the normalized coordinate of the grid unit where the target point is located.
As a preferred embodiment, the index unit 912 implements a hash table to store the data points contained in each grid unit based on the index encoding.
As another preferred embodiment, the spatial index includes an index code and data points included in grid units corresponding to the index code, and the query unit 922 is specifically configured to determine a nearest neighbor or k-nearest neighbor of the target point according to the data points in the grid units corresponding to the index code to which the target point belongs or/and the data points in other grid units nearest to the target point and the target point. In this embodiment of the present invention, the other grid units closest to the target point are other grid units including data points determined according to the order in which the difference between the index code and the index code to which the target point belongs is the smallest. Illustratively, the query unit 922 may determine the nearest neighbor or k-neighbor of the target point based on the distance of the target point from the data points in the respective grid units.
It should be noted that, in the foregoing embodiments of the present invention, the specific implementation process of each module and unit of the neighbor searching device may refer to the description of the foregoing method section, so that the description is omitted herein.
In addition, in other preferred embodiments, when the query unit 922 performs nearest neighbor query under the condition of allowing the error range, the distance between the data point in the grid unit and the target point may be directly returned to any point in the corresponding grid unit as the nearest neighbor or k nearest neighbor instead of traversing and calculating, so as to further reduce the calculation amount and improve the query speed. Illustratively, if a data point exists in the grid unit Hash (index_p) where the target point p is located, any point in the Hash (index_p) is directly returned as the nearest neighbor; when it is determined that no data point exists in the grid unit Hash (index_p) where the target point p is located, any point in the other nearest grid unit which has the smallest index code phase difference and contains the data point is returned to be the nearest neighbor. Similarly, when k neighbor judgment is performed, k points in the corresponding grid unit can be directly returned to serve as k neighbors under the condition that the error range allows.
In another preferred embodiment, the spatial division unit 910 may also downsample the grid unit when performing grid division under the condition that the accuracy is tolerable, so as to further reduce the computational complexity and the time complexity, and improve the speed and the efficiency of the neighbor query. Illustratively, downsampling a grid cell may be accomplished by replacing the locations of other points in the grid cell with one spatial point (e.g., the center of gravity of a point within the grid cell, or the center location of the grid cell), i.e., considering that all points within the grid cell are located at that spatial point. In this case, when the nearest neighbor and k-nearest neighbor are searched, the grid unit is determined directly according to the index code, and the spatial point corresponding to the grid unit is returned as the nearest neighbor or k-nearest neighbor data point.
Fig. 11 schematically illustrates a neighbor searching apparatus according to an embodiment of the present invention, which is implemented as shown in the figure, including:
a communication unit 100 for receiving a neighbor search request including a target point and transmitting to the processor 200; and
the processor 200 is configured to perform neighbor query on the target point according to the target point, a target space to be checked obtained by reading from the memory 300, and a spatial index created in advance for the target space to be checked; the spatial index of the target space to be checked is created by utilizing a pseudo-Hilbert curve in advance.
The neighbor searching device can be any intelligent product terminal such as a vehicle-mounted terminal which needs to apply a neighbor searching function. The communication unit 100 may receive a neighbor search request from other modules of the apparatus, may receive a neighbor search request directly input by a user through a user interface, and may also receive a neighbor search request from other intelligent devices or a cloud, which is not limited by the embodiment of the present invention. Illustratively, the target point included in the neighbor search request may be a three-dimensional coordinate including only the target point, or may include other required information, such as a normalized coordinate of the target point, and the like. In other embodiments, the neighbor search request may further include a target space to be searched or a three-dimensional point cloud set to be searched.
In the preferred embodiment of the present invention, the target space to be checked and the spatial index created in advance for the target space to be checked stored in the memory 300 may also be obtained from other modules of the device or obtained from a cloud server or other intelligent devices by using the method for setting the target space to be checked and creating the spatial index according to the embodiment of the present invention, which is not limited in this embodiment of the present invention. In other embodiments of the present invention, the processor 200 of the neighbor search device may also obtain the target space to be searched and the created spatial index from other modules of the device or from the cloud or from other intelligent terminals, instead of from the memory 300. The specific implementation method of the processor 200 for performing the neighbor query may refer to the description of the foregoing method section, and will not be repeated herein.
Fig. 12 schematically shows a neighbor searching apparatus according to another embodiment of the present invention, which is implemented as shown in the figure to include:
a memory 1 for storing executable instructions; and
a processor 2 for executing executable instructions stored in a memory, which when executed by the processor implement the steps of the neighbor search method of any of the preceding embodiments.
In specific practice, the above-mentioned neighbor searching device may be applied to an autopilot device such as an autopilot vehicle, an unmanned cleaner, an unmanned sweeper, a robot, or a semiautomatic device, for example, to implement neighbor searching for a given target point and a given three-dimensional point cloud on these devices, so as to improve the speed and efficiency of neighbor searching, reduce the calculation amount of the device, and improve the performance of the device. Specifically, the above-mentioned neighbor searching device may be implemented as a controller or a searcher or a detector on an intelligent mobile platform such as an autonomous vehicle.
Fig. 13 schematically shows a moving tool according to an embodiment of the present invention, as shown in fig. 13, including:
a controller 3 for performing a neighbor search for a given target point according to the method of any of the embodiments described above.
Optionally, in practical applications, the mobile tool may be an autopilot device, which may further include a perception recognition module and other planning control modules, such as a path planning controller, an underlying controller, and the like, where the functions of the controller 3 may also be implemented in the perception recognition module or the planner, which is not limited in this embodiment of the present invention.
In some embodiments, embodiments of the present invention provide a non-transitory computer readable storage medium having stored therein one or more programs including execution instructions that are readable and executable by an electronic device (including, but not limited to, a computer, a server, or a network device, etc.) for performing the neighbor search method of any of the above embodiments of the present invention.
In some embodiments, embodiments of the present invention also provide a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the neighbor search method of any of the embodiments above.
In some embodiments, the present application further provides an electronic device, including: the system comprises at least one processor and a memory communicatively connected with the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the neighbor search method of any of the embodiments described above.
In some embodiments, the embodiments of the present application further provide a storage medium having stored thereon a computer program which, when executed by a processor, implements the neighbor search method of any of the embodiments described above.
Fig. 14 is a schematic hardware structure of a neighbor searching apparatus according to another embodiment of the present application, where the neighbor searching apparatus may be implemented in the structure shown in the figure, and as shown in fig. 14, the neighbor searching apparatus includes:
one or more processors 610, and a memory 620, one processor 610 being illustrated in fig. 14.
The neighbor searching apparatus may further include: an input device 630 and an output device 640.
The processor 610, memory 620, input devices 630, and output devices 640 may be connected by a bus or other means, for example in fig. 14.
The memory 620 is used as a non-volatile computer readable storage medium for storing non-volatile software programs, non-volatile computer executable programs, and modules, such as program instructions/modules corresponding to the neighbor searching method in the embodiment of the present application. The processor 610 executes various functional applications of the server and data processing, i.e., implements the neighbor search method of the above-described method embodiments, by running nonvolatile software programs, instructions, and modules stored in the memory 620.
Memory 620 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created according to the use of the neighbor search method, and the like. In addition, memory 620 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 620 optionally includes memory remotely located relative to processor 610, which may be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 630 may receive input digital or character information and generate signals related to user settings and function control of the image processing apparatus. The output device 640 may include a display device such as a display screen.
The one or more modules are stored in the memory 620 that, when executed by the one or more processors 610, perform the neighbor search method in any of the method embodiments described above.
The product can execute the method provided by the embodiment of the application, and has the corresponding functional modules and beneficial effects of the execution method. Technical details not described in detail in this embodiment may be found in the methods provided in the embodiments of the present application.
The electronic device of the embodiments of the present application exists in a variety of forms including, but not limited to:
(1) Mobile communication devices, which are characterized by mobile communication functionality and are aimed at providing voice, data communication. Such terminals include smart phones (e.g., iPhone), multimedia phones, functional phones, and low-end phones, among others.
(2) Ultra mobile personal computer equipment, which belongs to the category of personal computers, has the functions of calculation and processing and generally has the characteristic of mobile internet surfing. Such terminals include PDA, MID and UMPC devices, etc., such as iPad.
(3) Portable entertainment devices such devices can display and play multimedia content. Such devices include audio, video players (e.g., iPod), palm game consoles, electronic books, and smart toys and portable car navigation devices.
(4) The server is similar to a general computer architecture in that the server is provided with high-reliability services, and therefore, the server has high requirements on processing capacity, stability, reliability, safety, expandability, manageability and the like.
(5) Other electronic devices with data interaction function.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the 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 purpose of the solution of this embodiment.
From the above description of embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus a general purpose hardware platform, or may be implemented by hardware. Based on such understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the related art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims (20)
1. A method of neighbor searching, the method comprising:
setting a target space to be checked for a given three-dimensional point cloud;
creating a spatial index for the target space to be checked by using a pseudo-Hilbert curve; and
and carrying out neighbor query on the target point according to the given target point, the set target space to be checked and the space index created for the target space to be checked.
2. The method according to claim 1, wherein the spatial index created for the target space to be examined is a spatial index of the target space to be examined in one-dimensional space, and the spatial index clusters a given three-dimensional point cloud in one-dimensional space by index coding.
3. The method of claim 2, wherein the performing a neighbor query on the target point based on a given target point, a set target space to be inspected, and a spatial index created for the target space to be inspected comprises:
determining the normalized coordinates of the target point according to the three-dimensional coordinates of the given target point and the set target space to be checked;
determining an index code to which the target point belongs according to the normalized coordinates of the target point;
and carrying out neighbor query on the target point according to the index code of the target point and the space index created for the target space to be checked.
4. A method according to claim 2 or 3, wherein said creating a spatial index for the target space to be examined using pseudo-hilbert curves comprises:
performing grid division on the target space to be checked to form a plurality of grid units;
filling the target space to be checked by using a pseudo Hilbert curve, and distributing index codes of the grid units in a one-dimensional space for the grid units; and
the data points contained in each grid cell are stored using the index code.
5. The method according to claim 4, wherein the number of grid elements divided in each dimension of the target space to be examined is equal and is a power of 2 to k;
Filling the target space to be checked by using a pseudo Hilbert curve, and distributing index codes of each grid unit in one-dimensional space to each grid unit comprises the following steps:
respectively carrying out normalization processing on each grid unit, and calculating the normalization coordinates of each grid unit;
and performing inverse mapping of the pseudo-Hilbert curve according to the normalized coordinates of each grid unit, and distributing index codes for each grid unit according to the inverse mapping result.
6. The method of claim 4, wherein storing data points contained in each grid cell using the index encoding is implemented using a hash table.
7. The method of claim 5, wherein the index code to which the target point belongs is an index code of a grid unit to which the target point belongs, and wherein determining the index code to which the target point belongs based on the normalized coordinates of the target point comprises:
determining the normalized coordinates of the grid unit where the target point is located according to the normalized coordinates of the target point;
and calculating index codes of the grid units by using the pseudo Hilbert curve according to the normalized coordinates of the grid units where the target points are located.
8. The method of claim 7, wherein the spatial index comprises an index code and data points contained in grid cells associated with the index code;
The performing neighbor query on the target point according to the index code to which the target point belongs and the spatial index created for the target space to be checked includes:
determining the nearest neighbor or k nearest neighbor of the target point according to the index code corresponding to the target point and the data point in the associated grid unit or/and the data point in other grid units closest to the target point;
the other grid units closest to the target point are determined according to the order of the minimum difference between the index code and the index code of the target point.
9. A method of neighbor searching, the method comprising:
receiving a neighbor search request containing a target point;
performing neighbor query on the target point according to the target point, a set target space to be checked and a space index created for the target space in advance; the spatial index of the target space to be checked is created by utilizing a pseudo-Hilbert curve in advance.
10. A neighbor search apparatus for neighbor searching of a three-dimensional point cloud, the apparatus comprising:
the target space construction module is used for setting a target space to be checked for a given three-dimensional point cloud;
The index construction module is used for creating a spatial index for the target space to be checked by using the pseudo-Hilbert curve; and
and the neighbor query module is used for performing neighbor query on the target point according to the given target point, the set target space to be checked and the space index created for the target space to be checked.
11. The apparatus of claim 10, wherein the spatial index created for the target space to be inspected is a spatial index of the target space to be inspected in one-dimensional space, the spatial index clustering a given three-dimensional point cloud in one-dimensional space by index encoding.
12. The apparatus of claim 11, wherein the neighbor query module comprises:
the target point normalization unit is used for determining the normalized coordinates of the target point according to the three-dimensional coordinates of the given target point and the set target space to be checked;
an index calculation unit, configured to determine an index code to which the target point belongs according to the normalized coordinate of the target point; and
and the query unit is used for carrying out neighbor query on the target point according to the index code of the target point and the space index created for the target space to be checked.
13. The apparatus of claim 11 or 12, wherein the index building module comprises:
the space dividing unit is used for dividing the target space to be checked into grids to form a plurality of grid units;
the coding unit is used for filling the target space to be checked by using a pseudo Hilbert curve, and distributing index codes of the grid units in a one-dimensional space; and
and the index unit is used for storing the data points contained in each grid unit by using the index codes.
14. The apparatus according to claim 13, wherein the indexing unit specifically comprises: and storing the data points contained in each grid unit based on the index codes by adopting a hash table.
15. The apparatus of claim 14, wherein the index code to which the target point belongs is an index code of a grid cell in which the target point belongs;
the index calculation unit is specifically configured to: and determining the normalized coordinates of the grid unit where the target point is located according to the normalized coordinates of the target point, and calculating the index code of the grid unit by using a pseudo-Hilbert curve according to the normalized coordinates of the grid unit where the target point is located.
16. The apparatus of claim 15, wherein the spatial index comprises an index code and data points contained in grid cells associated with the index code;
the query unit is specifically configured to: determining the nearest neighbor or k nearest neighbor of the target point according to the index code corresponding to the target point and the data point in the associated grid unit or/and the data point in other grid units closest to the target point;
the other grid units closest to the target point are determined according to the order of the minimum difference between the index code and the index code of the target point.
17. A neighbor search device, comprising:
a memory for storing executable instructions; and
a processor for executing executable instructions stored in a memory, which when executed by the processor implement the steps of the method of any one of claims 1 to 8.
18. A neighbor search device, comprising:
the communication unit is used for receiving a neighbor search request containing the target point and sending the neighbor search request to the processor;
the processor is used for carrying out neighbor query on the target point according to the target point, the target space to be checked, which is read from the memory, and a space index which is created for the target space to be checked in advance; the spatial index of the target space to be checked is created by utilizing a pseudo-Hilbert curve in advance.
19. A mobile tool, characterized in that it comprises:
a controller for performing a neighbor query of a given target point according to the method of any one of claims 1 to 9.
20. A storage medium having stored thereon a computer program, which when executed by a processor performs the steps of the method according to any of claims 1-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210135399.9A CN116630571A (en) | 2022-02-14 | 2022-02-14 | Neighbor searching method and device, mobile tool and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210135399.9A CN116630571A (en) | 2022-02-14 | 2022-02-14 | Neighbor searching method and device, mobile tool and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116630571A true CN116630571A (en) | 2023-08-22 |
Family
ID=87590788
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210135399.9A Pending CN116630571A (en) | 2022-02-14 | 2022-02-14 | Neighbor searching method and device, mobile tool and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116630571A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118069053A (en) * | 2024-02-19 | 2024-05-24 | 湖南财政经济学院 | Cloud data processing method, system and storage medium |
-
2022
- 2022-02-14 CN CN202210135399.9A patent/CN116630571A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118069053A (en) * | 2024-02-19 | 2024-05-24 | 湖南财政经济学院 | Cloud data processing method, system and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6632173B1 (en) | Robot map construction and position estimation | |
CN108801268B (en) | Target object positioning method and device and robot | |
JP7417745B2 (en) | Methods, devices, computing devices, logistics systems and storage media for detecting parcels | |
CN111553946B (en) | Method and device for removing ground point cloud and method and device for detecting obstacle | |
US11238641B2 (en) | Architecture for contextual memories in map representation for 3D reconstruction and navigation | |
CN111582054A (en) | Point cloud data processing method and device and obstacle detection method and device | |
CN111192364A (en) | Low-cost mobile multi-robot vision simultaneous positioning and map creating method | |
US11860846B2 (en) | Methods, systems and apparatus to improve spatial-temporal data management | |
CN114022858A (en) | Semantic segmentation method, system, electronic device and medium for automatic driving | |
CN116630571A (en) | Neighbor searching method and device, mobile tool and storage medium | |
CN113592015A (en) | Method and device for positioning and training feature matching network | |
CN114690769A (en) | Path planning method, electronic device, storage medium and computer program product | |
Cai et al. | Occupancy grid mapping without ray-casting for high-resolution LiDAR sensors | |
CN110413716B (en) | Data storage and data query method and device and electronic equipment | |
US9886652B2 (en) | Computerized correspondence estimation using distinctively matched patches | |
CN116295354A (en) | Unmanned vehicle active global positioning method and system | |
CN115269763B (en) | Local point cloud map updating and maintaining method and device, mobile tool and storage medium | |
CN116679698A (en) | Automatic driving method and device for vehicle, equipment and medium | |
CN113283821B (en) | Virtual scene processing method and device, electronic equipment and computer storage medium | |
CN114943766A (en) | Relocation method, relocation device, electronic equipment and computer-readable storage medium | |
CN117951240B (en) | Global three-dimensional point cloud map storage and real-time voxel retrieval method, device and equipment | |
Chu et al. | Convergent application for trace elimination of dynamic objects from accumulated lidar point clouds | |
CN113543307B (en) | Visual information feature fingerprint database construction method, positioning method and device | |
RU2791587C1 (en) | Method for providing computer vision | |
CN111947670B (en) | Robot mapping method and device, intelligent equipment and storage medium |
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 |