Loop detection method, related equipment and device
By dividing the target area into sub-areas in SLAM technology and matching the historical key chains in the sub-areas, the problem between real-time and accuracy of loopback detection is solved, and efficient positioning in a GPS signal-free environment is achieved.
Patent Information
- Application Number
- CN202210146309.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-17
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-02-17
AI Technical Summary
It is difficult for existing loopback detection methods to ensure real-time performance while ensuring accuracy, especially in applications where SLAM technology is used in environments without GPS signals such as indoors or caves.
By dividing the target area into sub-areas, and determining its corresponding sub-area based on the location information of the current key frame, matching the complete historical key chain and the current key frame in the sub-area to reduce the scope of the matching area and reduce repeated matching, improving real-time sex and accuracy.
It improves the real-time performance and accuracy of loopback detection, reduces matching time, enhances robustness, and ensures positioning accuracy in environments without GPS signals.
Smart Images

Figure CN114724056B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision, and in particular to a loop detection method, related equipment and devices. Background Art
[0002] SLAM technology is currently an important method and technology for achieving accurate mapping and positioning. It is mainly used in situations where there is no GPS signal or the GPS signal cannot accurately provide accurate positioning information, such as indoors or in caves.
[0003] Loop detection is a very important module in SLAM technology (SLAM: simultaneous localization and mapping), which refers to detecting whether the lidar passes through an area it has been to before. Once the loop detection is successful, the accumulated error can be reduced through back-end optimization.
[0004] However, most of the current loop detection methods find it difficult to ensure the real-time performance of loop detection while ensuring accuracy. Summary of the invention
[0005] The present invention provides a loop detection method, related equipment and device to solve the problem that it is difficult to ensure the real-time performance of the loop detection while ensuring the accuracy of the loop detection method.
[0006] To solve the above technical problems, the present invention provides a loop detection method, including: acquiring the current key frame of point cloud data and the position information of the current key frame; determining the sub-region corresponding to the current key frame based on the position information of the current key frame, wherein the sub-region is obtained by dividing the target region; in response to the existence of a complete historical key chain in the sub-region corresponding to the current key frame, matching the complete historical key chain with the current key frame; wherein the complete historical key chain is composed of at least one continuous frame of historical key frames; in response to the successful matching of the current key frame with the complete historical key chain, determining that the loop detection is successful.
[0007] Among them, matching the complete historical key chain with the current key frame includes: building a local map of the sub-area based on the point cloud data corresponding to each historical key frame in the complete historical key chain, and matching the local map with the point cloud data corresponding to the current key frame.
[0008] Among them, comparing the point cloud data corresponding to the local map and the current key frame, including: respectively comparing the coordinates of each point of the point cloud data corresponding to the current key frame with the coordinates of each point of the point cloud data corresponding to the local map; in response to the overlap between the point coordinates of the point cloud data corresponding to the current key frame and the point coordinates of the point cloud data of the local map exceeding a preset threshold, determining that the complete historical key chain matches the current key frame successfully.
[0009] In which, in response to the existence of a complete historical key chain in the sub-area corresponding to the current key frame, the complete historical key chain is matched with the current key frame, including: in response to the existence of multiple complete historical key chains in the sub-area corresponding to the current key frame, a complete historical key chain among the multiple complete historical key chains that is closest to the current key frame in time is matched with the current key frame to perform loop detection; wherein, there is a corresponding relationship between the multiple complete historical key chains, and the corresponding relationship is constructed after the multiple complete historical key chains are successfully matched.
[0010] Among them, in response to the existence of multiple complete historical key chains in the sub-area corresponding to the current key frame, a complete historical key chain among the multiple complete historical key chains that is closest to the current key frame time is matched with the current key frame to perform loop detection, including: in response to the existence of at least one corresponding relationship between the multiple complete historical key chains, at least one complete historical key chain corresponding to each corresponding relationship that is closest to the current key frame time is matched with the current key frame respectively; in response to the successful matching of the complete historical key chain with the current key frame, determining that the loop detection is successful, including: in response to the successful matching of the current key frame with the complete historical key chain, constructing a corresponding relationship between the current key frame and the complete historical key chain.
[0011] In which, in response to the successful matching of the current key frame with the complete historical key chain, determining that the loop detection is successful includes: in response to the successful matching of the complete historical key chain with the current key frame, updating the position information of the current key frame based on the position information corresponding to the complete historical key chain.
[0012] Among them, in response to the successful matching of the current key frame with the complete historical key chain, determining that the loop detection is successful also includes: in response to the existence of an incomplete historical key chain in the sub-area corresponding to the complete historical key chain that successfully matches the current key frame, merging the current key frame into the incomplete historical key chain; in response to the absence of an incomplete historical key chain in the sub-area corresponding to the complete historical key chain that successfully matches the current key frame, creating an incomplete historical key chain corresponding to the sub-area based on the current key frame.
[0013] Among them, the sub-regions are obtained after dividing the target area, including: dividing the target area based on the area size of a single loop detection to obtain multiple sub-regions arranged in an array; and determining the position information of each sub-region; the step of determining the sub-region corresponding to the current key frame based on the position information of the current key frame includes: determining the sub-region corresponding to the current key frame based on the position information of the current key frame and the position information of each sub-region.
[0014] Among them, determining the sub-region corresponding to the current key frame based on the position information of the current key frame includes: determining the sub-region where the current key frame is located based on the position information of the current key frame; in response to the existence of a complete historical key chain in the sub-region where the current key frame is located, taking the sub-region where the current key frame is located as the sub-region corresponding to the current key frame; in response to the absence of a complete historical key chain in the sub-region where the current key frame is located, obtaining a sub-region adjacent to the sub-region where the current key frame is located, and taking the sub-region adjacent to the sub-region where the current key frame is located as the sub-region corresponding to the current key frame.
[0015] Among them, determining the sub-area where the current key frame is located based on the position information of the current key frame also includes: in response to the sub-area where the current key frame is located being different from the sub-area where the previous key frame is located, determining the previous key frame as the last frame of the incomplete historical key chain corresponding to the sub-area where the previous key frame is located, so as to obtain the complete historical key chain of the sub-area where the previous key frame is located.
[0016] Among them, the loop detection method also includes: in response to the fact that there is no complete historical key chain in the sub-area corresponding to the current key frame, or there is a complete historical key chain in the sub-area corresponding to the current key frame and the complete historical key chain fails to match the current key frame, the loop detection fails; updating the current key frame to the incomplete historical key chain corresponding to the sub-area where the current key frame is located or creating a new incomplete historical key chain based on the current key frame.
[0017] To solve the above technical problems, the present invention further provides an electronic device, which includes: a memory and a processor coupled to each other, and the processor is used to execute program instructions stored in the memory to implement any of the above loop detection methods.
[0018] In order to solve the above technical problems, the present invention further provides a computer-readable storage medium, which stores program data, and the program data can be executed to implement any of the loop detection methods as described above.
[0019] The beneficial effects of the present invention are as follows: Different from the prior art, the present invention divides the target area into sub-areas, thereby being able to directly determine the sub-area corresponding to the current key frame based on the position information of the current key frame, and then when a complete historical key chain exists in the sub-area corresponding to the current key frame, the complete historical key chain is matched with the current key frame for loop detection, which can reduce the area range for matching with the current key frame and use the complete historical key chain to reduce the repeated matching of the current key frame with similar historical key frames in the sub-area, saving the time of loop detection, thereby improving the real-time performance of loop detection. Moreover, by matching the current key frame with a complete historical key chain consisting of at least one continuous historical key frame, the accuracy and robustness of loop detection can be improved. Thus, the accuracy of loop detection is guaranteed while ensuring the real-time performance of loop detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a flow chart of an embodiment of a loop detection method provided by the present invention;
[0021] Figure 2 is a flow chart of another embodiment of the loop detection method provided by the present invention;
[0022] Figure 3 yes Figure 2 A schematic diagram of an implementation method of dividing a target area in an embodiment;
[0023] Figure 4 is a structural schematic diagram of an embodiment of an electronic device provided by the present invention;
[0024] Figure 5 It is a structural schematic diagram of an embodiment of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] See also Figure 1 , Figure 1 It is a flowchart of an embodiment of a loop detection method provided by the present invention.
[0027] Step S11: Acquire the current key frame of the point cloud data and the position information of the current key frame.
[0028] In the laser SLAM mapping process, the current key frame of the point cloud data and the position information of the current key frame are obtained through the laser radar or robot. Among them, the current key frame is the key point cloud data frame.
[0029] In a specific application scenario, a laser radar can be used to sequentially acquire frames of point cloud data in a target area at a preset frequency. When an acquired frame of point cloud data meets preset conditions, the frame of point cloud data is determined as the current key frame.
[0030] The preset condition may include that the time difference between a frame of point cloud data obtained and the previous key frame exceeds the preset time, and / or the position difference between a frame of point cloud data obtained and the previous key frame exceeds the preset distance. The preset condition may include other conditions that can ensure that there are certain differences between adjacent current key frames to reduce invalid repetitions between key frames. The specific setting is based on actual conditions and is not limited here.
[0031] In a specific application scenario, when the preset time is 10 seconds and the preset distance is 1 meter, the time difference between the acquired frame of point cloud data and the previous key frame is 11 seconds and the position difference between the acquired frame and the previous key frame is 1.1 meters, the acquired frame of point cloud data will be used as the current key frame.
[0032] Among them, the position information of the current key frame can be the position information of the laser radar or the robot, that is, the coordinate information of the laser radar or the robot, which can be directly obtained based on the laser radar or the robot itself.
[0033] Step S12: determining the sub-region corresponding to the current key frame based on the position information of the current key frame, wherein the sub-region is obtained by dividing the target region.
[0034] The sub-region corresponding to the current key frame is determined based on the position information of the current key frame, wherein the sub-region is obtained by dividing the target region.
[0035] The target area is the area range determined before laser SLAM mapping, and the laser SLAM mapping process is to build a grid map or point cloud map for the entire target area.
[0036] The target area is divided into a plurality of sub-areas to determine the position range of each sub-area, so that the sub-area corresponding to the current key frame can be determined based on the comparison between the position information of the current key frame and the position range of each sub-area.
[0037] In a specific embodiment, the target area can be evenly divided to obtain multiple sub-areas with the same area and arranged in an array. In another specific embodiment, the target area can also be divided into multiple sub-areas according to its own characteristics. The specific division method is not limited here.
[0038] Step S13: In response to the existence of a complete historical key chain in the sub-region corresponding to the current key frame, matching the complete historical key chain with the current key frame; wherein the complete historical key chain is composed of at least one continuous historical key frame.
[0039] Determine whether there is a complete historical key chain in the sub-region corresponding to the current key frame. If so, match the complete historical key chain with the current key frame. The complete historical key chain is composed of at least one continuous historical key frame. The complete historical key chain in the sub-region is composed of at least one continuous historical key frame within the sub-region. The historical key frame also meets the preset conditions of the current key frame. That is, the multiple historical key frames included in the complete historical key chain are multi-frame point cloud data with certain differences in content in the same sub-region.
[0040] After the complete historical key chain of this embodiment is composed of at least one continuous historical key frame, it no longer adds any point cloud data of the current key frame or other frames, and is in a closed state.
[0041] Step S14: In response to the current key frame successfully matching the complete historical key chain, it is determined that the loop detection is successful.
[0042] When the current key frame successfully matches the complete historical key chain, it is determined that the lidar or robot has reached the sub-area and collected point cloud data for the sub-area, and the loop detection is successful.
[0043] Through the above steps, the loop detection method of this embodiment divides the target area into sub-areas, so that the sub-area corresponding to the current key frame can be determined directly based on the position information of the current key frame, and then when a complete historical key chain exists in the sub-area corresponding to the current key frame, the complete historical key chain is matched with the current key frame for loop detection, which can reduce the area range matched with the current key frame and use the complete historical key chain to reduce the repeated matching of the current key frame and similar historical key frames in the sub-area, saving the time of loop detection, thereby improving the real-time performance of loop detection. And by matching the current key frame with a complete historical key chain composed of at least one continuous historical key frame, the accuracy and robustness of loop detection can be improved. Thus, the accuracy of loop detection is guaranteed while ensuring the real-time performance of loop detection.
[0044] See also Figure 2 , Figure 2 It is a flowchart of another embodiment of the loop detection method provided by the present invention.
[0045] Step S21: Acquire the current key frame of the point cloud data and the position information of the current key frame.
[0046] This step is the same as step S11 in the aforementioned embodiment. Please refer to the above text and will not be described again here.
[0047] Step S22: determining the sub-region corresponding to the current key frame based on the position information of the current key frame and the position information of each sub-region.
[0048] Before this laser SLAM mapping, the target area is divided based on the area size of a single loop detection, and multiple array-arranged sub-areas are obtained, and the location information of each sub-area is determined. Among them, the area size of a single loop detection and the specific location and size of the target area can be set based on actual conditions. For example, the area size of a single loop detection is 1m×1m, and the size of the target area is 8m×10m, etc.
[0049] In a specific application scenario, a coordinate system can be constructed based on the edge and / or key points of the target area to determine the position information of each sub-area. The key points may include corner points, center points or other points of the target area. In another specific application scenario, the position information of each sub-area can also be determined by other methods, which are not limited here.
[0050] See also Figure 3 , Figure 3 yes Figure 2 A schematic diagram of an implementation method of dividing the target area in the embodiment.
[0051] The target area 100 of this embodiment is divided into a plurality of sub-areas 111. Each sub-area 111 has the same size, which is the area size of a single loop detection, and is arranged in an array in the target area 100.
[0052] In this embodiment, the upper left vertex of the target area 100 is used as the origin and the two edges of the upper left vertex are used as the x-axis and the y-axis to construct the coordinate system of the target area 100. The dividing line between each two adjacent sub-areas is the unit distance of the coordinate system.
[0053] In a specific application scenario, each sub-area 111 can also be numbered in sequence according to the arrangement order of the multiple sub-areas 111. For example, the sub-area 111 located in the upper left corner of the target area 100 is numbered as sub-area No. 0, the sub-area 111 adjacent to the right of sub-area No. 0 is numbered as sub-area No. 1, and the sub-area 111 adjacent to the bottom of sub-area No. 0 is numbered as sub-area No. 10... and so on until all sub-areas 111 are numbered, thereby facilitating the determination and management of sub-areas.
[0054] In a specific application scenario, when the coordinate information of the current key frame is obtained as [3.1, 2.4], the corresponding sub-region can be determined to be sub-region No. 23 by searching in the coordinate system according to the above coordinate information.
[0055] Through the above settings, the sub-region corresponding to the current key frame can be determined based on the position information of the current key frame and the position information of each sub-region.
[0056] The sub-region corresponding to the current key frame of this embodiment may include the sub-region where the current key frame is located and / or the sub-region adjacent to the sub-region corresponding to the current key frame. Among them, the adjacent in this embodiment may include edge adjacent and oblique adjacent. For example: sub-region No. 24 is adjacent to the edge of sub-region No. 23, and sub-region No. 34 is adjacent to sub-region No. 23 at an oblique angle.
[0057] In a specific implementation, the sub-region where the current key frame is located can be determined based on the position information of the current key frame. In response to the existence of a complete historical key chain in the sub-region where the current key frame is located, the sub-region where the current key frame is located can be used as the sub-region corresponding to the current key frame, and then subsequent matching steps can be performed.
[0058] If the sub-region where the current key frame is located does not have a complete historical key chain, the sub-region adjacent to the sub-region where the current key frame is located is obtained, and the sub-region adjacent to the sub-region where the current key frame is located is used as the sub-region corresponding to the current key frame, and then the subsequent matching steps are performed.
[0059] That is, in this embodiment, the sub-region corresponding to the current key frame can be appropriately adjusted based on the presence or absence of a complete historical key chain in the sub-region where the current key frame is located, thereby taking into account the situation where there is an error in the position information of the current key frame. The matching range is expanded by using the sub-region adjacent to the sub-region where the current key frame is located as the sub-region corresponding to the current key frame to avoid inaccurate matching due to errors in the position information of the current key frame, thereby improving the robustness and reliability of loop detection.
[0060] In a specific application scenario, when there is no complete historical key chain in sub-region 45 where the current key frame is located, sub-regions adjacent to the sub-region where the current key frame is located are obtained - sub-regions 34, 35, 36, 44, 46, 54, 55, and 56, and sub-regions 34, 35, 36, 44, 46, 54, 55, and 56 are used as sub-regions corresponding to the current key frame.
[0061] After the sub-region where the current key frame is located is determined, it is determined whether the sub-region where the current key frame is located is the same as the sub-region where the previous key frame is located. In response to the sub-region where the current key frame is located being different from the sub-region where the previous key frame is located, the previous key frame is determined as the last frame of the incomplete historical key chain corresponding to the sub-region where the previous key frame is located, so as to obtain the complete historical key chain of the sub-region where the previous key frame is located.
[0062] Among them, after the complete historical key chain of this embodiment is composed of at least one continuous historical key frame, it will no longer add any point cloud data of the current key frame or other frames, and it is in a closed state. The incomplete historical key chain of this embodiment is also composed of at least one continuous historical key frame, but it can add point cloud data of key frames or other frames, and it is in an open state.
[0063] Step S23: In response to the existence of multiple complete historical key chains in the sub-area corresponding to the current key frame, match the complete historical key chain closest to the current key frame time among the multiple complete historical key chains with the current key frame to perform loop detection; wherein, there is a corresponding relationship between the multiple complete historical key chains, and the corresponding relationship is constructed after the multiple complete historical key chains are successfully matched.
[0064] Determine whether there are multiple complete historical key chains in the sub-region corresponding to the current key frame. If there are multiple complete historical key chains in the sub-region corresponding to the current key frame, match the complete historical key chain closest to the current key frame in time with the current key frame to perform loop detection. There are corresponding relationships between the multiple complete historical key chains, and the corresponding relationships are constructed after the multiple complete historical key chains are successfully matched.
[0065] In a specific implementation, the specific steps of matching the complete historical key chain with the current key frame may include: constructing a local map of the sub-region based on the point cloud data corresponding to each historical key frame in the complete historical key chain, and matching the local map with the point cloud data corresponding to the current key frame. By constructing a local map of the sub-region based on the point cloud data corresponding to each historical key frame in the complete historical key chain, it is convenient to uniformly match the point cloud data, avoid repeated matching of similar or repeated areas in each historical key frame, and improve the matching efficiency.
[0066] In a specific implementation, the specific steps of matching the complete historical key chain with the current key frame may include: constructing a local map of the sub-area based on the point cloud data corresponding to each historical key frame in the complete historical key chain, and then comparing the coordinates of each point of the point cloud data corresponding to the current key frame with the coordinates of each point of the point cloud data corresponding to the local map; in response to the overlap between the point coordinates of the point cloud data corresponding to the current key frame and the point coordinates of the point cloud data of the local map exceeding the preset threshold, determining that the complete historical key chain is successfully matched with the current key frame. Among them, since the point cloud data is composed of multiple points, when the laser radar emits a laser forward, if there is an obstacle in front, the laser will be reflected back to the laser radar, and the obstacle will be referred to by the corresponding point in the point cloud data. When the overlap between the point coordinates of the point cloud data corresponding to the current key frame and the point coordinates of the point cloud data of the local map exceeds the preset threshold, it means that the similarity between the obstacle in the current key frame and the obstacle in the local map exceeds a certain threshold, and the laser radar has collected data at this location, and the loop detection is successful. Among them, the preset threshold can be 80%, 90% or other values, which can be set based on actual needs and is not limited here. The matching method between the complete historical key chain and the current key frame in the subsequent steps is the same as that in this implementation, and will not be repeated here.
[0067] The above matching method can perform loop detection by simply comparing the point coordinates of the point cloud data, avoiding matching through higher-dimensional features (such as lines, surfaces, descriptors, etc.), reducing the feature richness requirements for the point cloud data and improving the efficiency of loop detection.
[0068] In other specific implementations, the specific steps of matching the complete historical key chain with the current key frame may also include other methods, which are not limited here.
[0069] In a specific implementation, when matching a complete historical key chain closest to the current key frame time among multiple complete historical key chains with the current key frame, if there is at least one corresponding relationship among the multiple complete historical key chains, then at least one complete historical key chain closest to the current key frame time among the complete historical key chains corresponding to each corresponding relationship is matched with the current key frame respectively. For example: when there are 20 complete historical key chains in the sub-region corresponding to the current key frame, and there are two corresponding relationships among the 20 complete historical key chains, that is, there are corresponding relationships among 15 complete historical key chains and there are corresponding relationships among the other 5 complete historical key chains, then the two complete historical key chains closest to the current key frame time among the complete historical key chains corresponding to the two corresponding relationships are matched with the current key frame respectively.
[0070] In a specific application scenario, when a single complete historical key chain exists in the sub-region corresponding to the current key frame, the complete historical key chain is matched with the current key frame for loop detection. In another specific application scenario, when multiple complete historical key chains exist in the sub-region corresponding to the current key frame, but there is no corresponding relationship between the multiple complete historical key chains, the multiple complete historical key chains are matched with the current key frame respectively for loop detection. In another specific application scenario, when multiple complete historical key chains exist in the sub-region corresponding to the current key frame, but some of the multiple complete historical key chains have a corresponding relationship, while other parts of the complete historical key chains do not have a corresponding relationship, at least one complete historical key chain closest to the current key frame in the partial complete historical key chains with a corresponding relationship is matched with the current key frame respectively, and the other parts of the complete historical key chains are matched with the current key frame respectively for loop detection.
[0071] Among them, the situation where there are multiple corresponding relationships between multiple complete historical key chains can be caused by the fact that after the sub-area where the historical key frame in the historical key chain is located is determined, the historical key frame fails to match the corresponding complete historical key chain successfully due to algorithm, hardware or other errors, and thus the corresponding relationship cannot be established with the corresponding complete historical key chain. Instead, a new historical key chain is created with the historical key frame and subsequent matching is performed.
[0072] By matching at least one complete historical key chain that is closest to the current key frame time among multiple complete historical key chains with corresponding relationships with the current key frame, it is possible to form a larger closed loop with the multiple complete historical key chains with corresponding relationships, thereby improving the accuracy of loop detection, and only matching with the complete historical key chains with the same number of corresponding relationships, thereby greatly reducing the amount of calculation for loop detection, simplifying the computational complexity of loop detection, and thereby improving the efficiency and real-time performance of loop detection.
[0073] Step S24: In response to the complete historical key chain successfully matching the current key frame, the position information of the current key frame is updated based on the position information corresponding to the complete historical key chain.
[0074] When the complete historical key chain successfully matches the current key frame, the loop detection is determined to be successful, and the position information of the current key frame is updated based on the position information corresponding to the complete historical key chain, thereby eliminating the position error of the current key frame.
[0075] In response to the current key frame successfully matching the complete historical key chain, a corresponding relationship between the current key frame and the complete historical key chain is constructed.
[0076] In a specific application scenario, in response to the successful matching of the complete historical key chain with the current key frame, a corresponding relationship is established between the current key frame and the historical key frames in the corresponding complete historical key chain and back-end optimization is performed, and finally the position information of the current key frame and its sub-region and the corresponding key chain are updated according to the new position information after back-end optimization. Among them, when the complete key chain in other sub-regions adjacent to the sub-region where the current key frame is located is successfully matched, the position of the current key frame will be changed to the adjacent sub-region after back-end optimization, so the sub-region where the current key frame is located and the corresponding key chain also need to be updated.
[0077] Among them, back-end optimization refers to the use of the constructed cost function to perform nonlinear solution based on the position information of the current key frame and the position information corresponding to the complete historical key chain to eliminate errors and thus update the position.
[0078] In response to the current key frame successfully matching the complete historical key chain, a corresponding relationship between the current key frame and the complete historical key chain is established. The corresponding relationship used in step S23 is of the same nature as the corresponding relationship established in this step.
[0079] After the complete historical key chain successfully matches the current key frame, in response to the existence of an incomplete historical key chain in the sub-area corresponding to the complete historical key chain that successfully matches the current key frame, the current key frame is merged into the incomplete historical key chain. In response to the absence of an incomplete historical key chain in the sub-area corresponding to the complete historical key chain that successfully matches the current key frame, an incomplete historical key chain corresponding to the sub-area is newly created based on the current key frame.
[0080] In a specific application scenario, in response to the fact that there is no complete historical critical chain in the sub-area where the current key frame is located and the adjacent sub-area, or there is a complete historical critical chain in the sub-area corresponding to the current key frame and the complete historical critical chain fails to match the current key frame, it means that the laser radar or robot arrives at the area for the first time, and there is no loop detection, but laser SLAM mapping is still performed. The current key frame is updated to the incomplete historical critical chain corresponding to the sub-area where the current key frame is located, or a new incomplete historical critical chain is created based on the current key frame, but the corresponding relationship is not constructed.
[0081] Through the above steps, the loop detection method of the present embodiment divides the target area into multiple sub-areas based on the area size of a single loop detection before laser SLAM mapping, and determines the position information of each sub-area by constructing a coordinate system, so that the sub-area corresponding to the current key frame can be directly determined based on the position information of the current key frame, that is, without performing additional operations on the point cloud data, it can be quickly located in the sub-area corresponding to the size of the loop detection area, reducing the time of matching with irrelevant key frame data, simplifying the complexity of loop detection, and improving the efficiency and real-time performance of loop detection. The present embodiment greatly reduces the mismatch rate of loop detection through the division and positioning of sub-areas, and the point cloud data of similar areas will not enter the loop detection process and match the current key frame because of the limitation of the sub-area. The present embodiment uses the multiple complete historical key chains existing in the sub-area corresponding to the current key frame to match the current key frame with the complete historical key chain closest to the current key frame time, and can use the complete historical key chain closest to the time to reduce the repeated matching of the current key frame and the similar historical key frame under the sub-area, saving the time of loop detection, and improving the real-time performance of loop detection. And by matching at least one complete historical key chain closest to the current key frame time among the multiple complete historical key chains with corresponding relationships with the current key frame, a larger closed loop can be formed with the multiple complete historical key chains with corresponding relationships, thereby improving the accuracy of loop detection. And this embodiment also makes appropriate adjustments based on the presence or absence of a complete historical key chain in the sub-region where the current key frame is located, so as to take into account the situation where there is an error in the position information of the current key frame, and expand the matching range by using the sub-region adjacent to the sub-region where the current key frame is located as the sub-region corresponding to the current key frame, so as to avoid the situation where inaccurate matching occurs due to errors in the position information of the current key frame, thereby improving the robustness and reliability of loop detection.
[0082] Based on the same inventive concept, the present invention also proposes an electronic device, which can be executed to implement the loop detection method of any of the above embodiments. Figure 4 , Figure 4 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. The electronic device includes a processor 41 and a memory 42.
[0083] The processor 41 is used to execute the program instructions stored in the memory 42 to implement the steps of any of the above loop detection method embodiments or image loop detection method embodiments. In a specific implementation scenario, the electronic device may include but is not limited to: a microcomputer, a server, and in addition, the electronic device may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.
[0084] Specifically, the processor 41 is used to control itself and the memory 42 to implement the steps of any of the above embodiments. The processor 41 can also be called a CPU (Central Processing Unit). The processor 41 may be an integrated circuit chip with signal processing capabilities. The processor 41 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 41 can be implemented by an integrated circuit chip.
[0085] The above scheme can ensure the accuracy of loop detection while ensuring the real-time performance of loop detection.
[0086] Based on the same inventive concept, the present invention also proposes a computer-readable storage medium, see Figure 5 , Figure 5 1 is a schematic diagram of the structure of an embodiment of a computer-readable storage medium provided by the present invention. The computer-readable storage medium 50 stores at least one program data 51, and the program data 51 is used to implement any of the above methods. In one embodiment, the computer-readable storage medium 50 includes: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0087] In the several embodiments provided by the present invention, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0088] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0089] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0090] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium.
[0091] The above description is only an implementation mode of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A loop detection method, characterized in that: include: Obtaining the current key frame of the point cloud data and the position information of the current key frame; Determining a sub-region corresponding to the current key frame based on the position information of the current key frame, wherein the sub-region is obtained by dividing the target region; In response to the existence of a complete historical key chain in the sub-region corresponding to the current key frame, matching the complete historical key chain with the current key frame; wherein the complete historical key chain is composed of at least one continuous historical key frame; In response to the current key frame successfully matching the complete historical key chain, determining that the loop detection is successful; In response to the existence of a complete historical key chain in the sub-region corresponding to the current key frame, matching the complete historical key chain with the current key frame includes: In response to the existence of multiple complete historical key chains in the sub-region corresponding to the current key frame, a complete historical key chain closest in time to the current key frame among the multiple complete historical key chains is matched with the current key frame to perform loop detection; There is a corresponding relationship between the multiple complete historical key chains, and the corresponding relationship is constructed after the multiple complete historical key chains are successfully matched.
2. The loop detection method according to claim 1, characterized in that: The matching of the complete historical key chain with the current key frame includes: A local map of the sub-area is constructed based on the point cloud data corresponding to each historical key frame in the complete historical key chain, and the local map is matched with the point cloud data corresponding to the current key frame.
3. The loop detection method according to claim 2, characterized in that: The point cloud data corresponding to the local map and the current key frame includes: Respectively comparing the coordinates of each point of the point cloud data corresponding to the current key frame with the coordinates of each point of the point cloud data corresponding to the local map; In response to the coincidence between the point coordinates of the point cloud data corresponding to the current key frame and the point coordinates of the point cloud data of the local map exceeding a preset threshold, it is determined that the complete historical key chain is successfully matched with the current key frame.
4. The loop detection method according to claim 1, characterized in that: In response to the sub-region corresponding to the current key frame having multiple complete historical key chains, matching a complete historical key chain closest to the current key frame in time among the multiple complete historical key chains with the current key frame to perform loop detection, including: In response to at least one corresponding relationship between the plurality of complete historical key chains, at least one complete historical key chain corresponding to each corresponding relationship and closest to the current key frame in time is matched with the current key frame respectively; In response to the complete historical key chain successfully matching the current key frame, determining that the loop detection is successful includes: In response to the current key frame successfully matching the complete historical key chain, a corresponding relationship between the current key frame and the complete historical key chain is constructed.
5. The loop detection method according to claim 1, characterized in that: In response to the current key frame successfully matching the complete historical key chain, determining that the loop detection is successful includes: In response to the complete historical key chain successfully matching the current key frame, the position information of the current key frame is updated based on the position information corresponding to the complete historical key chain.
6. The loop detection method according to claim 1 or 5, characterized in that: In response to the current key frame successfully matching the complete historical key chain, determining that the loop detection is successful, further comprising: In response to the presence of an incomplete historical key chain in the sub-region corresponding to the complete historical key chain successfully matched with the current key frame, merging the current key frame into the incomplete historical key chain; In response to the fact that there is no incomplete historical key chain in the sub-region corresponding to the complete historical key chain that successfully matches the current key frame, a new incomplete historical key chain corresponding to the sub-region is created based on the current key frame.
7. The loop detection method according to claim 1, characterized in that: The sub-areas are obtained by dividing the target area, including: Dividing the target area based on the area size of a single loop detection to obtain a plurality of sub-areas arranged in an array; and Determining location information of each of the sub-areas; The step of determining the sub-region corresponding to the current key frame based on the position information of the current key frame comprises: The sub-region corresponding to the current key frame is determined based on the position information of the current key frame and the position information of each of the sub-regions.
8. The loop detection method according to claim 1 or 7, characterized in that: The determining the sub-region corresponding to the current key frame based on the position information of the current key frame includes: Determine the sub-region where the current key frame is located based on the position information of the current key frame; In response to the existence of the complete historical key chain in the sub-region where the current key frame is located, taking the sub-region where the current key frame is located as the sub-region corresponding to the current key frame; In response to the fact that the complete historical key chain does not exist in the sub-region where the current key frame is located, a sub-region adjacent to the sub-region where the current key frame is located is obtained, and the sub-region adjacent to the sub-region where the current key frame is located is used as the sub-region corresponding to the current key frame.
9. The loop detection method according to claim 8, characterized in that: The determining the sub-region where the current key frame is located based on the position information of the current key frame further includes: In response to the sub-region where the current key frame is located being different from the sub-region where the previous key frame is located, the previous key frame is determined as the last frame of the incomplete historical key chain corresponding to the sub-region where the previous key frame is located, so as to obtain the complete historical key chain of the sub-region where the previous key frame is located.
10. The loop detection method according to claim 8, characterized in that: The loop detection method further includes: In response to the sub-region corresponding to the current key frame not having a complete historical key chain, or the sub-region corresponding to the current key frame having a complete historical key chain and the complete historical key chain failing to match the current key frame, the loop detection fails; The current key frame is updated to the incomplete historical key chain corresponding to the sub-region where the current key frame is located, or a new incomplete historical key chain is created based on the current key frame.
11. An electronic device, characterized in that: The electronic device comprises: a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the loop detection method according to any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program data, and the program data can be executed to implement the loop detection method according to any one of claims 1 to 10.
