Obstacle detection method, device, robot and storage medium

The depth image is acquired and processed by the depth camera, and obstacles in the terrain environment are identified in real time, solving the problem of inaccurate identification in the prior art, and achieving the smooth passage of robots in complex terrains.

CN114677588BActive Publication Date: 2025-04-11SHENZHEN PUDU TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210269481.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-18
Publication Date
2025-04-11
Estimated Expiration
2042-03-18

AI Technical Summary

Technical Problem

The prior art is difficult to achieve real-time accurate identification of obstacles in terrain environments, affecting the smooth passage of robots in complex terrain.

Method used

The depth image is acquired through the depth camera, a detected static map is generated, and the output static map at the previous moment is updated and binarized to obtain obstacle information at the current moment.

Benefits of technology

Real-time accurate identification of obstacles in the terrain environment is achieved, helping the robot avoid obstacles and smoothly pass through complex terrain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114677588B_ABST
    Figure CN114677588B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, robot and computer-readable storage medium for obstacle detection. The method comprises: obtaining a depth image at the current moment through a depth camera, generating a detection static image at the current moment according to the depth image; updating the detection static image at the current moment according to the output static image at the previous moment to obtain the output static image at the current moment; binarizing the output static image at the current moment to obtain obstacle information in the output static image at the current moment. Thus, the obstacle information in the terrain environment can be accurately identified, helping the robot to pass through complex terrain smoothly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of robot vision technology, and in particular to a method, device, robot and storage medium for obstacle detection. Background Art

[0002] With the rapid development of robotics technology, the application scope of robots is becoming more and more extensive. For robots, using sensors to identify obstacles is its core technology. Only when robots accurately identify obstacles can they avoid obstacles and successfully pass through various complex terrains. Obstacle recognition in robot obstacle avoidance is closely related to the distribution, shape, and state of obstacles in the terrain environment. How to accurately identify obstacles in the terrain environment in real time is the key to whether the robot can successfully pass through complex terrain. It is also a hot research topic in the field of robotics and has attracted more and more attention. Summary of the invention

[0003] Based on this, it is necessary to provide an obstacle detection method, device, robot and computer-readable storage medium that can accurately identify obstacles in a terrain environment in real time to address the above technical problems.

[0004] In a first aspect, the present application provides a method for obstacle detection. The method comprises:

[0005] Obtain a depth image at the current moment through a depth camera, and generate a detection static image at the current moment based on the depth image;

[0006] According to the output static image at the previous moment, the detection static image at the current moment is updated to obtain the output static image at the current moment;

[0007] The output static image at the current moment is binarized to obtain obstacle information in the output static image at the current moment.

[0008] In one embodiment, the output static image at the last moment includes the original static image and / or a static image obtained by transforming the original static image;

[0009] When the output static image at the last moment is a static image obtained by transforming the original static image, before the output static image at the last moment is processed, the process includes:

[0010] Acquire the current moment positioning data and the last moment positioning data through the positioning sensor, and determine the transformation relationship between the last moment positioning data and the current moment positioning data according to the current moment positioning data and the last moment positioning data;

[0011] The original static image is transformed according to the transformation relationship to obtain the output static image at the previous moment.

[0012] In one embodiment, generating a detection static image at the current moment according to the depth image includes:

[0013] The depth image is converted into corresponding point cloud data, and the point cloud data is converted from the depth camera coordinate system to the robot coordinate system to obtain the first point cloud data in the robot coordinate system;

[0014] Convert the first point cloud data into a world coordinate system to obtain second point cloud data;

[0015] The second point cloud data is converted into a map coordinate system to obtain third point cloud data;

[0016] The third point cloud data is mapped to the grid map, and the detection static image at the current moment is obtained according to the mapping result.

[0017] In one embodiment, determining the transformation relationship between the last moment positioning data and the current moment positioning data according to the current moment positioning data and the last moment positioning data includes:

[0018] Map the positioning data of the previous moment into the grid map, and map the positioning data of the current moment into the grid map;

[0019] According to the mapping result of the positioning data at the previous moment in the grid map and the mapping result of the positioning data at the current moment in the grid map, the displacement information between the positioning data at the previous moment and the positioning data at the current moment is determined; the displacement information is a transformation relationship, including a translation amount and a rotation amount.

[0020] In one embodiment, mapping the third point cloud data into a grid map, and obtaining a detection static image at the current moment according to the mapping result, includes:

[0021] According to the mapping result of the third point cloud data in the grid map, the grid value corresponding to each grid in the grid map is calculated, and the grid values ​​corresponding to each grid in the grid map constitute the detection static map at the current moment.

[0022] In one embodiment, the detection static image at the current moment is updated according to the output static image at the previous moment to obtain the output static image at the current moment, including:

[0023] For two grids at any corresponding position between the output static image at the previous moment and the detection static image at the current moment, the two grids are respectively used as the first grid and the second grid. If the grid value corresponding to the second grid is 0, the grid value corresponding to the first grid is subtracted from the first preset threshold, and the subtraction result is used as the grid value of the grid at any corresponding position in the output static image at the current moment;

[0024] If the grid value corresponding to the second grid is not 0, the grid value corresponding to the first grid is added to the second preset threshold, and the addition result is used as the grid value of the grid at any corresponding position in the output static image at the current moment.

[0025] In one embodiment, binarization is performed on the output static image at the current moment to obtain obstacle information in the output static image at the current moment, including:

[0026] For any grid in the output static image at the current moment, determine whether the first grid value corresponding to any grid is within the preset range. If so, set the first grid value corresponding to any grid to 255; if not, set the first grid value corresponding to any grid to 0;

[0027] For any grid in the output static image at the current moment, determine whether the second grid value corresponding to any grid is greater than a third preset threshold value, if so, set the second grid value corresponding to any grid to 255; if not, set the second grid value corresponding to any grid to 0;

[0028] If the first grid value of any grid is 255, then any grid is a static grid. If the second grid value of any grid is 255, then any grid is a dynamic grid. Obstacle information is obtained based on the static grid and the dynamic grid.

[0029] In a second aspect, the present application also provides a device for obstacle detection. The device comprises:

