CN112200913B - Point cloud generation method, device, equipment and storage medium - Google Patents
Point cloud generation method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN112200913B CN112200913B CN202011064468.9A CN202011064468A CN112200913B CN 112200913 B CN112200913 B CN 112200913B CN 202011064468 A CN202011064468 A CN 202011064468A CN 112200913 B CN112200913 B CN 112200913B
- Authority
- CN
- China
- Prior art keywords
- grid
- point
- laser radar
- boundary line
- depth
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
- G06T17/20—Finite element generation, e.g. wire-frame surface description, tesselation
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Computer Graphics (AREA)
- Geometry (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Optical Radar Systems And Details Thereof (AREA)
Abstract
The application discloses a point cloud generation method, a device, equipment and a storage medium, wherein the method comprises the following steps: according to parameters of the laser radar, performing grid division on a visible area of the laser radar in space to obtain a plurality of first grids; calculating a first grid through which the contour boundary line of each surface passes according to the mapping positions of all surfaces of the object in the space in the first grid; calculating a covering grid corresponding to each surface according to a closed area formed by a first grid through which the contour boundary line of each surface passes; and calculating the depth from the coverage grid corresponding to each surface to the laser radar, and generating a point cloud based on the minimum depth of each coverage grid. The method solves the technical problems that the existing point cloud generation method depends on a ray tracing method based on a game engine, has high complexity and high calculation resource consumption, is difficult to apply to real-time test and large-scale scene test, and cannot generate corresponding point clouds according to parameters of different laser radars.
Description
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for generating a point cloud.
Background
The point cloud generation method can be applied to scenes such as three-dimensional modeling, automatic driving test of vehicles and the like. The existing point cloud generation method mainly depends on a ray tracing method based on a game engine, is high in complexity and high in resource consumption, is difficult to apply to real-time testing and large-scale scene testing, and cannot generate corresponding point clouds according to parameters of different laser radars by adopting fixed resolution.
Disclosure of Invention
The application provides a point cloud generation method, a device, equipment and a storage medium, which are used for solving the technical problems that the existing point cloud generation method depends on a ray tracing method based on a game engine, has high complexity and large calculation resource consumption, is difficult to apply to real-time test and large-scale scene test, and cannot generate corresponding point clouds according to parameters of different laser radars.
In view of this, a first aspect of the present application provides a point cloud generating method, including:
according to parameters of the laser radar, performing grid division on a visible area of the laser radar in space to obtain a plurality of first grids;
calculating the first grid through which the contour boundary line of each surface passes according to the mapping positions of all surfaces of the object in the space in the first grid;
Calculating a covering grid corresponding to each surface according to a closed area formed by the first grids through which the contour boundary line of each surface passes;
and calculating the depth from the coverage grid corresponding to each surface to the laser radar, and generating a point cloud based on the minimum depth of each coverage grid.
Optionally, the calculating the first grid through which the contour boundary line of each surface passes according to the mapping positions of all the surfaces of the object in the space in the first grid specifically includes:
s1, determining a starting point and an ending point of each contour boundary line segment of each surface according to mapping positions of all surfaces of an object in the space in the first grid;
s2, calculating the midpoint of each contour boundary line segment based on the starting point and the ending point of each contour boundary line segment;
s3, judging whether the middle point of the contour boundary line segment and the starting point or the end point of the contour boundary line are in the same first grid, if so, entering a step S4, and if not, entering steps S5 and S6;
s4, outputting the first grids of all starting points and end points of each contour boundary line segment to obtain the first grids through which the contour boundary line of each surface passes;
S5, taking the middle point of the contour boundary line segment as a new end point, and returning to the step S2;
s6, taking the middle point of the contour boundary line segment as a new starting point, and returning to the step S2.
Optionally, the calculating the covering grid corresponding to each surface according to the closed area formed by the first grid through which the contour boundary line of each surface passes specifically includes:
and scanning the closed area formed by the first grids passing by the contour boundary line of each surface row by row or column by column to obtain a covering grid corresponding to each surface.
Optionally, the calculating the covering grid corresponding to each surface according to the closed area formed by the first grid through which the contour boundary line of each surface passes specifically includes:
selecting a target grid from a closed area formed by the first grids passing by the contour boundary line of each surface, and traversing the first grids from the periphery of the target grid until the traversed first grids fill the closed area, so as to obtain a covering grid corresponding to each surface.
Optionally, the calculating the depth from the coverage grid corresponding to each surface to the laser radar, and generating a point cloud based on the minimum depth of each coverage grid specifically includes:
Calculating the depth from the covering grids corresponding to each surface to the laser radar, and taking the minimum depth from each surface of each covering grid to the laser radar as the minimum depth of each covering grid;
generating a depth map based on a minimum depth of the overlay mesh;
and determining visible points of each object through the depth map, and generating a point cloud.
Optionally, the determining the visible point of each object through the depth map generates a point cloud, and then further includes:
a new object shape for each of the objects is calculated based on the visible points of each of the objects.
Optionally, the generating a depth map based on the minimum depth of the coverage grid further includes:
and calculating invisible points of the laser radar according to the depth map, and generating blind areas of the laser radar based on the invisible points.
Optionally, the calculating the invisible point of the laser radar according to the depth map specifically includes:
calculating the intersection point of the midpoint ray of each first grid in the space and the horizontal plane at the preset height, wherein the endpoint of the midpoint ray of the first grid is the center point of the first grid;
And when the depth from the intersection point to the laser radar is larger than the minimum depth from the intersection point to the laser radar, judging that the intersection point is an invisible point of the laser radar, wherein the minimum depth from the intersection point to the laser radar is the minimum depth of the first grid where the midpoint ray corresponding to the intersection point is located, and the minimum depth of the first grid is obtained through the depth map.
Optionally, the calculating the invisible point of the laser radar according to the depth map specifically includes:
grid dividing the horizontal plane of the target area in the space to obtain a plurality of second grids;
mapping the center point of each second grid to a preset height to obtain a mapping point;
calculating azimuth angles and distances between each mapping point and the laser radar, wherein the azimuth angles comprise vertical azimuth angles and horizontal azimuth angles;
determining the minimum depth from the mapping point to the laser radar through the azimuth angle from the mapping point to the laser radar and the depth map;
and when the depth from the mapping point to the laser radar is larger than the minimum depth from the mapping point to the laser radar, judging that the mapping point is an invisible point of the laser radar.
Optionally, the determining the minimum depth from the mapping point to the laser radar according to the azimuth angle from the mapping point to the laser radar and the depth map specifically includes:
determining the first grid where the mapping point is located through the azimuth angle from the mapping point to the laser radar;
and determining the minimum depth of the first grid where the mapping point is located through the depth map, and obtaining the minimum depth from the mapping point to the laser radar.
A second aspect of the present application provides a point cloud generating device, including:
the dividing unit is used for dividing grids of a visible area of the laser radar in space according to parameters of the laser radar to obtain a plurality of first grids;
a first calculation unit, configured to calculate, according to mapping positions of all surfaces of an object in the space in the first grid, the first grid through which a contour boundary line of each surface passes;
the second calculation unit is used for calculating a covering grid corresponding to each surface according to a closed area formed by the first grids through which the contour boundary line of each surface passes;
and the point cloud generating unit is used for calculating the depth from the coverage grid corresponding to each surface to the laser radar and generating a point cloud based on the minimum depth of each coverage grid.
A third aspect of the present application provides a point cloud generating device, the device comprising a processor and a memory;
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to generate the point cloud according to any one of the first aspect of the instructions in the program code.
A fourth aspect of the present application provides a computer readable storage medium for storing program code for performing the point cloud generating method according to any one of the first aspects.
From the above technical scheme, the application has the following advantages:
the application provides a point cloud generation method, which comprises the following steps: according to parameters of the laser radar, performing grid division on a visible area of the laser radar in space to obtain a plurality of first grids; calculating a first grid through which the contour boundary line of each surface passes according to the mapping positions of all surfaces of the object in the space in the first grid; calculating a covering grid corresponding to each surface according to a closed area formed by a first grid through which the contour boundary line of each surface passes; and calculating the depth from the coverage grid corresponding to each surface to the laser radar, and generating a point cloud based on the minimum depth of each coverage grid.
According to the point cloud generation method, grid division is carried out on a visible area of the laser radar according to parameters of the laser radar, different first grids can be obtained for different types of laser radar through division, and then different point clouds are generated; according to the method, only the falling point of a laser scanning line on the surface of an object is calculated, the calculation method is simple, the calculation resource cost is reduced, the method can be applied to real-time testing and large-scale scene testing, and the technical problems that the existing point cloud generation method depends on a ray tracing method based on a game engine, the complexity is high, the calculation resource consumption is high, the method is difficult to apply to real-time testing and large-scale scene testing, and the corresponding point cloud cannot be generated according to parameters of different laser radars are solved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive faculty for a person skilled in the art.
Fig. 1 is a schematic flow chart of a point cloud generating method according to an embodiment of the present application;
fig. 2 is another flow chart of a point cloud generating method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a point cloud generating device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a first computing unit according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a second computing unit according to an embodiment of the present application.
Detailed Description
The application provides a point cloud generation method, a device, equipment and a storage medium, which are used for solving the technical problems that the existing point cloud generation method depends on a ray tracing method based on a game engine, has high complexity and large calculation resource consumption, is difficult to apply to real-time test and large-scale scene test, and cannot generate corresponding point clouds according to parameters of different laser radars.
In order to make the present application solution better understood by those skilled in the art, the following description will clearly and completely describe the technical solution in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Method embodiment one:
referring to fig. 1, a method for generating a point cloud according to an embodiment of the present application includes:
step 101, according to parameters of the laser radar, performing grid division on a visible area of the laser radar in a space to obtain a plurality of first grids.
The parameters of different types of laser radars are different, and the visible area of the laser radars in the space is meshed according to the parameters of the laser radars. Specifically, assuming that a certain 32-line laser radar has a visible range of [ -5 °,70 ° ], that is, a visible range of a visible area in a vertical direction is [ -5 °,70 ° ], the corresponding angular resolution of each laser scanning line in a vertical direction can be obtained, and assuming that the angular resolution of each laser scanning line in a horizontal direction is 3 °, that is, one laser point is visible every 3 ° in a horizontal direction, 120 angles are visible in the horizontal direction after the laser radar rotates once, and according to the angular resolutions of the horizontal direction and the vertical direction of the laser radar, the visible area of the laser radar is subjected to grid division, so that 120 x 32 first grids can be obtained, wherein each first grid represents one visible angle of one laser scanning line. The density degree of the laser scanning lines of different laser radars is also different, the division results are also different, and correspondingly, the generated point clouds are also different; the number of the laser scanning lines of the laser radar is more than one, and the number of discrete points is correspondingly calculated, and only the falling points of the laser scanning lines on the surface of the object are calculated, so that the calculation resource cost is reduced.
Step 102, calculating a first grid through which the contour boundary line of each surface passes according to the mapping positions of all surfaces of the object in the space in the first grid.
And scanning all surfaces of each object in the space to obtain the mapping position of each surface in the first grid, and further calculating to obtain the first grid through which the contour boundary line of each surface passes.
It will be appreciated that each surface is an enclosed area of a plurality of line segments, for example a rectangular surface is a rectangular enclosed area of 4 line segments. From monotonicity of the spherical coordinates and the euclidean coordinate system and monotonicity of the mapping, it is known that an angular coordinate of a point in a surface must be surrounded by all angular coordinates through which a line segment of the surface passes. For spherical coordinates where there are non-continuous points, the entire spherical coordinate space may be divided into two monotonic coordinate spaces with the non-continuous points as boundaries. Therefore, in order to quickly calculate all visible angles covered by a surface (i.e., all first grids covered), first grids passed by a line segment in the surface are calculated, and then all first grids covered by the surface are calculated through a closed area formed by the first grids passed by all line segments of the surface, so as to obtain the covered grids of the surface.
In one embodiment, since the first grid through which a line segment passes is monotonic and continuous, the first grid in which the start point and the end point of the line segment are located can be calculated, then the first grid in which the midpoint between the start point and the end point is located is calculated, if the midpoint is not the same first grid as the start point and the midpoint is not the same first grid as the end point, the midpoint between the start point and the midpoint is continuously calculated, and the midpoint between the midpoint and the end point is calculated until the midpoint is the same first grid as the start point or the end point, and then the first grid through which the contour boundary line of each surface passes is calculated, and the specific calculation process may be as follows:
s1, determining the starting point and the end point of each contour boundary line segment of each surface according to the mapping positions of all surfaces of the object in the space in the first grid.
It will be appreciated that each surface is a closed area formed by contour boundary lines which are connected by a plurality of contour boundary line segments. According to the mapping positions of all surfaces of the object in the space in the first grid, the starting point and the end point of each contour boundary line segment of each surface can be determined, and then the first grid where the starting point and the end point are located can be determined.
S2, calculating the midpoint of each contour boundary line segment based on the starting point and the ending point of each contour boundary line segment.
And S3, judging whether the middle point of the contour boundary line segment and the starting point or the end point of the contour boundary line are in the same first grid, if so, entering a step S4, and if not, entering steps S5 and S6.
After calculating the midpoint of the contour boundary line segment, correspondingly determining a first grid in which the midpoint is located, judging whether the first grid in which the midpoint of the contour boundary line segment is located and the first grid in which the starting point or the ending point is located are the same first grid, and entering step S4 when the first grid in which the midpoint is located is the first grid in which the starting point or the first grid in which the ending point is located; when the first grid where the middle point is located and the first grid where the starting point is located or the first grid where the end point is located are not the same grid, step S5 and step S6 are entered.
And S4, outputting the first grids where all the starting points and the ending points of each contour boundary line segment are located, and obtaining the first grids where the contour boundary line of each surface passes.
Outputting the first grids of all the starting points and the ending points of each contour boundary line segment to obtain all the first grids through which the contour boundary line passes.
S5, taking the middle point of the contour boundary line segment as a new end point, and returning to the step S2;
and (2) taking the middle point of the contour boundary line segment as a new end point, returning to the step (S2), and calculating the middle point between the starting point of the contour boundary line segment and the new end point until the middle point of the contour boundary line segment and the starting point or the end point are in the same first grid.
S6, taking the middle point of the contour boundary line segment as a new starting point, and returning to the step S2.
And (2) taking the midpoint of the contour boundary line segment as a new starting point, returning to the step (S2), and calculating the midpoint between the new starting point and the new end point of the contour boundary line segment until the midpoint of the contour boundary line segment and the starting point or the end point are in the same first grid.
In another embodiment, the first mesh through which the contour boundary line of each surface passes may also be calculated by analytical geometry or iterative methods.
And 103, calculating a covering grid corresponding to each surface according to the closed area formed by the first grid through which the contour boundary line of each surface passes.
After the first grid passing through the contour boundary line of each surface is obtained through the calculation in the steps, a closed area formed by the first grids passing through the contour boundary line of the surface is correspondingly determined, and at the moment, the first grid covered in the closed area is also required to be calculated, so that the first grid covered by the surface, namely the covered grid of the surface, is obtained. According to the method, the first grid through which the contour boundary line of the surface of the object passes is directly calculated to obtain the closed area corresponding to the surface, and then the covering grid of the surface is calculated.
In the first embodiment, all the first grids may be traversed, and all the first grids in the closed area formed by the first grids through which the contour boundary line of each surface passes are calculated, so as to obtain the coverage grid corresponding to each surface. Assuming that the shape of a certain surface of a certain object is rectangular, the first grids passed by the 4 outline border line segments of the rectangular surface can be calculated through the steps to obtain a rectangular closed area of the surface, then all the first grids in the space are traversed, whether each first grid falls in the rectangular closed area is judged, after all the first grids are traversed, all the first grids falling in the rectangular closed area can be determined, and therefore the coverage grid of the rectangular surface is obtained.
In a second embodiment, a target grid is selected from a closed area formed by a first grid through which the contour boundary line of each surface passes, and the first grid is traversed from the periphery of the target grid until the traversed first grid fills the closed area, so that a covering grid corresponding to each surface is obtained. And randomly selecting a point from each surface, calculating a first grid corresponding to the point as a target grid, then traversing other first grids from the periphery of the target grid, wherein the first grids can be traversed in a four-neighborhood or eight-neighborhood mode, and when the first grid is traversed to be the boundary of the closed area, traversing the periphery of the first grid is not performed any more until the traversed first grid fills the closed area, and obtaining the coverage grid of the closed area. The method computes the overlay grid for each surface faster and with less computational resource overhead than traversing all of the first grids in the first embodiment.
In the third embodiment, the closed area formed by the first grid through which the contour boundary line of each surface passes may also be scanned row by row or column by column, to obtain the covered grid of each surface. In the scanning process, each closed area is scanned row by row or column by column in a scanning line mode, when the boundary line of the closed area is scanned for the first time, the scanning is continued, the scanned first grid is marked as a covering grid of the closed area until the boundary of the closed area is scanned next time, and all covering grids obtained through marking are corresponding covering grids of the surface. Compared with the two methods, the method has the advantages that the efficiency of scanning the coverage grid of each surface by the scanning line method is higher, and the calculation resources are saved; and the scan line method may also be applied to concave polygons.
Step 104, calculating the depth from the coverage grid corresponding to each surface to the laser radar, and generating a point cloud based on the minimum depth of each coverage grid.
The mapping position of each surface in the first grid is obtained by scanning all the surfaces of each object in the space in the previous step, so that the first grids on which the points on each surface fall can be determined. Calculating the depth from the covered grid corresponding to each surface to the laser radar, namely calculating the actual distance from the point of the object surface mapped to each covered grid to the laser radar, wherein a plurality of points can exist in each covered grid, and the distances from each point to the laser radar can be different, so that each covered grid has different depth; there is also a certain first grid with no points falling inside, at which point the depth of the first grid can be defaulted to infinity. In the embodiment of the application, the minimum depth of each coverage grid is selected to generate the point cloud, namely, the point cloud is obtained by maintaining the minimum depth of each laser scanning line. Since each overlay grid represents a visible angle, after determining the minimum depth of the overlay grid, the spherical coordinates of the visible points on the object surface corresponding to the overlay grid are determined accordingly, and a point cloud is generated.
According to the point cloud generation method, grid division is carried out on a visible area of the laser radar according to parameters of the laser radar, different first grids can be obtained for different types of laser radar through division, and then different point clouds are generated; according to the method, only the falling point of a laser scanning line on the surface of an object is calculated, the calculation method is simple, the calculation resource cost is reduced, the method can be applied to real-time testing and large-scale scene testing, and the technical problems that the existing point cloud generation method depends on a ray tracing method based on a game engine, the complexity is high, the calculation resource consumption is high, the method is difficult to apply to real-time testing and large-scale scene testing, and the corresponding point cloud cannot be generated according to parameters of different laser radars are solved.
The first embodiment of the point cloud generating method provided in the present application is the above, and the second embodiment of the point cloud generating method provided in the present application is the following.
Method embodiment two:
referring to fig. 2, another point cloud generating method provided in an embodiment of the present application includes:
step 201, according to parameters of the laser radar, performing grid division on a visible area of the laser radar in space to obtain a plurality of first grids.
Step 202, calculating a first grid through which the contour boundary line of each surface passes according to the mapping positions of all surfaces of the object in the space in the first grid.
And 203, calculating a covering grid corresponding to each surface according to the closed area formed by the first grid through which the contour boundary line of each surface passes.
The specific contents of steps 201 to 203 are identical to those of steps 101 to 103, and will not be described here again.
And 204, calculating the depth from the coverage grid corresponding to each surface to the laser radar, and taking the minimum depth from each coverage grid to the laser radar at each surface as the minimum depth of each coverage grid.
Calculating the depth from the covered grid corresponding to each surface to the laser radar, namely calculating the actual distance from the point of the object surface mapped to each covered grid to the laser radar, wherein a plurality of points can exist in each covered grid, and the distances from each point to the laser radar can be different, so that each covered grid has different depth; there is also a certain first grid with no points falling inside, when the depth of the first grid is defaulted to infinity. And after the depth from the coverage grid corresponding to each surface to the laser radar is calculated, taking the minimum depth from each coverage grid to the laser radar at each surface as the minimum depth of each coverage grid.
Step 205, generating a depth map based on the minimum depth of the overlay mesh.
After the minimum depth of each covering grid is calculated, a depth map is generated based on the minimum depth of the covering grid, each pixel point in the depth map can be represented as [ a, b, d ], wherein a and b are visible angles in the horizontal direction and the vertical direction of the central point of the covering grid corresponding to the pixel point, and d is the minimum depth of the covering grid.
Step 206, determining visible points of each object through the depth map, and generating a point cloud.
The spherical coordinate angle and the depth of the visible point of each object surface can be determined through the depth map, wherein the spherical coordinate angle is determined through the visible angles of the horizontal direction and the vertical direction of the pixel point in the depth map. And converting the coordinates of all the visible points under the spherical coordinates into coordinates under a space rectangular coordinate system, and obtaining the point cloud. For example, a certain visible angle is determined to be [ a, b ] through a depth map]The depth corresponding to the visible angle is d, and the unit vector (x ', y ', z ') of the direction can be obtained through trigonometric function calculation, assuming that the laser radar coordinate is (x) 0 ,y 0 ,z 0 ) The visible point corresponding to the visible angle is (x 0 ,y 0 ,z 0 ) +d (x ', y ', z '), the visible points corresponding to all visible angles in the depth map constitute a point cloud.
In one embodiment, step 205 further comprises, after:
step 207, calculating invisible points of the laser radar according to the depth map, and generating blind areas of the laser radar based on the invisible points.
In one embodiment, the specific process of calculating the invisible point of the laser radar according to the depth map is as follows:
a1, calculating the intersection point of the midpoint ray of each first grid in the space and the horizontal plane at the preset height, wherein the endpoint of the midpoint ray of the first grid is the center point of the first grid.
And determining a highest visible height h, namely a preset height h, according to parameters configured by a user. If the lidar cannot scan for a point (x, y, h) due to occlusion, then the point (x, y, h) is determined to be an invisible point of the lidar.
After the user configures the preset height h, all the first grids can be scanned, and the intersection point of the midpoint ray of each first grid and the horizontal plane at the preset height h (i.e. z=h) can be calculated by an analytic geometry method.
A2, when the depth from the intersection point to the laser radar is larger than the minimum depth from the intersection point to the laser radar, judging that the intersection point is an invisible point of the laser radar.
After the intersection point is obtained through calculation, the depth from the intersection point to the laser radar is calculated, when the depth from the intersection point to the laser radar is larger than the minimum depth from the intersection point to the laser radar, the intersection point is considered to be shielded, the intersection point is judged to be an invisible point of the laser radar, the minimum depth from the intersection point to the laser radar is the minimum depth of a first grid where a midpoint ray corresponding to the intersection point is located, and the minimum depth of the first grid is obtained through a depth map.
In another embodiment, the specific process of calculating the invisible point of the lidar according to the depth map may be:
and B1, carrying out grid division on the horizontal plane of the target area in the space to obtain a plurality of second grids.
The target area is specifically set according to a specific application scene, and can be a concerned area of an automatic driving vehicle during an automatic driving test. And carrying out grid division on the horizontal plane of the target area in the space to obtain a plurality of second grids. It will be appreciated that the meshing of the horizontal plane of the target area in space is based on the same origin of coordinates as the meshing of the visible area of the lidar described above, except that the former meshing of the target area is based on the euro coordinate system and the latter meshing of the visible area is based on the spherical coordinate system.
And B2, mapping the center point of each second grid to a preset height to obtain a mapping point.
After the horizontal plane of the target area is subjected to grid division, the center point of each second grid can be expressed as (x, y), and the center point of each second grid is mapped to a preset height h to obtain a mapping point (x, y, h).
And B3, calculating azimuth angles and distances between each mapping point and the laser radar, wherein the azimuth angles comprise vertical azimuth angles and horizontal azimuth angles.
And B4, determining the minimum depth from the mapping point to the laser radar through the azimuth angle and the depth map from the mapping point to the laser radar.
And calculating azimuth angles and distances from each mapping point (x, y, h) to the laser radar o (0, 0), determining a first grid where the mapping point (x, y, h) is located according to the azimuth angles of each mapping point (x, y, h) relative to the laser radar o (0, 0), determining the minimum depth of the first grid through a depth map, and taking the minimum depth of the first grid as the minimum depth from the mapping point (x, y, h) to the laser radar.
And B5, when the depth from the mapping point to the laser radar is larger than the minimum depth from the mapping point to the laser radar, judging that the mapping point is an invisible point of the laser radar.
When the depth from the mapping point to the laser radar is larger than the minimum depth from the mapping point to the laser radar, the mapping point is considered to be blocked, and the mapping point is judged to be an invisible point of the laser radar.
The invisible point of the laser radar can be calculated through the two modes, and the invisible point is used as a blind area point to be added into the blind area, so that the blind area of the laser radar is generated. In the real-time scene test of the automatic driving, the blind area of the automatic driving vehicle is calculated by the method, so that the real vehicle driving environment can be simulated, and the method is suitable for the test of the automatic driving vehicle.
In another embodiment, after step 206, further comprising:
step 208, calculating the new object shape of each object according to the visible point of each object.
A visible point of the surface of each object is determined through the generated depth map, and a new object shape of each object can be calculated through the visible point. Specifically, a new object shape of each object can be calculated through a three-dimensional convex hull algorithm, and the new object shape is an object shape which can be detected by the simulated laser radar under a blind area. The object shape of each object is calculated by the three-dimensional convex hull algorithm, which belongs to the prior art, and will not be described herein.
According to the point cloud generation method, grid division is carried out on a visible area of the laser radar according to parameters of the laser radar, different first grids can be obtained for different types of laser radar through division, and then different point clouds are generated; according to the method, only the falling point of a laser scanning line on the surface of an object is calculated, the calculation method is simple, the calculation resource cost is reduced, the method can be applied to real-time testing and large-scale scene testing, and the technical problems that the existing point cloud generation method depends on a ray tracing method based on a game engine, has high complexity, is high in calculation resource consumption, is difficult to apply to real-time testing and large-scale scene testing, and cannot generate corresponding point clouds according to parameters of different laser radars are solved;
Further, according to the embodiment of the application, the invisible points of the laser radar are calculated according to the generated depth map so as to generate a blind area and the shape of an object under the blind area, and the shape of the object which can be detected by the laser radar under the blind area can be simulated; for the concerned area of the automatic driving vehicle, whether the laser scanning line of the laser radar can reach the concerned area or not can be detected to generate a blind area, and the method is suitable for real-time and large-scale scene test of automatic driving; in addition, the embodiment of the application considers different density degrees of the laser scanning lines of each laser radar, and can generate corresponding blind areas according to parameters of different laser radars.
In order to provide a second embodiment of a point cloud generating method, the following is an embodiment of a point cloud generating device provided in the present application.
Referring to fig. 3, a point cloud generating device provided in an embodiment of the present application includes:
the dividing unit 301 is configured to divide a visible area of the lidar in space into grids according to parameters of the lidar, so as to obtain a plurality of first grids;
a first calculation unit 302, configured to calculate a first grid through which a contour boundary line of each surface passes according to mapping positions of all surfaces of an object in a space in the first grid;
A second calculating unit 303, configured to calculate a coverage grid corresponding to each surface according to a closed area formed by the first grid through which the contour boundary line of each surface passes;
and a point cloud generating unit 304, configured to calculate a depth from the coverage grid corresponding to each surface to the lidar, and generate a point cloud based on a minimum depth of each coverage grid.
As a further improvement, referring to fig. 4, the first computing unit 302 specifically includes:
a determining subunit 3021, configured to determine a start point and an end point of each contour boundary line segment of each surface according to mapping positions of all surfaces of the object in the space in the first grid;
a calculation subunit 3022 for calculating a midpoint of each contour boundary line segment based on the start point and the end point of each contour boundary line segment;
a judging subunit 3023, configured to judge whether the midpoint of the contour boundary line segment and the start point or the end point of the contour boundary line are on the same first grid, if yes, trigger the output subunit 3024, and if not, trigger the first triggering subunit 3025 and the second triggering subunit 3026;
an output subunit 3024, configured to output a first grid where all the start points and the end points of each contour boundary line segment are located, so as to obtain a first grid where the contour boundary line of each surface passes through;
A first triggering subunit 3025, configured to trigger the computing subunit 3022 with a midpoint of the contour boundary line segment as a new end point;
a second triggering subunit 3026, configured to trigger the computing subunit 3022 with the midpoint of the contour boundary line segment as a new starting point.
As a further improvement, referring to fig. 5, the second computing unit 303 specifically includes:
the scanning subunit 3031 is configured to scan, row by row or column by column, the closed area formed by the first grid through which the contour boundary line of each surface passes, to obtain a coverage grid corresponding to each surface.
As a further improvement, referring to fig. 5, the second computing unit 303 further includes:
and the traversing subunit 3032 is configured to select a target grid from the closed area formed by the first grids passing by the contour boundary line of each surface, and traverse the first grids from the periphery of the target grid until the traversed first grids fill the closed area, so as to obtain the coverage grid corresponding to each surface.
As a further improvement, the point cloud generating unit 304 specifically functions to:
calculating the depth from the covering grid corresponding to each surface to the laser radar, and taking the minimum depth from each surface of each covering grid to the laser radar as the minimum depth of each covering grid;
Generating a depth map based on the minimum depth of the overlay mesh;
and determining visible points of each object through the depth map, and generating a point cloud.
As a further improvement, the device further comprises:
a third calculation unit 305 for calculating a new object shape for each object from the visible points of each object.
As a further improvement, the device further comprises:
the blind area generating unit 306 is configured to calculate an invisible point of the laser radar according to the depth map, and generate a blind area of the laser radar based on the invisible point.
As a further improvement, the blind area generating unit 306 specifically functions to:
calculating the intersection point of the midpoint ray of each first grid in the space and the horizontal plane at the preset height, wherein the endpoint of the midpoint ray of the first grid is the center point of the first grid;
when the depth from the intersection point to the laser radar is larger than the minimum depth from the intersection point to the laser radar, judging that the intersection point is an invisible point of the laser radar, wherein the minimum depth from the intersection point to the laser radar is the minimum depth of a first grid where a midpoint ray corresponding to the intersection point is located, and the minimum depth of the first grid is obtained through a depth map;
a blind zone of the lidar is generated based on the invisible point.
As a further improvement, the blind area generating unit 306 specifically functions to:
Grid dividing the horizontal plane of the target area in the space to obtain a plurality of second grids;
mapping the center point of each second grid to a preset height to obtain a mapping point;
calculating azimuth angles and distances from each mapping point to the laser radar, wherein the azimuth angles comprise vertical azimuth angles and horizontal azimuth angles;
determining the minimum depth from the mapping point to the laser radar through the azimuth angle and the depth map from the mapping point to the laser radar;
when the depth from the mapping point to the laser radar is larger than the minimum depth from the mapping point to the laser radar, judging that the mapping point is an invisible point of the laser radar;
a blind zone of the lidar is generated based on the invisible point.
According to the point cloud generating device, according to parameters of the laser radar, the visible area of the laser radar is subjected to grid division, and for different types of laser radar, different first grids can be obtained through division, so that different point clouds are generated; calculating a closed area formed by a first grid passing by a contour boundary line of each surface according to a mapping position of the object surface in the first grid, calculating a covered grid of each surface through the closed area, and finally generating a point cloud according to the minimum depth of each covered grid, wherein only the falling point of a laser scanning line on the object surface is required to be calculated;
Further, according to the embodiment of the application, the invisible points of the laser radar are calculated according to the generated depth map so as to generate a blind area and the shape of an object under the blind area, and the shape of the object which can be detected by the laser radar under the blind area can be simulated; for the concerned area of the automatic driving vehicle, whether the laser scanning line of the laser radar can reach the concerned area or not can be detected to generate a blind area, and the method is suitable for real-time and large-scale scene test of automatic driving; in addition, the embodiment of the application considers different density degrees of the laser scanning lines of each laser radar, and can generate corresponding blind areas according to parameters of different laser radars.
The embodiment of the application also provides a point cloud generating device, which comprises a processor and a memory;
the memory is used for storing the program codes and transmitting the program codes to the processor;
the processor is configured to execute the point cloud generating method according to any one of the first and second embodiments of the method according to an instruction in the program code.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium is used for storing program codes, and the program codes are used for executing the point cloud generating method in any one of the first and second embodiments of the method.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the apparatus and units described above may refer to corresponding procedures in the foregoing method embodiments, which are not described herein again.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to execute all or part of the steps of the methods described in the embodiments of the present application by a computer device (which may be a personal computer, a server, or a network device, etc.). And the aforementioned storage medium includes: u disk, mobile hard disk, read-Only Memory (ROM), random access Memory (RandomAccess Memory, RAM), magnetic disk or optical disk, etc.
The above embodiments are merely for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.
Claims (13)
1. A method of generating a point cloud, comprising:
according to parameters of the laser radar, performing grid division on a visible area of the laser radar in space to obtain a plurality of first grids;
calculating the first grid through which the contour boundary line of each surface passes according to the mapping positions of all surfaces of the object in the space in the first grid;
calculating a covering grid corresponding to each surface according to a closed area formed by the first grids through which the contour boundary line of each surface passes;
and calculating the depth from the coverage grid corresponding to each surface to the laser radar, and generating a point cloud based on the minimum depth of each coverage grid.
2. The method according to claim 1, wherein calculating the first grid through which the contour boundary line of each surface passes according to the mapping positions of all the surfaces of the object in the space in the first grid specifically includes:
s1, determining a starting point and an ending point of each contour boundary line segment of each surface according to mapping positions of all surfaces of an object in the space in the first grid;
s2, calculating the midpoint of each contour boundary line segment based on the starting point and the ending point of each contour boundary line segment;
s3, judging whether the middle point of the contour boundary line segment and the starting point or the end point of the contour boundary line are in the same first grid, if so, entering a step S4, and if not, entering steps S5 and S6;
s4, outputting the first grids of all starting points and end points of each contour boundary line segment to obtain the first grids through which the contour boundary line of each surface passes;
s5, taking the middle point of the contour boundary line segment as a new end point, and returning to the step S2;
s6, taking the middle point of the contour boundary line segment as a new starting point, and returning to the step S2.
3. The method according to claim 1, wherein the calculating the coverage grid corresponding to each surface according to the closed area formed by the first grid through which the contour boundary line of each surface passes specifically includes:
And scanning the closed area formed by the first grids passing by the contour boundary line of each surface row by row or column by column to obtain a covering grid corresponding to each surface.
4. The method according to claim 1, wherein the calculating the coverage grid corresponding to each surface according to the closed area formed by the first grid through which the contour boundary line of each surface passes specifically includes:
selecting a target grid from a closed area formed by the first grids passing by the contour boundary line of each surface, and traversing the first grids from the periphery of the target grid until the traversed first grids fill the closed area, so as to obtain a covering grid corresponding to each surface.
5. The method according to any one of claims 1-4, wherein the calculating the depth of the coverage grid corresponding to each surface to the lidar and generating the point cloud based on the minimum depth of each coverage grid specifically includes:
calculating the depth from the covering grids corresponding to each surface to the laser radar, and taking the minimum depth from each surface of each covering grid to the laser radar as the minimum depth of each covering grid;
Generating a depth map based on a minimum depth of the overlay mesh;
and determining visible points of each object through the depth map, and generating a point cloud.
6. The method of generating a point cloud according to claim 5, wherein said determining visible points of each of said objects from said depth map generates a point cloud, and further comprising:
a new object shape for each of the objects is calculated based on the visible points of each of the objects.
7. The method of generating a point cloud as claimed in claim 5, wherein said generating a depth map based on a minimum depth of said overlay grid further comprises:
and calculating invisible points of the laser radar according to the depth map, and generating blind areas of the laser radar based on the invisible points.
8. The method according to claim 7, wherein the calculating the invisible point of the lidar according to the depth map specifically comprises:
calculating the intersection point of the midpoint ray of each first grid in the space and the horizontal plane at the preset height, wherein the endpoint of the midpoint ray of the first grid is the center point of the first grid;
and when the depth from the intersection point to the laser radar is larger than the minimum depth from the intersection point to the laser radar, judging that the intersection point is an invisible point of the laser radar, wherein the minimum depth from the intersection point to the laser radar is the minimum depth of the first grid where the midpoint ray corresponding to the intersection point is located, and the minimum depth of the first grid is obtained through the depth map.
9. The method according to claim 7, wherein the calculating the invisible point of the lidar according to the depth map specifically comprises:
grid dividing the horizontal plane of the target area in the space to obtain a plurality of second grids;
mapping the center point of each second grid to a preset height to obtain a mapping point;
calculating azimuth angles and distances between each mapping point and the laser radar, wherein the azimuth angles comprise vertical azimuth angles and horizontal azimuth angles;
determining the minimum depth from the mapping point to the laser radar through the azimuth angle from the mapping point to the laser radar and the depth map;
and when the depth from the mapping point to the laser radar is larger than the minimum depth from the mapping point to the laser radar, judging that the mapping point is an invisible point of the laser radar.
10. The point cloud generating method according to claim 9, wherein the determining the minimum depth of the mapping point to the laser radar by the azimuth angle of the mapping point to the laser radar and the depth map specifically includes:
determining the first grid where the mapping point is located through the azimuth angle from the mapping point to the laser radar;
And determining the minimum depth of the first grid where the mapping point is located through the depth map, and obtaining the minimum depth from the mapping point to the laser radar.
11. A point cloud generating apparatus, comprising:
the dividing unit is used for dividing grids of a visible area of the laser radar in space according to parameters of the laser radar to obtain a plurality of first grids;
a first calculation unit, configured to calculate, according to mapping positions of all surfaces of an object in the space in the first grid, the first grid through which a contour boundary line of each surface passes;
the second calculation unit is used for calculating a covering grid corresponding to each surface according to a closed area formed by the first grids through which the contour boundary line of each surface passes;
and the point cloud generating unit is used for calculating the depth from the coverage grid corresponding to each surface to the laser radar and generating a point cloud based on the minimum depth of each coverage grid.
12. A point cloud generating device, characterized in that the device comprises a processor and a memory;
the memory is used for storing program codes and transmitting the program codes to the processor;
The processor is configured to perform the point cloud generation method of any of claims 1-10 according to instructions in the program code.
13. A computer readable storage medium, characterized in that the computer readable storage medium is for storing a program code for performing the point cloud generation method of any of claims 1-10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011064468.9A CN112200913B (en) | 2020-09-30 | 2020-09-30 | Point cloud generation method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011064468.9A CN112200913B (en) | 2020-09-30 | 2020-09-30 | Point cloud generation method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112200913A CN112200913A (en) | 2021-01-08 |
CN112200913B true CN112200913B (en) | 2024-01-12 |
Family
ID=74013161
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011064468.9A Active CN112200913B (en) | 2020-09-30 | 2020-09-30 | Point cloud generation method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112200913B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114089366B (en) * | 2021-11-11 | 2025-05-13 | 山东科技大学 | A method for inverting water optical parameters using spaceborne single-photon lidar |
CN118915088B (en) * | 2024-09-02 | 2025-03-21 | 山东沂蒙交通发展集团有限公司 | A high-precision roadside laser perception method based on area detection |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101324663A (en) * | 2008-01-08 | 2008-12-17 | 覃驭楚 | Rapid blocking and grating algorithm of laser radar point clouds data |
CN109145677A (en) * | 2017-06-15 | 2019-01-04 | 百度在线网络技术(北京)有限公司 | Obstacle detection method, device, equipment and storage medium |
KR20190070514A (en) * | 2017-12-13 | 2019-06-21 | 연세대학교 산학협력단 | Apparatus for Building Grid Map and Method there of |
CN111273305A (en) * | 2020-02-18 | 2020-06-12 | 中国科学院合肥物质科学研究院 | Multi-sensor fusion road extraction and indexing method based on global and local grid maps |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9659408B2 (en) * | 2013-11-27 | 2017-05-23 | Autodesk, Inc. | Mesh reconstruction from heterogeneous sources of data |
-
2020
- 2020-09-30 CN CN202011064468.9A patent/CN112200913B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101324663A (en) * | 2008-01-08 | 2008-12-17 | 覃驭楚 | Rapid blocking and grating algorithm of laser radar point clouds data |
CN109145677A (en) * | 2017-06-15 | 2019-01-04 | 百度在线网络技术(北京)有限公司 | Obstacle detection method, device, equipment and storage medium |
KR20190070514A (en) * | 2017-12-13 | 2019-06-21 | 연세대학교 산학협력단 | Apparatus for Building Grid Map and Method there of |
CN111273305A (en) * | 2020-02-18 | 2020-06-12 | 中国科学院合肥物质科学研究院 | Multi-sensor fusion road extraction and indexing method based on global and local grid maps |
Also Published As
Publication number | Publication date |
---|---|
CN112200913A (en) | 2021-01-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11982747B2 (en) | Systems and methods for generating synthetic sensor data | |
Aykin et al. | Three-dimensional target reconstruction from multiple 2-d forward-scan sonar views by space carving | |
CN112200913B (en) | Point cloud generation method, device, equipment and storage medium | |
CN112789521B (en) | Method and device for determining perception area, storage medium and vehicle | |
WO2020133230A1 (en) | Radar simulation method, apparatus and system | |
CN112734677B (en) | Airborne LiDAR point cloud cavity interpolation method and system | |
CN111336917A (en) | Volume measurement method, device, system and computer readable storage medium | |
CN115546023A (en) | Point cloud splicing method and device, electronic equipment and storage medium | |
CN113470169B (en) | Game scene generation method and device, computer equipment and readable storage medium | |
CN112657192B (en) | Collision detection method and device | |
CN109920057B (en) | Viewpoint transformation method and device, computing equipment and storage medium | |
CN114170367B (en) | Method, apparatus, storage medium, and device for infinite-line-of-sight pyramidal heatmap rendering | |
CN111316289A (en) | Target object fitting method, point cloud sensor and mobile platform | |
KR102014389B1 (en) | Method and apparatus for estimating scatterng center | |
CN112084854B (en) | Obstacle detection method, obstacle detection device and robot | |
Almanza-Medina et al. | Imaging sonar simulator for assessment of image registration techniques | |
CN116644616B (en) | Point cloud distortion effect reduction method and device, electronic equipment and storage medium | |
CN117848303A (en) | Intelligent mapping planning method and system for constructional engineering | |
CN115451938B (en) | A grid map construction method, grid map construction device and electronic equipment | |
CN116664809A (en) | Three-dimensional information acquisition method, three-dimensional information acquisition device, computer equipment, storage medium and product | |
CN115909277A (en) | Obstacle detection method, obstacle detection device, electronic device and computer-readable storage medium | |
CN115343724A (en) | Radar simulation scanning method and device, computer readable storage medium and terminal | |
US12100089B1 (en) | Systems and methods for generating and animating three-dimensional assets with a dynamic resolution | |
CN118397200B (en) | Method, device and equipment for reconstructing scene in automatic parking process | |
JP2015018484A (en) | Evaluation method and evaluation device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |