A map fusion method, chip and robot

Through the map fusion method, the optimal rotation angle and translation vector are calculated using cross-correlation, the transformation matrix is ​​generated and the map similarity is calculated, which solves the problem of redundant maps in the cleaning robot system and improves the system operation efficiency.

CN116203937BActive Publication Date: 2025-09-09AMICRO SEMICONDUCTOR CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111453920.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-01
Publication Date
2025-09-09
Estimated Expiration
2041-12-01

AI Technical Summary

Technical Problem

Redundant maps accumulate in cleaning robot systems, occupying system space and affecting performance. Existing technologies make it difficult to efficiently remove redundant maps and improve system operation speed.

Method used

Through the map fusion method, the optimal rotation angle and translation vector are calculated using cross-correlation to generate the optimal transformation matrix. The map to be fused is converted to the comparison map, and the map similarity is calculated through the double traversal detection algorithm. The maps that meet the conditions are selected for overlay fusion.

Benefits of technology

It effectively removes redundant maps, improves the operating efficiency of the robot system, and solves the problems of low accuracy and efficiency in calculating map similarity in traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116203937B_ABST
    Figure CN116203937B_ABST
Patent Text Reader

Abstract

The present invention discloses a map fusion method, chip and robot. The method is used to obtain the optimal rotation angle and optimal translation vector between the map to be fused and the corresponding comparison map based on the mutual correlation between the map to be fused and the corresponding comparison map, to form an optimal transformation matrix, and then transform a map to be fused to each comparison map through the corresponding optimal transformation matrix. Then, the map similarity between each rotated map to be fused and the corresponding comparison map is calculated, and the duplicate maps are fused according to the size of the map similarity to remove redundant data and improve the operating efficiency of the robot. At the same time, it solves the problem of low accuracy and efficiency of calculating map similarity in traditional methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent mobile robots, and in particular to a map fusion method, a chip, and a robot. Background Art

[0002] Typically, cleaning robots store multiple maps, and these maps often overlap. For example, when a cleaning robot cleans a whole house, it generates a map of the entire environment. Then, when it cleans a room, it generates a map of that room's environment. Both maps include the room itself. Alternatively, if the robot fails to locate itself for some reason, a duplicate map of the environment will be generated. After a cleaning robot has been running for a long time, a large number of redundant maps will accumulate in the system, taking up limited space and even affecting system performance. Summary of the Invention

[0003] To solve the above problems, the present invention provides a map fusion method, chip, and robot that can fuse duplicate maps, reduce redundancy, and improve the system's operating speed. The specific technical solutions of the present invention are as follows:

[0004] A map fusion method, the method comprising the following steps: step A, selecting one of the pre-stored maps as a map to be fused and the remaining maps as comparison maps, calculating a second preset number of optimal rotation angles based on the cross-correlation between the map to be fused and a comparison map, calling each optimal rotation angle to rotate the map to be fused respectively, and obtaining a second preset number of first optimized maps; wherein the robot pre-stores a total of maps equal to the sum of the first preset number and 1; step B, controlling the second preset number of first optimized maps to perform pairwise accelerated convolution with the first preset number of comparison maps respectively, and obtaining a cross-correlation parameter matrix between each first optimized map and each corresponding comparison map; step C, according to the same cross-correlation parameter matrix, The optimal transformation matrix is ​​composed of an element with the largest value and an optimal rotation angle corresponding to the first optimized map, the map to be fused is transformed into the corresponding comparison map, and the conversion is determined to be a second optimized map; step D, respectively segmenting the overlapping areas of the second optimized map and the corresponding comparison map, recorded as the first area and the second area, calculating the signed distance fields of the first area and the second area respectively through the double traversal detection algorithm, and then calculating the average distance between the first area and the second area based on the signed distance field, summing the average distances to obtain the map similarity between the first area and the second area, and then selecting the second optimized map and the comparison map corresponding to the map similarity that meets the conditions and superimposing them to complete the map fusion.

[0005] Furthermore, in step D, the method for obtaining the map similarity between the first area and the second area includes: step D1, segmenting the overlapping areas of the second optimized map and the corresponding comparison map, respectively, and recording them as the first area and the second area; step D2, defining a set, the set including all matrix elements in the first area and the second area, and the values ​​in the set are non-repeated; step D3, calculating the average distance between the matrix elements in the first area with a preset value and the nearest matrix elements with the same value in the corresponding second area, and calculating the average distance between the matrix elements in the second area with a preset value and the nearest matrix elements with the same value in the corresponding first area; wherein the preset value belongs to the set; step D4, defining a value in the set that is not involved in the calculation as the preset value, returning to step D3 to perform calculations until all values ​​in the set are involved in the calculation, and then entering step D5; step D5, calculating the sum of all average distances obtained in step D3 to obtain the map similarity between the first area and the second area; wherein each map similarity matches a corresponding comparison map and a corresponding optimal rotation angle.

[0006] Furthermore, in step D3, the method for calculating the average distance between a matrix element in the first region whose value is a preset value and the nearest matrix element with the same value in the corresponding second region specifically includes the following steps: step D31, calculating the signed distance field of the second region; step D32, calculating the distances between the matrix element in the first region whose value is the preset value and all matrix elements in the signed distance field of the second region that originally have the same value, and taking the minimum value therebetween; step D33, searching for the next matrix element in the first region whose value is the preset value, returning to step D32 for calculation until all matrix elements in the first region whose value is the preset value are calculated, and then entering step D34; step D34, calculating the sum of all minimum values ​​obtained in step D32, and then averaging them to obtain the average distance between the matrix element in the first region whose value is the preset value and the nearest matrix element with the same value in the second region.

[0007] Furthermore, in step D31, the method for calculating the signed distance field of the second region specifically includes: step D311, initializing matrix elements in the second region; step D312, performing a first traversal of the initialized matrix elements in the second region according to the first traversal direction, updating the current matrix elements to values ​​that satisfy the first condition during the traversal, and entering step D313 after the first traversal; step D313, performing a second traversal of the matrix elements in the second region that has been traversed the first time according to the second traversal direction, updating the current matrix elements to values ​​that satisfy the second condition during the traversal, and obtaining the signed distance field corresponding to the second region after the second traversal.

[0008] Furthermore, in step D311, the method of initializing the matrix elements in the second region specifically includes: initializing the matrix elements in the second region whose values ​​are preset values ​​to 0, and then initializing the other matrix elements to infinity.

[0009] Furthermore, the first traversal direction in step D312 specifically refers to: starting from the first matrix element in the first row of the second area, traversing from left to right, after traversing the last matrix element in the first row, continuing to traverse from the first matrix element in the second row from left to right, and so on, until all matrix elements are traversed.

[0010] Furthermore, the value satisfying the first condition in step D312 specifically refers to: during the traversal process, taking the matrix element values ​​to the left and above the current matrix element and adding 1 respectively, and then comparing the values ​​with the current matrix element value, where the minimum value among the three is the value satisfying the first condition.

[0011] Furthermore, the second traversal direction in step D313 specifically refers to: starting from the last matrix element in the last row of the second area, traversing from right to left, after traversing the first matrix element in the last row, continuing to traverse from the last matrix element in the second to last row from right to left, and so on, until all matrix elements are traversed.

[0012] Furthermore, the value satisfying the second condition in step D313 specifically refers to: during the traversal process, taking the matrix element values ​​to the right and below the current matrix element and adding 1 respectively, and then comparing the values ​​with the current matrix element value, where the minimum value among the three is the value satisfying the second condition.

[0013] Furthermore, the traversal starting point of the second traversal direction is the traversal end point of the first traversal direction.

[0014] Furthermore, in step D, the method of selecting the second optimized map and the comparison map corresponding to the map similarity that meets the conditions and superimposing them includes: step D6, selecting the map with the largest map similarity value and judging whether it is greater than or equal to a threshold value; if not, selecting a map that has not been selected from the pre-stored maps as the map to be fused, and then repeating steps A to D; if so, proceeding to step D7; step D7, adding the matrix elements in the overlapping area of ​​the second optimized map and the comparison map corresponding to the map similarity with the largest map value and subtracting them from a preset constant to obtain the superimposed matrix elements, and then retaining the other matrix elements of the second optimized map and / or the comparison map except for the overlapping area to complete the map fusion.

[0015] A chip is used to store a computer program, and the computer program implements the map fusion method when executed.

[0016] A robot equipped with the chip.

[0017] The beneficial effects of the present invention are as follows: the technical solution of the present invention is used to obtain the optimal rotation angle and optimal translation vector between the map to be fused and the corresponding comparison map based on the mutual correlation between the map to be fused and the corresponding comparison map, to form an optimal transformation matrix, and then transform a map to be fused to each comparison map through the corresponding optimal transformation matrix, and then calculate the map similarity between each rotated map to be fused and the corresponding comparison map, and fuse the duplicate maps according to the size of the map similarity to remove redundant data, improve the operating efficiency of the robot, and at the same time solve the problem of low accuracy and efficiency of calculating map similarity using traditional methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 The figure is a flowchart of a map fusion method according to an embodiment of the present invention.

[0019] Figure 2 The figure is a flow chart of a method for obtaining a rotation angle based on Hough transform according to an embodiment of the present invention.

[0020] Figure 3 The figure is a flowchart of a method for calculating map similarity according to an embodiment of the present invention.

[0021] Figure 4 FIG. 1 is a schematic diagram of a signed distance field calculation process according to an embodiment of the present invention.

[0022] Figure 5 This is an example diagram of the calculation results of the signed distance field according to an embodiment of the present invention. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solutions and advantages of this application more clear, the present application is described and illustrated below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely used to explain the present invention and are not intended to limit this application. Based on the embodiments provided in this application, all other embodiments obtained by those of ordinary skill in the art without making any creative work are within the scope of protection of this application.

[0024] In order to reduce redundant maps in the robot system and improve the system operation efficiency, the embodiment of the present invention provides a map fusion method, such as Figure 1 As shown, the method includes the following steps:

[0025] Step A: Select one of the pre-stored maps as the map to be fused and the remaining maps as comparison maps. Calculate a second preset number of optimal rotation angles based on the correlation between the map to be fused and the comparison map. Use each optimal rotation angle to rotate the map to be fused, and obtain a second preset number of first optimized maps. The robot pre-stores a total of maps equal to the sum of the first preset number and 1. Figure 2As shown, step A specifically includes: step A1, obtaining first frequency statistical information in a reference coordinate mapping space from the comparison map using a Hough transform, and simultaneously obtaining second frequency statistical information in a reference coordinate mapping space from the map to be fused using a Hough transform, and setting a reference rotation angle applicable to all reference coordinate mapping spaces; wherein the reference coordinate mapping space belongs to the Hough space; then proceeding to step A2. step A2, periodically convolving the second frequency statistical information with the first frequency statistical information using a trigonometric function of the reference rotation angle to obtain a cross-correlation signal sequence between a line in the map to be fused and a line corresponding to the comparison map, which is represented by the correlation between a line in the map to be fused and a line in the comparison map at a rotation angle; then proceeding to step A3. step A3, calculating and obtaining a second preset number of local maxima from the cross-correlation signal sequence, and then setting the rotation angles corresponding to the second preset number of local maxima currently obtained as the second preset number of optimal rotation angles of the map to be fused relative to the comparison map, i.e., the second preset number of optimal rotation angles of the same map to be fused relative to the corresponding comparison map. In this embodiment, the optimal rotation angles corresponding to the second preset number of local maxima can be obtained by performing partial derivative operations on the cross-correlated signal sequence. Each optimal rotation angle can be used as the rotation angle of the X-axis of the robot coordinate system of the same map to be fused relative to the X'-axis of the global coordinate system of the corresponding comparison map. It should be added that, within the map to be fused constructed in real time, these optimal rotation angles may be the rotation angles of the straight lines extracted in the corresponding directions relative to a reference navigation direction. At the same time, the similarity of the straight lines extracted in these corresponding directions to the corresponding straight lines of the same comparison map is the greatest. Among them, a reference coordinate mapping space corresponding to the comparison map and a reference coordinate mapping space corresponding to the map to be fused are both used to represent the same environmental area. The map to be fused is constructed in real time by the robot in the current motion area, and the comparison map is constructed by the robot in advance in the same motion area.By executing steps A1 to A3, a reference coordinate mapping space of the same size and relative distribution area is mapped from the comparison map and the map to be fused, respectively, using the Hough transform to timely save the line feature information. This can both accelerate line detection and avoid map information loss. Statistical information associated with the lines is then extracted from the respective reference coordinate mapping spaces, and a convolution operation is performed with the rotation angle as a period to obtain the strength of the cross-correlation between the rotation angle of the line in the map to be fused and the rotation angle of the corresponding line in the comparison map. A matching operation is then performed on the line in the map to be fused and the line in the comparison map. On this basis, the rotation angle corresponding to the convolution value with the local maximum is selected as the optimal rotation angle between the map to be fused and the comparison map, making the optimal rotation angle candidate more accurate. Furthermore, the cross-correlation is only evaluated for the distribution frequency characteristics of the corresponding lines in the reference coordinate mapping space at specific locations, which speeds up the processing of the rotation angle and, in turn, accelerates the subsequent conversion of the map to be fused to the comparison map.

[0026] In step A, each map to be fused is rotated by each optimal rotation angle to obtain a second preset number of first optimized maps, i.e., a second preset number of first optimized maps are obtained; then, step B is performed. Each first optimized map has a corresponding optimal rotation angle. Preferably, the first optimized maps can be obtained by rotating the same map to be fused by a corresponding optimal rotation angle in chronological order, thereby sequentially rotating the second preset number of optimal rotation angles to obtain the second preset number of first optimized maps. Alternatively, the same map to be fused can be simultaneously rotated by a corresponding optimal rotation angle to obtain first optimized maps after different rotation operations, thereby synchronously rotating the second preset number of optimal rotation angles to obtain the second preset number of first optimized maps.

[0027] In step A, the pose of the line in the first optimized map is obtained by rotating the corresponding line in the map to be fused in a specific direction according to the optimal rotation angle, so that the local pose of the corresponding line or corresponding linear feature after rotation is the same as the global pose of the corresponding line in the comparison map in terms of the directional pose dimension. The directional pose of the line in the first optimized map is equivalent to the directional pose of the corresponding line in the comparison map, which can be regarded as directional matching of the line in the map to be fused with the line in the comparison map. In order to perform the conversion between the robot coordinate system of the map to be fused and the global coordinate system of the comparison map and complete the precise positioning of the robot in the map (overcoming the robot coordinate system positioning error caused by sensor installation error), this embodiment also requires a translation vector and a rotation matrix composed of trigonometric function values ​​of the optimal rotation angle to complete the conversion between the robot coordinate system of the map to be fused and the global coordinate system of the comparison map (converting them to the same map plane). Therefore, it is necessary to calculate the displacement pose. In this embodiment, a cross-correlation calculation is performed on the map to be fused and the comparison map, and the position coordinate with the highest correlation is used as the coordinate offset that is most likely to match at the corresponding angle, including the offset of the origin of the robot coordinate system relative to the origin of the global coordinate system of the comparison map. Among them, the global coordinate system of the comparison map can be the reference navigation coordinate system during the robot's mapping and navigation process, used for positioning and ranging.

[0028] It should be noted that the formation of a rotation matrix from the trigonometric function values ​​of the optimal rotation angle is achieved using conventional technical means. Those skilled in the art will know that a rotation matrix is ​​multiplied by the coordinates in the map to be fused and then added to a translation vector to obtain the coordinates in the map to be fused, which are converted to the coordinates in the comparison map. Specifically, by introducing the homogeneous coordinate form and based on the conversion relationship between plane rectangular coordinate systems, a rotation matrix and a translation vector can be combined into a conversion matrix to facilitate conversion calculations between coordinate systems.