[0030] A generation module is used to obtain a depth image at the current moment through a depth camera, and generate a detection static image at the current moment according to the depth image;

[0031] An updating module is used to update the detection static image at the current moment according to the output static image at the previous moment to obtain the output static image at the current moment;

[0032] The first determination module is used to perform binarization processing on the output static image at the current moment to obtain obstacle information in the output static image at the current moment.

[0033] In a third aspect, the present application further provides a robot, wherein the robot is provided with a depth camera and a positioning sensor, and the robot further comprises a memory and a processor, wherein the memory is used to store a computer program, and when the processor executes the computer program, the following steps are implemented:

[0034] Obtain a depth image at the current moment through a depth camera, and generate a detection static image at the current moment based on the depth image;

[0035] According to the output static image at the previous moment, the detection static image at the current moment is updated to obtain the output static image at the current moment;

[0036] The output static image at the current moment is binarized to obtain obstacle information in the output static image at the current moment.

[0037] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0038] Obtain a depth image at the current moment through a depth camera, and generate a detection static image at the current moment based on the depth image;

[0039] According to the output static image at the previous moment, the detection static image at the current moment is updated to obtain the output static image at the current moment;

[0040] The output static image at the current moment is binarized to obtain obstacle information in the output static image at the current moment.

[0041] The above obstacle detection method, device, robot and computer-readable storage medium obtain the depth image at the current moment through the depth camera, generate the detection static image at the current moment according to the depth image; update the detection static image at the current moment according to the output static image at the previous moment to obtain the output static image at the current moment; perform binarization processing on the output static image at the current moment to obtain the obstacle information in the output static image at the current moment. Thus, the obstacle information in the terrain environment can be accurately identified, helping the robot to pass through complex terrain smoothly. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 is a flow chart of a method for obstacle detection in one embodiment;

[0043] Figure 2 A schematic diagram of a mapping result of positioning data at the current moment in a grid map in a method for obstacle detection in one embodiment;

[0044] Figure 3 A schematic diagram of a static image output at the current moment in a method for obstacle detection in one embodiment;

[0045] Figure 4 A schematic diagram of a dynamic obstacle in obstacle information in an output static image at a current moment in a method for obstacle detection in one embodiment;

[0046] Figure 5 A schematic diagram of a static obstacle in obstacle information in an output static image at a current moment in a method for obstacle detection in one embodiment;

[0047] Figure 6 is a structural block diagram of an obstacle detection device in one embodiment;

[0048] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0050] With the rapid development of robotics technology, the application scope of robots is becoming more and more extensive. For robots, using sensors to identify obstacles is its core technology. Only when robots accurately identify obstacles can they avoid obstacles and successfully pass through various complex terrains. Obstacle recognition in robot obstacle avoidance is closely related to the distribution, shape, and state of obstacles in the terrain environment. How to accurately identify obstacles in the terrain environment in real time is the key to whether the robot can successfully pass through complex terrain. It is also a hot research topic in the field of robotics and has attracted more and more attention.

[0051] It is understood that the terms "first", "second", etc. used in this application can be used in this article to describe various professional terms, but unless otherwise specified, these professional terms are not limited by these terms. These terms are only used to distinguish one professional term from another professional term.

[0052] In view of the problems existing in the above-mentioned related technologies, an embodiment of the present invention provides a method for obstacle detection, which can be applied to a server, a terminal, or a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the server can be implemented as an independent server or a server cluster composed of multiple servers. The terminal can be, but is not limited to, various robots. At least one of the terminal or the server includes the hardware equipment required to implement the method for obstacle detection in an embodiment of the present invention, and the hardware equipment includes a depth camera and / or a positioning sensor.

[0053] In one embodiment, Figure 1 As shown, a method for obstacle detection is provided. This embodiment takes the method applied to a server as an example for illustration. The method includes the following steps:

[0054] 102. Obtain a depth image at the current moment through a depth camera, and generate a detection static image at the current moment according to the depth image.

[0055] It should be noted that the depth camera is installed on the robot. The depth image is explained in combination with a specific application scenario. For example, the robot is a food delivery robot in a restaurant. The depth camera can be regarded as the robot's eyes. The depth image at the current moment is obtained by the depth camera shooting the scene within the robot's field of view. Based on this, the detection static image at the current moment can be a grid map after filling the grid value on the blank grid map, and the grid value is determined according to the pixel points of the depth image at the current moment. Among them, the size of the blank grid map is determined based on the mobile space where the robot is located. Combined with the above application scenario, the mobile space is the range of the robot's activities in the restaurant. Since the blank grid map is determined based on the mobile space where the robot is located, and the depth image at the current moment is only a depth image obtained by shooting the scene within the robot's field of view, the range of the mobile space where the robot is located is larger than the robot's field of view. Based on this, it can be understood that there may be grids in the above grid map that do not have corresponding grid values.

[0056] 104. Update the detection static image at the current moment according to the output static image at the previous moment to obtain the output static image at the current moment.

[0057] Specifically, the grid values ​​of the corresponding grids between the output static image at the previous moment and the detection static image at the current moment are fused, and the fusion result is used as the output static image at the current moment.

[0058] The output static image of the previous moment can be obtained by fusing the corresponding grid values ​​between the detection static image of the previous moment and the output static image of the previous moment. It should be noted that the acquisition process of the output static image of the previous moment can refer to the description of the acquisition process of the output static image of the current moment in the following embodiment, so it will not be repeated here.

[0059] 106. Binarize the output static image at the current moment to obtain obstacle information in the output static image at the current moment.

[0060] It should be noted that after obtaining the obstacle information in the output static image at the current moment, the obstacle information will be sent to the robot to instruct the robot to avoid the obstacle.

[0061] The obstacle information may include the obstacle position and obstacle status, and the obstacle status may be dynamic or static.

[0062] In the above obstacle detection method, the depth image of the current moment is obtained through the depth camera, and the detection static image of the current moment is generated according to the depth image; the detection static image of the current moment is updated according to the output static image of the previous moment to obtain the output static image of the current moment; the output static image of the current moment is binarized to obtain the obstacle information in the output static image of the current moment. In this way, obstacles in the terrain environment can be accurately identified, helping the robot to pass through complex terrain smoothly.

