A method, system and product for constructing terrain semantic map based on binocular camera

By equipping the robot with a binocular camera and using a target detection neural network model to perform terrain semantic segmentation and dynamic object removal, a high-precision three-dimensional environmental map is constructed, which solves the problems of low map accuracy and lack of semantic information in the wild environment, and enhances The robot’s ability to move autonomously.

CN116883586BActive Publication Date: 2024-08-23CHONGQING UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310706925.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-14
Publication Date
2024-08-23
Estimated Expiration
2043-06-14

AI Technical Summary

Technical Problem

In the wild environment, due to the lack of prior maps, the robot has low accuracy in constructing environmental maps and lacks terrain semantic information, resulting in limited autonomous movement capabilities.

Method used

A binocular camera is mounted on the robot, and the depth information image is obtained by calibrating the pose transformation matrix of the camera coordinate system and the robot coordinate system. The target detection neural network model is used to perform dynamic object position and terrain segmentation, remove the dynamic object position, and calculate the position. pose transformation matrix to construct a three-dimensional environment map and integrate terrain semantic information.

Benefits of technology

It improves the accuracy of the three-dimensional environment map, enhances the stability of the robot's autonomous movement, avoids the influence of dynamic objects and the instability of illumination changes, and provides a three-dimensional space map with terrain semantic information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116883586B
    Figure CN116883586B
Patent Text Reader

Abstract

The present invention provides a method, system and product for constructing a terrain semantic map based on a binocular camera. The method comprises: calibrating the relative posture transformation matrix between the binocular camera coordinate system and the robot coordinate system, determining the image with depth information according to the left-eye image and the right-eye image, selecting the key frame of the image with depth information, inputting it into the target detection neural network model, outputting the dynamic object position and the terrain segmentation result; removing the pixel points of the dynamic object position, and selecting the key frame after the dynamic object is removed; extracting the feature points of the key frame after the dynamic object is removed, matching the feature points, calculating the posture transformation matrix of the binocular camera movement, and constructing a three-dimensional environment map; according to the relative posture transformation matrix, transforming the terrain segmentation result to the robot coordinate system, fusing the three-dimensional environment map and the terrain segmentation result, and outputting a three-dimensional space map with terrain semantic information. The present invention improves the accuracy of the three-dimensional environment map.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of path planning in outdoor environments, and in particular to a method, system and product for constructing a terrain semantic map based on a binocular camera. Background Art

[0002] With the development of social and economic levels and the continuous improvement of technology, new requirements have been put forward for the advancement of industrial manufacturing intelligence and unmanned systems. The large-scale application of industrial robots in industry and service robots in life shows the wide range of future application scenarios of robots. In the design of general mobile robots, it is mainly divided into three parts: environmental perception, path planning and behavior control. Among them, environmental perception refers to the process in which the robot uses its own sensors to process objects in the environment to obtain data fed back by the sensors, and uses the data to judge the robot's own state; path planning is the robot's clarification of the destination to be reached by its own task, and planning its own local path and global path; behavior control is the robot's control of its own speed and direction according to the path planned to safely reach the destination. In extreme outdoor environments, there will be no prior map of unknown environments, which leads to the robot's extremely low ability to perform tasks in unknown environments.

[0003] Solution 1: Use the laser radar as the sensor carried by the robot itself, extract features from the previous and next frames through the point cloud data collected by the laser radar, and use the extracted three-dimensional point cloud features to calculate the laser radar's pose transformation matrix to obtain the robot's own pose transformation matrix. The robot's pose transformation matrix can be used to construct a laser radar odometer, which can then be used to obtain environmental information of the unknown environment and build an environmental map. The main disadvantage of this method is that the price of the laser radar is too high. In the wild environment, the large amount of point cloud data collected by the laser radar leads to widespread noise, resulting in the failure of subsequent environmental map construction. In addition, dynamic objects in the environment will greatly affect the results of the map construction, and the constructed point cloud map does not have semantic information of the terrain, resulting in inaccurate positioning of the robot itself, which affects the robot's autonomous movement.

[0004] To avoid the problem of high price of using LiDAR as the main sensor, a new method is to use a depth camera as the sensor carried by the robot itself. The price of the camera is relatively low compared to LiDAR, and the data it collects is an image, which has rich color and texture information, so the image can output rich geometric features of the scene.

[0005] Solution 2: Use the depth camera as the robot's own sensor. The depth information of the scene objects can be obtained through the color image and depth image taken by the depth camera. By extracting and matching the features of the two frames before and after the captured image, the rotation matrix of the camera can be calculated. By transforming the camera rotation matrix, the robot's posture transformation can be obtained, so the visual odometer can be constructed to obtain a map of the environment.

[0006] This method uses a color image and a corresponding depth image as input, and uses the relationship between the two to derive the world coordinates of objects in the environment. Then, by extracting and matching features, tracking postures, and building maps on the feedback data, it is possible to build maps of unknown environments. The main disadvantage of this method is that it cannot stably extract image features when the illumination changes greatly, and the effective range of the depth camera is within 10m. It is very common to exceed the range in the wild environment, which leads to inaccurate depth information. At the same time, dynamic objects will affect the accuracy of mapping to a greater extent, and this method does not incorporate the semantic information of the terrain into the final constructed map, which greatly affects the autonomous movement of the robot. Summary of the invention

[0007] The purpose of the present invention is to provide a method, system and product for constructing a terrain semantic map based on a binocular camera, so as to solve the problem that the accuracy of the constructed environment map is low and the autonomous movement of the robot is greatly affected because there is no terrain semantic information in the constructed environment map.

[0008] To achieve the above object, the present invention provides the following solutions:

[0009] A method for constructing a terrain semantic map based on a binocular camera, wherein a binocular camera is mounted on a robot, comprising:

[0010] Calibrate the relative pose transformation matrix between the binocular camera coordinate system and the robot coordinate system, and obtain the left eye image and the right eye image captured by the binocular camera;

[0011] Determine an image with depth information according to the left-eye image and the right-eye image, and select a key frame of the image with depth information;

[0012] Inputting the key frame of the image with depth information into the target detection neural network model, outputting the position of the dynamic object in the image with depth information and the terrain segmentation result;

[0013] Removing pixels at the position of the dynamic object, and selecting a key frame after the dynamic object is removed;

[0014] Extracting feature points of the key frame after the dynamic object is removed, matching the feature points, and calculating the pose transformation matrix of the binocular camera movement;

[0015] Constructing a three-dimensional environment map according to the posture transformation matrix;

[0016] According to the relative posture transformation matrix, the terrain segmentation result is transformed into the robot coordinate system, the three-dimensional environment map and the terrain segmentation result are fused, and a three-dimensional space map with terrain semantic information is output.

[0017] Optionally, selecting a key frame of the image with depth information specifically includes:

[0018] Obtaining the sampling frame rate and system processing speed of the binocular camera;

[0019] The key frame of the image with depth information is selected according to the sampling frame rate and the system processing speed.

[0020] Optionally, removing the pixel points at the position of the dynamic object specifically includes:

[0021] Based on the imaging principle of the binocular camera, the three-dimensional world coordinates of the dynamic object are calculated, and the coordinates of the left-eye image and the coordinates of the right-eye image are obtained; the vertical coordinates of the left-eye image and the right-eye image are the same;

[0022] Determine the parallax according to the horizontal coordinate of the left image and the horizontal coordinate of the right image;

[0023] Obtain the focal length of the binocular camera and the distance between the centers of the two cameras;

[0024] Determine a depth value in three-dimensional space according to the parallax, focal length, and the distance between the centers of the two cameras;

[0025] The pixels of the dynamic object are removed according to the depth value of the three-dimensional space and the position of the dynamic object.

[0026] Optionally, determining the depth value of the three-dimensional space according to the parallax, the focal length, and the distance between the centers of the two cameras specifically includes:

[0027] Using the formula Determine the depth value of the three-dimensional space; where z is the depth value of the three-dimensional space, f is the focal length, b is the distance between the centers of the two cameras, and d is the parallax.

[0028] Optionally, matching the feature points and calculating the pose transformation matrix of the binocular camera movement specifically includes:

[0029] Extract the feature points of the key frames of the previous and next two frames, match the feature points based on the minimum Hamming distance, and generate a feature point matching relationship;

[0030] Obtaining the three-dimensional coordinates of the feature point in the camera coordinate system;

[0031] According to the relative posture transformation matrix, the three-dimensional coordinates in the camera coordinate system are transferred to the robot coordinate system to generate the three-dimensional coordinates of the feature point in the robot coordinate system;

[0032] Based on the three-dimensional coordinates of the feature points in the robot coordinate system, a pose transformation matrix of the binocular camera movement is calculated according to the feature point matching relationship.

[0033] Optionally, constructing a three-dimensional environment map according to the posture transformation matrix specifically includes:

[0034] The first frame image captured by the binocular camera when working is used as a world coordinate system, and the feature points are used as map points in constructing an environment map; the coordinates of the map points are the coordinates in the world coordinate system;

[0035] Generate a posture transformation matrix of the robot in three-dimensional space according to the posture transformation matrix;

[0036] Reconstructing an environment map according to the posture transformation matrix of the robot;

[0037] bundling optimization of the continuous posture transformation matrices of the robot to generate an optimized robot posture transformation matrix, and generating a locally optimized environment map according to the optimized posture transformation matrix;

[0038] Perform loop closure detection on the robot, use visual word bags to match key frames in the locally optimized environment map, and if the match is successful, output a loop fusion map;

[0039] The global map is optimized using the loop-fused map; the optimized global map is a three-dimensional environment map.

[0040] Optionally, the three-dimensional environment map and the terrain segmentation result are integrated to output a three-dimensional space map with terrain semantic information, and then the method further includes:

[0041] The three-dimensional space map with terrain semantic information is subjected to Euclidean clustering of terrain point clouds to generate a clustered three-dimensional space map with terrain semantic information.

[0042] A terrain semantic map construction system based on binocular cameras, wherein a binocular camera is mounted on a robot, and includes:

[0043] A calibration module is used to calibrate the relative posture transformation matrix between the binocular camera coordinate system and the robot coordinate system, and obtain the left eye image and the right eye image captured by the binocular camera;

[0044] A key frame selection module, used to determine the image with depth information according to the left-eye image and the right-eye image, and select a key frame of the image with depth information;

[0045] A dynamic object position and terrain segmentation result output module, used to input the key frame of the image with depth information into the target detection neural network model, and output the dynamic object position and terrain segmentation result in the image with depth information;

[0046] A dynamic object removal module, used to remove the pixel points at the position of the dynamic object and select the key frame after the dynamic object is removed;

[0047] A posture transformation matrix calculation module is used to extract feature points of the key frame after the dynamic object is removed, match the feature points, and calculate the posture transformation matrix of the binocular camera movement;

[0048] A three-dimensional environment map construction module, used to construct a three-dimensional environment map according to the posture transformation matrix;

[0049] The three-dimensional space map output module with terrain semantic information is used to transform the terrain segmentation result to the robot coordinate system according to the relative posture transformation matrix, fuse the three-dimensional environment map and the terrain segmentation result, and output the three-dimensional space map with terrain semantic information.

[0050] An electronic device includes a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the above-mentioned method for constructing a terrain semantic map based on a binocular camera.

[0051] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned method for constructing a terrain semantic map based on a binocular camera.

[0052] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects: the present invention provides a method, system and product for constructing a terrain semantic map based on a binocular camera, wherein a binocular camera is mounted on a robot, an image with depth information is determined, and the position of dynamic objects and terrain segmentation results in the image with depth information are output based on a target detection neural network model, and the pixel points at the position of the dynamic object are removed. A three-dimensional environment map is constructed based on the key frame after the dynamic object is removed (i.e., the image after the dynamic object is removed), and then the terrain segmentation results are fused to output a three-dimensional space map with terrain semantic information. Since the pixel points at the position of the dynamic object are removed, the accuracy of the three-dimensional environment map is greatly improved, and the terrain segmentation results are fused to generate a three-dimensional space map with terrain semantic information, thereby avoiding affecting the autonomous movement of the robot. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0054] Figure 1 A flow chart of a method for constructing a terrain semantic map based on a binocular camera provided by the present invention;

[0055] Figure 2 This is a schematic diagram of the structure of the field robot mobile platform provided by the present invention;

[0056] Figure 3 Schematic diagram of field images collected by binocular cameras;

[0057] Figure 4 This is a schematic diagram of an image after semantic segmentation;

[0058] Figure 5 Schematic diagram of dynamic object detection in a wild environment;

[0059] Figure 6 This is a flow chart of a method for constructing a terrain semantic map based on a binocular camera in a field environment provided by the second embodiment of the present invention. DETAILED DESCRIPTION