[0029] Step B: Control the second preset number of first optimized maps to perform pairwise accelerated convolution with the first preset number of comparison maps, obtain a cross-correlation parameter matrix between each first optimized map and each corresponding comparison map, and then proceed to step C. Specifically, when the comparison map and the first optimized map are both large in size, in order to reduce the huge computational cost of traditional convolution operations, this embodiment uses a discrete Fourier transform to convert each first optimized map and a corresponding comparison map involved in the convolution from the time domain to the frequency domain. The transformed value of the first optimized map at the frequency domain position is then multiplied by the transformed value of the corresponding comparison map involved in the convolution at the corresponding frequency domain position. An inverse discrete Fourier transform is then performed to obtain a cross-correlation parameter matrix to perform accelerated convolution, thereby replacing the convolution between a first optimized map and a comparison map with a convolution of two column elements and obtaining the same computational result. Each of the second preset number of first optimized maps is configured to perform the accelerated convolution with any comparison map, obtaining a cross-correlation parameter matrix whose number is the product of the first preset number and the second preset number, to achieve the pairwise accelerated convolution. The number of columns in the cross-correlation parameter matrix is ​​equal to the number of grids in the horizontal direction of the corresponding first optimized map, and the number of rows in the cross-correlation parameter matrix is ​​equal to the number of grids in the vertical direction of the corresponding first optimized map. Therefore, this embodiment uses discrete Fourier transform to accelerate the convolution calculation of the above-mentioned two maps, and converts the multiplication calculation of the small window item by item in the convolution calculation into two column convolutions, thereby reducing the number of calculations and memory usage. In particular, the more discrete data of the map being transformed, the more significant the degree of computational savings of this embodiment, especially the order of magnitude reduction of the computational amount is more obvious.

[0030] It should be added that this embodiment controls the first optimized map (values ​​are taken at the map coordinate positions or the map image is taken at the corresponding matrix element points) and a comparison map (values ​​are taken at the map coordinate positions or the map image is taken at the corresponding matrix element points) to perform discrete convolution, and sets the offset amplitude of one of the operable maps in the horizontal axis direction to be the length of a row of grids of the first optimized map, and sets the offset amplitude of the operable map in the vertical axis direction to be the length of a column of grids of the first optimized map. For example, taking the comparison map as a map data item that can be translated, the integer values ​​included in the integer length from 1 to the first optimized map are set as the translation parameters in the horizontal axis direction, and the integer values ​​included in the integer width from 1 to the first optimized map are set as the translation parameters in the vertical axis direction. When the corresponding position elements are multiplied after conversion to the frequency domain, the specific positions involved in the multiplication can be mastered by those skilled in the art who understand discrete Fourier transform, and will not be repeated here. The matrices that make up the two maps are involved in the map convolution operation. The matrix elements of the map matrix are values ​​at the map coordinate positions or the map image is valued at the corresponding matrix element points. The specific values ​​of the matrix elements involved include but are not limited to the number of times the straight line falls into the corresponding position, the frequency, and the brightness value of the map image. The specific value type has a negligible impact on the evaluation results of the cross-correlation between each first optimized map and each corresponding comparison map.

[0031] In this embodiment, in the process of using discrete Fourier transform to process the discrete convolution of each first optimized map and a corresponding comparison map, in the frequency domain, each time backtracking, only the discrete Fourier transform result of the matrix element sequence of the corresponding grid map of the current front half is calculated, and the discrete Fourier transform result of the matrix element sequence of the corresponding grid map of the back half can be inferred, thereby reducing the computational complexity, so that the order of magnitude of the computational amount before and after the transformation is reduced from the order of power to the order of logarithm, and the difference is obvious.

[0032] Step C, based on the optimal transformation matrix composed of the largest element in the same cross-correlation parameter matrix and the optimal rotation angle corresponding to the first optimized map, the map to be fused is transformed into the corresponding comparison map, and the transformation into the second optimized map is determined. Specifically, the largest element is obtained from the same cross-correlation parameter matrix, and then the horizontal axis coordinate and the vertical axis coordinate corresponding to the currently obtained element with the largest value and the optimal rotation angle corresponding to the first optimized map are used to form the optimal transformation matrix between the corresponding comparison map and the map to be fused, wherein the horizontal axis coordinate and the vertical axis coordinate corresponding to the currently obtained element with the largest value are the coordinate offsets that best match the map to be fused relative to the comparison map, which are equivalent to the horizontal and vertical axis offsets of the origin of the robot coordinate system of the map to be fused relative to the origin of the global coordinate system of the comparison map, which can form the translation vector and accurately position the robot in combination with the corresponding optimal rotation angle. The map to be fused is then transformed into the corresponding comparison map using the optimal transformation matrix. The second optimized map is then determined, including rotating and translating the robot coordinate system into the comparison map to facilitate robot positioning within the comparison map. The map to be fused and the corresponding comparison map are then matched for correlation. The second optimized map is then used as the map matching result of the two maps at the corresponding optimal rotation angle. The process then proceeds to step D.

[0033] It can be seen from the above steps that: based on the second preset number of maps to be fused and a comparison map, the pairwise accelerated convolution can be used to obtain the second preset number of optimal transformation matrices based on a comparison map, thereby converting the second preset number of coordinate offsets relative to the origin of the global coordinate system of the comparison map, and the second preset number of positioning positions can be located in the same comparison map; on this basis, based on the second preset number of maps to be fused and the first preset number of comparison maps, the pairwise accelerated convolution can be used to obtain the second preset number of optimal transformation matrices based on a comparison map to obtain coordinate offsets that are the product of the first preset number and the second preset number, and the positioning positions that are the product of the first preset number and the second preset number can be cumulatively located in all comparison maps.

[0034] Step D: Segment the overlapping areas of the second optimized map and the corresponding comparison map, respectively, and record them as the first area and the second area. Calculate the signed distance fields of the first area and the second area respectively using the double traversal detection algorithm. Then, calculate the average distance between the first area and the second area based on the signed distance field. Sum the average distances to obtain the map similarity between the first area and the second area. Then, select the second optimized map and the comparison map corresponding to the map similarity that meets the conditions and superimpose them to complete the map fusion.

[0035] Specifically, if Figure 3 As shown, in this embodiment, the method for obtaining map similarity between a first region and a second region includes: Step D1, segmenting the overlapping regions of the second optimized map and the corresponding comparison map, respectively, denoted as the first region and the second region. The first region represents the region on the second optimized map that overlaps with the corresponding comparison map, and the second region represents the region on the comparison map that overlaps with the corresponding second optimized map. The first and second regions are of equal size (equal length and width) to facilitate similarity calculation for each matrix element, and then proceeding to Step D2. In Step D2, a set P is first defined to count all matrix elements in the first region and the corresponding second region. It should be noted that the map described in the present invention is a grid map, and free and occupancy are generally used to represent the occupancy status of the grid. Therefore, when values ​​are not repeated, set P includes free and / or occupancy, and then proceeding to Step D3. Step D3, calculating the average distance between matrix elements with a preset value in the first region and the nearest matrix element with the same value in the corresponding second region, and calculating the average distance between matrix elements with a preset value in the second region and the nearest matrix element with the same value in the corresponding first region, and then proceeding to Step D4. The preset value belongs to the set P.

[0036] The process of executing step D3 further includes the following steps:

[0037] Step D31, calculate the signed distance field of the second area, and then go to step D32. It should be noted that the signed distance field (SDF) is a data set that identifies the distance parameter to the specified position, and the direction can also be identified by a positive or negative sign. SDF was originally used to replace the traditional alpha-test (transparency test) to render text. It can use smaller text textures and will not be severely distorted when enlarged. It can be seamlessly integrated with the traditional alpha-test method, and has great advantages in text rendering. However, it is necessary to pre-calculate a smaller signed distance field texture from a larger text image. Finite distance fields are usually calculated using a recursive algorithm with a time complexity of O(nlogn), which cannot reach the linear time O(n), and the calculation speed is slow. Therefore, this embodiment uses a double traversal detection algorithm to optimize the calculation process of SDF to increase the calculation speed. Figure 4 A diagram showing the signed distance field calculation process is available. Figure 4 , the method for calculating the signed distance field of the second area specifically includes:

[0038] Step D311: Initialize the matrix elements in the second region. Figure 4The left panel, Init, shows the initialized second region. Initializing the matrix elements in the second region specifically includes initializing the matrix elements in the second region with preset values ​​to 0, and then initializing the remaining matrix elements to infinity. The 0s in Init indicate zero boundaries, where the preset values ​​are values ​​in the set P. This initialization process prepares for the subsequent minimum value extraction.

[0039] Step D312, perform the first traversal of the matrix elements in the initialized second area according to the first traversal direction, update the current matrix element to a value that satisfies the first condition during the traversal, and enter step D313 after the first traversal. In this embodiment, the first traversal direction specifically refers to: starting from the first matrix element in the first row of the second area, traverse from left to right, and after traversing the last matrix element in the first row, continue traversing from left to right from the first matrix element in the second row, and so on, until all matrix elements are traversed, that is, all matrix elements in the second area are traversed according to the rules from left to right and from top to bottom. During the traversal process, the traversed matrix element (called the current matrix element) needs to be updated, specifically, the matrix element values ​​to the left and above the current matrix element are taken and added by 1 respectively, and then compared with the current matrix element value, and the minimum value of the three is assigned to the current matrix element. Reference Figure 4 , the middle figure Relaxation Step 1 shows the process of traversing the second area for the first time, where the black matrix element point is visitedposition, that is, the current matrix element, and the gray matrix element point is neighbor, that is, the adjacent matrix element (in this embodiment, the matrix elements to the left and above the current matrix element are taken). Assuming that the current matrix element is infinite, the left matrix element is 0, and the above matrix element is infinite, then the matrix elements to the left and above are added by 1 to become 1 and infinity respectively. The minimum value of the three is 1, so the current matrix element is updated to 1. As mentioned above, the position of 0 is the boundary, so the meaning of 1 is that the distance between the current matrix element and the boundary is 1. It should be noted that because the first traversal direction is from the upper left corner to the lower right corner of the second area, taking the matrix element values ​​to the left and above the current matrix element can avoid taking the matrix elements that have not been traversed, that is, the matrix elements that have not been updated. Such values ​​have no computational meaning.

[0040] Optionally, the first traversal direction can be to start from the last matrix element of the first row of the second area and traverse from right to left. After traversing the first matrix element of the first row, continue to traverse from right to left from the last matrix element of the second row, and so on, until all matrix elements are traversed, that is, all matrix elements of the second area are traversed according to the rules from right to left and from top to bottom. In addition, the traversal starting point of the first traversal direction can also be the matrix element where other vertices of the second area are located, and traverse in the diagonal direction according to similar rules as mentioned above, which will not be repeated. It should be noted that when the first traversal direction is from the upper right corner to the lower left corner of the second area, when taking values ​​for comparison, it is necessary to take the matrix elements to the right and above the current matrix element, also to avoid taking matrix elements that have not been traversed. When the first traversal direction changes, the value needs to be adaptively changed, which will not be repeated.

[0041] Step D313, perform a second traversal on the matrix elements in the second area that have been traversed for the first time according to the second traversal direction, update the current matrix element to a value that satisfies the second condition during the traversal process, and obtain the signed distance field corresponding to the second area after the second traversal. In this embodiment, the second traversal direction specifically refers to: starting from the last matrix element in the last row of the second area, traversing from right to left, after traversing the first matrix element in the last row, continue traversing from right to left from the last matrix element in the second to last row, and so on, until all matrix elements are traversed, that is, all matrix elements in the second area are traversed according to the rule from right to left and from bottom to top. During the traversal process, the traversed matrix elements need to be updated again, specifically, the matrix element values ​​to the right and below the current matrix element are taken and added by 1 respectively, and then compared with the current matrix element value, and the minimum value of the three is assigned to the current matrix element. Reference Figure 4 The figure on the right, Relaxation Step 2, shows the second traversal of the second region. The black matrix element is the visited position, i.e., the current matrix element, and the gray matrix element is the neighbor, i.e., the adjacent matrix element (in this embodiment, the matrix elements to the right and below the current matrix element are used). Assuming the current matrix element is 0, the matrix element to the right is infinite, and the matrix element below is 1, then adding 1 to the matrix elements to the right and below becomes infinite and 2, respectively. The minimum of these three values ​​is 0, so the current matrix element remains 0 (because the current matrix element itself is the boundary).

[0042] It should be noted that the starting point of the traversal in the second traversal direction is the end point of the traversal in the first traversal direction. For example, when the first traversal ends at the matrix element in the lower left corner of the second area (starting from the upper right corner), the second traversal starts from the matrix element in the lower left corner (and then ends the second traversal at the matrix element in the upper right corner). This is because when the first traversal starts from the upper right corner, only the distances of the matrix elements to the right and above the current matrix element from 0 are updated. Therefore, the second traversal needs to update the distances of the matrix elements to the left and below from 0. Setting the starting point of the traversal in the second traversal direction to the end point of the traversal in the first traversal direction can meet this requirement.

[0043] like Figure 5 As shown in FIG, this embodiment is an example diagram of the calculation results of the signed distance field. Figure 5 The upper left image shows the second region, the upper right image shows the corresponding signed distance field, and the lower image shows the numerical representation of the signed distance field. Note that the signed distance field in the upper right image is a vector rendering; zooming in on it accurately restores the second region. This signed distance field is calculated using a double-pass detection algorithm, requiring only two passes through the second region to approximate the result of a traditional signed distance field calculation. The double-pass detection algorithm has a computational complexity of O(n), achieving linear speed, significantly improving the computational speed of the signed distance field.

[0044] Step D32: Calculate the distances between each matrix element in the first region whose value is a preset value and all matrix elements in the signed distance field of the second region that originally had the same value, and take the minimum value. During step D32, a matrix element in the first region whose value is a preset value is selected, and all locations of zero (i.e., locations that originally had the preset value) are found in the signed distance field of the second region. The distances between the first and the second are calculated, and the minimum value is used as the result of step D32. Preferably, the distance in this embodiment uses the Manhattan distance, which is simple and fast to calculate.

[0045] Step D33 searches for the next matrix element in the first region whose value is the preset value, then returns to step D32 and continues the calculation until all matrix elements in the first region whose value is the preset value are calculated, and then proceeds to step D34. Combining steps D32 and D33, it is readily apparent that calculating the average distance from the matrix element in the first region whose value is the preset value to the nearest matrix element with the same value in the second region requires multiple traversals and calculations, resulting in high computational complexity. Therefore, this embodiment uses a signed distance field to simplify the calculation process and increase the speed of calculating the average distance.

[0046] Step D34: Calculate the sum of all minimum values ​​obtained in step D32, then average them to obtain the average distance between the matrix element with the preset value in the first region and the nearest matrix element with the same value in the second region. It should be noted that the method for calculating the average distance between the pixel with the preset value in the second region and the nearest pixel with the same value in the first region is the same as described above; only the positions of the first and second regions need to be swapped. The calculation principle remains the same and is not further described.

[0047] In step D4, a value in the set that is not included in the calculation is defined as a preset value. The calculation is then repeated in step D3 until all values ​​in the set are included in the calculation, and then the process proceeds to step D5. During step D4, all values ​​in set P are traversed to calculate the two average distances in step D3, and then the next step is executed.

[0048] Step D5: Calculate the sum of all average distances obtained in step D3 to obtain the map similarity between the first and second regions. This result can be used as a reference to measure whether the two images are similar. Each map similarity is matched to a corresponding comparison map and a corresponding optimal rotation angle. Then proceed to step D6.

[0049] In step D6, the map with the highest similarity value is selected and its value is determined to be greater than or equal to a threshold. If not, a previously stored map that has not been selected is selected as the map to be fused, and steps A through D are repeated. If so, the process proceeds to step D7. If the map similarity is less than the threshold, it indicates that the map does not overlap with the other maps and is retained for the next comparison round. In the next comparison round, the map to be fused that has already been calculated can be removed from the comparison process to improve efficiency.