[0063] In one embodiment, the output static image at the last moment includes the original static image and / or a static image obtained by transforming the original static image;

[0064] When the output static image at the last moment is a static image obtained by transforming the original static image, before the output static image at the last moment is processed, the process includes:

[0065] The current moment positioning data and the last moment positioning data are obtained through the positioning sensor, and the transformation relationship between the last moment positioning data and the current moment positioning data is determined according to the current moment positioning data and the last moment positioning data.

[0066] Among them, the positioning sensor can be a laser radar or a marking positioning sensor, and the embodiments of the present application do not specifically limit this. It can be understood that although the depth camera also has a positioning function, its accuracy is poorer than that of the positioning sensor. Therefore, the present application transforms the original static image through the transformation relationship between the positioning data of the positioning sensor at the previous moment and the positioning data at the current moment, so that the output static image at the previous moment and the output static image at the current moment are better aligned.

[0067] The original static image is transformed according to the transformation relationship to obtain the output static image at the previous moment.

[0068] In this embodiment, the current moment positioning data and the previous moment positioning data are obtained by the positioning sensor, and the transformation relationship between the previous moment positioning data and the current moment positioning data is determined according to the current moment positioning data and the previous moment positioning data; the original static image is transformed according to the transformation relationship to obtain the output static image of the previous moment. Since the positioning of the output static image of the previous moment is aligned with the positioning of the detection static image of the current moment, the position of the same static obstacle in the output static image of the previous moment is the same as the position in the output static image of the current moment, thereby making the obstacle information in the output static image of the current moment more accurate.

[0069] In one embodiment, generating a detection static image at the current moment according to the depth image includes:

[0070] The depth image is converted into corresponding point cloud data, and the point cloud data is converted from the depth camera coordinate system to the robot coordinate system to obtain the first point cloud data in the robot coordinate system.

[0071] Specifically, converting the depth image into corresponding point cloud data includes but is not limited to: for any pixel point in the depth image, according to the horizontal coordinate of any pixel point in the two-dimensional coordinate system corresponding to the depth image, the first horizontal coordinate internal parameter of the depth camera, the second horizontal coordinate internal parameter of the depth camera and the depth value of any pixel point in the depth image, the point cloud horizontal coordinate of any pixel point is calculated; according to the vertical coordinate of any pixel point in the two-dimensional coordinate system corresponding to the depth image, the first vertical coordinate internal parameter of the depth camera, the second vertical coordinate internal parameter of the depth camera and the depth value of any pixel point in the depth image, the point cloud horizontal coordinate, the point cloud vertical coordinate and the depth value constitute the point cloud data of any pixel point, and the point cloud data of all pixels constitute the point cloud data.

[0072] The process of converting the depth image into the corresponding point cloud data can refer to the following formula (1):

[0073]

[0074] It should be noted that in formula (1), (u, v) is the image coordinate, d is the depth value at the image coordinate (u, v), fx, fy, cx and cy are the internal parameters of the depth camera provided by the manufacturer, fx and fy correspond to the focal lengths in the x-axis and y-axis directions respectively, cx and cy are the offsets of the optical axis to the center of the projection plane coordinate, and (x, y, z) is the point cloud data.

[0075] It is understandable that the reason for converting the point cloud data from the depth camera coordinate system to the robot coordinate system is that it is difficult to directly obtain the position of the depth camera in the world coordinate system. However, the depth camera is installed on the robot, and the position of the depth camera in the robot coordinate system can be obtained, and the position of the robot in the world coordinate system can also be obtained. Therefore, by converting the point cloud data from the depth camera coordinate system to the robot coordinate system, the mapping result of the point cloud data in the world coordinate system is obtained. Here, the mapping result of the point cloud data in the world coordinate system refers to the second point cloud data.

[0076] Specifically, converting the point cloud data from the depth camera coordinate system to the robot coordinate system to obtain the first point cloud data in the robot coordinate system may include: multiplying the point cloud data with a first transformation matrix to obtain the first point cloud data in the robot coordinate system, where the first transformation matrix is ​​a transformation matrix between the coordinate system of the depth camera and the coordinate system of the robot.

[0077] The specific process of obtaining the first point cloud data in the robot coordinate system can refer to the following formula (2):

[0078] P robot =M camra_robot P camera ; (2)

[0079] It should be noted that in formula (2), P robot is the first point cloud data in the robot coordinate system, M camra_robot is the transformation matrix between the coordinate system of the depth camera and the coordinate system of the robot, P camera Point cloud data.

[0080] The first point cloud data is converted into a world coordinate system to obtain second point cloud data.

[0081] The specific process may include: multiplying the first point cloud data by the second transformation matrix to obtain the second point cloud data, where the second transformation matrix is ​​a transformation matrix between the coordinate system of the robot and the world coordinate system.

[0082] The specific process of obtaining the second point cloud data can be referred to the following formula (3):

[0083] P world =M robot_world P robot ; (3)

[0084] It should be noted that in formula (3), P world is the second point cloud data, M robot_world It is the transformation matrix between the robot's coordinate system and the world coordinate system.

[0085] The second point cloud data is converted into a map coordinate system to obtain third point cloud data.

[0086] The specific process may include: obtaining the third point cloud data according to the second point cloud data, the resolution of the grid map and the origin coordinates of the coordinate system where the grid map is located.

[0087] The process of obtaining the third point cloud data can refer to the following formula (4):

[0088]

[0089] It should be noted that, in formula (4), (Xm, Ym) is the third point cloud data, (Xw, Yw) is the position in the world coordinate system, (Xo, Yo) is the origin coordinate of the coordinate system where the grid map is located, and resolution is the resolution of the grid map.

[0090] The third point cloud data is mapped to the grid map, and the detection static image at the current moment is obtained according to the mapping result.

[0091] It should be noted that the grid map is determined based on the moving space where the robot is located.