[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0061] The purpose of the present invention is to provide a method, system and product for constructing a terrain semantic map based on a binocular camera, which improves the accuracy of the three-dimensional environment map and avoids affecting the autonomous movement of the robot.

[0062] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0063] Embodiment 1

[0064] like Figure 1 As shown, the present invention provides a method for constructing a terrain semantic map based on a binocular camera, wherein a binocular camera is mounted on a robot, comprising:

[0065] Step 101: calibrate the relative posture transformation matrix between the binocular camera coordinate system and the robot coordinate system, and obtain the left eye image and the right eye image captured by the binocular camera.

[0066] Step 102: determining an image with depth information according to the left-eye image and the right-eye image, and selecting a key frame of the image with depth information.

[0067] In practical applications, selecting the key frame of the image with depth information specifically includes: obtaining the sampling frame rate and system processing speed of the binocular camera; and selecting the key frame of the image with depth information according to the sampling frame rate and the system processing speed.

[0068] Step 103: Input the key frame of the image with depth information into the target detection neural network model, and output the position of the dynamic object in the image with depth information and the terrain segmentation result; the terrain segmentation result includes sand, grass, woods, people and sky, etc.

[0069] In the current object detection and semantic segmentation neural networks, the two are treated as different tasks. If different operations need to be performed on the image, different neural networks are required to implement them, which greatly increases the same computing resources.

[0070] The present invention combines the two tasks of segmentation and detection, and can output the segmentation status and detection results of the image using one convolutional neural network, thus saving the same computing resources and speeding up the image processing.

[0071] Step 104: remove the pixel points at the position of the dynamic object, and select the key frame after the dynamic object is removed.

[0072] In practical applications, removing the pixel points at the position of the dynamic object specifically includes: calculating the three-dimensional world coordinates of the dynamic object based on the imaging principle of the binocular camera, and obtaining the coordinates of the left-eye image and the right-eye image; the longitudinal coordinate of the left-eye image and the longitudinal coordinate of the right-eye image are the same; determining the disparity according to the abscissa of the left-eye image and the abscissa of the right-eye image; obtaining the focal length of the binocular camera and the distance between the centers of the two cameras; determining the depth value of the three-dimensional space according to the disparity, the focal length and the distance between the centers of the two cameras; and removing the pixel points of the dynamic object according to the depth value of the three-dimensional space and the position of the dynamic object.

[0073] Determine the depth value of the three-dimensional space according to the parallax, focal length and the distance between the centers of the two cameras, specifically including: using the formula Determine the depth value of the three-dimensional space; where z is the depth value of the three-dimensional space, f is the focal length, b is the distance between the centers of the two cameras, and d is the parallax.

[0074] Step 105: extracting feature points of the key frame after the dynamic object is removed, matching the feature points, and calculating the pose transformation matrix of the binocular camera movement.

[0075] In practical applications, the feature points are matched and the pose transformation matrix of the binocular camera movement is calculated, which specifically includes: extracting feature points of key frames of two frames before and after, and matching the feature points based on the minimum Hamming distance to generate a feature point matching relationship; obtaining the three-dimensional coordinates of the feature points in the camera coordinate system; according to the relative pose transformation matrix, transferring the three-dimensional coordinates in the camera coordinate system to the robot coordinate system to generate the three-dimensional coordinates of the feature points in the robot coordinate system; based on the three-dimensional coordinates of the feature points in the robot coordinate system, the pose transformation matrix of the binocular camera movement is calculated according to the feature point matching relationship.

[0076] Step 106: construct a three-dimensional environment map according to the posture transformation matrix.

[0077] In practical applications, step 106 specifically includes: using the first frame image collected when the binocular camera is working as the world coordinate system, and using the feature points as map points in constructing the environment map; the coordinates of the map points are the coordinates in the world coordinate system; generating the posture transformation matrix of the robot in three-dimensional space according to the posture transformation matrix; reconstructing the environment map according to the posture transformation matrix of the robot; bundling and optimizing the continuous posture transformation matrices of the robot to generate an optimized robot posture transformation matrix, and generating a locally optimized environment map according to the optimized posture transformation matrix; performing loop detection on the robot, and using the visual word bag to match the key frames in the locally optimized environment map, if the match is successful, outputting the loop fused map; using the loop fused map to optimize the global map; the optimized global map is a three-dimensional environment map.