[0050] In step D7, the matrix elements in the overlapping area of ​​the second optimized map and the comparison map corresponding to the map with the greatest map similarity are added together and subtracted from a preset constant to obtain the superimposed matrix elements. The remaining matrix elements of the second optimized map and / or comparison map, excluding the overlapping area, are then retained to complete the map fusion. After weighted calculation, the two similar maps are fused into one, reducing data redundancy.

[0051] In summary, the technical solution described in the present invention is used to obtain the optimal rotation angle and optimal translation vector between the map to be fused and the corresponding comparison map based on the mutual correlation between the map to be fused and the corresponding comparison map, to form an optimal transformation matrix, and then transform a map to be fused to each comparison map through the corresponding optimal transformation matrix. Then, the map similarity between each rotated map to be fused and the corresponding comparison map is calculated, and the duplicate maps are fused according to the size of the map similarity to remove redundant data and improve the operating efficiency of the robot. At the same time, it solves the problem of low accuracy and efficiency of calculating map similarity by traditional methods.

[0052] As an example, Figure 2 A flowchart of a method for obtaining a rotation angle based on Hough transform provided in an embodiment of the present invention, namely Figure 1 The specific steps of the disclosed step A. The specific method of calculating the second preset number of optimal rotation angles based on the cross-correlation between a straight line of a map to be fused and a straight line of a comparison map in the Hough space includes the following steps:

[0053] In step A1, first frequency statistics are obtained from a reference coordinate mapping space of the comparison map using a Hough transform. Second frequency statistics are also obtained from a reference coordinate mapping space of the to-be-fused map using a Hough transform. A reference rotation angle applicable to all reference coordinate mapping spaces is set. The process then proceeds to step A2. Both the second and first frequency statistics reflect the number of occurrences of lines in specific directions within the corresponding Hough spaces.

[0054] It should be noted that, in this embodiment, the core idea of ​​the Hough transform is to map a set of points (two-dimensional) belonging to a certain graphic in the map to a point (which can be high-dimensional). This point records the number of points in the point set. This point is the parameter of the graphic to be searched, and the range of the parameter is called the parameter space, that is, the reference coordinate mapping space. The Hough transform can not only identify whether there are graphics that need to be detected in the scanned map, but also locate the graphic (including position, angle, etc.). When the feature to be extracted is within the point set and can be described mathematically, it can be searched through the Hough transform.

[0055] The Hough transform is a method for detecting straight lines and various geometric shapes in a binary image. Considering that there are many linear features on the walls inside a building, this embodiment focuses on the detection of straight lines in a grid map.

[0056] The line extraction methods involved in this embodiment all perform a Hough transform of all lines in the corresponding map into polar coordinate points in Hough space, which are used to represent the set of lines in the comparison map or the map to be fused. Different polar coordinate points represent different lines, and the same polar coordinate point represents at least one line. The polar coordinate point includes a rotation angle and a point-to-line distance. The rotation angle is the angle between the normal of the line represented by the polar coordinate point and the positive direction of the horizontal axis of the coordinate system of the map to which it belongs, and the point-to-line distance is the geometric perpendicular distance from the origin of the coordinate system of the map to which the polar coordinate point belongs to the line represented by the polar coordinate point. If the Hough transform is repeated on the same polar coordinate point, a new vote is cast for the corresponding polar coordinate point in the accumulator space, that is, the count is increased by one. If all points are calculated in this way, it is inevitable that the vote count of some points will be a local maximum (i.e., a peak). This embodiment uses the Hough transform to map lines of the same shape in one map space to points in another coordinate space to vote and count, forming a peak to complete the conversion of line information, thereby transforming the problem of detecting environmental line features into a problem of counting peaks. By introducing probabilistic peak statistics, the robot's mapping and localization algorithm becomes more robust to noise and incomplete shapes, mitigating the impact of missing straight line features in the map during robot navigation. It's important to note that in conventional Hough transform line detection algorithms, peaks in the accumulator space indicate strong evidence of the corresponding line in the image.

[0057] In order to speed up the detection speed, this embodiment uses Discrete Hough Transform (DHT). DHT divides the Hough space into a matrix HS with a preset number of rows and a preset number of columns, which is defined as the reference coordinate mapping space and belongs to the matrix space within the Hough space.

[0058] The reference coordinate mapping space (parameter space) is not continuous, but an array space composed of rectangular cells (accumulated units) one by one. Each rectangular cell stores the corresponding frequency statistics information (the cumulative result of the number of conversions) of (ρ, θ). In this embodiment, the reference rotation angle is the rotation angle of the polar coordinate point of the reference coordinate mapping space, and the reference point-line distance is the point-line distance of the polar coordinate point of the reference coordinate mapping space. Both are adaptively set according to the actual traversal environment of the robot; when the rotation angle is set to 0, there are infinite cases of corresponding matching point-line distances in the same grid map; when the point-line distance is set to 0, there are infinite cases of corresponding matching rotation angles in the same grid map. Therefore, in order to create a valid reference coordinate mapping space in the Hough space, the maximum value of the reference rotation angle is set to θ s , the minimum value of the reference rotation angle is set to 1; the maximum value of the reference point line distance is set to ρs , the minimum value of the reference point line distance is set to 1; extract the straight lines on the wall in the grid map (comparison map and map to be fused) as much as possible, intuitively show the frequency of occurrence of straight lines in a specific direction on the grid map, and use it to combine the statistical information and polar coordinate information of the reference coordinate mapping space to reflect the distribution position characteristics of the straight lines in the grid map. Specifically, the number of rows of elements arranged in the reference coordinate mapping space is the number of polar coordinate points with the same reference rotation angle but different reference point line distances, that is, the preset number of rows, which is equivalent to the number of parallel straight lines extracted from the map. In some embodiments, it is preferably set to p s , in particular, the reference point line distances in the reference coordinate mapping space form an arithmetic progression with a leading term of 1 and a tolerance of 1. The number of columns of elements arranged in the reference coordinate mapping space is the number of polar coordinate points with the same reference point line distances but different reference rotation angles, that is, the preset number of columns, which is equivalent to the number of intersecting straight lines extracted from the map, and in some embodiments is preferably set to θ s In particular, the reference rotation angles in the reference coordinate mapping space form an arithmetic progression with a first term of 1 and a tolerance of 1; the polar coordinate points in the reference coordinate mapping space are all discrete.

[0059] Preferably, the number of columns of the reference coordinate mapping space can also be the number of polar coordinate points with the same reference rotation angle but different reference point line spacing, which is equal to the preset number of rows; the number of rows of the reference coordinate mapping space is the number of polar coordinate points with the same reference point line spacing but different reference rotation angles, which is equal to the preset number of columns; in this embodiment, the polar coordinate points arranged in the reference coordinate mapping space are all discretely distributed.

[0060] In the aforementioned embodiment, the elements of each row and column in the reference coordinate mapping space are the number of straight lines represented by the polar coordinate points at the corresponding positions in the Hough space. It should be noted that the coordinate system to which the polar coordinate points in the Hough space belong is not a standard polar coordinate system, but belongs to a Cartesian coordinate system. This embodiment maps a reference coordinate mapping space of the same size and relative distribution area from the comparison map and the map to be fused, both of which are used as parameter spaces to be detected, wherein the number of polar coordinate points with the same reference rotation angle but different reference point line spacing represents the number of parallel straight lines in the corresponding map, and the number of polar coordinate points with the same reference point line spacing but different reference rotation angles represents the number of straight lines with common points in the corresponding map, so that the straight line parameters described by the reference coordinate mapping space are more comprehensive, covering more and more comprehensive straight line segments in the corresponding map area.

[0061] As an embodiment, in step A1, the specific steps are as follows:

[0062] Step A11: extract a straight line in the comparison map, and then perform Hough transformation of the currently extracted straight line into the corresponding reference coordinate mapping space. Then, calculate the sum of squares of the number of times the straight lines with different reference point line distances at the same reference rotation angle are extracted. That is, when the reference rotation angle θ is equal to a certain value θ_i, 1≤θ_i≤θ s When the line distance at the reference point is 1 to ρ s Among the lines, using lines with the same reference point spacing as statistical units, the number of times each line is Hough transformed to the corresponding position in the reference coordinate mapping space is counted line by line. Then, the number of times lines with the same reference point spacing and the same reference rotation angle appear at the same polar coordinate point position in the Hough space of the comparison map is squared. Finally, the squared values ​​of the number of times lines with different reference point spacings at the same reference rotation angle appear are accumulated and summed, and this sum is used as the first frequency statistical information. That is, first frequency statistical information in a reference coordinate mapping space is obtained from the comparison map through the Hough transform, where lines with different reference point spacings at the same reference rotation angle are equivalent to parallel lines in the comparison map. Then, the process proceeds to step A12.

[0063] Step A12: Calculate the first frequency statistics at each reference rotation angle in sequence according to step A11 to form a discrete sequence of the sum of squares of the linear distribution of the comparison map, wherein the number of elements in the discrete sequence of the sum of squares of the linear distribution of the comparison map is the preset number of columns, corresponding to discrete reference rotation angles from 1 to θ s , which is a discrete angle value, can be an arithmetic progression with a first term of 1 and a common difference of 1 in some embodiments.

[0064] Step A13: extract straight lines in the map to be fused, perform Hough transformation on the straight lines into the corresponding reference coordinate mapping space, and then calculate the sum of squares of the number of times straight lines with different reference point line distances at the same reference rotation angle are extracted, as the second frequency statistical information, wherein straight lines with different reference point line distances at the same reference rotation angle are equivalent to parallel straight lines in the map to be fused; then proceed to step A14; that is, when the reference rotation angle θ is equal to a certain value θ_i, 1≤θ_i≤θ s When the line distance at the reference point is 1 to ρ sAmong the lines, using lines with the same reference point spacing as statistical units, the number of times each line is Hough transformed to the corresponding position in the reference coordinate mapping space is counted line by line. Then, the number of times lines with the same reference point spacing and the same reference rotation angle appear at the same polar coordinate point position in the Hough space of the map to be fused is squared. Finally, the squared values ​​of the number of times lines with the same reference rotation angle and different reference point spacing appear are accumulated and summed. This sum is used as the first frequency statistical information. That is, second frequency statistical information in a reference coordinate mapping space is obtained from the map to be fused through the Hough transform. Then, the process proceeds to step A14.

[0065] Step A14: Calculate the second frequency statistics at each reference rotation angle in sequence according to step A13 to form a discrete sequence of the sum of squares of the straight line distribution of the map to be fused. The number of elements in the discrete sequence of the sum of squares of the straight line distribution of the map to be fused is the preset number of columns, corresponding to discrete reference rotation angles from 1 to θ. s , which is a discrete angle value, can be an arithmetic progression with a first term of 1 and a common difference of 1 in some embodiments.

[0066] Steps A11 to A14 are equivalent to obtaining the detected and extracted frequencies of each parallel straight line within the same map, but do not obtain the detected and extracted frequencies of each intersecting straight line at different angles and orientations within the same map. Quantitative information of the straight line in the corresponding reference coordinate mapping space with the reference rotation angle as the independent variable is accumulated, and the square sum of the obtained frequencies is then calculated to describe the frequency of straight lines in various directions appearing in the grid map, thereby enabling the robot to identify and locate areas with linear features such as walls and furniture.

[0067] Step A2: Periodically convolve the second frequency statistical information and the first frequency statistical information using the trigonometric function of the reference rotation angle to obtain a cross-correlation signal sequence between the straight line of the map to be fused and the straight line corresponding to the comparison map; then proceed to step A3. Specifically, the reference point line distance is used as the independent variable, the discrete sequence of the sum of squares of the straight line distribution of the to-be-fused map is kept unchanged, the reference rotation angle is used to translate the discrete sequence of the sum of squares of the straight line distribution of the comparison map, and then the two sequences are multiplied with the discrete sequence of the sum of squares of the straight line distribution of the to-be-fused map and then added together; or the reference point line distance is used as the independent variable, the discrete sequence of the sum of squares of the straight line distribution of the comparison map is kept unchanged, the reference rotation angle is used to translate the discrete sequence of the sum of squares of the straight line distribution of the to-be-fused map, and then the two sequences are multiplied with the discrete sequence of the sum of squares of the straight line distribution of the comparison map and then added together; wherein the cross-correlation between the discrete sequence of the sum of squares of the straight line distribution of the to-be-fused map and the discrete sequence of the sum of squares of the straight line distribution of the comparison map can reflect the degree of similarity of the delays of each corresponding reference rotation angle, the discrete sequence of the sum of squares of the straight line distribution of the to-be-fused map is regarded as the Hough space signal of the to-be-fused map, and the discrete sequence of the sum of squares of the straight line distribution of the comparison map is regarded as the Hough space signal of the comparison map. When obtaining the cross-correlation signal between the discrete sequence of the sum of squares of the straight line distribution of the to-be-fused map and the discrete sequence of the sum of squares of the straight line distribution of the comparison map, since the trigonometric function of the reference rotation angle is periodic, the Hough space signal should be periodically extended.

[0068] As an embodiment, in step A2, the method of periodically convolving the second frequency statistical information and the first frequency statistical information using the trigonometric function of the reference rotation angle to obtain a cross-correlation signal sequence between a straight line of the map to be fused and a straight line corresponding to the comparison map specifically includes: setting the number of different reference point line distances corresponding to the polar coordinate points in the reference coordinate mapping space as the cumulative number, wherein, in the reference coordinate mapping space, the cumulative number is greater than 0, preferably set to be greater than or equal to 1; when the reference point line distances in the reference coordinate mapping space form an arithmetic progression with a first term of 1 and a tolerance of 1, the cumulative number is ρ s, which can be set as an independent variable in the convolution process; at the same time, the number of polar coordinate points in the reference coordinate mapping space with the same reference point line spacing but different reference rotation angles is set as the reference offset number, which is used to determine whether all sequences have been calculated; then, discrete convolution is performed on the discrete sequence of the sum of squares of the straight line distribution of the comparison map and the discrete sequence of the sum of squares of the straight line distribution of the map to be fused, to obtain a cross-correlation signal sequence of the straight line of the map to be fused and the corresponding straight line of the comparison map under the periodic extension of different reference rotation angles, so as to achieve periodic extension and accumulation of the second frequency statistical information and the first frequency statistical information using the periodicity of the reference rotation angle, thereby completing the convolution of the first frequency statistical information and the second frequency statistical information; wherein the trigonometric function periodicity of the reference rotation angle is: based on the trigonometric function relationship in the Hough transform, for the same straight line in the comparison map or the map to be fused, this is a straight line in the reference coordinate mapping space transformed from the Hough transform, and when the same reference point line spacing is used as the result of the trigonometric function, the angles obtained by the inverse trigonometric function contain at least one of the reference rotation angles, and the difference between these reference rotation angles is a multiple of 360 degrees. This embodiment uses a convolution operation to evaluate the similarity between the angular orientations of a straight line in the to-be-fused map and a straight line in the comparison map within a plurality of discrete angle ranges defined by the reference rotation angle, so as to provide a rotation angle suitable for map matching.

[0069] Specifically, the discrete convolution of the discrete sequence of the sum of squares of the straight line distribution of the comparison map and the discrete sequence of the sum of squares of the straight line distribution of the map to be fused is specifically:

[0070] The number of different reference point line distances corresponding to the polar coordinate points in the reference coordinate mapping space is set as the cumulative number, which is greater than or equal to 1 and is set as the independent variable in the convolution process; at the same time, the number of polar coordinate points in the reference coordinate mapping space with the same reference point line distance but different reference rotation angles is set as the reference offset number, which is used to determine whether all sequences have been calculated. The reference offset number can be 0.

