Laser SLAM global positioning method and device based on invariant moment
By extracting and matching the invariant moment characteristics of laser SLAM raster map and lidar point cloud, the problems of slow global positioning speed and poor stability of laser SLAM are solved, and fast and reliable positioning matching is achieved.
Patent Information
- Application Number
- CN202410972519.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-07-19
AI Technical Summary
The prior art is slow in the global positioning of laser SLAM and the stability is difficult to guarantee, especially when the initial positioning reference value is lacking in large-area environments, global matching positioning of maps is required, which is very computationally expensive and time-consuming.
The invariant moment characteristics of laser SLAM raster map are extracted and matched with the invariant moment characteristics of real-time lidar point clouds. The real-time position of lidar in the map is determined by the maximum similarity, and the positioning speed is improved. stability.
While speeding up the computing speed, it improves positioning stability, reduces the computational complexity, and significantly reduces global positioning time-consuming especially in large-area environments.
Smart Images

Figure CN118918187A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of robot autonomous positioning and navigation technology, and more specifically, 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, robots, drones, augmented reality and other fields. The robot obtains information about the surrounding environment and builds an environmental map through its own laser radar, IMU and other sensors. During actual positioning and navigation, the robot collects data from sensors such as laser radar and IMU in real time and matches it with the environmental map to estimate its own position and posture. This is the basis for the robot to achieve positioning and navigation. However, when the robot is operating in a large area environment, the scale of the constructed environmental map is large. 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, on the basis of mainstream SLAM, by detecting and calculating the visual tags randomly distributed in the entire space, the position of the robot in the working environment can be determined, which can effectively solve the problem of slow SLAM global positioning. However, it is necessary to deploy visual tags in the environment and add visual sensors to the robot body for identification. The implementation process is complicated and the implementation cost is high. In the prior art, the grid map obtained by the laser SLAM algorithm can also be used to extract the geometric features in the environment, including using the endpoints and corners of obstacles in the environment as map nodes, and the distance between nodes as the adjacency matrix, to establish a topological map of the geometric features of the environment, by extracting the key points and geometric information of the obstacles in the current laser data, and matching the data with the topological map of the geometric features of the environment, to obtain the map nodes corresponding to the key points, and to accelerate the positioning process by matching the geometric information with the nodes. This method can reduce the amount of global positioning matching operations and reduce the time consumption of global positioning, but it is difficult to ensure the reliability of the matching results when global positioning is performed by only using the local features of the environment. In the prior art, it is also possible to reasonably arrange reflectors in the environment, build a global coordinate system reflector and SLAM feature information library while building a SLAM grid map, and the robot scans the surrounding environment information through a laser radar to obtain the local position information of the reflector and the SLAM local map. When positioning is lost, the global coordinate position can be calculated through the reflector position. This method uses reflector information for global positioning, which can improve positioning speed, but the deployment of reflectors adds extra 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 view of the defects of the prior art, the purpose of this application is to achieve the goal of accelerating the global positioning speed of laser SLAM while improving the 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 nodes of the laser SLAM grid map, and during positioning matching, extract the invariants of the laser radar point cloud and match them with the invariants of the grid map nodes. While accelerating 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 binary image corresponding to the real-time laser radar point cloud, the invariant moment feature of the binary image is extracted to obtain the invariant moment value group corresponding to the real-time laser radar 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 point in the binary map image, and determine the pixel point corresponding to the maximum similarity;
[0009] Based on the position of the pixel point corresponding to the maximum similarity in the binary map image, the real-time position of the laser radar in the map is determined;
[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 a 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 laser radar 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 a possible implementation, based on the two-dimensional laser radar point cloud map, binarization and dimensionality reduction processing are performed to obtain a binary map image after dimensionality reduction, including:
[0016] Based on the two-dimensional laser radar point cloud map, the map image is binarized to obtain a binary map image, in which one value indicates that there is an obstacle and the other value indicates that there is no obstacle;
[0017] According to the preset dimensionality reduction multiple, the binary map image is reduced in dimensionality to obtain the binary map image after dimensionality reduction.
[0018] In a possible implementation, the two-dimensional laser radar point cloud map is a grid map, and the state of the grid in the two-dimensional laser radar 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;
[0019] Based on the two-dimensional laser radar 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 it is unknown whether the corresponding position is occupied by an obstacle. 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 multiple to obtain the binary map image after dimensionality reduction includes:
[0024] Determine the length and width of the sliding window as a preset dimensionality reduction multiple and determine the sliding step length of the sliding window as 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 point selected by the sliding window before the first sliding and the minimum grayscale value of the pixel point 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 a possible implementation, each pixel point in the binary map image after dimensionality reduction is traversed to obtain a local view map corresponding to each pixel point, including performing the following operations on each traversed pixel point:
[0028] Based on the binary map image after dimensionality reduction, scan the surrounding area of the pixel point to determine the obstacle distribution in the surrounding area of 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 viewing angle map corresponding to the pixel is determined.
[0030] In a possible implementation, the invariant moment value group includes three invariant moment values. 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, 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 the 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 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;
[0037] A similarity analysis module is used to analyze the similarity between the invariant moment value group corresponding to the real-time laser radar 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;
[0038] A real-time position determination module 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;
[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 prior art:
[0044] By utilizing the characteristics that invariant moments are invariant to rotation, translation and scale changes and can highly condense the global features of an image, by converting a two-dimensional lidar point cloud map (i.e., a laser SLAM grid map) into a binary map image and extracting the invariant moment features of the local perspective at each pixel in the binary map image, the invariant moment value group corresponding to each pixel 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 (i.e., 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 nodes (i.e., 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 the embodiments 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 the 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 by 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 in an embodiment of the present application;
[0050] Figure 6is a schematic diagram of similarity solution results at each pixel point provided in an embodiment of the present application;
[0051] Figure 7 It is a schematic diagram of converting similarity into a grayscale image display provided in an embodiment of the present application;
[0052] Figure 8 The original point cloud binary image and the local perspective map provided in the embodiment of the present application Figure 2 Schematic diagram of value comparison;
[0053] Fig. 9 is a comparison chart of the computational complexity of the method provided in the embodiment of the present application and the AMCL algorithm;
[0054] Fig.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] Fig.11 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0057] In the embodiments of the present 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 the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0058] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two. For example, multiple processing units refer to two or more processing units, etc.; multiple elements refer to 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 laser radar point cloud, extract the invariant moment features of the binarized image, and obtain the invariant moment value group corresponding to the real-time laser radar point cloud.
[0062] Step S102, analyzing the similarity between the invariant moment value group corresponding to the real-time laser radar point cloud and the invariant moment value group corresponding to each pixel point in the binary map image, and determining the pixel point 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, 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.
[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 condense the global features of an image, by converting a two-dimensional lidar point cloud map (i.e., a laser SLAM grid map) into a binary map image and extracting the invariant moment features of the local perspective at each pixel in the binary map image, it is possible to obtain a group of invariant moment values corresponding to each pixel in the binary map image. The invariant moment features of the local perspective at the pixel 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 (i.e., 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 nodes (i.e., similarity analysis). Based on the position of the pixel 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.
[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 laser radar 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 laser radar 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 laser radar point cloud map, the map image is binarized to obtain a binary map image, in which one value indicates that there is an obstacle and the other value indicates that there is no obstacle;
[0072] According to the preset dimensionality reduction multiple, the binary map image is reduced in dimensionality to obtain the binary map image after dimensionality reduction.
[0073] Optionally, the two-dimensional laser radar point cloud map is a grid map, and the state of the grid in the two-dimensional laser radar 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 laser radar 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 it is unknown whether the corresponding position is occupied by an obstacle. 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, 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, adjust the grayscale value of the pixel to 255, if the grayscale value of the pixel is less than the map threshold, adjust the grayscale value of the pixel to 0;
[0077] The adjusted grayscale image is determined as a binary map image.
[0078] Optionally, reducing the dimension of the binary map image according to a preset dimensionality reduction multiple to obtain the binary map image after dimensionality reduction includes:
[0079] Determine the length and width of the sliding window as a preset dimensionality reduction multiple and determine the sliding step length of the sliding window as 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 point selected by the sliding window before the first sliding and the minimum grayscale value of the pixel point 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] Exemplarily, the preset traversal order may be to start traversal 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 traversal 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 perspective 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, scan the surrounding area of the pixel point to determine the obstacle distribution in the surrounding area of 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 viewing angle 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 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 laser radar point cloud map at the operating site, and export the map into an image format.
[0090] Using the LiDAR point cloud, Inertial Measurement Unit (IMU) and other sensor data as input, a two-dimensional LiDAR point cloud map is constructed at the operating site. Usually, the constructed map is a grid map. The grid of the grid map has three specific states: "occupied" (indicates that the grid is occupied by obstacles), "free" (indicates that the grid is not occupied by obstacles) and "unknown" (indicates that it is unknown whether the grid is occupied by obstacles).
[0091] Furthermore, the constructed point cloud map is converted into a grayscale image, denoted as M1. Figure 3 is the original map image constructed 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 pixels in the grayscale image (the corresponding grayscale value is 0), the grid in the "idle" state corresponds to the white pixels in the grayscale image (the corresponding grayscale value is 255), and the grid in the "unknown" state corresponds to the gray pixels in the grayscale image (the corresponding grayscale value is 128).
[0092] Step S202, binarization is performed on the map image according to the map threshold. After the binarization, the black area in the image represents an obstacle, and the white area represents a passable area.
[0093] According to the map construction information, select the map threshold GV th =128, and binarize the grayscale image converted from the above point cloud map.
[0094] Specifically, the gray 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 indicates the passable area of the map; 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 binary image is denoted as M2.
[0096] Step S203, selecting a suitable 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 amount of calculation is too large and the calculation time is long. Image dimensionality reduction can effectively reduce the amount of calculation.
[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 calculation, 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 of 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, the M3 binary image has a pixel value of 255 (white) indicating the traversable area of the map, and a pixel value of 0 (black) indicating an obstacle on the map. After dimensionality reduction, the image pixel corresponds to 0.3 m in the world coordinate system.
[0105] Step S204, traverse the binary map image after dimensionality reduction, generate local perspective maps at all pixel points, and solve the invariant moment value group of the local perspective 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 viewing angle map of the pixel point in M3.
[0110] The laser radar scanning distance is denoted as R, and the distance represented by the pixel of M3 in the world coordinate is denoted as r. Then the distance represented by R / r pixels in one direction in M3 is R, and the local viewing angle of a pixel in M3 involves all directions. Therefore, the size of B is: H1=2×R / r, W1=2×R / r, and the calculation result is rounded up.
[0111] Furthermore, all elements of B are initially assigned a value of 255 (white, indicating a 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 condition m+H1 / 2<0, or m+H1 / 2>H1, or n+W1 / 2<0, or n+W1 / 2>W1 is 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 element value at M3(i+m,j+n), recorded as s. If s=0, it means that the current scanning angle has encountered an obstacle, then let: B(m+H1 / 2,n+W1 / 2)=0. If s>0, it means that the current scanning angle has not encountered an obstacle, then let: L0=L0+r, continue to search farther along the current scanning angle until an obstacle is encountered, or when L0>R, that is, the scanning distance has exceeded the laser radar scanning distance, then end the current angle traversal, and the corresponding position B element value is not assigned, and the default value is taken.
[0118] Furthermore, after completing the traversal at the current angle θ0, let: θ0 = θ0 + σ, and repeat the above scanning traversal process 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 viewing angle map at the element M3(i, j).
[0119] Furthermore, three invariant moment values are solved for the local view map B. Before solving the invariant moment, the element values of B are normalized, and let: That is, the elements in B that are greater than 0 are assigned to 0, and the elements that were originally zero are assigned to 1. It can be understood that the black pixels in the local perspective 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 point needs to be assigned to 1. Therefore, the elements in the local perspective map B that were originally zero are assigned to 1, and the elements in the local perspective map B that are greater than 0 (white pixels) are assigned to 0.
[0120] (1) Solve the 0th to 3rd order geometric moments 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 after computational processing, and solving the invariant moment value group of the binary image.
[0139] Load the LiDAR point cloud data. Since the 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), get the minimum and maximum values of X and Y.
[0143] Further, construct a point cloud image G, 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] Further, 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, round up the result, calculate the index value, assign 1 to the corresponding element (indicating an obstacle), set G(i,j)=1, then set k=k+1, and calculate the index value again until k=N. The point cloud image G obtained after traversal is the binary image corresponding to the lidar point cloud.
[0145] Further, 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 laser radar 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 laser radar 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 value 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), A(i, j, 3)) corresponding to the element A(i, j).
[0149] Further, solving (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 It is a schematic diagram of the similarity solution results at each pixel point provided in an embodiment of the present application.
[0152] After solving the similarity matrix S, find the row and column index value of the maximum similarity value. Theoretically, 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 from pixel coordinates to 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, obtaining S max The element index at the position is recorded as (i max ,j max ).
[0155] Further, 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 origin of the image.
[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 7is a schematic diagram of converting similarity into a grayscale image provided in an 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 in the embodiment of the present application Figure 2 The value diagram is compared with the schematic diagram, 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) algorithm as an example, N represents the number of grid map nodes, 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). Fig. 9 is a comparison chart of the computational complexity of the method provided in the embodiment of the present application and the AMCL algorithm, such as Fig. 9 As shown, 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 laser SLAM global positioning device based on invariant moments provided in the present application is described below. 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 be referred to each other.
[0160] Fig.10 is a schematic diagram of the structure of a laser SLAM global positioning device based on invariant moments provided in an embodiment of the present application, such as Fig.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] The similarity analysis module 20 is used to analyze the similarity between the invariant moment value group corresponding to the real-time laser radar 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;
[0163] A real-time position determination module 30, for 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;
[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 can be understood that the detailed functional implementation of each of the above-mentioned 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, which will not be repeated here.
[0167] Based on the method in the above embodiment, an embodiment of the present application provides an electronic device, Fig.11 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Fig.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 through 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 it is 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 a computer device (which can be a personal computer, a server, or a network device, etc.) to perform 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 understandable that the processor in the embodiment of the present application may be a central processing unit (CPU), or 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 known in the art. An exemplary storage medium is coupled to a 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 may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may 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)), etc.
[0174] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
[0175] It will be easily understood by those skilled in the art that the above description 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 shall 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, extract the invariant moment feature of the binarized image, and obtain 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 laser radar 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; 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.
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 laser radar 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 dimension 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 method 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 indicates that there is an obstacle and the other value indicates that there is no obstacle; The binary map image is dimensionality reduced 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 laser radar point cloud map is a grid map, and the state of the grid in the two-dimensional laser radar 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 process of binarizing the map image based on the two-dimensional laser radar point cloud map to obtain a binary map image includes: Based on the state of each grid in the two-dimensional laser radar point cloud map, a grayscale image is obtained, in which a black pixel point indicates that the corresponding position is occupied by an obstacle, a white pixel point indicates that the corresponding position is not occupied by an obstacle, and a gray pixel point indicates that whether the corresponding position is occupied by an obstacle is unknown, the grayscale value of the black pixel point is 0, the grayscale value of the white pixel point is 255, and the grayscale value of the gray pixel point 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 dimension reduction multiple to obtain the binary map image after the dimension reduction includes: Determine the length and width of the sliding window as a preset dimensionality reduction multiple and determine the sliding step length of the sliding window as 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; 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 point selected by the sliding window before the first sliding and the minimum grayscale value of the pixel point 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, scan 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 viewing angle 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 the 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 laser radar 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; A real-time position determination module, 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; 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 / image signal generator / network device / transmitter / terminal / base station / industrial computer, 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 runs 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
Map updating method and device based on 2D-SLAM, electronic equipment and storage medium
CN118225072A
Positioning method and robot using the same
US20200005487A1