[0078] If image features are directly used to reconstruct a map of an unknown three-dimensional environment, dynamic objects in the three-dimensional space (such as cars, people, etc.) will greatly affect the calculation of the pose transformation matrix of the robot's movement, and an inaccurate pose transformation matrix will cause the three-dimensional map to fail to be constructed.

[0079] The present invention utilizes a convolutional neural network to remove dynamic objects, and performs feature extraction and feature matching on the image after the dynamic objects are removed, so as to robustly obtain the posture transformation matrix of the robot, thereby realizing reconstruction of the three-dimensional environment.

[0080] Step 107: transform the terrain segmentation result into the robot coordinate system according to the relative posture transformation matrix, fuse the three-dimensional environment map and the terrain segmentation result, and output a three-dimensional space map with terrain semantic information.

[0081] The terrain segmentation results output by the convolutional neural network are used to obtain the terrain point cloud information in the three-dimensional space using the imaging characteristics of the binocular camera and the pose transformation matrix from the camera to the robot coordinate system. This method can output a three-dimensional space map with terrain semantic information, overcoming the problem that there is no terrain semantic information in the reconstructed environment map.

[0082] In practical applications, the three-dimensional environment map and the terrain segmentation result are fused to output a three-dimensional space map with terrain semantic information, and then the method further includes: performing Euclidean clustering of terrain point clouds on the three-dimensional space map with terrain semantic information to generate a clustered three-dimensional space map with terrain semantic information.

[0083] The Euclidean clustering method is used to cluster the terrain map points in the three-dimensional environment, and the representative terrain map points of this class are selected by clustering. This method solves the problem of large amount of terrain data in the constructed three-dimensional map caused by redundant terrain points, and can output a stable map.

[0084] The method for constructing a terrain semantic map based on a binocular camera in a wild environment proposed in the present invention can stably segment terrain semantic information and identify dynamic objects by using a convolutional neural network to perform semantic segmentation and target detection on the collected images, thereby solving the problem that dynamic objects in a wild environment affect the accuracy of map construction, realizing robust three-dimensional map construction, and then outputting a three-dimensional environment map with terrain semantic information.

[0085] Embodiment 2

[0086] The present invention uses the left and right eye images of a binocular camera as output, automatically identifies dynamic objects and terrain in the scene, and outputs robust map information in an unknown environment.

[0087] To achieve the above purpose, the hardware system of the present invention is Figure 2 As shown, it includes a robot chassis 1, a liquid crystal display 2, an industrial computer system 3, and a binocular camera 4. The specific implementation method is as follows:

[0088] 1. Calibrate the relative pose transformation matrix between the binocular camera coordinate system and the robot coordinate system.

[0089] Calibrate the relative pose transformation matrix T1 between the binocular camera's own coordinate system and the robot's base coordinate system through any mature robot hand-eye calibration method 4 .

[0090] 2. Initial image acquisition.

[0091] First, the robot chassis 1 drives the binocular camera 4 to work in the field environment to collect Figure 3 Original image shown.

[0092] 3. Key frame selection. Considering the frame rate of the binocular camera sampling and the processing speed of the system, starting from the first frame, a key frame is taken every 5 frames. This key frame represents the past 5 frames.

[0093] 4. Terrain segmentation and dynamic object recognition.

[0094] The keyframes are fed into the convolutional neural network model, which can output the segmentation of terrain and the detection of dynamic objects respectively. Figure 3 Inputting the convolutional neural network model will output something like Figure 4 The same terrain segmentation results as Figure 5 The same dynamic object detection results, where Figure 4 It includes grass 4-1, trees 4-2, mud 4-3, people 4-4 and sky 4-5.

[0095] 5. Dynamic object removal in key frames.

[0096] The three-dimensional world coordinates of dynamic objects are calculated based on the imaging principle of the binocular camera. Assume that the coordinates of a point in the three-dimensional space in the left eye image are (u L ,v), the coordinates in the right image are (u R ,v),Because the two cameras of the binocular camera are parallel, the vertical coordinate of the same point in the three-dimensional space is the same in the image.

[0097] Parallax d = u L -u R , the baseline b is the distance between the two camera centers, which is given in the factory parameters of the camera; the focal length of the camera is f, which is also given in the factory parameters; then the depth value of the three-dimensional space is The dynamic object is removed using the position of the dynamic object detected in step 4 and the calculated depth.