[0071] Keeping the discrete sequence of the sum of squares of the straight line distribution of the comparison map unchanged, directly multiply the discrete sequence of the sum of squares of the straight line distribution of the to-be-fused map by each element of the discrete sequence of the sum of squares of the straight line distribution of the comparison map at the same reference point line spacing, and then add them together. This is used as the first discrete convolution value in the cross-correlation signal sequence. This is regarded as a translation operation of the corresponding reference rotation angle occurring once for each element in the discrete sequence of the sum of squares of the straight line distribution of the to-be-fused map. In this embodiment, the translation operation is a translation in the same direction, and the reference rotation angle in the first translation operation is 0. Then, after each element in the discrete sequence of the sum of squares of the straight line distribution of the to-be-fused map undergoes a translation operation of the corresponding reference rotation angle, it is multiplied and added with the corresponding element of the discrete sequence of the sum of squares of the straight line distribution of the comparison map to obtain the convolution value under the current translation operation, which is used as a discrete convolution value in the cross-correlation signal sequence. The discrete sequence of the sum of squares of the straight line distribution of the to-be-fused map is shifted left or right by the offset amplitude of the corresponding reference rotation angle according to the translation order represented by the current reference offset number. The offset amplitude of a reference rotation angle is equivalent to an interval of the independent variable. Then, under the same independent variable, it is multiplied and added with each element of the discrete sequence of the sum of squares of the straight line distribution of the comparison map to obtain the convolution value under the current translation operation. This process is repeated until the reference rotation angles equal to the reference offset number are translated in the same direction to obtain all the discrete convolution values ​​in the cross-correlation signal sequence.

[0072] As another discrete convolution implementation method, the discrete sequence of the sum of squares of the straight line distribution of the map to be fused is kept unchanged, and the discrete sequence of the sum of squares of the straight line distribution of the comparison map is directly multiplied by each element of the discrete sequence of the sum of squares of the straight line distribution of the map to be fused at the same reference point line distance and then added. The multiplication is used as the first discrete convolution value in the cross-correlation signal sequence, and is regarded as a translation operation of the corresponding reference rotation angle for each element in the discrete sequence of the sum of squares of the straight line distribution of the comparison map. The translation operation in this embodiment is a translation operation in the same direction, wherein the reference rotation angle under the first translation operation is 0. Then, after each element in the discrete sequence of the sum of squares of the straight line distribution of the comparison map undergoes a translation operation of the corresponding reference rotation angle, it is multiplied and added with the corresponding element of the discrete sequence of the sum of squares of the straight line distribution of the map to be fused to obtain the convolution value under the current translation operation, which is used as a discrete convolution value in the cross-correlation signal sequence, wherein the discrete sequence of the sum of squares of the straight line distribution of the comparison map is shifted left or right by the offset amplitude of the corresponding reference rotation angle according to the translation order represented by the current reference offset number, and the offset amplitude of a reference rotation angle is equivalent to an interval of the independent variable, and then multiplied and added with each element of the discrete sequence of the sum of squares of the straight line distribution of the map to be fused under the same independent variable to obtain the convolution value under the current translation operation; this is repeated until the reference rotation angles equal to the reference offset number are translated in the same direction, and all discrete convolution values ​​in the cross-correlation signal sequence are obtained.

[0073] The aforementioned embodiment of discrete convolution utilizes the periodicity of the reference rotation angle in the reference coordinate mapping space relative to the reference point line distance, sets the mapping discrete sequence of the translated map and the mapping discrete sequence corresponding to the same map to be matched, multiplies each value in pair by pair, and then adds them together to complete the periodic extension of the Hough space, obtains the cross-correlation of each reference rotation angle in the comparison map to be matched and the map to be fused, and reduces the influence of the angular offset error of the corresponding straight lines in the two maps used for matching.

[0074] Step A3: Calculate and obtain a second preset number of local maxima from the discrete convolution values ​​in the cross-correlation signal sequence (the number is the second preset number of local maxima), and then set the rotation angles corresponding to the currently obtained second preset number of local maxima as the optimal rotation angles between the to-be-fused map and the comparison map, and set the rotation angle corresponding to each local maximum as an optimal rotation angle; wherein the cross-correlation signal sequence is the result of a cross-correlation operation based on the reference rotation angle, so there may be multiple maxima at the same reference rotation angle, that is, there may be one or more local maxima as candidates for the rotation angle parameters required for map rotation matching.

[0075] Specifically, the method for calculating and obtaining a second preset number of local maxima from the mutual correlation signal sequence specifically includes: in the reference coordinate mapping space, controlling the mutual correlation signal sequence to perform a partial derivative operation along the direction of the variable axis where the reference rotation angle is located, performing a partial derivative operation on the mutual correlation signal sequence, when the first-order difference of the mutual correlation signal sequence is 0 and the second-order difference of the mutual correlation signal sequence is less than 0, obtaining at least one local maximum discrete convolution value from the mutual correlation signal sequence and determining them as local maxima, wherein the cumulative number of local maxima obtained is the second preset number; then setting all local maxima as the straight lines and contrast areas of the map to be fused. At the same time, the rotation angles corresponding to all local maxima are set as the optimal rotation angles of the map to be fused relative to the comparison map. These optimal rotation angles can be used as candidate rotation angles for converting the coordinates calculated by the robot in real time in the map to be fused into the first optimized map to be fused. It should be added that, in the map to be fused constructed in real time, these optimal rotation angles may be the rotation angles of the straight lines extracted in the corresponding directions relative to a reference navigation direction. At the same time, the similarity (matching) degree of the straight lines extracted in these corresponding directions relative to the straight lines of the same comparison map is the greatest.

[0076] In this embodiment, when the first-order difference is 0, at the corresponding polar coordinate point in the reference coordinate mapping space, the rate of change of the cross-correlation signal sequence in the direction of the coordinate axis (variable axis) to which the reference rotation angle corresponding to the polar coordinate point belongs (or the directional derivative in the direction of the coordinate axis (variable axis) to which the reference rotation angle belongs) is 0, and a local maximum or local minimum can be obtained. At this time, the second-order difference is continued to be obtained. When the second-order difference (or the second-order directional derivative of the coordinate axis (variable axis) to which the reference rotation angle belongs) is less than 0, the cross-correlation signal sequence grows slowest in the direction of the coordinate axis (variable axis) to which the reference rotation angle of the corresponding polar coordinate point belongs, and a local maximum is obtained. At this time, the second-order difference of the cross-correlation signal sequence less than 0 corresponds to more than one polar coordinate point in the reference coordinate mapping space, and the maximum point is more than one, so that the local maximum obtained in the end is also more than one. This prevents the algorithm from detecting multiple extremely close "false" straight lines and making misjudgments; furthermore, if the local maximum value in the cross-correlation signal sequence is high enough, only a small amount of time is needed to find it, thereby substantially reducing the calculation time and having high execution efficiency.

[0077] In the aforementioned embodiment, a reference coordinate mapping space of the same size and relative distribution area is mapped from the comparison map and the map to be fused respectively through the Hough transform to timely save the straight line feature information to avoid the loss of map information. Then, statistical information associated with the straight line is extracted from the respective reference coordinate mapping spaces and a convolution operation is performed with the rotation angle as a period to obtain the strength of the cross-correlation between the rotation angle of the straight line of the map to be fused and the rotation angle of the corresponding straight line of the comparison map, and a matching operation is performed on the straight line of the map to be fused and the straight line of the comparison map. On this basis, the rotation angle corresponding to the convolution value of the local maximum is selected as the optimal rotation angle between the map to be fused and the comparison map, and the cross-correlation is only evaluated for the distribution frequency characteristics of the corresponding straight line in the reference coordinate mapping space at a specific orientation, thereby accelerating the processing speed of the rotation angle and thereby accelerating the subsequent conversion of the map to be fused to the comparison map.