[0092] In this embodiment, by converting the depth image into corresponding point cloud data, the point cloud data is converted from the depth camera coordinate system to the robot coordinate system to obtain the first point cloud data in the robot coordinate system; the first point cloud data is converted to the world coordinate system to obtain the second point cloud data; the second point cloud data is converted to the map coordinate system to obtain the third point cloud data; the third point cloud data is mapped to the grid map, and the detection static image at the current moment is obtained according to the mapping result. Since the obstacle information is ultimately determined based on the grid map, the point cloud data on the depth camera coordinate system is mapped to the grid map through multiple conversions, so as to obtain the detection static image at the current moment, and then the accurate position of the obstacle in the map can be determined according to the detection static image at the current moment, the output static image at the previous moment and the output static image at the current moment, and then the obstacles in the terrain environment can be accurately identified, helping the robot to pass through complex terrain smoothly.

[0093] In one embodiment, determining the transformation relationship between the last moment positioning data and the current moment positioning data according to the current moment positioning data and the last moment positioning data includes:

[0094] The positioning data of the previous moment is mapped to the grid map, and the positioning data of the current moment is mapped to the grid map; according to the mapping result of the positioning data of the previous moment in the grid map and the mapping result of the positioning data of the current moment in the grid map, the displacement information between the positioning data of the previous moment and the positioning data of the current moment is determined; the displacement information is a transformation relationship, including a translation amount and a rotation amount.

[0095] The mapping result of the current positioning data in the grid map can be as follows: Figure 2 shown.

[0096] Specifically, "determining the displacement information between the positioning data at the previous moment and the positioning data at the current moment based on the mapping result of the positioning data at the previous moment in the grid map and the mapping result of the positioning data at the current moment in the grid map" includes but is not limited to: obtaining multiple sample displacement information; taking the mapping result of the positioning data at the previous moment in the grid map as the first mapping result, taking the mapping result of the positioning data at the current moment in the grid map as the second mapping result, and calculating the displacement mapping result after the first mapping result is displacement-adjusted under each sample displacement information; calculating the matching degree between each bit displacement mapping result and the second mapping result, and taking the sample displacement information corresponding to the maximum matching degree as the displacement information.

[0097] Specifically, calculating the degree of match between each displacement mapping result and the second mapping result may include: calculating the grid state matrix corresponding to the second mapping result; for any displacement mapping result, determining the target position in the grid state matrix corresponding to the grid where the point cloud exists in any displacement mapping result; superimposing the grid state corresponding to each target position in the grid state matrix, and using the superimposed result as the degree of match between any displacement mapping result and the second mapping result. It should be noted that the positioning data is essentially point cloud data.

[0098] Specifically, the process of calculating the grid state matrix corresponding to the second mapping result includes but is not limited to: setting the grid state of the grid corresponding to the point cloud in the second mapping result to 1; for any grid without point cloud in the second mapping result, obtaining the grid state of any grid at the corresponding position in the grid state matrix based on the grid state of the target grid that is closest to any grid in the second mapping result and has a point cloud and the distance between any grid and the target grid.

[0099] It can be understood that the distance between any grid and the target grid is negatively correlated with the grid state of the corresponding position of any grid in the grid state matrix. The smaller the distance between any grid and the target grid, the larger the grid state of the corresponding position of any grid in the grid state matrix, but smaller than the grid state of the target grid.

[0100] In this embodiment, since the output static image at the previous moment is obtained by transforming the original static image, that is, the positioning of the output static image at the previous moment is aligned with the positioning of the detection static image at the current moment, so that the position of the same static obstacle in the output static image at the previous moment is the same as the position in the output static image at the current moment, thereby making the obstacle information in the output static image at the current moment more accurate.

[0101] In one embodiment, the third point cloud data is mapped into a grid map, and a detection static image at the current moment is obtained according to the mapping result, including:

[0102] According to the mapping result of the third point cloud data in the grid map, the grid value corresponding to each grid in the grid map is calculated, and the grid values ​​corresponding to each grid in the grid map constitute the detection static map at the current moment.

[0103] Specifically, for any grid in the grid map, it is determined whether any grid has a point cloud. If not, the grid value corresponding to any grid is 0. If so, the second preset threshold is used as the grid value corresponding to any grid.

[0104] In one embodiment, the detection static image at the current moment is updated according to the output static image at the previous moment to obtain the output static image at the current moment, including:

[0105] For two grids at any corresponding position between the output static image at the previous moment and the detection static image at the current moment, the two grids are respectively used as the first grid and the second grid. If the grid value corresponding to the second grid is 0, the grid value corresponding to the first grid is subtracted from the first preset threshold, and the subtraction result is used as the grid value of the grid at any corresponding position in the output static image at the current moment;

[0106] If the grid value corresponding to the second grid is not 0, the grid value corresponding to the first grid is added to the second preset threshold, and the addition result is used as the grid value of the grid at any corresponding position in the output static image at the current moment.

[0107] It should be noted that the first preset threshold and the second preset threshold are algorithm parameters and can be set according to actual conditions. Generally, the second preset threshold is twice the first preset threshold. In some scenarios, the first preset threshold can be 10 and the second preset threshold can be 20.

[0108] It can be understood that if the grid value corresponding to the second grid is 0, the grid value corresponding to the first grid is subtracted from the first preset threshold. On the one hand, it is to obtain the motion trajectory of the dynamic obstacle. On the other hand, if the grid value corresponding to the second grid is not 0, the grid value corresponding to the first grid is added to the second preset threshold. The subtraction and addition operations are to increase the difference between dynamic obstacles and static obstacles and improve the accuracy of obstacle information. In actual application scenarios, in order to reduce the amount of calculation, generally when the grid value of the grid at any corresponding position in the output static image at the current moment is greater than 255, the grid value of the grid at any corresponding position in the output static image at the current moment is 255; when the grid value of the grid at any corresponding position in the output static image at the current moment is less than 0, the grid value of the grid at any corresponding position in the output static image at the current moment is 0.