[0098] 6. Tracking of robot posture.

[0099] First, extract the ORB (Oriented FAST and Rotated BRIEF) feature points from the image without dynamic objects. Use the depth calculation method in step 5 to obtain the three-dimensional coordinates of the feature points in the camera coordinate system. Then use the pose transformation matrix from the camera coordinate system to the robot coordinate system calculated in step 1 to transform the coordinates of the feature points to the robot coordinate system. Perform feature point matching based on the minimum Hamming distance for the feature points extracted from the key frames of the previous and next frames. Use the matching relationship to calculate and estimate the pose transformation matrix of the robot.

[0100] 7. Map reconstruction of three-dimensional environment.

[0101] The present invention uses the first frame image collected when the binocular camera is working as the world coordinate system.

[0102] The feature points extracted from the image are used as map points in the map of the constructed environment, and the coordinates of the map points are the coordinates in the world coordinate system (that is, the first frame image).

[0103] The robot's posture coordinate transformation matrix calculated in step 6 can be used to obtain the robot's posture transformation in three-dimensional space. The matrix is ​​used to restore the robot's motion and then reconstruct the environment map.

[0104] 8. Local map optimization.

[0105] This step is mainly to reduce the distortion of the robot pose transformation matrix calculation caused by some observation and environmental noise.

[0106] The continuous posture transformation matrix of the robot over a period of time is bundled and optimized (Bundle Adjustment) to obtain a more accurate posture transformation matrix of the robot.

[0107] 9. Loop detection of the robot.

[0108] When the robot returns to the location it has been to before, it will fuse the locally optimized map in step 8. This step is implemented by using the visual word bag to match the current key frame. If the match is successful, the loop is found and the loop-fused map is output, and the global map is further optimized using bundling.

[0109] 10. Terrain semantic map fusion.

[0110] In step 9, the reconstructed map in three-dimensional space has been obtained. The corresponding depth information of the terrain segmented in step 4 is calculated to obtain the three-dimensional spatial information of the terrain. Then, T1 calculated in step 1 is used 4 The terrain map points in the terrain segmentation result in the key frame are transformed into the three-dimensional space under the robot coordinate system (the terrain map points have semantic color labels of different terrain types), and then the three-dimensional space map reconstructed in step 9 and the terrain segmentation result are fused by superposition fusion, and then the three-dimensional space map with terrain semantic information is output.

[0111] 11. Map output.

[0112] The three-dimensional spatial map with terrain semantic information in step 10 is subjected to Euclidean clustering of terrain point clouds. The specific method of Euclidean clustering is to set the threshold of Euclidean clustering to t and set the maximum number of point clouds in a single cluster to N. Then, the centroid of each Euclidean cluster is calculated and used as the representative of the class, thereby avoiding the problem of too many terrain point clouds. Then, the final three-dimensional spatial map with terrain semantic information can be output, which is conducive to robot path planning and behavior control.

[0113] The flowchart of the method for constructing a terrain semantic map based on a binocular camera in a field environment proposed by the present invention is as follows: Figure 6 As shown, the present invention solves the problem that dynamic objects affect the accuracy of the robot's construction of an environment map in an unknown environment and the constructed map has no terrain semantic information.

[0114] Embodiment 3

[0115] In order to execute the method corresponding to the above-mentioned embodiment 1 to achieve the corresponding functions and technical effects, a terrain semantic map construction system based on a binocular camera is provided below.

[0116] A terrain semantic map construction system based on binocular cameras, wherein a binocular camera is mounted on a robot, and includes:

[0117] The calibration module is used to calibrate the relative posture transformation matrix between the binocular camera coordinate system and the robot coordinate system, and obtain the left eye image and the right eye image captured by the binocular camera.

[0118] The key frame selection module is used to determine the image with depth information according to the left-eye image and the right-eye image, and select the key frame of the image with depth information.

[0119] A dynamic object position and terrain segmentation result output module is used to input the key frame of the image with depth information into the target detection neural network model, and output the dynamic object position and terrain segmentation result in the image with depth information;

[0120] The dynamic object removal module is used to remove the pixel points at the position of the dynamic object and select the key frame after the dynamic object is removed.

