Similar point cloud determination method based on data compression, robot and storage medium
By compressing and matching the robot point cloud data multiple times, the problem of excessive computing load caused by excessive number of point clouds to be matched is solved, and efficient determination of similar point clouds and global relocation is achieved.
Patent Information
- Application Number
- CN202311798399.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-25
- Publication Date
- 2025-06-27
AI Technical Summary
In the prior art, due to the excessive number of point clouds to be matched, the real-time computing performance of global relocation is affected.
By performing multiple data compression of the current point cloud, a compression matrix and compression vector are generated, and a candidate solution set is matched in the preset compressed point cloud database, the calculation load is further reduced by using point cloud rotation invariance to achieve rapid similar point cloud determination.
While ensuring high-precision determination of similar point clouds, the calculation burden is significantly reduced through step-by-step compression and first-thick filtering methods, and the real-time computing performance of global relocation is improved.
Smart Images

Figure CN120219774A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of robot navigation, and in particular to a method for determining similar point clouds based on data compression, a robot, and a storage medium. Background Art
[0002] With the development and application of robot technology, it has become increasingly popular to use robots to perform tasks such as cleaning, disinfection, delivery, and security. Robots often use a pose estimation method based on point cloud matching. First, a map is constructed, and then the point cloud corresponding to the working environment is saved. However, this method often leads to incorrect pose estimation of the robot due to reasons such as the robot being hijacked and environmental changes, making it difficult to continue performing tasks and requiring global relocalization. During the global relocalization process, it is necessary to first find the most similar point cloud in the map to obtain the corresponding global pose.
[0003] The current mainstream technical solution is to directly use point-to-point or point-to-line matching methods to obtain the most similar point cloud from the current point cloud to the point cloud saved in the map. However, in a large working scenario, due to the large number of point clouds to be matched, if point-to-point or point-to-line matching is used for each match, it will require a large amount of computing power consumption and it is difficult to achieve fast point cloud search, thus affecting the real-time computing performance of global relocalization. Summary of the Invention
[0004] The present application provides a method for determining similar point clouds based on data compression, a robot, and a storage medium to solve the problem in the prior art that the real-time computing performance of global relocalization of a robot is affected due to the excessive number of point clouds to be matched.
[0005] In a first aspect, the present application provides a method for determining similar point clouds based on data compression, including:
[0006] Determine the current point cloud;
[0007] Perform multiple data compressions on the current point cloud to obtain a current compression matrix and a current compression vector respectively, where the current compression vector is a vector generated by the current compression matrix based on the rotational invariance of the point cloud;
[0008] Determine a candidate solution set that matches the current compression matrix in a preset compressed point cloud database. The candidate solution set includes multiple historical compression matrices. The historical compression matrix is a matrix obtained by compressing historical point clouds, the historical compression vector is a vector generated by the historical compression matrix based on the rotational invariance of the point cloud, and the historical compression vector and the current compression vector satisfy a difference condition;
[0009] Determine a target historical compression matrix that matches the current compression matrix in the candidate solution set;
[0010] Determine a similar point cloud based on the target historical point cloud corresponding to the target historical compression matrix.
[0011] Optionally, the performing multiple data compressions on the current point cloud to obtain a current compression matrix includes:
[0012] Determine a distance resolution and an angle resolution;
[0013] Determine the element positions of the current compression matrix according to the distance resolution and the angle resolution;
[0014] Traverse the current point cloud according to the distance resolution and the angle resolution, and configure elements for each element position of the current compression matrix to obtain the current compression matrix.
[0015] Optionally, the determining the element positions of the current compression matrix according to the distance resolution and the angle resolution includes:
[0016] Determine the number of columns of the current compression matrix according to the distance resolution and the maximum distance of the current point cloud;
[0017] Determine the number of rows of the current compression matrix according to the angle resolution and a preset maximum angle;
[0018] Determine the element positions of the current compression matrix according to the number of columns and rows of the current compression matrix.
[0019] Optionally, the performing multiple data compressions on the current point cloud to obtain a current compression vector includes:
[0020] Calculate the sum of the elements at each element position in each row of the current compression matrix;
[0021] Based on the rotational invariance of the point cloud, determine that the sum of the elements at each element position in each row of the current compression matrix is an element of the current compression vector, and obtain the current compression vector.
[0022] Optionally, the determining, in a preset compressed point cloud database, a historical compression vector that satisfies a difference condition with the current compression vector to obtain a candidate solution set matching the current compression matrix includes:
[0023] Traverse the historical compression vectors, and calculate the difference between the historical compression vectors and the current compression vector;
[0024] Determine whether the difference is less than a preset threshold;
[0025] If it is less than, determine that the historical compression vector belongs to the candidate solution set.
[0026] Optionally, before calculating the difference between the historical compressed vector and the current compressed vector, the method further includes:
[0027] Constructing a retrieval tool according to the historical compressed vector;
[0028] Then, traversing the historical compressed vector, the calculation of the difference between the historical compressed vector and the current compressed vector is:
[0029] Traversing the historical compressed vector according to the retrieval tool, and calculating the difference between the historical compressed vector and the current compressed vector.
[0030] Optionally, before determining the target historical compressed matrix matching the current compressed matrix in the candidate solution set, the method further includes:
[0031] Judging whether the number of historical compressed matrices in the candidate solution set is less than a preset threshold;
[0032] If it is less than, the method for determining similar point clouds is ended.
[0033] Optionally, before determining the target historical compressed matrix matching the current compressed matrix in the candidate solution set, the method further includes:
[0034] Calculating the corresponding robot pose covariance according to the historical compressed matrices in the candidate solution set;
[0035] Judging whether the robot pose covariance is greater than a preset threshold;
[0036] If it is greater than, the method for determining similar point clouds is ended.
[0037] Optionally, the method further includes: obtaining historical point clouds;
[0038] Performing data compression on the historical point clouds according to a preset distance resolution and an angular resolution to obtain a historical compressed matrix;
[0039] Generating the compressed point cloud database according to the historical point clouds and the historical compressed matrix.
[0040] Optionally, before performing data compression on the historical point clouds according to a preset distance resolution and an angular resolution to obtain a historical compressed matrix, the method further includes:
[0041] Determining a downsampling resolution;
[0042] Performing downsampling on the historical compressed matrix according to the downsampling resolution.
[0043] In a second aspect, the present application further provides a robot, including a memory and a processor, the memory being connected to the processor, the processor being configured to execute one or more computer programs stored in the memory, and when the processor executes the one or more computer programs, the robot is caused to implement the method as described in the first aspect.
[0044] In a third aspect, the present application further provides a computer-readable storage medium storing a computer program, the computer program including program instructions, and when the program instructions are executed by a processor, the processor is caused to execute the method as described in the first aspect.
[0045] In the technical solution provided by the present application, by compressing the current point cloud, matching is performed based on the compressed point cloud data to reduce the computational load, and based on the rotational invariance of the point cloud, the matrix is further compressed into a vector. Then, a batch of candidate solution sets are preliminarily and roughly screened according to the vector difference condition, and then a traditional matching method is used to perform precise matching in the candidate solution sets to determine the most similar point cloud. Thus, while ensuring high-precision determination of the similar point cloud, the computational burden is reduced through step-by-step compression and a screening method of first rough and then fine, thereby ensuring the real-time operation performance of global relocalization. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments of the present invention. Obviously, the following drawings are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.
[0047] Figure 1 Schematic diagram of the application environment of the method for determining similar point clouds based on data compression provided by an embodiment of the present application;
[0048] Figure 2 Schematic diagram of the flow of the method for determining similar point clouds based on data compression provided by an embodiment of the present application;
[0049] Figure 3 Schematic diagram of the current compression matrix provided by an embodiment of the present application;
[0050] Figure 4 Schematic diagram of the rotational invariance of the point cloud provided by an embodiment of the present application;
[0051] Figure 5 Schematic diagram of the current compression vector provided by an embodiment of the present application;
[0052] Figure 6Schematic flowchart of a method for constructing a compressed point cloud database provided by an embodiment of the present application;
[0053] Figure 7 Schematic flowchart of a method for compressing current point cloud data to obtain a current compression matrix provided by an embodiment of the present application;
[0054] Figure 8 Schematic diagram of a method for determining a current compression matrix according to a polar coordinate system provided by an embodiment of the present application;
[0055] Figure 9 Schematic flowchart of a method for compressing current compression matrix data to obtain a current compression vector provided by an embodiment of the present application;
[0056] Figure 10 Schematic flowchart of a method for determining a candidate solution set matching a current compression matrix in a preset compressed point cloud database provided by an embodiment of the present application;
[0057] Figure 11 Schematic flowchart of a method for determining a target historical compression matrix matching a current compression matrix in a candidate solution set provided by an embodiment of the present application;
[0058] Figure 12 Schematic diagram of the architecture of a computer device provided by an embodiment of the present application. Detailed implementation manners
[0059] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0060] It should be noted that if there is no conflict, the various features in the embodiments of the present application can be combined with each other, and all are within the protection scope of the present application. In addition, although functional module division is performed in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order from the module division in the device or the flowchart. Furthermore, the terms "first", "second", "third", etc. used in the present application do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.
[0061] First, to facilitate the description of the method for determining similar point clouds based on data compression provided by the embodiments of the present application, the application environment of the method provided by the embodiments of the present application will be introduced.
[0062] Please refer toFigure 1 , Figure 1 This is a schematic diagram of the application environment of a method for determining similar point clouds based on data compression provided by an embodiment of the present application. In this application scenario, a target space 10 is provided, and a robot 20 is included in the target space 10. The robot 20 can move to different positions within the target space 10 and obtain the position information of the target object within the target space 10. Then, based on the movement position information of the robot 20 itself and the position information of the target object, a global map of the target space 10 is generated for subsequent positioning of the robot 20 or functional interaction between the robot 20 and the target space 10.
[0063] The target space 10 is a space that provides functions for any area. For example, the target space 10 includes indoor spaces, shopping malls, living rooms, kitchens, offices, and other spaces. The robot 20 can be deployed in any of the above types of target spaces 10 to perform tasks within the target space 10.
[0064] The target object 30 is an object existing within the target space 10. For example, in this embodiment, the target object 30 is a curtain and a window. It can be understood that the target object 30 can also include stationary objects such as hanging paintings, table lamps, sofas, and coffee tables, or moving objects such as humans, pets, and balls, which are not limited herein. For the robot 20 at different positions, the environmental information observed for the target object 30 is different due to factors such as distance, angle, light, and occlusion by other objects. Therefore, for the same target object 30, if the environmental information observed by the robot 20 at different positions has sufficient similarity, it is added to the global map; otherwise, it may be judged as a different object or directly deleted from the global map.
[0065] The robot 20 includes a moving component, a sensing component, and a controller. The moving component is used to drive the robot to move between different positions within the target space. The sensing component is used to obtain the environmental information near the robot. The controller is communicatively connected to the moving component and the sensing component and generates a global map based on the environmental information obtained by the robot at different positions. For example, the moving component can be wheels, tracks, or mechanical legs. The sensing component can be a binocular camera, radar, motion sensor, etc. The controller can be a general-purpose processor, digital signal processor, application-specific integrated circuit, field-programmable gate array, single-chip microcomputer, ARM, or other programmable logic devices, discrete gate or transistor logic, discrete hardware components, or any combination of these components. It can also be a combination of computing devices. For example, a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors combined with a DSP and / or any other such configuration, which is not limited herein.
[0066] When the robot 20 moves to different positions within the target space 10, at each position, it obtains a frame recording the environmental information near that position through sensors, and obtains the global map of the target space 10 by processing and splicing multiple frames. However, if the environment changes, it may cause the robot to be unable to correctly recognize the current changed environment based on the previously saved map, so global relocalization of the robot is required, and then the map is updated. The specific method is to first determine the current position by comparing the current frame obtained at the current moment with the historical frames saved in the previously established map database according to the current frame. It can be understood that although the environment has changed, the environments before and after the change are not completely different, and there are still some identical features. Therefore, by matching the current frame with the historical frames, the current position of the robot can be re-determined. It should be noted that the current frame, historical frame, etc. are mainly saved in the form of a point cloud map. Therefore, in the following text, the current point cloud represents the frame obtained at the current moment, and the historical point cloud represents the frame obtained at the historical moment. In some embodiments, due to too many historical point clouds and high computing power consumption, the time for traversing and matching the historical point clouds is too long, affecting the real-time computing performance of global relocalization.
[0067] Based on the above application scenario description, the following introduces the method for determining similar point clouds based on data compression provided by the embodiments of the present application.
[0068] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of the method for determining similar point clouds based on data compression provided by an embodiment of the present application. The method includes:
[0069] S21. Determine the current point cloud.
[0070] In this step, the current point cloud is the point cloud map obtained by the robot at the current position according to the processing of the sensor captured image. The point cloud map includes multiple point clouds, and each point cloud is a set of points determined according to the machine vision algorithm to represent the object features in the image. The point cloud has three-dimensional coordinates determined in the map coordinate system. For example, the point cloud position is (8, 13, 21), and each number represents the distance from the corresponding coordinate axis in the three-dimensional coordinate system. For example, the first number 8 represents the distance from the x-axis is 8. According to the coordinates of the point cloud, the unique and accurate position can be determined in the map coordinate system. It can be understood that the expression of the coordinate system is not limited to the rectangular coordinate system, and can also be the polar coordinate system, such as (8, π / 6, π / 12), which is not limited here. In addition to the coordinates, the point cloud may also record other information, such as the pose of the camera in the robot sensor, the pose of the robot, etc. In some embodiments, the pose of the robot is defined as P i , i is the recording time, and the pose P i includes coordinate parameters and angle parameters. For example, P i = {x i , yi , z i , roll i , pitch i , yaw i}, where x, y, and z respectively represent the coordinates of the robot in the global map, and roll, pitch, and yaw respectively represent the orientation of the robot in the global map.
[0071] In this step, the current point cloud is determined by processing the image currently captured by the sensor. In some embodiments, since the point cloud in the image obtained by the robot sensor is too dense at some positions (such as the near area), while relatively sparse at other positions, in order to maintain the balance of the point cloud distribution and reduce the number of map point clouds for data compression, after obtaining the current point cloud, it is also necessary to downsample the current point cloud. The specific process will be described in detail later and will not be elaborated here.
[0072] S22. Perform multiple data compressions on the current point cloud to obtain the current compression matrix and the current compression vector respectively.
[0073] In this step, the current compression matrix is a matrix obtained by compressing the current point cloud. Specifically, please refer to Figure 3 , Figure 3 which is a schematic diagram of the current compression matrix provided by an embodiment of the present application. The current point cloud exists in matrix form. By reducing the number of rows and / or columns of the matrix, the compression of the matrix can be achieved. For example, transforming a 9x9 matrix into a 3x3 matrix, such that there is still a certain mapping relationship between the new 3x3 matrix and the original 9x9 matrix. It can be understood that each element in the new 3x3 matrix represents multiple elements in the original 9x9 matrix. Therefore, the information coverage range of each element in the new 3x3 matrix is larger, while the information details are reduced. This can be analogized to taking a photo of a distant object to see a wider perspective, while taking a photo of a nearby object to see more object details. Thus, the current compression matrix can facilitate the search and matching in a large amount of historical point cloud data. After determining one or several possible compression matrices, the original current point cloud matrix can be determined through the corresponding relationship for accurate matching determination, improving the calculation efficiency.
[0074] In this step, please refer to Figure 4 , Figure 4Schematic diagram of the point cloud rotation invariance provided by an embodiment of the present application. The current compression vector is a vector obtained by further compressing data based on the point cloud rotation invariance according to the current compression matrix. Specifically, the point cloud rotation invariance means that when a rotation operation is performed on the point cloud, even if the coordinates of all points in the point cloud change, the point cloud can still represent the same object, and the relative distances between all points in the point cloud do not change. Please refer to Figure 5 , Figure 5 Schematic diagram of the current compression vector provided by an embodiment of the present application. The current compression vector is a parameter generated based on the point cloud rotation invariance, and can represent the current point cloud to a certain extent at the mathematical level. The current compression vector is represented in vector form, that is, a one-dimensional array {a0, a1, a2... a n}, by reducing the number of rows or columns of the matrix, or directly taking the diagonal elements of the matrix, the obtained vector still has a certain mapping relationship with the original matrix, that is, the current compression vector can be used to represent the current compression vector, and thus can also be used to represent the current point cloud to a certain extent. Obviously, compared with the current compression matrix, the current compression vector has a smaller data volume and further reduces the computing power consumed. Therefore, using the current compression vector can further reduce the computing power consumption and improve the speed of determining the matching historical point cloud data.
[0075] S23. Determine a candidate solution set that matches the current compression matrix in a preset compressed point cloud database.
[0076] In this step, the compressed point cloud database is a pre-generated database, which stores the historical compression matrices of all historical point clouds. The compression principle and parameter settings of the historical compression matrix are the same as those of the current compression matrix, so that the historical compression matrix and the current compression matrix can match each other. When the robot constructs a map for the first time, the robot collects historical point clouds at historical moments, compresses the historical point clouds to obtain historical compression matrices, and saves the historical point clouds, historical compression matrices, and robot poses at the same time, where the historical compression matrices are saved in the compressed point cloud database. The specific generation methods of the historical compression matrix and the compressed point cloud database are described in detail later and will not be elaborated here.
[0077] In this step, the candidate solution set is a set composed of historical compression matrices that may match the current compression matrix. That is, each historical compression matrix included in the candidate solution set may be determined to match the current compression matrix, thereby affecting the relocalization of the robot. The candidate solution set is determined based on the calculation of the historical compression vector and the current compression vector. The historical compression vector is generated from the historical compression vector and can also represent the historical compression matrix. Thus, by traversing the historical compression vector and querying for the historical compression vector that meets the difference condition, the historical compression vector that matches the current compression vector is obtained. Then, further based on the historical compression vector, the historical compression matrix corresponding to the historical compression vector is searched, and this historical compression matrix is added to the candidate solution set to complete the construction of the candidate solution set. Thus, by using the historical compression vector, the amount of data to be queried for matching and the computing power consumption are further reduced, and the historical compression vector that may match is quickly found, performing a preliminary rough screening for accurately querying the matching historical point cloud subsequently.
[0078] In this step, the method for determining the matching candidate solution set is to query whether the historical compression vector meets the difference condition with the current compression vector, that is, it is necessary to calculate the difference between the historical compression vector and the current compression vector. The specific calculation method will be described in detail later and will not be elaborated here. Querying whether it meets the difference can be performed using an optimized retrieval tool, or the historical compression vector and the current compression vector can be compared one by one to calculate the difference, and no limitation is imposed on this.
[0079] S24. Determine the target historical compression matrix that matches the current compression matrix in the candidate solution set.
[0080] In this step, the target historical compression matrix is the historical compression matrix determined after accurate matching according to the point cloud matching algorithm. Specifically, this target historical compression matrix is determined to be an exact match with the current compression matrix from multiple possible matching historical compression matrices (i.e., the candidate solution set). The target historical compression matrix is used to subsequently query the target historical point cloud corresponding to the historical compression matrix, thereby realizing the determination of the final similar point cloud and completing the relocalization of the robot.
[0081] S25. Determine the similar point cloud according to the target historical point cloud corresponding to the target historical compression matrix.
[0082] In this step, the target historical point cloud is the point cloud that matches the current point cloud determined according to the historical compression matrix. Since the historical point cloud and the historical compression matrix are saved simultaneously during generation, the corresponding historical point cloud can be determined according to the historical compression matrix. After the historical point cloud is determined to be the similar point cloud, according to the robot pose information included in the historical point cloud, the current position of the robot in the map can be re-determined.
[0083] In the technical solution of the embodiment of the present application, the current point cloud is compressed, and the compressed point cloud data is used for matching to reduce the calculation load. Based on the rotational invariance of the point cloud, the matrix is further compressed into a vector. Then, a batch of candidate solution sets are preliminarily and roughly screened according to the vector difference condition, and then the most similar point cloud is accurately matched from the candidate solution sets by using a traditional matching method. Thus, while ensuring the high-precision determination of the similar point cloud, the calculation burden is reduced through step-by-step compression and a screening method of first rough and then fine, thereby ensuring the real-time operation performance of global relocalization.
[0084] The method for constructing a compressed point cloud database in the embodiment of the present application is introduced below.
[0085] Please refer to Figure 6 , Figure 6 which is a schematic flowchart of the method for constructing a compressed point cloud database provided by an embodiment of the present application. The method specifically includes the following steps:
[0086] S61. Obtain historical point clouds.
[0087] S62. Compress the historical point clouds according to a preset distance resolution and angle resolution to obtain a historical compression matrix.
[0088] S63. Generate a compressed point cloud database according to the historical point clouds and the historical compression matrix.
[0089] In step S61, the historical point clouds are the point cloud data obtained at historical moments. It can be understood that the historical moments are relative to the current moment when the method for determining similar point clouds is performed. For the moment when the robot initially constructs a map, the robot synchronously obtains historical point clouds while moving for the purpose of constructing the map. At the same time as obtaining the historical point clouds, the robot also synchronously saves the robot poses when the historical point clouds are obtained. The robot poses can be used for subsequent repositioning of the robot. The principle is that although due to environmental changes, the environmental information recorded by the historical point clouds may not match the actual environment, the position of the robot relative to the position in the target environment is still correct, which can help the robot re-determine its position in the target environment. In some embodiments, before obtaining the historical point clouds, there is also a step of determining whether the positioning at the historical moment is correct. Only when the robot is correctly positioned at the historical moment is the step of obtaining the historical point clouds executed, so as to avoid the robot saving incorrect historical point clouds due to incorrect robot positioning, such as the robot being in a feature degradation environment or sensor recognition error, which affects the accuracy of subsequent map construction and robot positioning.
[0090] In some embodiments, before compressing the historical point cloud, a step of downsampling the historical point cloud is further included. As described above, the downsampling step is to maintain the distribution balance of the historical point cloud and further reduce the data volume of the historical point cloud. Specifically, the downsampling step first determines the downsampling resolution, and then downsamples the historical compression matrix according to the downsampling resolution. For example, the historical point cloud has coordinate parameters (x, y, z), the downsampling resolution is determined to be grid_resolution, and the coordinate parameters of the downsampled historical point cloud are re-determined as (grid x ,grid y ,grid z ). Specifically, it can be calculated according to the following exemplary formula:
[0091]
[0092] where grid x is the x-axis coordinate after downsampling, grid y is the y-axis coordinate after downsampling, grid z is the z-axis coordinate after downsampling, grid_resolution is the downsampling resolution, and x, y, and z are the original x-axis, y-axis, and z-axis coordinates before downsampling respectively. Further, in some embodiments, before saving the historical point cloud each time, all the previously saved point clouds are traversed to determine whether the coordinates of the point cloud have been saved. If there is a point cloud with the same coordinate value in the database, it is determined that the point cloud has been saved. If there is no point cloud with the same coordinate value in the database, it is determined that the point cloud is a new point cloud. Furthermore, if the point cloud is determined to be a previously saved point cloud, it is further determined whether the determination time corresponding to the point cloud is greater than the time threshold compared with the determination time corresponding to the previously saved point cloud. If it is less than the time threshold, the point cloud is not saved; if it is greater than the time threshold, the point cloud is re-saved to the database. For example, for the historical point cloud A(5, 12, 13), it is found that there is a previously saved historical point cloud B(5, 12, 13) in the database. However, the time difference between the determination time of historical point cloud B and the determination time of historical point cloud A is 12 hours, which is greater than the preset time threshold of 1 hour. Therefore, the historical point cloud A is saved to the database and replaces the historical point cloud B. It should be noted that the time threshold is an empirical parameter set according to the environment, and those skilled in the art can adaptively adjust the time threshold according to the frequency of actual scenario changes.
[0093] In step S62, the distance resolution and the angle resolution are custom parameters. Since the method principle of compressing the historical point cloud to obtain the historical compression matrix is the same as the method principle of compressing the current point cloud to obtain the current compression matrix, please refer to the introduction of compressing the current point cloud in the following text, and it will not be elaborated here for the time being.
[0094] In step S63, the compressed point cloud database is used to store historical point clouds and historical compression matrices. In some embodiments, the steps of generating the compressed point cloud database specifically include: First, create an initially empty database, then traverse the historical point clouds and their corresponding historical compression matrices, and save the historical point clouds and historical compression matrices into the database to obtain the compressed point cloud database. In some other embodiments, in addition to the historical point clouds and historical compression matrices, the compressed point cloud database also stores the robot pose information when the historical point clouds are acquired. It can be understood that the compressed point cloud database can be a single database that stores historical point clouds, historical compression matrices, and robot poses simultaneously, or it can be a master database composed of multiple sub-databases, with each sub-database storing a specific type of data separately. For example, one sub-database stores only historical point clouds, and another sub-database stores historical compression matrices.
[0095] The following introduces the method for compressing the data of the current point cloud in the embodiments of the present application.
[0096] Please refer to Figure 7 , Figure 7 which is a flowchart of the method for compressing the data of the current point cloud to obtain the current compression matrix provided by an embodiment of the present application. The following will introduce the method for compressing the data of the current point cloud in combination with Figure 7 including:
[0097] S71. Determine the distance resolution and the angular resolution.
[0098] S72. Determine the element positions of the current compression matrix according to the distance resolution and the angular resolution.
[0099] S73. Traverse the current point cloud according to the distance resolution and the angular resolution, and configure elements for each element position of the current compression matrix to obtain the current compression matrix.
[0100] In step S71, the distance resolution is the minimum distance unit of the current compression matrix, and it also represents the minimum distance between adjacent recognizable point clouds in the compressed point cloud map. For example, originally there are three point clouds A, B, and C within the distance resolution. Since the distances between them are all less than the distance resolution, they are also set as the same point cloud in the compressed point cloud map. That is, according to the current compression matrix, it is impossible to distinguish the three point clouds A, B, and C at one position, and it is not necessary to calculate the three point clouds A, B, and C separately, thus reducing the computational burden.
[0101] In step S71, the angular resolution is the minimum angular unit of the current compression matrix, and it also represents the minimum angle between adjacent recognizable point clouds in the compressed point cloud map. For example, in the original historical point cloud, starting from point cloud C, rotating clockwise by 0.5 degrees can determine point cloud D, and then rotating clockwise by 0.3 degrees can determine point cloud E, while the angular resolution is set to 1 degree. So that starting from point cloud C, it is no longer possible to rotate clockwise by 0.5 degrees to determine point cloud D, and point cloud D is directly grouped into point cloud C for statistics, and the same is true for point cloud E. Similar to the distance resolution, after setting the angular resolution for the compressed point cloud map, multiple point clouds within the angular resolution cannot be separately recognized anymore, but there is no need to calculate them separately either. It only needs to be determined that there are point clouds within the corresponding angular resolution, without having to know how many point clouds there are within each angular resolution range, reducing the computational burden.
[0102] In step S72, the distance resolution and the angular resolution jointly determine the element positions of the current compression matrix. In some embodiments, the distance resolution is used to determine the number of columns n of the current compression matrix, and the angular resolution is used to determine the number of rows m of the current compression matrix. The current compression matrix is an m*n matrix. When m and n are determined, that is, when the number of rows and columns of the matrix are determined, the specification size of the matrix is also determined accordingly. Specifically, the number of columns of the current compression matrix is jointly determined by the maximum distance of the current point cloud itself and the distance resolution. For example, the maximum length of the current point cloud image is 12 meters, and the distance resolution is 1.5 meters, then the number of columns of the current compression matrix is 8, and it can be calculated according to the following exemplary formula:
[0103] n = range_max / range_resolution
[0104] where range_max is the maximum distance of the current point cloud, range_resolution is the distance resolution, and n is the number of columns of the current compression matrix.
[0105] In step S72, the number of rows of the current compression matrix is determined by the angular resolution and the preset maximum angle. For example, the preset maximum angle is 360 degrees, and the angular resolution is 30 degrees, then the number of rows of the current compression matrix is 12, and it can be calculated according to the following exemplary formula:
[0106] m = angle_max / angle_resolution
[0107] where angle_max is the maximum angle, angle_resolution is the angular resolution, and m is the number of rows of the current compression matrix. In this embodiment, m is 12 and n is 8, then accordingly, it can be determined that the current compression matrix is a matrix with a specification of 12x8, and accordingly, the element position of each element can also be determined.
[0108] In step S73, the distance resolution and the angular resolution will traverse and scan the current point cloud, divide the grid with the distance resolution and the angular resolution, and establish a compressed point cloud map in the polar coordinate system, which is represented in the form of the current compression matrix. If there is a point cloud in a certain grid in the corresponding polar coordinate system map, the element position of the current compression matrix corresponding to this grid is configured with element 1. If there is no point cloud in the grid, the element position corresponding to this grid is configured with element 0. Thus, the current compression matrix can be obtained. For example, please refer to Figure 8 , Figure 8 which is a schematic diagram of the method for determining the current compression matrix according to the polar coordinate system provided by an embodiment of the present application. There are a total of 4 point clouds A, B, C, and D in the original current point cloud map. Among them, A and B are in the same grid, C is within the same angular resolution range as A and B, D is within the same distance resolution range as C, and there is no point cloud in the remaining grids. Then, only 3 positions in the matrix are 1, and the rest are 0. Thus, the elements configured at all element positions in the current compression matrix can be determined, and the complete current compression matrix can be obtained.
[0109] After determining the current compression matrix, it further includes the step of performing data compression on the current compression matrix to obtain the current compression vector. Please refer to Figure 9 , Figure 9 which is a flowchart of the method for performing data compression on the current compression matrix to obtain the current compression vector provided by an embodiment of the present application. Specifically:
[0110] S91. Calculate the sum of the elements at each element position in each row of the current compression matrix.
[0111] S92. Based on the rotational invariance of the point cloud, determine that the sum of the elements at each element position in each row of the current compression matrix is the element of the current compression vector, and obtain the current compression vector.
[0112] In step S91, the rotational invariance of the point cloud is manifested as that no matter how the point cloud rotates and how the point cloud coordinates change, the relative distance between the point clouds remains unchanged. That is, within the same distance range, no matter which angular range grid the point cloud is in, the total number of point clouds is unchanged. Specifically corresponding to the current compression matrix, no matter how it rotates, the sum of the elements at each element position in each row of the current compression matrix is a fixed value.
[0113] In step S92, the further compression of the current compression matrix based on the rotational invariance of the point cloud is to compress the sum of the point clouds within all angular ranges within the same distance range in the compressed point cloud map corresponding to the current matrix. Specifically, in the current compression matrix, it is manifested as taking the sum of the elements in each row position as the elements of the new column vector, and the new column vector is the current compression vector. Specifically, successively taking the sum of the elements in each row as the elements in the new current compression vector to obtain a one-dimensional set of elements, and this set of elements is the current compression vector. For example, if the current compression matrix is a 3x3 matrix, the sum of the elements in the first row is 0, the sum of the elements in the second row is 1, and the sum of the elements in the third row is 2, then the current compression vector is a column vector of {0, 1, 2}. It can be understood that the number of rows of the matrix is the number of elements in the current compression vector.
[0114] The method for determining the candidate solution set provided by the embodiments of the present application is introduced below.
[0115] Please refer to Figure 10 , Figure 10 which is a flowchart of the method for determining a candidate solution set that matches the current compression matrix in a preset compressed point cloud database provided by an embodiment of the present application. The method for determining the candidate solution set is introduced below in combination with Figure 5 including:
[0116] S101. Traverse the historical compression vectors and calculate the difference between the historical compression vectors and the current compression vector.
[0117] S102. Determine whether the difference is less than a preset threshold.
[0118] S103. If it is less, determine that the historical compression vector belongs to the candidate solution set.
[0119] S104. If it is greater, determine that the historical compression vector does not belong to the candidate solution set.
[0120] In step S101, the historical compression vector is the column vector of the historical compression matrix in the compressed point cloud database. It can be understood that since the historical compression matrix and the current compression matrix use the same data compression algorithm for data compression, the historical compression vector of the historical compression matrix is also a vector generated based on the rotational invariance of the point cloud. Therefore, the historical compression vector and the current compression vector are comparable. The similarities between the historical compression vector and the current compression vector represent that the historical point cloud and the current point cloud have some similarities. Similarly, the differences between the historical compression vector and the current compression vector also represent some differences between the historical point cloud and the current point cloud. From this, it can be concluded that the smaller the difference between the historical compression vector and the current compression vector, the more similar the historical point cloud and the current point cloud are, and the more likely this historical point cloud is to be determined as the most similar point cloud to help the robot for relocalization.
[0121] In step S101, the difference is used to represent the similarity between the historical compressed vector and the current compressed vector. In some embodiments, the difference is defined as the sum of the squares of the differences between the corresponding elements of the historical compressed vector and the current compressed vector. For example, if the current compressed vector is {a1, a2, a3... a n}, and the historical compressed vector is {b1, b2, b3... b n}, then the difference can be calculated according to the following exemplary formula:
[0122]
[0123] where D is the difference, a i is an element in the current compressed vector, and b i is an element in the historical compressed vector. For example, the calculated difference between the current compressed vector {1, 1, 2} and the historical compressed vector {1, 3, 3} is 5. In some embodiments, to further improve the calculation efficiency, before calculating the difference, the steps also include: constructing a retrieval tool according to the historical compressed vector. For example, the K-dtree algorithm is used to construct a k-dimensional binary tree data structure. The K-dtree divides all historical compressed vectors according to the data space to obtain multiple spaces, and improves the search speed through the binary search method of the binary tree. During the construction of the K-dtree, the boundary of the data space is called a node, and the node is regarded as a hyperplane to divide the data space into two half-spaces. In one half-space on one side of the node, some attributes of the data are less than a certain set threshold, and in the other half-space on the other side, some attributes of the data are greater than the set threshold. The historical compressed vector continuously eliminates the parts that cannot be the target during the screening of numerous nodes, without having to completely calculate the difference between this part of the historical compressed vector and the current compressed vector, thereby reducing the calculation burden and improving the calculation efficiency. It can be understood that the method of constructing the search tool is not limited to the K-dtree algorithm, and other retrieval algorithms such as the hash table-based retrieval algorithm and the inverted-index-based retrieval algorithm can also be used to construct the retrieval tool, which is not limited herein.
[0124] In step S102, the preset threshold is an empirical parameter used to determine whether the historical compressed vector can be added to the candidate solution set as a candidate solution, and this threshold can be adjusted according to the actual situation. For example, if the threshold is set to 10, then the calculated difference of 5 between the historical compressed vector {1, 3, 3} and the current compressed vector {1, 1, 2} is less than the threshold 10, and this historical compressed vector is determined to belong to the candidate solution set.
[0125] The method for determining the target historical compressed matrix according to the candidate solution set is introduced below.
[0126] Please refer to Figure 11 , Figure 11The flowchart of the method for determining a target historical compression matrix matching the current compression matrix in a candidate solution set provided by an embodiment of the present application. The following will be combined with Figure 11 introduce the method for determining the target historical matrix, including:
[0127] S111. Determine whether the number of historical compression matrices in the candidate solution set is less than a preset threshold.
[0128] S112. If it is less, end the method for determining similar point clouds.
[0129] In step S111, the preset threshold is an empirical parameter used to judge the rationality of the candidate solution set. If there is indeed a historical compression matrix in the candidate solution set that can match the current compression matrix, there should be multiple similar candidate historical compression matrices near the target historical compression matrix. On the contrary, if the number of historical compression matrices included in the candidate solution set is too small, it indicates that there is an incorrect matching problem with the historical compression matrices screened based on the matching of the current compression vector and the historical compression vector. Using the historical compression matrix in this candidate solution set as the target may cause the robot to reposition to the wrong location. Therefore, it is necessary to end the method for determining similar point clouds.
[0130] S113. Calculate the corresponding robot pose covariance based on the historical compression matrices in the candidate solution set.
[0131] S114. Determine whether the robot pose covariance is greater than a preset threshold.
[0132] S115. If it is greater, end the method for determining similar point clouds.
[0133] In step S113, the robot pose covariance is used to judge the concentration of candidate solutions. Specifically, first determine the robot poses corresponding to all historical compression matrices in the candidate solution set, and then calculate the covariance based on all robot poses.
[0134] In step S114, the preset threshold is an empirical parameter for judging the concentration of candidate solutions and can be adjusted according to the actual situation. If the robot pose covariance is greater than this value, it means that the historical point cloud distributions corresponding to the historical compression matrices in the candidate solution set are too dispersed, and similar matchable environments are detected in different places. At this time, if a historical compression matrix is selected as the target historical compression matrix, there may be a risk of incorrect matching due to similar scenarios. Therefore, it is necessary to end the method for determining similar point clouds.
[0135] S116. Calculate the difference between the historical compression matrices in the candidate solution set and the current compression matrix.
[0136] S117. Sort the historical compression matrices in the candidate solution set according to the difference.
[0137] S118. Perform point cloud matching in sequence according to the sorting result.
[0138] In step S66, the difference of the matrices is a parameter used to represent the similarity between the historical compression matrix and the current compression matrix. In some embodiments, the difference of the matrices is defined as the absolute value of the element difference between the corresponding elements of the historical compression vector and the current compression vector. For example, for the current compression matrix historical compression matrix The difference of the matrices can be calculated according to the following exemplary formula:
[0139]
[0140] where D is the difference of the matrices, a i,j represents the element at the i-th row and j-th column of the current compression matrix, and b i,j represents the element at the i-th row and j-th column of the historical compression matrix.
[0141] In step S117, according to the difference between the historical compression matrix and the current compression matrix, re-arrange the order from small to large. Specifically, for a historical compression matrix with a relatively small difference of the compression matrices, the difference between its corresponding historical point cloud and the current point cloud may also be relatively small. Therefore, it is calculated and matched first, thereby improving the overall calculation efficiency.
[0142] In step S118, the method for performing point cloud matching is point-to-point matching or point-to-line matching in the prior art to improve the accuracy of the final matching result. Since all the historical point clouds have been screened according to the historical compression matrix and the historical compression vector respectively before, the number of historical point clouds to be calculated is small, reducing the overall calculation burden of the method for determining similar point clouds in this application, reducing the computing power consumption, and thus improving the real-time operation performance of global relocalization.
[0143] In summary, the method for determining similar point clouds based on data compression provided by the embodiments of the present application synchronously saves historical point clouds and historical compression matrices during map construction to facilitate reducing the computational burden by comparing the historical compression matrices with less data volume during relocalization. Further, based on the compression matrix, the rotation invariance of the point cloud is further utilized for data compression to obtain the current compression vector. The candidate solution set is initially screened by comparing the differences between vectors, and in the candidate solution set, the accuracy of the finally matched historical point cloud is ensured by judging the number of historical compression matrices and the concentration of candidate solutions. Finally, the historical compression matrices in the candidate solutions are sorted and then the traditional point cloud matching method is used for accurate matching to determine the most similar point cloud. In this process, the present application makes full use of data compression to reduce the computational burden, and at the same time reasonably abstracts new compressed data based on the original data to ensure the accuracy of the final matching result. On the premise of achieving accurate matching, the computing power consumption is reduced and the real-time operation performance of global relocalization is improved.
[0144] The embodiments of the present application further provide a computer-readable storage medium. The computer-readable storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer is enabled to execute the method of the foregoing embodiments.
[0145] The embodiments of the present application further provide a robot, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the method of the foregoing embodiments is implemented.
[0146] The embodiments of the present application further provide a computer device. The computer device may be a server, and its internal structure diagram may be as Figure 12 shown. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the data that needs to be saved in the method of the foregoing embodiments. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the method provided by the foregoing embodiments is implemented.
[0147] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0148] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0149] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention and should all be included in the protection scope of the present invention.
Claims
1. A method for determining similar point clouds based on data compression, characterized in that, Including: Determine the current point cloud; Perform multiple data compressions on the current point cloud to respectively obtain a current compression matrix and a current compression vector, where the current compression vector is a vector generated by the current compression matrix based on the rotational invariance of the point cloud; Determine a candidate solution set matching the current compression matrix in a preset compressed point cloud database, where the candidate solution set includes multiple historical compression matrices, the historical compression matrices are matrices obtained by compressing historical point clouds, the historical compression vectors are vectors generated by the historical compression matrices based on the rotational invariance of the point cloud, and the historical compression vectors and the current compression vector satisfy a difference condition; Determine a target historical compression matrix matching the current compression matrix in the candidate solution set; Determine a similar point cloud according to the target historical point cloud corresponding to the target historical compression matrix.
2. The method according to claim 1, characterized in that, The performing multiple data compressions on the current point cloud to obtain a current compression matrix includes: Determine the distance resolution and the angular resolution; Determine the element positions of the current compression matrix according to the distance resolution and the angular resolution; Traverse the current point cloud according to the distance resolution and the angular resolution, and configure elements for each element position of the current compression matrix to obtain the current compression matrix.
3. The method according to claim 2, wherein The determining the element positions of the current compression matrix according to the distance resolution and the angular resolution includes: Determine the number of columns of the current compression matrix according to the distance resolution and the maximum distance of the current point cloud; Determine the number of rows of the current compression matrix according to the angular resolution and a preset maximum angle; Determine the element positions of the current compression matrix according to the number of columns and rows of the current compression matrix.
4. The method according to claim 3, characterized in that The performing multiple data compressions on the current point cloud to obtain a current compression vector includes: Calculate the sum of the elements at each element position in each row of the current compression matrix; Based on the rotational invariance of the point cloud, determine that the sum of the elements at each element position in each row of the current compression matrix is an element of the current compression vector to obtain the current compression vector.
5. The method according to any one of claims 1 to 4, characterized in that, The determining a candidate solution set matching the current compression matrix in a preset compressed point cloud database includes: Traverse the historical compression vectors and calculate the difference between the historical compression vectors and the current compression vector; Judge whether the difference is less than a preset threshold; If it is less than, determine that the historical compression vector belongs to the candidate solution set.
6. The method according to claim 5, characterized in that, Before calculating the difference between the historical compression vector and the current compression vector, it further includes: Construct a retrieval tool according to the historical compression vector; Then, the traversing the historical compression vectors and calculating the difference between the historical compression vectors and the current compression vector is: Traverse the historical compression vectors according to the retrieval tool and calculate the difference between the historical compression vectors and the current compression vector.
7. The method according to claim 1, wherein Before determining a target historical compression matrix matching the current compression matrix in the candidate solution set, it further includes: Judge whether the number of the historical compression matrices in the candidate solution set is less than a preset threshold; If it is less than, end the method for determining the similar point cloud.
8. The method according to claim 1, characterized in that, Before determining the target historical compression matrix that matches the current compression matrix in the candidate solution set, the following steps are also included: Calculate the corresponding robot pose covariance based on the historical compression matrix in the candidate solution set; Determine whether the robot pose covariance is greater than a preset threshold; If it is greater than the threshold, end the method for determining similar point clouds.
9. The method according to claim 1, wherein The following steps are also included: Obtain historical point clouds; Perform data compression on the historical point clouds according to a preset distance resolution and angle resolution to obtain a historical compression matrix; Generate the compressed point cloud database based on the historical point clouds and the historical compression matrix.
10. The method according to claim 9, characterized in that, Before performing data compression on the historical point clouds according to the preset distance resolution and angle resolution to obtain a historical compression matrix, the following steps are also included: Determine the downsampling resolution; Perform downsampling on the historical compression matrix according to the downsampling resolution.
11. A robot, characterized in that, It includes a memory and a processor. The memory is connected to the processor. The processor is used to execute one or more computer programs stored in the memory. When the processor executes the one or more computer programs, the robot realizes the method described in any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program. The computer program includes program instructions. When the program instructions are executed by the processor, the processor executes the method described in any one of claims 1 to 10.