[0109] In this embodiment, for two grids at any corresponding position between the output static image of the previous moment and the detection static image of the current moment, the two grids are respectively used as the first grid and the second grid. If the grid value corresponding to the second grid is 0, the grid value corresponding to the first grid is subtracted from the first preset threshold, and the subtraction result is used as the grid value of the grid at any corresponding position in the output static image of the current moment; if the grid value corresponding to the second grid is not 0, the grid value corresponding to the first grid is added to the second preset threshold, and the addition result is used as the grid value of the grid at any corresponding position in the output static image of the current moment. On the one hand, the motion trajectory of the dynamic obstacle is obtained. On the other hand, the difference between dynamic obstacles and static obstacles is increased, and the accuracy of obstacle information is improved.

[0110] In one embodiment, the output static image at the current moment is binarized to obtain obstacle information in the output static image at the current moment, including:

[0111] For any grid in the output static image at the current moment, determine whether the first grid value corresponding to any grid is within the preset range. If so, set the first grid value corresponding to any grid to 255; if not, set the first grid value corresponding to any grid to 0.

[0112] For any grid in the output static image at the current moment, determine whether the second grid value corresponding to any grid is greater than a third preset threshold value, if so, set the second grid value corresponding to any grid to 255; if not, set the second grid value corresponding to any grid to 0;

[0113] If the first grid value of any grid is 255, then any grid is a static grid. If the second grid value of any grid is 255, then any grid is a dynamic grid. Obstacle information is obtained based on the static grid and the dynamic grid.

[0114] Among them, the preset range and the third preset threshold are parameters set for the binarization process. If the value range of the preset range is V1 to V2, then the value of the third preset threshold can be V2. Accordingly, the specific process of determining whether the first grid value corresponding to any grid is within the preset range can be shown in the following formula (5):

[0115]

[0116] The specific process of judging whether the second grid value corresponding to any grid is greater than the third preset threshold value can be shown in the following formula (6):

[0117]

[0118] In formula (5) and formula (6), f(v) is the grid value of any grid in the output static image at the current moment after the grid is reset, and the grid value of any grid in the output static image at the current moment before the grid is reset.

[0119] Specifically, if the output static image at the current moment is Figure 3 As shown, the dynamic obstacles in the obstacle information in the output static image at the current moment can be as follows Figure 4 As shown, the static obstacles in the obstacle information in the output static image at the current moment can be as follows Figure 5 As shown, the embodiments of the present application do not make any specific limitation to this.

[0120] In this embodiment, by binarizing the output static image at the current moment, obstacles in the terrain environment can be identified simply, in real time and accurately, the location information of the obstacles can be obtained, and the state of the obstacles, specifically whether they are dynamic obstacles or static obstacles, can be determined, thereby helping the robot to pass through complex terrain smoothly.

[0121] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0122] Based on the same inventive concept, the embodiment of the present application also provides an obstacle detection device for implementing the obstacle detection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations of one or more obstacle detection device embodiments provided below can refer to the limitations of the obstacle detection method above, and will not be repeated here.

[0123] In one embodiment, Figure 6 As shown, an obstacle detection device is provided, including: a generating module 602, an updating module 604 and a first determining module 606, wherein:

[0124] A generating module 602 is used to obtain a depth image at a current moment through a depth camera, and generate a detection static image at the current moment according to the depth image;

[0125] An updating module 604 is used to update the detection static image at the current moment according to the output static image at the previous moment to obtain the output static image at the current moment;

[0126] The first determination module 606 is used to perform binarization processing on the output static image at the current moment to obtain obstacle information in the output static image at the current moment.

[0127] In one embodiment, the output static image at the last moment includes the original static image and / or the static image obtained by transforming the original static image; when the output static image at the last moment is the static image obtained by transforming the original static image, the device further includes:

[0128] The second determination module is used to obtain the current moment positioning data and the last moment positioning data through the positioning sensor, and determine the transformation relationship between the last moment positioning data and the current moment positioning data according to the current moment positioning data and the last moment positioning data;

[0129] The third determination module is used to transform the original static image according to the transformation relationship to obtain the output static image at the previous moment.

[0130] In one embodiment, the generating module 602 includes:

[0131] A first conversion unit, used to convert the depth image into corresponding point cloud data, and convert the point cloud data from the depth camera coordinate system to the robot coordinate system to obtain first point cloud data in the robot coordinate system;

[0132] A second conversion unit, used for converting the first point cloud data into a world coordinate system to obtain second point cloud data;

[0133] A third conversion unit, used for converting the second point cloud data into a map coordinate system to obtain third point cloud data;

[0134] The acquisition unit is used to map the third point cloud data into a grid map, and acquire the detection static image at the current moment according to the mapping result.

[0135] In one embodiment, the second determining module includes:

[0136] A mapping unit, used to map the positioning data of the previous moment into the grid map, and to map the positioning data of the current moment into the grid map;

[0137] The first determination unit is used to determine the displacement information between the positioning data at the previous moment and the positioning data at the current moment according to the mapping result of the positioning data at the previous moment in the grid map and the mapping result of the positioning data at the current moment in the grid map; the displacement information is a transformation relationship, including a translation amount and a rotation amount.

[0138] In one embodiment, the acquisition unit includes:

[0139] The calculation subunit is used to calculate the grid value corresponding to each grid in the grid map according to the mapping result of the third point cloud data in the grid map, and the grid values ​​corresponding to each grid in the grid map constitute the detection static map at the current moment.

[0140] In one embodiment, the update module 604 includes:

[0141] A second determination unit is used to, for two grids at any corresponding positions between the output static image at the previous moment and the detection static image at the current moment, use the two grids as the first grid and the second grid respectively, and if the grid value corresponding to the second grid is 0, subtract the first preset threshold from the grid value corresponding to the first grid, and use the subtraction result as the grid value of the grid at any corresponding position in the output static image at the current moment;

[0142] The third determining unit is used to add the grid value corresponding to the first grid and the second preset threshold if the grid value corresponding to the second grid is not 0, and use the addition result as the grid value of the grid at any corresponding position in the output static image at the current moment.

[0143] In one embodiment, the first determining module 606 includes:

[0144] The first judgment unit is used to judge whether the first grid value corresponding to any grid in the output static image at the current moment is within a preset range, and if so, set the first grid value corresponding to any grid to 255; if not, set the first grid value corresponding to any grid to 0;