[0121] The posture transformation matrix calculation module is used to extract the feature points of the key frame after the dynamic object is removed, match the feature points, and calculate the posture transformation matrix of the binocular camera movement.

[0122] The three-dimensional environment map construction module is used to construct a three-dimensional environment map according to the posture transformation matrix.

[0123] The three-dimensional space map output module with terrain semantic information is used to transform the terrain segmentation result to the robot coordinate system according to the relative posture transformation matrix, fuse the three-dimensional environment map and the terrain segmentation result, and output the three-dimensional space map with terrain semantic information.

[0124] Embodiment 4

[0125] An embodiment of the present invention provides an electronic device including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the terrain semantic map construction method based on a binocular camera provided in the first embodiment.

[0126] In practical applications, the above electronic device may be a server.

[0127] In practical applications, an electronic device includes: at least one processor, a memory, a bus and a communications interface.

[0128] Wherein: the processor, the communication interface, and the memory communicate with each other via a communication bus.

[0129] Communication interface, used to communicate with other devices.

[0130] The processor is used to execute the program, and specifically can execute the method described in the above embodiment.

[0131] Specifically, the program may include program codes including computer operation instructions.

[0132] The processor may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the electronic device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0133] The memory is used to store programs. The memory may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.

[0134] Based on the description of the above embodiments, the embodiments of the present application provide a storage medium on which computer program instructions are stored. The computer program instructions can be executed by a processor to implement the method described in any embodiment.

[0135] The terrain semantic map construction system based on binocular cameras provided in the embodiments of the present application exists in various forms, including but not limited to:

[0136] (1) Mobile communication devices: These devices are characterized by their mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.

[0137] (2) Ultra-mobile personal computer devices: These devices fall into the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access capabilities. These terminals include: PDA, MID and UMPC devices, such as iPad.

[0138] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as iPods), handheld game consoles, e-books, smart toys, and portable car navigation devices.

[0139] (4) Other electronic devices with data interaction functions.

[0140] Thus far, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims may be performed in a different order and still achieve the desired results. Additionally, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing may be advantageous.

[0141] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0142] For the convenience of description, the above device is described by being divided into various units according to their functions and described separately. Of course, when implementing the present application, the functions of each unit can be implemented in the same one or more software and / or hardware. It should be understood by those skilled in the art that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0143] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0144] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0145] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0146] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0147] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0148] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM),

[0149] Digital Versatile Disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, disk storage or other magnetic storage devices

[0150] Or any other non-transmission medium that can be used to store information that can be accessed by a computing device. According to the definition in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0151] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0152] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific transactions or implement specific abstract data types. The present application may also be practiced in distributed computing environments where transactions are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0153] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0154] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A method for constructing a terrain semantic map based on a binocular camera, characterized in that: The robot is equipped with a binocular camera, including: Calibrate the relative pose transformation matrix between the binocular camera coordinate system and the robot coordinate system, and obtain the left eye image and the right eye image captured by the binocular camera; Determine an image with depth information according to the left-eye image and the right-eye image, and select a key frame of the image with depth information; Inputting the key frame of the image with depth information into the target detection neural network model, outputting the position of the dynamic object in the image with depth information and the terrain segmentation result; Removing pixels at the position of the dynamic object, and selecting a key frame after the dynamic object is removed; Extracting feature points of the key frame after the dynamic object is removed, matching the feature points, and calculating the pose transformation matrix of the binocular camera movement; Constructing a three-dimensional environment map according to the posture transformation matrix; According to the relative posture transformation matrix, the terrain segmentation result is transformed into the robot coordinate system, the three-dimensional environment map and the terrain segmentation result are fused, and a three-dimensional space map with terrain semantic information is output.

2. The method for constructing a terrain semantic map based on a binocular camera according to claim 1, characterized in that: Selecting the key frame of the image with depth information specifically includes: Obtaining the sampling frame rate and system processing speed of the binocular camera; The key frame of the image with depth information is selected according to the sampling frame rate and the system processing speed.