[0078] Based on the aforementioned embodiment, a chip is also disclosed. The chip is used to store a program. The program is the map fusion method, which is used to calculate and obtain a cross-correlation signal sequence between a straight line of the map to be fused and a straight line corresponding to a comparison map, then calculate and obtain a local maximum from the cross-correlation signal sequence, and use the rotation angle corresponding to this local maximum as a candidate rotation angle and use it to rotate the map to be fused. Then, for each rotated map to be fused, the cross-correlation coefficient is calculated between it and a comparison map to obtain the corresponding best matching result in combination with the candidate rotation angle; then, for each best matching result, the map similarity is calculated using a directed distance field under the corresponding comparison map, and then the matching result with the greatest similarity is selected from multiple comparison maps and fused with the map to be fused to reduce data redundancy.

[0079] The present invention also protects a robot equipped with the chip, which is used to obtain the optimal rotation angle and optimal translation vector between the map to be fused and the corresponding comparison map based on the mutual correlation between the map to be fused and the corresponding comparison map, to form an optimal transformation matrix, and then transform a map to be fused into each comparison map through the corresponding optimal transformation matrix. Finally, the different maps are normalized to the same scale for similarity comparison to obtain the most similar map to be fused and comparison map and fuse them to remove redundant data and improve the operating efficiency of the robot.

[0080] It will be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the references to memory, storage, database or other media used in the various embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory ROM, programmable memory PROM, electrically programmable memory DPROM, electrically erasable programmable memory DDPROM or flash memory. Volatile memory may include random access memory RAM or external cache memory.

[0081] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0082] The above embodiments merely represent several embodiments of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention. It should be noted that a person skilled in the art may make various modifications and improvements without departing from the concept of the present application, and these modifications and improvements are all within the scope of protection of the present application.

Claims

1. A map fusion method, characterized in that: The method comprises the following steps: Step A: Select one of the pre-stored maps as the map to be fused and the remaining maps as comparison maps; calculate a second preset number of optimal rotation angles based on the correlation between the map to be fused and the comparison map; use each optimal rotation angle to rotate the map to be fused respectively to obtain a second preset number of first optimized maps; wherein the robot pre-stores a total of maps equal to the sum of the first preset number and 1; Step B: Controlling the second preset number of first optimized maps to perform pairwise accelerated convolution with the first preset number of comparison maps, respectively, to obtain a cross-correlation parameter matrix between each first optimized map and each corresponding comparison map; Step C: converting the map to be fused to the corresponding comparison map based on an optimal conversion matrix composed of an element with the largest value in the same cross-correlation parameter matrix and an optimal rotation angle corresponding to the first optimized map, and determining to convert it into the second optimized map; Step D: Segment the overlapping areas of the second optimized map and the corresponding comparison map, respectively, and record them as the first area and the second area. Calculate the signed distance fields of the first area and the second area respectively using the double traversal detection algorithm. Then, calculate the average distance between the first area and the second area based on the signed distance field. Sum the average distances to obtain the map similarity between the first area and the second area. Then, select the second optimized map and the comparison map corresponding to the map similarity that meets the conditions and superimpose them to complete the map fusion.

2. A map fusion method according to claim 1, characterized in that: In step D, the method for obtaining the map similarity between the first area and the second area includes: Step D1: Segment the overlapping areas of the second optimized map and the corresponding comparison map, respectively, and record them as the first area and the second area; Step D2: define a set, the set including all matrix elements in the first region and the second region, and the values ​​in the set are non-repeated; Step D3, calculating the average distance between a matrix element having a preset value in the first region and the nearest matrix element having the same value in the corresponding second region, and calculating the average distance between a matrix element having a preset value in the second region and the nearest matrix element having the same value in the corresponding first region; wherein the preset value belongs to the set; Step D4: define a value in the set that is not involved in the calculation as a preset value, return to step D3 to perform calculations until all values ​​in the set are involved in the calculation, and then proceed to step D5; Step D5: Calculate the sum of all average distances obtained in step D3 to obtain the map similarity between the first area and the second area; Each map similarity is matched with a corresponding comparison map and a corresponding optimal rotation angle.

3. A map fusion method according to claim 2, characterized in that: In step D3, the method for calculating the average distance between the matrix element with a preset value in the first region and the nearest matrix element with the same value in the corresponding second region specifically includes the following steps: Step D31: Calculate the signed distance field of the second area; Step D32: Calculate the distances between the matrix elements with preset values ​​in the first region and all matrix elements with the same values ​​in the directed distance field of the second region, and take the minimum value. Step D33: Search for the next matrix element whose value in the first region is the preset value, return to step D32 and continue calculation until all matrix elements whose values ​​in the first region are the preset value are calculated, and then proceed to step D34; Step D34: Calculate the sum of all minimum values ​​obtained in step D32, and then average them to obtain the average distance between the matrix element with the preset value in the first area and the nearest matrix element with the same value in the second area.

4. A map fusion method according to claim 3, characterized in that: In step D31, the method for calculating the signed distance field of the second area specifically includes: Step D311, initializing the matrix elements in the second region; Step D312: Perform a first traversal of the matrix elements in the initialized second region according to the first traversal direction. During the traversal, update the current matrix elements to values ​​that satisfy the first condition. After the first traversal is completed, proceed to step D313. Step D313: Perform a second traversal on the matrix elements in the second region that have been traversed for the first time in the second traversal direction. During the traversal, update the current matrix elements to values ​​that satisfy the second condition. After the second traversal, obtain the signed distance field corresponding to the second region.

5. A map fusion method according to claim 4, characterized in that: In step D311, the method for initializing the matrix elements in the second region specifically includes: initializing the matrix elements in the second region whose values ​​are preset values ​​to 0, and then initializing the other matrix elements to infinity.

6. A map fusion method according to claim 4, characterized in that: The first traversal direction in step D312 specifically refers to: starting from the first matrix element in the first row of the second area, traversing from left to right, after traversing the last matrix element in the first row, continuing to traverse from the first matrix element in the second row from left to right, and so on, until all matrix elements are traversed.

7. A map fusion method according to claim 6, characterized in that: The value that satisfies the first condition in step D312 specifically refers to: during the traversal process, taking the matrix element values ​​to the left and above the current matrix element and adding 1 to each, and then comparing the values ​​with the current matrix element value, where the minimum value among the three is the value that satisfies the first condition.

8. A map fusion method according to claim 4, characterized in that: The second traversal direction in step D313 specifically refers to: starting from the last matrix element in the last row of the second region, traversing from right to left, after traversing the first matrix element in the last row, continuing to traverse from the last matrix element in the second to last row from right to left, and so on, until all matrix elements are traversed.

9. A map fusion method according to claim 8, characterized in that: The value that satisfies the second condition in step D313 specifically refers to: during the traversal process, taking the matrix element values ​​to the right and below the current matrix element and adding 1 to each, and then comparing the values ​​with the current matrix element value, where the minimum value among the three is the value that satisfies the second condition.

10. A map fusion method according to claim 6 or 8, characterized in that: The traversal starting point of the second traversal direction is the traversal end point of the first traversal direction.

11. A map fusion method according to claims 2 to 10, characterized in that: In step D, the method of selecting the second optimized map corresponding to the map similarity that meets the conditions and the comparison map and superimposing them includes: Step D6: Select the map with the largest similarity value and determine whether it is greater than or equal to a threshold. If not, select a map that has not been selected from the pre-stored maps as the map to be fused, and then repeat steps A to D. If yes, proceed to step D7. In step D7, the matrix elements in the overlapping area of ​​the second optimized map and the comparison map corresponding to the map similarity with the largest value are added and subtracted from a preset constant to obtain the superimposed matrix elements. Then, the other matrix elements of the second optimized map and / or the comparison map except for the overlapping area are retained to complete the map fusion.

12. A chip for storing a computer program, characterized in that: When the computer program is executed, the map fusion method according to any one of claims 1 to 11 is implemented.

13. A robot, characterized in that: The robot is equipped with the chip according to claim 12.

Citation Information

Patent Citations

  • 3D map merging method, 3D map merging device and electronic device

    CN105447911A

  • Multi-data-source map data fusion method

    CN110851547A