[0145] The second judgment unit is used to judge whether the second grid value corresponding to any grid in the output static image at the current moment is greater than a third preset threshold value, and if so, set the second grid value corresponding to any grid to 255; if not, set the second grid value corresponding to any grid to 0;

[0146] The fourth determining unit is used to determine that if the first grid value of any grid is 255, then any grid is a static grid; if the second grid value of any grid is 255, then any grid is a dynamic grid; and obtain obstacle information according to the static grid and the dynamic grid.

[0147] Each module in the above obstacle detection device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0148] In one embodiment, a robot is provided with a depth camera and a positioning sensor, and the robot further includes a memory and a processor, wherein the memory is used to store a computer program, and the processor implements the following steps when executing the computer program:

[0149] Obtain a depth image at the current moment through a depth camera, and generate a detection static image at the current moment based on the depth image;

[0150] According to the output static image at the previous moment, the detection static image at the current moment is updated to obtain the output static image at the current moment;

[0151] The output static image at the current moment is binarized to obtain obstacle information in the output static image at the current moment.

[0152] In one embodiment, the output static image at the last moment includes the original static image and / or the static image obtained by transforming the original static image; when the output static image at the last moment is the static image obtained by transforming the original static image, the processor further implements the following steps when executing the computer program:

[0153] Acquire the current moment positioning data and the last moment positioning data through the positioning sensor, and determine the transformation relationship between the last moment positioning data and the current moment positioning data according to the current moment positioning data and the last moment positioning data;

[0154] The original static image is transformed according to the transformation relationship to obtain the output static image at the previous moment.

[0155] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0156] The depth image is converted into corresponding point cloud data, and the point cloud data is converted from the depth camera coordinate system to the robot coordinate system to obtain the first point cloud data in the robot coordinate system;

[0157] Convert the first point cloud data into a world coordinate system to obtain second point cloud data;

[0158] The second point cloud data is converted into a map coordinate system to obtain third point cloud data;

[0159] The third point cloud data is mapped to the grid map, and the detection static image at the current moment is obtained according to the mapping result.

[0160] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0161] Map the positioning data of the previous moment into the grid map, and map the positioning data of the current moment into the grid map;

[0162] According to the mapping result of the positioning data at the previous moment in the grid map and the mapping result of the positioning data at the current moment in the grid map, the displacement information between the positioning data at the previous moment and the positioning data at the current moment is determined; the displacement information is a transformation relationship, including a translation amount and a rotation amount.

[0163] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0164] According to the mapping result of the third point cloud data in the grid map, the grid value corresponding to each grid in the grid map is calculated, and the grid values ​​corresponding to each grid in the grid map constitute the detection static map at the current moment.

[0165] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0166] For two grids at any corresponding position between the output static image at the previous moment and the detection static image at the current moment, the two grids are respectively used as the first grid and the second grid. If the grid value corresponding to the second grid is 0, the grid value corresponding to the first grid is subtracted from the first preset threshold, and the subtraction result is used as the grid value of the grid at any corresponding position in the output static image at the current moment;

[0167] If the grid value corresponding to the second grid is not 0, the grid value corresponding to the first grid is added to the second preset threshold, and the addition result is used as the grid value of the grid at any corresponding position in the output static image at the current moment.

[0168] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0169] For any grid in the output static image at the current moment, determine whether the first grid value corresponding to any grid is within the preset range. If so, set the first grid value corresponding to any grid to 255; if not, set the first grid value corresponding to any grid to 0;

[0170] For any grid in the output static image at the current moment, determine whether the second grid value corresponding to any grid is greater than a third preset threshold value, if so, set the second grid value corresponding to any grid to 255; if not, set the second grid value corresponding to any grid to 0;

[0171] If the first grid value of any grid is 255, then any grid is a static grid. If the second grid value of any grid is 255, then any grid is a dynamic grid. Obstacle information is obtained based on the static grid and the dynamic grid.

[0172] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as a depth image, an output static image at the previous moment, a detection static image at the current moment and an output static image at the current moment. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for obstacle detection is implemented.

[0173] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0174] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0175] Obtain a depth image at the current moment through a depth camera, and generate a detection static image at the current moment based on the depth image;

[0176] According to the output static image at the previous moment, the detection static image at the current moment is updated to obtain the output static image at the current moment;

[0177] The output static image at the current moment is binarized to obtain obstacle information in the output static image at the current moment.

[0178] In one embodiment, the output static image at the last moment includes the original static image and / or the static image obtained by transforming the original static image; when the output static image at the last moment is the static image obtained by transforming the original static image, the processor further implements the following steps when executing the computer program:

[0179] Acquire the current moment positioning data and the last moment positioning data through the positioning sensor, and determine the transformation relationship between the last moment positioning data and the current moment positioning data according to the current moment positioning data and the last moment positioning data;

[0180] The original static image is transformed according to the transformation relationship to obtain the output static image at the previous moment.

[0181] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0182] The depth image is converted into corresponding point cloud data, and the point cloud data is converted from the depth camera coordinate system to the robot coordinate system to obtain the first point cloud data in the robot coordinate system;

[0183] Convert the first point cloud data into a world coordinate system to obtain second point cloud data;

[0184] The second point cloud data is converted into a map coordinate system to obtain third point cloud data;

[0185] The third point cloud data is mapped to the grid map, and the detection static image at the current moment is obtained according to the mapping result.

[0186] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0187] Map the positioning data of the previous moment into the grid map, and map the positioning data of the current moment into the grid map;

[0188] According to the mapping result of the positioning data at the previous moment in the grid map and the mapping result of the positioning data at the current moment in the grid map, the displacement information between the positioning data at the previous moment and the positioning data at the current moment is determined; the displacement information is a transformation relationship, including a translation amount and a rotation amount.

[0189] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0190] According to the mapping result of the third point cloud data in the grid map, the grid value corresponding to each grid in the grid map is calculated, and the grid values ​​corresponding to each grid in the grid map constitute the detection static map at the current moment.