3. The method for constructing a terrain semantic map based on a binocular camera according to claim 1, characterized in that: Removing the pixel points at the position of the dynamic object specifically includes: Based on the imaging principle of the binocular camera, the three-dimensional world coordinates of the dynamic object are calculated, and the coordinates of the left-eye image and the coordinates of the right-eye image are obtained; the vertical coordinates of the left-eye image and the right-eye image are the same; Determine the parallax according to the horizontal coordinate of the left image and the horizontal coordinate of the right image; Obtain the focal length of the binocular camera and the distance between the centers of the two cameras; Determine a depth value in three-dimensional space according to the parallax, focal length, and the distance between the centers of the two cameras; The pixels of the dynamic object are removed according to the depth value of the three-dimensional space and the position of the dynamic object.

4. The method for constructing a terrain semantic map based on a binocular camera according to claim 3, characterized in that: Determining the depth value of the three-dimensional space according to the parallax, focal length, and the distance between the centers of the two cameras specifically includes: Using the formula Determine the depth value of the three-dimensional space; where z is the depth value of the three-dimensional space, f is the focal length, b is the distance between the centers of the two cameras, and d is the parallax.

5. The method for constructing a terrain semantic map based on a binocular camera according to claim 1, characterized in that: Matching the feature points and calculating the pose transformation matrix of the binocular camera movement specifically includes: Extract the feature points of the key frames of the previous and next two frames, match the feature points based on the minimum Hamming distance, and generate a feature point matching relationship; Obtaining the three-dimensional coordinates of the feature point in the camera coordinate system; According to the relative posture transformation matrix, the three-dimensional coordinates in the camera coordinate system are transferred to the robot coordinate system to generate the three-dimensional coordinates of the feature point in the robot coordinate system; Based on the three-dimensional coordinates of the feature points in the robot coordinate system, a pose transformation matrix of the binocular camera movement is calculated according to the feature point matching relationship.

6. The method for constructing a terrain semantic map based on a binocular camera according to claim 1, characterized in that: Constructing a three-dimensional environment map according to the posture transformation matrix specifically includes: The first frame image captured by the binocular camera when working is used as a world coordinate system, and the feature points are used as map points in constructing an environment map; the coordinates of the map points are the coordinates in the world coordinate system; Generate a posture transformation matrix of the robot in three-dimensional space according to the posture transformation matrix; Reconstructing an environment map according to the posture transformation matrix of the robot; bundling optimization of the continuous posture transformation matrices of the robot to generate an optimized robot posture transformation matrix, and generating a locally optimized environment map according to the optimized posture transformation matrix; Perform loop closure detection on the robot, use visual word bags to match key frames in the locally optimized environment map, and if the match is successful, output a loop fusion map; The global map is optimized using the loop-fused map; the optimized global map is a three-dimensional environment map.

7. The method for constructing a terrain semantic map based on a binocular camera according to claim 1, characterized in that: The three-dimensional environment map and the terrain segmentation result are integrated to output a three-dimensional space map with terrain semantic information, and then the following steps are further included: The three-dimensional space map with terrain semantic information is subjected to Euclidean clustering of terrain point clouds to generate a clustered three-dimensional space map with terrain semantic information.

8. A terrain semantic map construction system based on binocular cameras, characterized in that: The robot is equipped with a binocular camera, including: A calibration module is used to calibrate the relative posture transformation matrix between the binocular camera coordinate system and the robot coordinate system, and obtain the left eye image and the right eye image captured by the binocular camera; A key frame selection module, used to determine the image with depth information according to the left-eye image and the right-eye image, and select a key frame of the image with depth information; A dynamic object position and terrain segmentation result output module, used to input the key frame of the image with depth information into the target detection neural network model, and output the dynamic object position and terrain segmentation result in the image with depth information; A dynamic object removal module, used to remove the pixel points at the position of the dynamic object and select the key frame after the dynamic object is removed; A posture transformation matrix calculation module is used to extract feature points of the key frame after the dynamic object is removed, match the feature points, and calculate the posture transformation matrix of the binocular camera movement; A three-dimensional environment map construction module, used to construct a three-dimensional environment map according to the posture transformation matrix; The three-dimensional space map output module with terrain semantic information is used to transform the terrain segmentation result to the robot coordinate system according to the relative posture transformation matrix, fuse the three-dimensional environment map and the terrain segmentation result, and output the three-dimensional space map with terrain semantic information.

9. An electronic device, characterized in that: It includes a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the terrain semantic map construction method based on a binocular camera as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: It stores a computer program, which, when executed by a processor, implements a terrain semantic map construction method based on a binocular camera as described in any one of claims 1 to 7.