A laser SLAM global positioning method and device based on invariant moment
By using invariant moment feature matching in laser SLAM, the problems of slow global positioning speed and insufficient stability of laser SLAM are solved, and fast and stable positioning is achieved.
Patent Information
- Application Number
- CN202410972519.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2044-07-19
AI Technical Summary
Existing laser SLAM global positioning methods are computationally intensive and time-consuming in large-area environments, and rely on environmental markers or local feature matching, resulting in insufficient positioning stability.
By utilizing the rotation, translation and scale change invariance of the invariant moment, the invariant moment features of the laser SLAM grid map nodes are extracted. By matching the invariant moment features of the real-time lidar point cloud with the grid map node features, the real-time position of the lidar in the map is determined.
It speeds up global positioning, improves positioning stability and accuracy, and reduces computational complexity.
Smart Images

Figure CN118918187B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of robot autonomous positioning and navigation technology, and more specifically, relates to a laser SLAM global positioning method and device based on invariant moment. Background Art
[0002] Simultaneous Localization and Mapping (SLAM) technology has been widely used in unmanned driving, robotics, drones, augmented reality and other fields. The robot obtains information about the surrounding environment and constructs an environmental map through its own sensors such as lidar and IMU. During actual positioning and navigation, the robot estimates its own position and posture by collecting data from sensors such as lidar and IMU in real time and matching it with the environmental map. This is the basis for the robot to achieve positioning and navigation. However, when the robot is operating in a large area environment, the environmental map constructed is large in scale. If the robot is positioned in this environment and there is no initial positioning reference value, it is necessary to perform global matching positioning under the map, which usually requires a large amount of calculation, so global positioning takes a long time. How to quickly and accurately perform global matching positioning on the map is a technical problem that needs to be solved urgently in this field.
[0003] In the prior art, by arranging visual tags in the environment, based on mainstream SLAM, the robot's position within the operating environment is determined by detecting and calculating visual tags randomly distributed throughout the space. This effectively solves the problem of slow SLAM global positioning. However, this requires additional deployment of visual tags in the environment and the addition of visual sensors to the robot body for identification, which makes the implementation process complex and costly. In the prior art, a raster map obtained by a laser SLAM algorithm can also be used to extract geometric features in the environment, including using the endpoints and corners of obstacles in the environment as map nodes and the distances between nodes as an adjacency matrix to establish a topological map of the environment's geometric features. By extracting the key points and geometric information of obstacles in the current laser data, data association matching is performed with the topological map of the environment's geometric features to obtain map nodes corresponding to the key points. The positioning process is accelerated by matching the geometric information with the node matching. This method can reduce the amount of global positioning matching computation and reduce the time consumed by global positioning. However, by only utilizing local features of the environment, it is difficult to ensure the reliability of the matching results during global positioning. In existing technologies, it is also possible to construct a global coordinate system of reflectors and a SLAM feature information library by rationally placing reflectors in the environment while building a SLAM grid map. The robot then uses a lidar to scan the surrounding environment, obtaining the local position information of the reflectors and the SLAM local map. If positioning is lost, the global coordinate position can be calculated based on the reflector position. This method uses reflector information for global positioning, which can improve positioning speed, but the deployment of reflectors adds additional workload.
[0004] The above method solves the problem of slow global positioning speed of laser SLAM to a certain extent, but it needs to rely on markers in the environment, or only uses the matching of local features to achieve positioning, thereby reducing the amount of calculation, and stability is difficult to guarantee. Summary of the Invention
[0005] In response to the defects of the existing technology, the purpose of this application is to achieve the goal of accelerating the global positioning speed of laser SLAM while improving positioning stability. The core of the method is to utilize the characteristics of invariants (Invariants Moment) that are invariant to rotation, translation and scale changes and can highly condense the global features of the image, extract the invariants of the moments of each node in the laser SLAM grid map, and during positioning matching, extract the invariants of the lidar point cloud and match them with the invariants of the moments of the grid map nodes. While speeding up the calculation speed, the global features are also taken into account, thereby improving stability.
[0006] To achieve the above objectives, in a first aspect, the present application provides a laser SLAM global positioning method based on invariant moments, comprising:
[0007] Based on the binarized image corresponding to the real-time lidar point cloud, the invariant moment features of the binarized image are extracted to obtain the invariant moment value group corresponding to the real-time lidar point cloud;
[0008] Analyze the similarity between the invariant moment value group corresponding to the real-time lidar point cloud and the invariant moment value group corresponding to each pixel in the binary map image, and determine the pixel corresponding to the maximum similarity;
[0009] Determine the real-time position of the lidar in the map based on the position of the pixel point corresponding to the maximum similarity in the binary map image;
[0010] Among them, the invariant moment value group corresponding to each pixel point in the binary map image is obtained by converting the two-dimensional lidar point cloud map into a binary map image and extracting the invariant moment features of the local perspective at each pixel point in the binary map image.
[0011] In one possible implementation, the invariant moment value group corresponding to each pixel point in the binary map image is obtained by the following steps:
[0012] Based on the two-dimensional lidar point cloud map, binarization and dimensionality reduction processing are performed to obtain a binary map image after dimensionality reduction;
[0013] Traverse each pixel point in the binary map image after dimensionality reduction to obtain the local perspective map corresponding to each pixel point;
[0014] Based on the local perspective map corresponding to each pixel point, the invariant moment value group corresponding to each pixel point is obtained by solving the invariant moment of the local perspective map.
[0015] In one possible implementation, binarization and dimensionality reduction processing are performed based on the two-dimensional lidar point cloud map to obtain a binary map image after dimensionality reduction, including:
[0016] Based on the two-dimensional lidar point cloud map, the map image is binarized to obtain a binary map image. In the binarization process, one value indicates the presence of an obstacle and the other value indicates the absence of an obstacle.
[0017] The binary map image is dimensionality reduced according to a preset dimensionality reduction multiple to obtain a binary map image after dimensionality reduction.
[0018] In a possible implementation, the two-dimensional lidar point cloud map is a grid map, and the state of a grid in the two-dimensional lidar point cloud map is any one of the following states: an occupied state indicating that the grid is occupied by an obstacle, an idle state indicating that the grid is not occupied by an obstacle, and an unknown state indicating that it is unknown whether the grid is occupied by an obstacle;
[0019] Based on the two-dimensional lidar point cloud map, the map image is binarized to obtain a binary map image, including:
[0020] Based on the status of each grid in the two-dimensional lidar point cloud map, a grayscale image is obtained. In the grayscale image, black pixels indicate that the corresponding position is occupied by an obstacle, white pixels indicate that the corresponding position is not occupied by an obstacle, and gray pixels indicate that whether the corresponding position is occupied by an obstacle is unknown. The grayscale value of black pixels is 0, the grayscale value of white pixels is 255, and the grayscale value of gray pixels is 128.
[0021] Adjust the gray pixels in the grayscale image to white pixels;
[0022] The adjusted grayscale image is determined as a binary map image.
[0023] In a possible implementation, reducing the dimension of the binary map image according to a preset dimensionality reduction factor to obtain the binary map image after dimensionality reduction includes:
[0024] Determining the length and width of the sliding window to be a preset dimensionality reduction multiple and determining the sliding step of the sliding window to be the preset dimensionality reduction multiple, the sliding window is used to select some pixels in the binary map image and determine the minimum grayscale value of the selected pixels;
[0025] According to the sliding step size and the preset traversal order, the binary map image is traversed through the sliding window to obtain the minimum grayscale value of the pixel points selected by the sliding window before the first sliding and the minimum grayscale value of the pixel points selected by the sliding window after each sliding;
[0026] According to the preset traversal order, each minimum grayscale value is filled into the preset binary image to obtain the binary map image after dimensionality reduction. The ratio between the width and height of the binary map image before dimensionality reduction and the width and height of the preset binary image is the preset dimensionality reduction multiple.
[0027] In one possible implementation, each pixel in the binary map image after dimensionality reduction is traversed to obtain a local view map corresponding to each pixel, including performing the following operations on each traversed pixel:
[0028] Based on the binary map image after dimensionality reduction, the area around the pixel point is scanned to determine the obstacle distribution in the area around the pixel point. The size of the surrounding area is determined based on the laser radar scanning distance.
[0029] Based on the obstacle distribution in the surrounding area of the pixel, the local view map corresponding to the pixel is determined.
[0030] In one possible implementation, the invariant moment value group includes three invariant moment values. Based on the local view map corresponding to each pixel point, the invariant moment value group corresponding to each pixel point is obtained by solving the invariant moment of the local view map, including:
[0031] Based on the local view map corresponding to each pixel point, solve the 0th to 3rd order geometric moments corresponding to each pixel point;
[0032] Based on the 0th to 3rd order geometric moments corresponding to each pixel point, solve the 0th to 3rd order central moments corresponding to each pixel point;
[0033] Based on the 0th to 3rd order central moments corresponding to each pixel point, solve the 2nd order normalized central moment and 3rd order normalized central moment corresponding to each pixel point;
[0034] Based on the second-order normalized central moment and the third-order normalized central moment corresponding to each pixel point, three invariant moment values corresponding to each pixel point are constructed.
[0035] In a second aspect, the present application provides a laser SLAM global positioning device based on invariant moments, comprising:
[0036] The invariant moment feature extraction module is used to extract the invariant moment features of the binary image corresponding to the real-time lidar point cloud based on the binary image, and obtain the invariant moment value group corresponding to the real-time lidar point cloud;
[0037] The similarity analysis module is used to analyze the similarity between the invariant moment value group corresponding to the real-time lidar point cloud and the invariant moment value group corresponding to each pixel in the binary map image, and determine the pixel corresponding to the maximum similarity;
[0038] A real-time position determination module is used to determine the real-time position of the lidar in the map based on the position of the pixel point corresponding to the maximum similarity in the binary map image;
[0039] Among them, the invariant moment value group corresponding to each pixel point in the binary map image is obtained by converting the two-dimensional lidar point cloud map into a binary map image and extracting the invariant moment features of the local perspective at each pixel point in the binary map image.
[0040] In a third aspect, the present application provides an electronic device comprising: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method described in the first aspect or any possible implementation of the first aspect.
[0041] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method described in the first aspect or any possible implementation of the first aspect.
[0042] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0043] In general, the above technical solutions conceived by this application have the following beneficial effects compared with the existing technologies:
[0044] By utilizing the characteristics of invariant moments that are invariant to rotation, translation and scale changes and can highly condensely represent the global features of the image, by converting the two-dimensional lidar point cloud map (also known as the laser SLAM grid map) into a binary map image and extracting the invariant moment features of the local perspective at each pixel point in the binary map image, the invariant moment value group corresponding to each pixel point in the binary map image can be obtained. The invariant moment features of the local perspective at the pixel point can characterize the invariant moment features of the corresponding node in the SLAM grid map. During positioning and matching, the invariant moment features of the real-time lidar point cloud (also known as the invariant moment value group corresponding to the real-time lidar point cloud) are extracted and matched with the invariant moment features of the grid map node (that is, similarity analysis). Based on the position of the pixel point corresponding to the maximum similarity in the binary map image, the real-time position of the lidar in the map is determined. This can speed up the calculation while also taking into account the global features, thereby improving positioning stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 This is one of the flow charts of the laser SLAM global positioning method based on invariant moments provided in an embodiment of the present application;
[0046] Figure 2 This is the second flow chart of the laser SLAM global positioning method based on invariant moments provided in an embodiment of the present application;
[0047] Figure 3 It is the original map image constructed by the test site provided in the embodiment of the present application;
[0048] Figure 4 The binary map image is obtained by binarizing the original map image provided in the embodiment of the present application;
[0049] Figure 5 This is a flowchart of positioning the laser radar point cloud and the map through invariant moment matching provided by an embodiment of the present application;
[0050] Figure 6This is a schematic diagram of similarity calculation results at each pixel point provided in an embodiment of the present application;
[0051] Figure 7 Schematic diagram of converting similarity into grayscale image display provided by an embodiment of the present application;
[0052] Figure 8 The original point cloud binary image and the local perspective map provided by the embodiment of the present application are Figure 2 Schematic diagram of value comparison;
[0053] Figure 9 This is a comparison chart of the computational complexity of the method provided in the embodiment of the present application and the AMCL algorithm;
[0054] Figure 10 Schematic diagram of the structure of a laser SLAM global positioning device based on invariant moments provided in an embodiment of the present application;
[0055] Figure 11 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0057] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0058] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more, for example, multiple processing units means two or more processing units, etc.; multiple elements means two or more elements, etc.
[0059] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application.
[0060] Figure 1 This is one of the flow charts of the laser SLAM global positioning method based on invariant moments provided in the embodiment of the present application, such as Figure 1 As shown, the execution subject of the method may be an electronic device, such as a robot or a server, etc. The method includes the following steps S101, S102 and S103.
[0061] Step S101 : based on the binarized image corresponding to the real-time lidar point cloud, extract the invariant moment features of the binarized image and obtain the invariant moment value group corresponding to the real-time lidar point cloud.
[0062] Step S102, analyzing the similarity between the invariant moment value group corresponding to the real-time lidar point cloud and the invariant moment value group corresponding to each pixel in the binary map image, and determining the pixel corresponding to the maximum similarity;
[0063] Among them, the invariant moment value group corresponding to each pixel point in the binary map image is obtained by converting the two-dimensional lidar point cloud map into a binary map image and extracting the invariant moment features of the local perspective at each pixel point in the binary map image.
[0064] Step S103: Determine the real-time position of the laser radar in the map based on the position of the pixel point corresponding to the maximum similarity in the binary map image.
[0065] It can be understood that by utilizing the characteristics of invariant moments that are invariant to rotation, translation and scale changes and can highly condensely represent the global features of the image, by converting the two-dimensional lidar point cloud map (that is, the laser SLAM grid map) into a binary map image and extracting the invariant moment features of the local perspective at each pixel point in the binary map image, the invariant moment value group corresponding to each pixel point in the binary map image can be obtained. The invariant moment features of the local perspective at the pixel point can characterize the invariant moment features of the corresponding node in the SLAM grid map. During positioning and matching, the invariant moment features of the real-time lidar point cloud (that is, the invariant moment value group corresponding to the real-time lidar point cloud) are extracted and matched with the invariant moment features of the grid map node (that is, similarity analysis). Based on the position of the pixel point corresponding to the maximum similarity in the binary map image, the real-time position of the lidar in the map is determined, which can speed up the calculation while taking into account the global features, thereby improving positioning stability.
[0066] In a possible implementation, the invariant moment value group corresponding to each pixel point in the binary map image is obtained by the following steps:
[0067] Based on the two-dimensional lidar point cloud map, binarization and dimensionality reduction processing are performed to obtain a binary map image after dimensionality reduction;
[0068] Traverse each pixel point in the binary map image after dimensionality reduction to obtain the local perspective map corresponding to each pixel point;
[0069] Based on the local perspective map corresponding to each pixel point, the invariant moment value group corresponding to each pixel point is obtained by solving the invariant moment of the local perspective map.
[0070] Optionally, the above-mentioned two-dimensional lidar point cloud map is subjected to binarization and dimensionality reduction processing to obtain a binary map image after dimensionality reduction, including:
[0071] Based on the two-dimensional lidar point cloud map, the map image is binarized to obtain a binary map image. In the binarization process, one value indicates the presence of an obstacle and the other value indicates the absence of an obstacle.
[0072] The binary map image is dimensionality reduced according to a preset dimensionality reduction multiple to obtain a binary map image after dimensionality reduction.
[0073] Optionally, the two-dimensional lidar point cloud map is a grid map, and the state of a grid in the two-dimensional lidar point cloud map is any one of the following states: an occupied state for indicating that the grid is occupied by an obstacle, an idle state for indicating that the grid is not occupied by an obstacle, and an unknown state for indicating that it is unknown whether the grid is occupied by an obstacle;
[0074] The above-mentioned two-dimensional lidar point cloud map is based on which the map image is binarized to obtain a binary map image, including:
[0075] Based on the status of each grid in the two-dimensional lidar point cloud map, a grayscale image is obtained. In the grayscale image, black pixels indicate that the corresponding position is occupied by an obstacle, white pixels indicate that the corresponding position is not occupied by an obstacle, and gray pixels indicate that whether the corresponding position is occupied by an obstacle is unknown. The grayscale value of black pixels is 0, the grayscale value of white pixels is 255, and the grayscale value of gray pixels is 128.
[0076] Adjust the gray pixels in the grayscale image to white pixels, that is, you can set the map threshold to 128, traverse each pixel in the grayscale image, if the grayscale value of the pixel is greater than or equal to the map threshold, then adjust the grayscale value of the pixel to 255, if the grayscale value of the pixel is less than the map threshold, then adjust the grayscale value of the pixel to 0;
[0077] The adjusted grayscale image is determined as a binary map image.
[0078] Optionally, the step of reducing the dimension of the binary map image according to a preset dimensionality reduction factor to obtain the binary map image after dimensionality reduction includes:
[0079] Determining the length and width of the sliding window to be a preset dimensionality reduction multiple and determining the sliding step of the sliding window to be the preset dimensionality reduction multiple, the sliding window is used to select some pixels in the binary map image and determine the minimum grayscale value of the selected pixels;
[0080] According to the sliding step size and the preset traversal order, the binary map image is traversed through the sliding window to obtain the minimum grayscale value of the pixel points selected by the sliding window before the first sliding and the minimum grayscale value of the pixel points selected by the sliding window after each sliding;
[0081] According to the preset traversal order, each minimum grayscale value is filled into the preset binary image to obtain the binary map image after dimensionality reduction. The ratio between the width and height of the binary map image before dimensionality reduction and the width and height of the preset binary image is the preset dimensionality reduction multiple.
[0082] For example, the preset traversal order may be to start traversing from the upper left corner of the binary map image, and traverse in order from left to right and from top to bottom until the traversal reaches the lower right corner of the binary map image; the preset traversal order may also be to start traversing from the lower right corner of the binary map image, and traverse in order from right to left and from bottom to top until the traversal reaches the upper left corner of the binary map image.
[0083] Optionally, the above traversing each pixel point in the binary map image after dimensionality reduction to obtain the local view map corresponding to each pixel point includes performing the following operations on each traversed pixel point:
[0084] Based on the binary map image after dimensionality reduction, the area around the pixel point is scanned to determine the obstacle distribution in the area around the pixel point. The size of the surrounding area is determined based on the laser radar scanning distance.
[0085] Based on the obstacle distribution in the surrounding area of the pixel, the local view map corresponding to the pixel is determined.
[0086] Optionally, the invariant moment value group includes 3 invariant moment values;
[0087] The above-mentioned local perspective map corresponding to each pixel point is based on the local perspective map, and the invariant moment value group corresponding to each pixel point is obtained by solving the invariant moment of the local perspective map, including: solving the 0th to 3rd order geometric moments corresponding to each pixel point based on the local perspective map corresponding to each pixel point; solving the 0th to 3rd order central moments corresponding to each pixel point based on the 0th to 3rd order geometric moments corresponding to each pixel point; solving the 2nd order normalized central moment and the 3rd order normalized central moment corresponding to each pixel point based on the 0th to 3rd order central moment corresponding to each pixel point; constructing the 3 invariant moment values corresponding to each pixel point based on the 2nd order normalized central moment and the 3rd order normalized central moment corresponding to each pixel point.
[0088] For example, Figure 2 This is the second flow chart of the laser SLAM global positioning method based on invariant moment provided in the embodiment of the present application, such as Figure 2 As shown, the method includes the following steps S201 to S206.
[0089] Step S201: construct a two-dimensional lidar point cloud map at the operating site and export the map into an image format.
[0090] Using sensor data such as lidar point clouds and inertial measurement units (IMUs) as input, a two-dimensional lidar point cloud map is constructed at the operating site. Typically, this constructed map is a grid map. A grid map has three specific states: "occupied" (indicates a grid is occupied by an obstacle), "free" (indicates a grid is not occupied by an obstacle), and "unknown" (indicates whether a grid is occupied by an obstacle is unknown).
[0091] Furthermore, the constructed point cloud map is converted into a grayscale image, which is denoted as M1. Figure 3 is the original map image built by the test site provided in the embodiment of the present application, such as Figure 3 As shown in the figure, after conversion to a grayscale image, the grid in the "occupied" state in the grid map corresponds to the black pixel in the grayscale image (the corresponding grayscale value is 0), the grid in the "idle" state corresponds to the white pixel in the grayscale image (the corresponding grayscale value is 255), and the grid in the "unknown" state corresponds to the gray pixel in the grayscale image (the corresponding grayscale value is 128).
[0092] Step S202: Binarize the map image according to the map threshold. After the binarization, the black areas in the image represent obstacles, and the white areas represent passable areas.
[0093] According to the construction map information, select the map threshold GV th =128, and binarize the grayscale image converted from the above point cloud map.
[0094] Specifically, the grayscale value is greater than or equal to GV th The pixels of GV are set to 255 (the gray value corresponding to the white pixel), which represents the passable area of the map; the gray value is less than GV th The pixels are set to 0 (the grayscale value corresponding to the black pixel), which represents the obstacles on the map.
[0095] Figure 4 The binary map image obtained by binarizing the original map image provided by the embodiment of the present application is as follows: Figure 4 As shown, the binarized image is denoted as M2.
[0096] Step S203 , selecting an appropriate scale according to the map size, and performing dimensionality reduction on the binary map image to reduce the amount of image processing operations.
[0097] The pixel coordinates of the original point cloud map usually correspond to 0.05m in the world coordinate system. When the site area is large, the map image resolution is high. For subsequent image processing, the calculation amount is too large and the calculation time is long. Image dimensionality reduction can effectively reduce the calculation amount.
[0098] Specifically, in a 25m×25m site, a map constructed with a resolution of 0.05m has an image size of 526×560 pixels. In order to reduce the amount of computation, the coefficient Q=6 (Q represents the multiple of dimensionality reduction) is selected to reduce the dimensionality of the image.
[0099] Specifically, a blank binary image M3 is constructed with image width: W = 526 / Q, image height: H = 560 / Q, rounded up, and the final image size is [88, 94]. The initial values of all image elements are assigned to 255.
[0100] Furthermore, the image M2 is traversed with a step size of 6, and the elements of M3 are assigned values according to the traversal results.
[0101] Specifically, let i = 0, j = 0 as the initial value, j increases from 0 to W-1, increasing by 1 each time, when j = W-1, let j = 0, i = i+1, when i = H-1, j = W-1, complete the traversal and assignment of all elements:
[0102] M3(i+1,j+1)=min(M2(i×6+1,j×6+1),...,M2(i×6+6,j×6+6));
[0103] For the purpose of taking the minimum value of min(), since the value corresponding to the black pixel in M2 is 0 (the minimum value of the possible values of 0 or 255 in the binary image M2), it means that there is an obstacle in the corresponding area on the map. During the traversal process, if a black pixel is encountered, it means that the area represented by the corresponding pixel in M3 is occupied by an obstacle. Therefore, by taking the minimum value, the corresponding pixel in M3 can be assigned a value of 0, indicating that there is an obstacle in the corresponding area on the map.
[0104] After the assignment is completed, the M3 binary image has a pixel value of 255 (white) representing the passable area of the map, and a pixel value of 0 (black) representing the obstacle on the map. After dimensionality reduction, the image pixel corresponds to 0.3m in the world coordinate system.
[0105] Step S204 , traverse the binary map image after dimensionality reduction, generate local view maps at all pixel points, and solve the invariant moment value group of the local view map, and save the result.
[0106] Load the aforementioned binary image M3 and obtain the image height and width [H, W].
[0107] Furthermore, a local perspective map invariant moment matrix A is constructed, and an invariant moment value group (including 3 invariant moment values) is used to match each element in the binary image M3. Therefore, the order of matrix A is W×H×3, and all elements of matrix A are initialized to 0.
[0108] Furthermore, let i=1, j=1 as index values to traverse M3 and assign values to the elements of the A matrix.
[0109] Furthermore, a blank image B is created, and the height and width of B are set to [H1, W1]. The height and width of B represent the size of the local perspective map of the pixel point in M3.
[0110] The lidar scanning distance is denoted as R, and the distance represented by the pixels of M3 in the world coordinate system is denoted as r. Then, the distance represented by R / r pixels in one direction in M3 is R. The local viewing angle of a pixel in M3 involves all directions, so the size of B is: H1 = 2 × R / r, W1 = 2 × R / r, and the calculated result is rounded up.
[0111] Furthermore, all elements of B are initially assigned a value of 255 (white, indicating the traversable area of the map).
[0112] Furthermore, let m=1, n=1 as index values to traverse B.
[0113] Calculate the angular resolution: σ = arctan(r / R).
[0114] Let the starting angle θ0 = 0, the starting distance L0 = 0, the traversal step length be r, and scan and traverse from distance 0 to R with r as the step length.
[0115] Let m = L0 × sinθ0 / r, n = L0 × cosθ0 / r, and round up the result.
[0116] If the conditions m+H1 / 2<0, or m+H1 / 2>H1, or n+W1 / 2<0, or n+W1 / 2>W1 are met, that is, the index exceeds the limit, the value is skipped.
[0117] In addition, if the conditions i+m>0, i+m≤H, j+n>0, and j+n≤W are met, extract the value of the element at M3(i+m,j+n), recorded as s. If s=0, indicating that the current scanning angle has encountered an obstacle, then set: B(m+H1 / 2,n+W1 / 2)=0. If s>0, indicating that the current scanning angle has not encountered an obstacle, then set: L0=L0+r, and continue searching further along the current scanning angle until an obstacle is encountered. Or when L0>R, that is, the scanning distance has exceeded the lidar scanning distance, the current angle traversal ends, and the corresponding position B element value is not assigned, and the default value is used.
[0118] Furthermore, after completing the traversal at the current angle θ0, let: θ0 = θ0 + σ, and repeat the above scanning traversal process again with the new angle θ0 until θ0 ≥ 2×π. At this time, a full circle of scanning traversal is completed, and the solved image B is the local perspective map at the element M3(i, j).
[0119] Furthermore, the three invariant moment values are solved for the local view map B. Before solving the invariant moments, the element values of B are normalized, and let: That is, the elements in B that are greater than 0 are assigned a value of 0, and the elements that were originally zero are assigned a value of 1. It can be understood that the black pixels in the local view map B (whose pixel value is 0) are the feature points that need to be paid attention to in the process of solving the invariant moment. In the normalization process, the value of the feature points needs to be assigned to 1. Therefore, the elements in the local view map B that were originally zero are assigned a value of 1, and the elements in the local view map B that are greater than 0 (white pixels) are assigned a value of 0.
[0120] (1) Solve the geometric moments of order 0 to 3 of B and then obtain the central moment.
[0121] To solve the 0th order geometric moment, let:
[0122] To solve the first-order geometric moment, let:
[0123] To solve the second-order geometric moment, let:
[0124] To solve the third-order geometric moment, let:
[0125] (2) According to the solved geometric moment, solve the 0th to 3rd order central moments to eliminate the influence of translation on feature extraction. To simplify the representation, first let: μ 10 =M 10 / M 00 , μ 01 =M 01 / M 00 .
[0126] To solve the 0th order central moment, let: Y 00 =M 00 .
[0127] To solve the first-order central moment, let: Y 10 =0, Y 01 =0.
[0128] To solve the second-order central moment, let: Y 20 =M 20 -μ 10 ×M 10 , Y11 =M 11 -μ 01 ×M 10 , Y 02 =M 02 -μ 01 ×M 01 .
[0129] To solve the third-order central moment, let:
[0130]
[0131] (3) Solve the second-order and third-order normalized central moments to eliminate the influence of rotation on feature extraction, and let:
[0132]
[0133] (4) Based on the normalized central moment, construct three invariant moment values, let:
[0134]
[0135] Construct the three invariant moment values of B (E B1 ,E B2 ,E B3 ), (E B1 ,E B2 ,E B3 ) is assigned to the (i, j)th element of the invariant moment matrix A to save the result.
[0136] Furthermore, let j=j+1, create a blank image B again, and solve the local viewing angle map at the next pixel, and so on until j=W.
[0137] Further, let i=i+1,j=j+1, and continue the above process until i=H,j=W, and the solution is completed. Figure 5 This is a flowchart of positioning the laser radar point cloud and the map through invariant moment matching provided by the embodiment of the present application. The solution process is as follows: Figure 5 shown.
[0138] Step S205 , obtaining a real-time laser radar point cloud, converting it into a binary image through computational processing, and solving a set of invariant moment values of the binary image.
[0139] Load the LiDAR point cloud data. Since point cloud data is generally in the format of angle + distance (θ, D), it needs to be converted into points in a rectangular coordinate system.
[0140] According to the number of point clouds N, construct arrays X and Y, whose size is N.
[0141] Furthermore, let: X i =cosθi ×D i , Y i = sinθ i ×D i , where i∈[1,N].
[0142] Furthermore, let: X max =max(X),X min =min(X),Y max =max(Y),Y min =min(Y) to get the minimum and maximum values of X and Y.
[0143] Furthermore, a point cloud image G is constructed, whose size is (m,n), where n=(X max -X min ) / r,m=(Y max -Y min ) / r, the result is rounded up, r is the distance represented by the pixel in world coordinates, and all elements of G are initialized to 0.
[0144] Furthermore, traverse the point cloud data, let k∈[1,N], take the initial value k=1, and the index (i,j) of the kth point in the point cloud image G is: i=(X k -X min ) / r,j=(Y k -Y min ) / r, rounding the result upwards. After calculating the index value, assign 1 to the corresponding element (indicating the presence of an obstacle), setting G(i, j) = 1. Then set k = k + 1 and calculate the index value again until k = N. The resulting point cloud image G is the binary image corresponding to the lidar point cloud.
[0145] Furthermore, we can solve the three invariant moment values of G (E G1 ,E G2 ,E G3 ), which is the same as the process of solving the three invariant moments of B, and will not be repeated here.
[0146] Step S206, calculate the similarity between the invariant moment value group of the real-time lidar point cloud and the invariant moment value group of the local perspective map of all pixels in the map image, and the pixel corresponding to the maximum similarity is the position of the lidar in the map.
[0147] The three invariant moment values (E G1 ,E G2 ,E G3 ), and the ground Figure 2 The elements of the local view map invariant moment matrix A of the value image M3 are compared to calculate the similarity.
[0148] Specifically, construct a similarity matrix S with a size of (W, H). First, let i = 1, j = 1, and extract the three invariant moment values (A(i, j, 1), A(i, j, 2), and A(i, j, 3)) corresponding to the element A(i, j).
[0149] Further, solve (E G1 ,E G2 ,E G3 ) and (A(i,j,1),A(i,j,2),A(i,j,3)), the similarity is defined as:
[0150]
[0151] Let j = j + 1, and continue to solve the invariant moment value corresponding to the next element of A and (E G1 ,E G2 ,E G3 ), and so on, until j = W. Further, let i = i + 1, j = 1, and repeat the solution until i = H, j = W. Figure 6 Schematic diagram of similarity calculation results at each pixel point provided in an embodiment of the present application.
[0152] After completing the solution of the similarity matrix S, find the row and column index value of the maximum similarity value. In theory, this index value is the pixel coordinate obtained by matching the lidar point cloud with the binary image M3. After the coordinate system correspondence relationship between the pixel coordinates and the world coordinates is converted, the world coordinates of the lidar point cloud under the map can be obtained.
[0153] Specifically, first traverse the matrix S and calculate the maximum element value S of the matrix S max .
[0154] Furthermore, obtain S max The element index at the position is recorded as (i max ,j max ).
[0155] Furthermore, solve the world coordinates of the point cloud under the map: (i max ×r+T x ,j max ×r+T y ), where r is the distance represented by the pixel in world coordinates, (T x ,T y ) is the world coordinate corresponding to the image origin.
[0156] In order to intuitively demonstrate the role of the solved similarity matrix S, all element values of S are renormalized by a threshold of 0.9 and then converted into a grayscale image. Figure 7This is a schematic diagram of converting similarity into grayscale display provided by the embodiment of the present application, such as Figure 7 As shown, the marked point is the location of the maximum similarity value.
[0157] Furthermore, the local view map at the location of the maximum similarity value is extracted and visualized, and compared with the original point cloud map. Figure 8 The original point cloud binary image and the local perspective map provided by the embodiment of the present application are Figure 2 Schematic diagram of value comparison, such as Figure 8 As shown, the overall characteristics of the two are consistent.
[0158] Taking the mainstream SLAM algorithm AMCL (Adaptive Monte Carlo Localization) as an example, N represents the number of grid map nodes, and the computational complexity of the AMCL algorithm is approximately O(N 2 ), while the computational complexity of the method proposed in the present invention is approximately O(N). Figure 9 This is a comparison chart of the computational complexity of the method provided in the embodiment of the present application and the AMCL algorithm, as shown in FIG. Figure 9 As shown in the figure, by comparing the AMCL algorithm and the method proposed in the present invention, the computational complexity changes when the number of map nodes increases. It can be seen that the computational complexity of the method proposed in the present invention is lower than that of the AMCL algorithm, and the advantage becomes greater as the number of map nodes increases.
[0159] The following describes the laser SLAM global positioning device based on invariant moments provided by the present application. The laser SLAM global positioning device based on invariant moments described below and the laser SLAM global positioning method based on invariant moments described above can refer to each other.
[0160] Figure 10 Schematic diagram of the structure of the laser SLAM global positioning device based on invariant moment provided in the embodiment of the present application. Figure 10 As shown, the device includes: an invariant moment feature extraction module 10, a similarity analysis module 20 and a real-time position determination module 30. Among them:
[0161] The invariant moment feature extraction module 10 is used to extract the invariant moment features of the binary image based on the binary image corresponding to the real-time laser radar point cloud, and obtain the invariant moment value group corresponding to the real-time laser radar point cloud;
[0162] A similarity analysis module 20 is used to analyze the similarity between the invariant moment value group corresponding to the real-time lidar point cloud and the invariant moment value group corresponding to each pixel in the binary map image, and determine the pixel corresponding to the maximum similarity;
[0163] A real-time position determination module 30 is used to determine the real-time position of the laser radar in the map based on the position of the pixel point corresponding to the maximum similarity in the binary map image;
[0164] Among them, the invariant moment value group corresponding to each pixel point in the binary map image is obtained by converting the two-dimensional lidar point cloud map into a binary map image and extracting the invariant moment features of the local perspective at each pixel point in the binary map image.
[0165] It is understandable that the detailed functional implementation of each of the above units / modules can be found in the introduction of the aforementioned method embodiment, and will not be repeated here.
[0166] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment. The implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method and will not be repeated here.
[0167] Based on the method in the above embodiment, an embodiment of the present application provides an electronic device, Figure 11 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 11 As shown, the electronic device may include: a processor (Processor) 810, a communication interface (Communications Interface) 820, a memory (Memory) 830 and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 can call the logic instructions in the memory 830 to execute the method in the above embodiment.
[0168] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application.
[0169] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.
[0170] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method in the above embodiment.
[0171] It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0172] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0173] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted via the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0174] It will be understood that the various numerical numbers involved in the embodiments of the present application are merely distinctions for the convenience of description and are not intended to limit the scope of the embodiments of the present application.
[0175] It is easy for those skilled in the art to understand that the above is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. A laser SLAM global positioning method based on invariant moments, characterized in that: include: Based on the binarized image corresponding to the real-time laser radar point cloud, extracting the invariant moment features of the binarized image, and obtaining the invariant moment value group corresponding to the real-time laser radar point cloud; Analyze the similarity between the invariant moment value group corresponding to the real-time lidar point cloud and the invariant moment value group corresponding to each pixel point in the binary map image, and determine the pixel point corresponding to the maximum similarity; Determining the real-time position of the laser radar in the map based on the position of the pixel point corresponding to the maximum similarity in the binary map image; Among them, the invariant moment value group corresponding to each pixel point in the binary map image is obtained by converting the two-dimensional lidar point cloud map into a binary map image and extracting the invariant moment features of the local perspective at each pixel point in the binary map image.
2. The laser SLAM global positioning method based on invariant moments according to claim 1, characterized in that: The invariant moment value group corresponding to each pixel point in the binary map image is obtained by the following steps: Based on the two-dimensional lidar point cloud map, binarization and dimensionality reduction processing are performed to obtain a binary map image after dimensionality reduction; Traversing each pixel point in the binary map image after dimensionality reduction to obtain a local perspective map corresponding to each pixel point; Based on the local perspective map corresponding to each pixel point, the invariant moment value group corresponding to each pixel point is obtained by solving the invariant moment of the local perspective map.
3. The laser SLAM global positioning method based on invariant moments according to claim 2, characterized in that: The step of performing binarization and dimensionality reduction processing based on the two-dimensional laser radar point cloud map to obtain a binary map image after dimensionality reduction includes: Based on the two-dimensional laser radar point cloud map, a map image is binarized to obtain a binary map image, wherein one value in the binarization process indicates the presence of an obstacle and the other value indicates the absence of an obstacle; The binary map image is subjected to dimensionality reduction according to a preset dimensionality reduction multiple to obtain the binary map image after dimensionality reduction.
4. The laser SLAM global positioning method based on invariant moments according to claim 3, characterized in that: The two-dimensional lidar point cloud map is a grid map, and the state of the grid in the two-dimensional lidar point cloud map is any one of the following states: an occupied state for indicating that the grid is occupied by an obstacle, an idle state for indicating that the grid is not occupied by an obstacle, and an unknown state for indicating that it is unknown whether the grid is occupied by an obstacle; The step of performing binarization processing on the map image based on the two-dimensional laser radar point cloud map to obtain a binarized map image includes: Based on the status of each grid in the two-dimensional lidar point cloud map, a grayscale image is obtained, wherein a black pixel in the grayscale image indicates that the corresponding position is occupied by an obstacle, a white pixel indicates that the corresponding position is not occupied by an obstacle, and a gray pixel indicates that whether the corresponding position is occupied by an obstacle is unknown. The grayscale value of the black pixel is 0, the grayscale value of the white pixel is 255, and the grayscale value of the gray pixel is 128; Adjust the gray pixels in the grayscale image to white pixels; The adjusted grayscale image is determined as a binary map image.
5. The laser SLAM global positioning method based on invariant moments according to claim 4, characterized in that: The step of reducing the dimension of the binary map image according to a preset dimensionality reduction multiple to obtain the binary map image after the dimensionality reduction includes: Determining the length and width of a sliding window to be a preset dimensionality reduction multiple and determining the sliding step length of the sliding window to be the preset dimensionality reduction multiple, the sliding window being used to select a portion of pixels in the binary map image and determining the minimum grayscale value of the selected pixels; Traversing the binary map image through the sliding window according to the sliding step size and the preset traversal order, obtaining the minimum grayscale value of the pixel points selected by the sliding window before the first sliding and the minimum grayscale value of the pixel points selected by the sliding window after each sliding; According to the preset traversal order, each minimum grayscale value is filled into the preset binary image to obtain the binary map image after dimensionality reduction, and the ratio between the width and height of the binary map image before dimensionality reduction and the width and height of the preset binary image is the preset dimensionality reduction multiple.
6. The laser SLAM global positioning method based on invariant moments according to claim 2, characterized in that: The traversing each pixel point in the binary map image after dimensionality reduction to obtain the local perspective map corresponding to each pixel point includes performing the following operations on each traversed pixel point: Based on the binary map image after dimensionality reduction, scanning the surrounding area of the pixel point to determine the obstacle distribution in the surrounding area of the pixel point, wherein the size of the surrounding area is determined based on the laser radar scanning distance; Based on the obstacle distribution in the surrounding area of the pixel, the local view map corresponding to the pixel is determined.
7. The laser SLAM global positioning method based on invariant moments according to claim 2, characterized in that: The invariant moment value group includes three invariant moment values. The invariant moment value group corresponding to each pixel point is obtained by solving the invariant moment of the local perspective map based on the local perspective map, including: Based on the local view map corresponding to each pixel point, solve the 0th to 3rd order geometric moments corresponding to each pixel point; Based on the 0th to 3rd order geometric moments corresponding to each pixel point, solve the 0th to 3rd order central moments corresponding to each pixel point; Based on the 0th to 3rd order central moments corresponding to each pixel point, solve the 2nd order normalized central moment and 3rd order normalized central moment corresponding to each pixel point; Based on the second-order normalized central moment and the third-order normalized central moment corresponding to each pixel point, three invariant moment values corresponding to each pixel point are constructed.
8. A laser SLAM global positioning device based on invariant moment, characterized in that: include: An invariant moment feature extraction module is used to extract the invariant moment features of the binary image based on the binary image corresponding to the real-time laser radar point cloud, and obtain the invariant moment value group corresponding to the real-time laser radar point cloud; A similarity analysis module is used to analyze the similarity between the invariant moment value group corresponding to the real-time lidar point cloud and the invariant moment value group corresponding to each pixel in the binary map image, and determine the pixel corresponding to the maximum similarity; A real-time position determination module, configured to determine the real-time position of the laser radar in the map based on the position of the pixel point corresponding to the maximum similarity in the binary map image; Among them, the invariant moment value group corresponding to each pixel point in the binary map image is obtained by converting the two-dimensional lidar point cloud map into a binary map image and extracting the invariant moment features of the local perspective at each pixel point in the binary map image.
9. An electronic device, characterized in that: include: at least one memory for storing a computer program; At least one processor is used to execute the program stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed on a processor, the processor is caused to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Visual position method in nursing robot system
CN108061553A
Target identification method and device based on unmanned aerial vehicle, unmanned aerial vehicle and storage medium
CN116597333A