[0191] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0192] For two grids at any corresponding position between the output static image at the previous moment and the detection static image at the current moment, the two grids are respectively used as the first grid and the second grid. If the grid value corresponding to the second grid is 0, the grid value corresponding to the first grid is subtracted from the first preset threshold, and the subtraction result is used as the grid value of the grid at any corresponding position in the output static image at the current moment;

[0193] If the grid value corresponding to the second grid is not 0, the grid value corresponding to the first grid is added to the second preset threshold, and the addition result is used as the grid value of the grid at any corresponding position in the output static image at the current moment.

[0194] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0195] For any grid in the output static image at the current moment, determine whether the first grid value corresponding to any grid is within the preset range. If so, set the first grid value corresponding to any grid to 255; if not, set the first grid value corresponding to any grid to 0;

[0196] For any grid in the output static image at the current moment, determine whether the second grid value corresponding to any grid is greater than a third preset threshold value, if so, set the second grid value corresponding to any grid to 255; if not, set the second grid value corresponding to any grid to 0;

[0197] If the first grid value of any grid is 255, then any grid is a static grid. If the second grid value of any grid is 255, then any grid is a dynamic grid. Obstacle information is obtained based on the static grid and the dynamic grid.

[0198] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0199] Obtain a depth image at the current moment through a depth camera, and generate a detection static image at the current moment based on the depth image;

[0200] According to the output static image at the previous moment, the detection static image at the current moment is updated to obtain the output static image at the current moment;

[0201] The output static image at the current moment is binarized to obtain obstacle information in the output static image at the current moment.

[0202] In one embodiment, the output static image at the last moment includes the original static image and / or the static image obtained by transforming the original static image; when the output static image at the last moment is the static image obtained by transforming the original static image, the computer program further implements the following steps when executed by the processor:

[0203] Acquire the current moment positioning data and the last moment positioning data through the positioning sensor, and determine the transformation relationship between the last moment positioning data and the current moment positioning data according to the current moment positioning data and the last moment positioning data;

[0204] The original static image is transformed according to the transformation relationship to obtain the output static image at the previous moment.

[0205] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0206] The depth image is converted into corresponding point cloud data, and the point cloud data is converted from the depth camera coordinate system to the robot coordinate system to obtain the first point cloud data in the robot coordinate system;

[0207] Convert the first point cloud data into a world coordinate system to obtain second point cloud data;

[0208] The second point cloud data is converted into a map coordinate system to obtain third point cloud data;

[0209] The third point cloud data is mapped to the grid map, and the detection static image at the current moment is obtained according to the mapping result.

[0210] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0211] Map the positioning data of the previous moment into the grid map, and map the positioning data of the current moment into the grid map;

[0212] According to the mapping result of the positioning data at the previous moment in the grid map and the mapping result of the positioning data at the current moment in the grid map, the displacement information between the positioning data at the previous moment and the positioning data at the current moment is determined; the displacement information is a transformation relationship, including a translation amount and a rotation amount.

[0213] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0214] According to the mapping result of the third point cloud data in the grid map, the grid value corresponding to each grid in the grid map is calculated, and the grid values ​​corresponding to each grid in the grid map constitute the detection static map at the current moment.

[0215] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0216] For two grids at any corresponding position between the output static image at the previous moment and the detection static image at the current moment, the two grids are respectively used as the first grid and the second grid. If the grid value corresponding to the second grid is 0, the grid value corresponding to the first grid is subtracted from the first preset threshold, and the subtraction result is used as the grid value of the grid at any corresponding position in the output static image at the current moment;

[0217] If the grid value corresponding to the second grid is not 0, the grid value corresponding to the first grid is added to the second preset threshold, and the addition result is used as the grid value of the grid at any corresponding position in the output static image at the current moment.

[0218] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0219] For any grid in the output static image at the current moment, determine whether the first grid value corresponding to any grid is within the preset range. If so, set the first grid value corresponding to any grid to 255; if not, set the first grid value corresponding to any grid to 0;

[0220] For any grid in the output static image at the current moment, determine whether the second grid value corresponding to any grid is greater than a third preset threshold value, if so, set the second grid value corresponding to any grid to 255; if not, set the second grid value corresponding to any grid to 0;

[0221] If the first grid value of any grid is 255, then any grid is a static grid. If the second grid value of any grid is 255, then any grid is a dynamic grid. Obstacle information is obtained based on the static grid and the dynamic grid.

[0222] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and 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, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0223] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features 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.

[0224] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for obstacle detection, characterized in that: The method comprises: Acquire a depth image at the current moment through a depth camera, and generate a detection static image at the current moment according to the depth image; According to the output static image at the previous moment, the detection static image at the current moment is updated to obtain the output static image at the current moment; Binarizing the output static image at the current moment to obtain obstacle information in the output static image at the current moment; When the output static image at the previous moment is a static image obtained by transforming the original static image, before updating the detection static image at the current moment according to the output static image at the previous moment, the method further includes: Acquire the current moment positioning data and the last moment positioning data through the positioning sensor, determine the transformation relationship between the last moment positioning data and the current moment positioning data according to the current moment positioning data and the last moment positioning data; transform the original static image according to the transformation relationship to obtain the output static image of the last moment; The determining, according to the current moment positioning data and the previous moment positioning data, a transformation relationship between the previous moment positioning data and the current moment positioning data comprises: Acquire multiple sample displacement information; use the mapping result of the positioning data at the previous moment in the grid map as the first mapping result, use the mapping result of the positioning data at the current moment in the grid map as the second mapping result, and calculate the displacement mapping result of the first mapping result after displacement adjustment under each sample displacement information; calculate the matching degree between each displacement mapping result and the second mapping result, and use the sample displacement information corresponding to the maximum matching degree as the displacement information, wherein the displacement information is the transformation relationship, including the translation amount and the rotation amount; Calculating the degree of match between each displacement mapping result and the second mapping result includes: calculating a grid state matrix corresponding to the second mapping result; for any displacement mapping result, determining a target position in the grid state matrix corresponding to a grid having a point cloud in any displacement mapping result; superimposing the grid state corresponding to each target position in the grid state matrix, and using the superimposed result as the degree of match between any displacement mapping result and the second mapping result; The process of calculating the grid state matrix corresponding to the second mapping result includes: setting the grid state of the grid corresponding to the position in the grid state matrix where there is a point cloud in the second mapping result to 1; for any grid where there is no point cloud in the second mapping result, obtaining the grid state of any grid at the corresponding position in the grid state matrix based on the grid state of the target grid that is closest to any grid in the second mapping result and has a point cloud and the distance between any grid and the target grid.

