Search

CN-114897669-B - Labeling method and device and electronic equipment

CN114897669BCN 114897669 BCN114897669 BCN 114897669BCN-114897669-B

Abstract

The embodiment of the invention provides a labeling method, a labeling device and electronic equipment. The method comprises the steps of obtaining a target three-dimensional point cloud of a target area, mapping the target three-dimensional point cloud to a two-dimensional grid map, wherein the two-dimensional grid map is divided into a plurality of grids, and marking obstacles in the two-dimensional grid map according to the point cloud density of each grid in the two-dimensional grid map, wherein the point cloud density is in direct proportion to the number of the point clouds contained in the grids. The point cloud density in each grid can be determined by mapping the three-dimensional point cloud to the grid map, and the point cloud density of the obstacle area is higher than that of the non-obstacle area, so that the obstacle can be marked in the two-dimensional grid map based on the point cloud density of the grid. The efficiency of the obstacle marking is higher because the obstacle does not need to be marked manually.

Inventors

  • LI FEI
  • LI WEI
  • KUANG HONGWU

Assignees

  • 杭州海康汽车软件有限公司

Dates

Publication Date
20260508
Application Date
20220425

Claims (17)

  1. 1.A method of labeling, the method comprising: acquiring a target three-dimensional point cloud of a target area; mapping the target three-dimensional point cloud to a two-dimensional grid map, wherein the two-dimensional grid map is divided into a plurality of grids; Marking obstacles in the two-dimensional grid map according to the point cloud density of each grid in the two-dimensional grid map, wherein the point cloud density is in direct proportion to the number of point clouds contained in the grids; The method further comprises the steps of: determining an area between two adjacent obstacles as an idle area; If the size of the idle area is larger than the preset parking space size, marking the idle area as a parking space; the obtaining the target three-dimensional point cloud of the target area comprises the following steps: acquiring a plurality of laser frames obtained by scanning a target area by a laser radar LiDAR, and the pose of each of the plurality of laser frames; mapping the point cloud in the laser frames to a preset global coordinate system according to the pose of the laser frames for each laser frame to obtain a target three-dimensional point cloud; The acquiring the pose of each of the plurality of laser frames includes: based on the motion data of the LiDAR measured by an inertial sensor IMU, respectively determining the pose of each laser frame acquired by the LiDAR as the initial value of the pose of the laser frame; for each laser frame, mapping the point cloud of the laser frame to a global coordinate system according to the pose initial value of the laser frame to obtain a first current point cloud corresponding to the laser frame; registering the first current point cloud corresponding to each laser frame with a local point cloud to obtain the pose of the laser frame, wherein the local point cloud is a point cloud in a local area in a three-dimensional point cloud constructed based on the laser frames with known pose; Mapping the point cloud in the laser frame to a preset global coordinate system according to the pose of the laser frame for each laser frame to obtain a target three-dimensional point cloud, wherein the method comprises the following steps of: for each laser frame in the plurality of laser frames, mapping the point cloud of the laser frame to a global coordinate system according to the pose of the laser frame to obtain a second current point cloud corresponding to the laser frame; Registering the second current point cloud corresponding to the laser frame with a global point cloud aiming at each laser frame to obtain corrected pose of the laser frame, wherein the global point cloud is all point clouds in three-dimensional point clouds constructed based on the laser frames with known pose, the global point cloud is point clouds in a global area, the global area comprises an area where the first current point cloud is located, the size of the global area is not smaller than a preset size upper limit threshold, and the preset size upper limit threshold is larger than the preset size lower limit threshold; For each laser frame, mapping the point cloud in the laser frame to a preset global coordinate system according to the corrected pose of the laser frame to obtain a target three-dimensional point cloud; each of the laser frames includes a plurality of fan angle data, the method further comprising: for each laser frame, based on the motion data of the LiDAR measured by an inertial sensor IMU, respectively determining the pose of each fan angle data in the laser frame obtained by the LiDAR acquisition as the pose corresponding to each fan angle data; and mapping the point cloud in each fan angle data to the same coordinate system according to the pose corresponding to each fan angle data in the laser frame to obtain the point cloud in the laser frame.
  2. 2. The method of claim 1, wherein the marking obstacles in the two-dimensional grid map according to the point cloud density of each grid in the two-dimensional grid map comprises: determining an obstacle grid belonging to an obstacle region in the two-dimensional grid map according to the point cloud density of each grid in the two-dimensional grid map; dividing the barrier grids into at least one barrier grid group, wherein the distance between any two barrier grids in the barrier grid group is smaller than a preset distance threshold; determining a minimum convex hull region surrounding the barrier grid groups for each barrier grid group; and marking the minimum convex hull area as an obstacle.
  3. 3. The method of claim 2, wherein the labeling the smallest convex hull region as an obstacle comprises: and if the size of the barrier grid group meets the preset priori size condition, marking the minimum convex hull area as a barrier.
  4. 4. The method of claim 2, wherein the determining an obstacle grid belonging to an obstacle region in the two-dimensional grid map according to the point cloud density of each grid in the two-dimensional grid map comprises: Determining a grid with the point cloud density larger than a preset density threshold value in the two-dimensional grid map as an occupied grid; for each of the occupancy grids, if at least one occupancy grid exists in the occupancy grid neighborhood, determining the occupancy grid and the grids in the neighborhood as obstacle grids.
  5. 5. The method of claim 1, wherein the determining the area between two adjacent obstacles as the free area comprises: determining a first boundary of a first obstacle and a second boundary of a second obstacle, wherein the first obstacle and the second obstacle are any two adjacent obstacles, the first obstacle and the second obstacle are positioned on different sides of the first boundary, and the first obstacle and the second obstacle are positioned on different sides of the second boundary; And determining a region between the first boundary and the second boundary as a free region.
  6. 6. The method of claim 1, wherein the mapping the target three-dimensional point cloud to a two-dimensional grid map comprises: removing points belonging to the ground in the target three-dimensional point cloud to obtain a three-dimensional point cloud after ground filtering; And mapping the filtered three-dimensional point cloud to a two-dimensional grid map.
  7. 7. The method of claim 6, wherein the method further comprises: Calculating a vertical angle of a connecting line between each point cloud and a ground point in each point band in the target three-dimensional point cloud, wherein the point bands are sets of point clouds with the same horizontal direction in the same laser frame, and the ground point clouds are point clouds which are determined to belong to the ground; and if the vertical angle is smaller than a preset angle threshold value, determining the point cloud to be the point cloud belonging to the ground.
  8. 8. The method according to claim 1, wherein registering the first current point cloud and the local point cloud corresponding to the laser frame to obtain the pose of the laser frame includes: Registering the first current point cloud corresponding to the laser frame with a local point cloud, and determining the offset rotation amount of the first current point cloud relative to the local point cloud; And performing offset rotation on the pose initial value according to the offset rotation quantity to obtain the pose of the laser frame.
  9. 9. The method of claim 1, wherein the registering the first current point cloud and a local point cloud corresponding to the laser frame comprises: determining the size of a point cloud polarization matrix according to working parameters of LiDAR; Determining row coordinates, column coordinates and depth values of each point cloud according to the positions of each point cloud in the first current point cloud relative to the LiDAR when the point cloud is acquired through the LiDAR; constructing a point cloud polarization matrix according to the size of the point cloud polarization matrix and row coordinates, column coordinates and depth values of each point cloud; Determining a characteristic point cloud in the first current point cloud according to the point cloud polarization matrix; Registering the characteristic point cloud and the local point cloud.
  10. 10. The method of claim 9, wherein the determining a characteristic point cloud of the first current point cloud from the point cloud polarization matrix comprises: determining the curvature of the point cloud i of the first current point cloud by the following formula : ; Wherein S is a point set distributed on the left side and the right side of the point cloud i in the point cloud polarization matrix, The number of representative point sets is calculated, The depth value of the j-th point cloud in the S in the point cloud polarization matrix, The depth value of the point cloud i in the point cloud polarization matrix is set as the depth value; And screening out characteristic point clouds in the first current point cloud according to the point cloud curvature of each point cloud in the first current point cloud.
  11. 11. The method according to claim 1, wherein for each laser frame, mapping the point cloud in the laser frame to a preset global coordinate system according to the corrected pose of the laser frame to obtain a target three-dimensional point cloud, including: performing pose smoothing on the corrected pose of each laser frame to obtain an optimized pose of each laser frame; And mapping the point cloud in the laser frame to a preset global coordinate system according to the optimized pose of the laser frame for each laser frame to obtain a target three-dimensional point cloud.
  12. 12. The method of claim 1, wherein each of the laser frames includes a plurality of fan angle data, the method further comprising: for each laser frame in the plurality of laser frames, determining an interval between acquisition times of fan angle data adjacent to the acquisition time in the laser frame; Mapping the point cloud in the laser frame to a preset global coordinate system according to the pose of the laser frame for each laser frame to obtain a target three-dimensional point cloud, wherein the method comprises the following steps of: And mapping the point cloud in the laser frames to a preset global coordinate system according to the pose of the laser frames for each laser frame with the interval not larger than a preset interval threshold value to obtain a target three-dimensional point cloud.
  13. 13. The method of claim 1, wherein for each of the laser frames, mapping the point cloud in each of the fan angle data to the same coordinate system according to the pose corresponding to each of the fan angle data in the laser frame, respectively, to obtain the point cloud in the laser frame, includes: determining a pose transformation relation of each fan angle data in the laser frame relative to first fan angle data, wherein the first fan angle data is one fan angle data in the laser frame; Mapping the pose of each fan angle data in the laser frame to a coordinate system where the pose of the first fan angle data is located according to the pose transformation relation to obtain a new pose of each fan angle data; and mapping the point cloud in each fan angle data to the same coordinate system according to the new pose of each fan angle data to obtain the point cloud in the laser frame.
  14. 14. An labeling device, the device comprising: The data acquisition module is used for acquiring a target three-dimensional point cloud of a target area; a point cloud mapping module for mapping the target three-dimensional point cloud to a two-dimensional grid map, wherein the two-dimensional grid map is divided into a plurality of grids; the obstacle marking module is used for marking obstacles in the two-dimensional grid map according to the point cloud density of each grid in the two-dimensional grid map, wherein the point cloud density is in direct proportion to the number of point clouds contained in the grids; The apparatus further comprises: an idle region determining module for determining a region between two adjacent obstacles as an idle region; The parking space determining module is used for marking the idle area as a parking space if the size of the idle area is larger than the preset parking space size; The data acquisition module comprises: The pose determining unit is used for obtaining a plurality of laser frames obtained by scanning a target area by the laser radar LiDAR and respective poses of the plurality of laser frames; The target three-dimensional point cloud determining unit is used for mapping the point cloud in the laser frames to a preset global coordinate system according to the pose of each laser frame to obtain target three-dimensional point cloud; Wherein, the position appearance determining unit includes: The pose initial value determining subunit is used for respectively determining the pose of each laser frame acquired by the LiDAR based on the motion data of the LiDAR measured by the inertial sensor IMU, and taking the pose as the pose initial value of the laser frame; The first point cloud determining subunit is used for mapping the point cloud of the laser frame to a global coordinate system according to the pose initial value of the laser frame for each laser frame to obtain a first current point cloud corresponding to the laser frame; The pose determining subunit is used for registering the first current point cloud corresponding to each laser frame with a local point cloud to obtain the pose of the laser frame, wherein the local point cloud is a point cloud in a local area in a three-dimensional point cloud constructed based on the laser frames with known pose; the target three-dimensional point cloud determining unit includes: A second point cloud determining subunit, configured to map, for each laser frame of the plurality of laser frames, a point cloud of the laser frame to a global coordinate system according to a pose of the laser frame, to obtain a second current point cloud corresponding to the laser frame; The pose correction determining subunit is configured to register, for each laser frame, the second current point cloud corresponding to the laser frame with a global point cloud to obtain a corrected pose of the laser frame, where the global point cloud is all point clouds in a three-dimensional point cloud constructed based on a laser frame with a known pose; the global point cloud is a point cloud in a global area, the global area comprises an area where the first current point cloud is located, the size of the global area is not smaller than a preset size upper limit threshold, and the preset size upper limit threshold is larger than the preset size lower limit threshold; The target three-dimensional point cloud determining subunit is used for mapping the point cloud in the laser frame to a preset global coordinate system according to the corrected pose of the laser frame for each laser frame to obtain a target three-dimensional point cloud; Each laser frame comprises a plurality of fan angle data, and the data acquisition module further comprises: The fan angle pose determining unit is used for determining pose of each fan angle data in each laser frame based on the motion data of the LiDAR measured by the inertial sensor IMU, wherein the pose of each fan angle data in the laser frame is obtained through the LiDAR acquisition and is used as the pose corresponding to each fan angle data; And the laser frame point cloud determining unit is used for mapping the point cloud in each sector angle data to the same coordinate system according to the pose corresponding to each sector angle data in each laser frame to obtain the point cloud in the laser frame.
  15. 15. The apparatus of claim 14, wherein the free-area determination module comprises: a boundary determining unit configured to determine a first boundary of a first obstacle and a second boundary of a second obstacle, where the first obstacle and the second obstacle are any two adjacent obstacles, the first obstacle and the second obstacle are located on different sides of the first boundary, and the first obstacle and the second obstacle are located on different sides of the second boundary; An idle region determining unit configured to determine a region between the first boundary and the second boundary as an idle region; the obstacle labeling module comprises: a grid determining unit configured to determine an obstacle grid belonging to an obstacle region in the two-dimensional grid map according to a point cloud density of each grid in the two-dimensional grid map; a grid group determining unit, configured to divide the obstacle grid into at least one obstacle grid group, where a distance between any two obstacle grids in the obstacle grid group is smaller than a preset distance threshold; a convex hull region determining unit configured to determine, for each of the obstacle grid groups, a minimum convex hull region that encloses the obstacle grid group; the obstacle marking unit is used for marking the minimum convex hull area as an obstacle; the obstacle labeling unit is specifically configured to label the minimum convex hull area as an obstacle if the size of the obstacle grid set meets a preset priori size condition; The grid group determination unit includes: An occupied grid subunit, configured to determine, in the two-dimensional grid map, a grid with a point cloud density greater than a preset density threshold, as an occupied grid; An obstacle grid determining subunit, configured to determine, for each of the occupied grids, if at least one occupied grid exists in the occupied grid neighborhood, the occupied grid and the grids in the neighborhood as obstacle grids; the point cloud mapping module comprises: The filtered three-dimensional point cloud determining unit is used for removing points belonging to the ground in the target three-dimensional point cloud to obtain a filtered three-dimensional point cloud; the two-dimensional grid map determining unit is used for mapping the filtered three-dimensional point cloud to a two-dimensional grid map; a ground point calculation unit, configured to calculate, for each point cloud in each point band in the target three-dimensional point cloud, a vertical angle of a connection line between the point cloud and a ground point in the point band, where the point bands are a set of point clouds with the same horizontal orientation in the same laser frame, and the ground point clouds are point clouds that have been determined to belong to the ground; the ground point determining unit is used for determining the point cloud to be the point cloud belonging to the ground if the vertical angle is smaller than a preset angle threshold value; The pose determining subunit is specifically configured to register the first current point cloud corresponding to the laser frame with a local point cloud, determine an offset rotation amount of the first current point cloud relative to the local point cloud, where the local point cloud is a point cloud in a local area in a three-dimensional point cloud constructed based on a laser frame with a known pose; The pose determination subunit is specifically configured to determine a size of a point cloud polarization matrix according to an operating parameter of a LiDAR, determine row coordinates, column coordinates and depth values of each point cloud according to a position of each point cloud in the first current point cloud relative to the LiDAR when the point cloud is acquired by the LiDAR, construct a point cloud polarization matrix according to the size of the point cloud polarization matrix and the row coordinates, column coordinates and depth values of each point cloud, determine a characteristic point cloud in the first current point cloud according to the point cloud polarization matrix, and register the characteristic point cloud with a local point cloud; the pose determination subunit is specifically configured to determine a curvature of the point cloud i in the first current point cloud according to the following formula : ; Wherein S is a point set distributed on the left side and the right side of the point cloud i in the point cloud polarization matrix, The number of representative point sets is calculated, The depth value of the j-th point cloud in the S in the point cloud polarization matrix, The depth value of the point cloud i in the point cloud polarization matrix is set as the depth value; Screening out characteristic point clouds in the first current point cloud according to the point cloud curvature of each point cloud in the first current point cloud; The target three-dimensional point cloud determining subunit is specifically configured to smooth the corrected pose of each laser frame to obtain an optimized pose of each laser frame; for each laser frame, mapping the point cloud in the laser frame to a preset global coordinate system according to the optimized pose of the laser frame to obtain a target three-dimensional point cloud; the data acquisition module further comprises: a fan angle interval determining unit, configured to determine, for each of the plurality of laser frames, an interval between acquisition times of fan angle data adjacent to acquisition times in the laser frame; The target three-dimensional point cloud determining unit is specifically configured to map, for each of the laser frames having an interval not greater than a preset interval threshold, a point cloud in the laser frame to a preset global coordinate system according to a pose of the laser frame, to obtain a target three-dimensional point cloud; The laser frame point cloud determining unit comprises: the fan angle and pose transformation subunit is used for determining the pose transformation relation of each piece of fan angle data in the laser frame relative to first fan angle data, wherein the first fan angle data is one piece of fan angle data in the laser frame; A fan angle new pose subunit, configured to map, according to the pose transformation relationship, a pose of each fan angle data in the laser frame to a coordinate system where the pose of the first fan angle data is located, so as to obtain a new pose of each fan angle data; And the fan angle mapping subunit is used for mapping the point cloud in each fan angle data to the same coordinate system according to the new pose of each fan angle data to obtain the point cloud in the laser frame.
  16. 16. An electronic device, comprising: A memory for storing a computer program; a processor for carrying out the method steps of any one of claims 1-13 when executing a program stored on a memory.
  17. 17. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-13.

Description

Labeling method and device and electronic equipment Technical Field The present invention relates to the field of machine vision, and in particular, to a labeling method, a labeling device, and an electronic device. Background The method is one of the main methods of the automatic driving technology, and the method divides the positioning technology into 2 steps, namely, constructing a high-precision map of a scene and realizing high-precision positioning based on a public high-precision map of the scene. The accuracy of the positioning is thus dependent on the accuracy of the map. Ensuring the accuracy of high-precision maps is a key to the overall positioning technology. In order to ensure the accuracy of the high-precision map, the positions of the respective target objects, such as the obstacles, need to be accurately marked in the high-precision map. In the related art, the manual marking mode is often adopted to mark the obstacle, and the efficiency is low. Disclosure of Invention The embodiment of the invention aims to provide a labeling method, a labeling device and electronic equipment so as to improve labeling efficiency. The specific technical scheme is as follows: in a first aspect of the present invention, there is provided a labeling method, the method comprising: acquiring a target three-dimensional point cloud of a target area; mapping the target three-dimensional point cloud to a two-dimensional grid map, wherein the two-dimensional grid map is divided into a plurality of grids; and marking obstacles in the two-dimensional grid map according to the point cloud density of each grid in the two-dimensional grid map, wherein the point cloud density is proportional to the number of point clouds contained in the grids. In a second aspect of the present invention, there is provided an annotating device, the device comprising: The data acquisition module is used for acquiring a target three-dimensional point cloud of a target area; a point cloud mapping module for mapping the target three-dimensional point cloud to a two-dimensional grid map, wherein the two-dimensional grid map is divided into a plurality of grids; And the obstacle marking module is used for marking obstacles in the two-dimensional grid map according to the point cloud density of each grid in the two-dimensional grid map, wherein the point cloud density is in direct proportion to the number of point clouds contained in the grids. In a third aspect of the present invention, there is provided an electronic apparatus comprising: A memory for storing a computer program; A processor for implementing the method steps of any of the above first aspects when executing a program stored on a memory. In a fourth aspect of the present invention, there is provided a computer readable storage medium having a computer program stored therein, which when executed by a processor, implements the method steps of any of the first aspects. The embodiment of the invention has the beneficial effects that: according to the labeling method, the labeling device and the electronic equipment provided by the embodiment of the invention, the point cloud density in each grid can be determined by mapping the three-dimensional point cloud to the grid map, and the point cloud density of the obstacle area is higher than that of the non-obstacle area, so that the obstacle can be labeled in the two-dimensional grid map based on the point cloud density of the grid. The efficiency of the obstacle marking is higher because the obstacle does not need to be marked manually. Of course, it is not necessary for any one product or method of practicing the invention to achieve all of the advantages set forth above at the same time. Drawings In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other embodiments may be obtained according to these drawings to those skilled in the art. FIG. 1 is a schematic flow chart of a labeling method according to an embodiment of the present invention; FIG. 2 is a schematic diagram of a vertical angle evaluation method applied to a labeling method according to an embodiment of the present invention; Fig. 3 is a schematic diagram of a point cloud map filtering effect applied to a labeling method according to an embodiment of the present invention; Fig. 4 is a schematic flow chart of a method for determining an obstacle grid according to an embodiment of the present invention; FIG. 5 is a schematic diagram of a labeling structure of an obstacle and a parking space according to an embodiment of the present invention; FIG. 6 is a flowchart of another labeling method according to an embodiment of the present invention; Fig. 7 is a schematic diagram of the effect of the targe