2. The method according to claim 1, characterized in that The step of generating a detection static image at the current moment according to the depth image comprises: Converting the depth image into corresponding point cloud data, converting the point cloud data from the depth camera coordinate system to the robot coordinate system, and obtaining first point cloud data in the robot coordinate system; Converting the first point cloud data into a world coordinate system to obtain second point cloud data; Converting the second point cloud data into a map coordinate system to obtain third point cloud data; The third point cloud data is mapped into a grid map, and the detection static image at the current moment is obtained according to the mapping result.

3. The method according to claim 2, characterized in that Mapping the third point cloud data into a grid map, and acquiring the detection static image at the current moment according to the mapping result, comprises: According to the mapping result of the third point cloud data in the grid map, the grid value corresponding to each grid in the grid map is calculated, and the grid value corresponding to each grid in the grid map constitutes the detection static image at the current moment.

4. The method according to claim 1, characterized in that: The updating of the detection static image at the current moment according to the output static image at the previous moment to obtain the output static image at the current moment includes: For two grids at any corresponding positions between the output static image at the previous moment and the detection static image at the current moment, the two grids are respectively used as the first grid and the second grid. If the grid value corresponding to the second grid is 0, the grid value corresponding to the first grid is subtracted from the first preset threshold, and the subtraction result is used as the grid value of the grid at any corresponding position in the output static image at the current moment; If the grid value corresponding to the second grid is not 0, the grid value corresponding to the first grid is added to the second preset threshold, and the addition result is used as the grid value of the grid at any corresponding position in the output static image at the current moment.

5. The method according to claim 1, characterized in that: The binarization process is performed on the output static image at the current moment to obtain obstacle information in the output static image at the current moment, including: For any grid in the output static image at the current moment, determine whether the first grid value corresponding to any grid is within a preset range, if so, set the first grid value corresponding to any grid to 255; if not, set the first grid value corresponding to any grid to 0; For any grid in the output static image at the current moment, determine whether the second grid value corresponding to any grid is greater than a third preset threshold value, if so, set the second grid value corresponding to any grid to 255; if not, set the second grid value corresponding to any grid to 0; If the first grid value of any grid is 255, then any grid is a static grid, and if the second grid value of any grid is 255, then any grid is a dynamic grid, and the obstacle information is obtained according to the static grid and the dynamic grid.

6. An obstacle detection device, characterized in that: The device comprises: A generation module, used to obtain a depth image at a current moment through a depth camera, and generate a detection static image at the current moment according to the depth image; An updating module, used for updating the detection static image at the current moment according to the output static image at the previous moment, to obtain the output static image at the current moment; A first determination module is used to perform binarization processing on the output static image at the current moment to obtain obstacle information in the output static image at the current moment; A second determination module is used to obtain the current moment positioning data and the last moment positioning data through the positioning sensor, and determine the transformation relationship between the last moment positioning data and the current moment positioning data according to the current moment positioning data and the last moment positioning data; A third determination module is used to transform the original static image according to the transformation relationship to obtain an output static image at the previous moment; The determining, according to the current moment positioning data and the previous moment positioning data, a transformation relationship between the previous moment positioning data and the current moment positioning data comprises: Acquire multiple sample displacement information; use the mapping result of the positioning data at the previous moment in the grid map as the first mapping result, use the mapping result of the positioning data at the current moment in the grid map as the second mapping result, and calculate the displacement mapping result of the first mapping result after displacement adjustment under each sample displacement information; calculate the matching degree between each displacement mapping result and the second mapping result, and use the sample displacement information corresponding to the maximum matching degree as the displacement information, wherein the displacement information is the transformation relationship, including the translation amount and the rotation amount; Calculating the matching degree between each bit shift mapping result and the second mapping result includes: Calculate the grid state matrix corresponding to the second mapping result; for any displacement mapping result, determine the target position in the grid state matrix corresponding to the grid with the point cloud in any displacement mapping result; superimpose the grid states corresponding to each target position in the grid state matrix, and use the superimposed result as the matching degree between any displacement mapping result and the second mapping result; The process of calculating the grid state matrix corresponding to the second mapping result includes: The grid state of the grid corresponding to the point cloud in the second mapping result is set to 1; for any grid without point cloud in the second mapping result, the grid state of the target grid closest to any grid and with point cloud in the second mapping result and the distance between any grid and the target grid are obtained.

7. The device according to claim 6, characterized in that The generating module comprises: A first conversion unit, converting the depth image into corresponding point cloud data, converting the point cloud data from the depth camera coordinate system to the robot coordinate system, to obtain first point cloud data in the robot coordinate system; A second conversion unit, used for converting the first point cloud data into a world coordinate system to obtain second point cloud data; A third conversion unit, used for converting the second point cloud data into a map coordinate system to obtain third point cloud data; The acquisition unit is used to map the third point cloud data into a grid map, and acquire the detection static image at the current moment according to the mapping result.

8. The device according to claim 7, characterized in that The acquisition unit comprises: The calculation subunit is used to calculate the grid value corresponding to each grid in the grid map according to the mapping result of the third point cloud data in the grid map, and the grid values ​​corresponding to each grid in the grid map constitute the detection static image at the current moment.

9. A robot, wherein the robot is provided with a depth camera and a positioning sensor, and further comprises a memory and a processor, wherein the memory is used to store a computer program, wherein: The processor is configured to implement the steps of the method according to any one of claims 1 to 5 when executing the computer program.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Obstacle recognizing and tracking method oriented for road rescue safety monitoring

    CN107239746A

  • Static map generation method and device, computer equipment and storage medium

    CN112799095A