Method, device and apparatus for scene reconstruction during automatic parking
Through lidar point cloud fusion and two-dimensional elliptical patch conversion, combined with the Gaussian splash algorithm, the problem of sparse and colorless 3D reconstruction in automatic parking scenes is solved, and high-precision and high-smooth 3D scene reconstruction is achieved, improving Improve labeling efficiency and accuracy.
Patent Information
- Application Number
- CN202410853850.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-06-28
AI Technical Summary
The 3D reconstruction in the automatic parking scene is sparse and colorless, resulting in low annotation efficiency and poor accuracy.
By acquiring multiple lidar point cloud data in the same scene for point cloud fusion, converting it into a two-dimensional elliptical patch, and combining it with the Gaussian splatter algorithm for real-time rendering, high-precision and high-smooth three-dimensional reconstruction is achieved.
It improves the accuracy and smoothness of 3D reconstruction, enhances the efficiency and accuracy of annotation, and realizes the reconstruction of dense and colored 3D scenes.
Smart Images

Figure CN118397200B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of three-dimensional reconstruction, and in particular to a method, device and equipment for scene reconstruction in an automatic parking process. Background Art
[0002] In the memory parking scenario of autonomous driving, massive amounts of data are very important for scene reconstruction model training, but the manual annotation of a single image is expensive, and the annotated three-dimensional (3D) information has very large errors. In order to solve the annotation errors of 3D information, LiDAR can be introduced for reconstruction, but the 3D scene reconstructed based on LiDAR is sparse and colorless. Each 3D annotation must correspond to the image, which makes the annotation efficiency relatively low and small objects are more prone to errors. Summary of the invention
[0003] In view of this, the present invention provides a method, device and apparatus for scene reconstruction during automatic parking to solve the problem that the three-dimensional scene reconstruction is sparse and has no color, resulting in poor reconstruction effect.
[0004] In a first aspect, the present invention provides a method for scene reconstruction during automatic parking, the method comprising: acquiring multiple laser radar point cloud data in the same scene, performing point cloud fusion on the multiple laser radar point cloud data to obtain a point cloud data set after reconstructing the current scene, the point cloud data set comprising multiple fused point clouds; converting the fused point cloud into a two-dimensional elliptical patch, wherein the parameters of the two-dimensional elliptical patch include: a three-dimensional position of a patch center point, a two-dimensional elliptical patch covariance matrix, a spherical harmonic function and transparency; based on a two-dimensional picture of the current scene, rendering the current scene obtained from the two-dimensional picture in real time through the two-dimensional elliptical patch, and performing three-dimensional reconstruction of the current scene based on the rendering result.
[0005] In the process of Gaussian splash point cloud initialization, by fusing LiDAR point cloud data, the difficulty of reconstruction can be reduced. In scenes with unclear textures, the accuracy of reconstruction can be improved to achieve high-precision reconstruction. Converting the fused point cloud into a two-dimensional elliptical patch can improve the smoothness of reconstruction. In this way, combining LiDAR point cloud and Gaussian splash, the three-dimensional point cloud obtained by the LiDAR can be reconstructed into a dense three-dimensional scene with color, which has the characteristics of high smoothness and high precision. It can also provide better scene reconstruction for automatic annotation, improve the efficiency of annotation, and improve the accuracy of annotation.
[0006] In an optional embodiment, the multiple lidar point cloud data are point cloud fused based on an initial voxel step size; the fused point cloud is point cloud thinned based on a second voxel step size to obtain the point cloud data set, wherein the initial voxel step size is smaller than the second voxel step size.
[0007] Setting the initial voxel step size to be smaller than the second voxel step size can make the reconstructed point cloud in the point cloud data set relatively dense, and can also facilitate the subsequent normal vector calculation; performing point cloud sparse processing based on the second voxel step size can maintain the shape characteristics of the point cloud, and at the same time, can remove redundant information in the point cloud data, thereby improving the processing speed and efficiency of the point cloud data and reducing the memory burden of subsequent three-dimensional reconstruction.
[0008] In an optional implementation, the two-dimensional elliptical patch covariance matrix includes: a scale matrix, the last element on the diagonal of the scale matrix is zero and is not updated, and other elements on the diagonal of the scale matrix are updated during the rendering process.
[0009] By setting the scale matrix, a two-dimensional elliptical patch is used to replace the three-dimensional Gaussian in the Gaussian splash. Compared with the singularity of the intersection of the three-dimensional Gaussian, the two-dimensional elliptical patch can better fit the surface of the real scene than the three-dimensional ellipse, the quality of the rendered depth will be higher, and a smoother three-dimensional reconstruction effect can be achieved.
[0010] In an optional embodiment, the two-dimensional elliptical patch covariance matrix includes: a rotation matrix, the rotation matrix includes the normal vector, the first vector and the second vector of the fused point cloud; the normal vector of the fused point cloud is obtained based on preset point cloud information of the point cloud during the point cloud fusion process, the first vector is perpendicular to the normal vector of the fused point cloud, and the second vector is obtained based on the normal vector of the fused point cloud and the first vector.
[0011] By fusing the normal vectors of the point cloud to initialize the rotation matrix of the two-dimensional elliptical patch, the network can converge faster; the direction and posture of the two-dimensional elliptical patch are adjusted through the rotation matrix to achieve more accurate three-dimensional reconstruction.
[0012] In an optional embodiment, the current scene is reconstructed in three dimensions based on the rendering results, including: obtaining color and depth information of pixels in the two-dimensional image based on the rendering results; defining a three-dimensional space based on the current scene, dividing the three-dimensional space into voxels to obtain a first voxel unit, and obtaining a distance between a center point of the first voxel unit and a scene surface based on the depth information; establishing a surface model of the current scene based on the distance, and performing the three-dimensional reconstruction based on the surface model.
[0013] The TSDF algorithm is used to reconstruct the three-dimensional surface. The calculation is simple and there is no complicated calculation. The details of the generated grid are well preserved, and the three-dimensional point cloud of the lidar can be quickly converted into a dense reconstruction with color.
[0014] In an optional embodiment, for the two-dimensional picture of the current scene, the current scene obtained from the two-dimensional picture is rendered in real time based on the two-dimensional elliptical patch, including: rendering an image based on the two-dimensional elliptical patch; obtaining the difference between the rendered image and the two-dimensional picture, and calculating the loss based on the difference; adjusting the parameters based on the loss, optimizing the parameters, and performing adaptive density control on the two-dimensional elliptical patch to obtain the rendering result.
[0015] In the process of real-time rendering of the current scene, adaptive density control is performed to help the 2D elliptical patches better fit the fine grains and details, and unnecessary 2D elliptical patches can be trimmed.
[0016] In an optional embodiment, for a two-dimensional picture of the current scene, the current scene obtained from the two-dimensional picture is rendered in real time based on the two-dimensional elliptical patch, including: obtaining a camera cone based on the two-dimensional picture, obtaining multiple target patches whose center points are within the range of the camera cone, projecting the target patches to the two-dimensional picture, wherein the projected target patches cover at least one pixel, and there are multiple covered pixels; for the covered pixels, calculating the depth of the target patch at the covered pixel, and performing weighted averaging on the transparency corresponding to the target patch based on the depth to obtain the predicted depth of the covered pixel; inputting the direction vector of the covered pixel into the spherical harmonic function corresponding to the target patch to obtain the initial predicted color of the covered pixel, and performing weighted averaging on the transparency corresponding to the target patch based on the initial predicted color to obtain the final predicted color of the covered pixel; and obtaining the rendering result based on the predicted depth and the final predicted color.
[0017] In this way, after obtaining the optimized two-dimensional elliptical patch parameters, we can realize image rendering of any perspective based on the observed image of the current scene; we can render the depth of the image of a given perspective to achieve dense three-dimensional reconstruction. We can obtain more accurate point cloud reconstruction. Since the point cloud fused by LiDAR has spatial noise points, we can eliminate some noise points by using the color constraints of the two-dimensional elliptical patch.
[0018] In a second aspect, the present invention provides a device for scene reconstruction during automatic parking, the device comprising: a point cloud fusion module, used to obtain multiple laser radar point cloud data in the same scene, and perform point cloud fusion on the multiple laser radar point cloud data to obtain a point cloud data set after reconstructing the current scene, wherein the point cloud data set includes multiple fused point clouds; a conversion module, used to convert the fused point cloud into a two-dimensional elliptical patch, wherein the parameters of the two-dimensional elliptical patch include: the three-dimensional position of the patch center point, the two-dimensional elliptical patch covariance matrix, spherical harmonic functions and transparency; a reconstruction module, used to render the current scene obtained from the two-dimensional picture of the current scene in real time through the two-dimensional elliptical patch, and perform three-dimensional reconstruction of the current scene based on the rendering result.
[0019] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for scene reconstruction during automatic parking according to the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0020] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for scene reconstruction during automatic parking according to the first aspect or any corresponding embodiment thereof.
[0021] In the process of Gaussian splash point cloud initialization, by fusing LiDAR point cloud data, the difficulty of reconstruction can be reduced. In scenes with unclear textures, the accuracy of reconstruction can be improved to achieve high-precision reconstruction. Converting the fused point cloud into a two-dimensional elliptical patch can improve the smoothness of reconstruction. In this way, combining LiDAR point cloud and Gaussian splash, the three-dimensional point cloud obtained by the LiDAR can be reconstructed into a dense three-dimensional scene with color, which has the characteristics of high smoothness and high precision. It can also provide better scene reconstruction for automatic annotation, improve the efficiency of annotation, and improve the accuracy of annotation. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 A schematic flow chart of a method for scene reconstruction in an automatic parking process provided by this embodiment is shown;
[0024] Figure 2 A schematic diagram of the structure of a device for scene reconstruction in an automatic parking process provided by this embodiment is shown;
[0025] Figure 3 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0027] The pure visual reconstruction technology in related technologies is based on Gaussian splashing. The algorithm based on Gaussian splashing can obtain very good rendering images, but it is still sparse reconstruction and it is difficult to extract a good scene surface. Gaussian splashing is initialized based on the sparse reconstruction results of recovering the three-dimensional scene structure from motion information (Structure from Motion, referred to as sfm). The error of the vehicle trajectory and the error of the 3D point cloud will increase the difficulty of network training.
[0028] In scenes with poor color texture, that is, the surfaces of objects in the scene lack rich texture information, such as a car body with no obvious texture or features, a uniform and smooth metal surface, or a textureless monochrome white wall, it is impossible to find enough feature points. Due to the lack of features, the SFM reconstruction has very few point clouds here, which makes it difficult for Gaussian splashing to generate well-distributed 3D Gaussians. The depth of 3D Gaussian reconstruction rendering will be relatively poor, and effective 3D reconstruction cannot be performed.
[0029] Another reason for the poor depth of Gaussian splash is that 3D Gaussian cannot fit the scene surface well. For example, if it is a flat plane, 3D Gaussian needs a very large 3D ellipse to represent the local plane, but this does not meet the settings of the split threshold and merge threshold of Gaussian in Gaussian splash.
[0030] The present disclosure provides an embodiment of a method for scene reconstruction during automatic parking. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0031] In this embodiment, a method for scene reconstruction during automatic parking is provided, which can be applied to mobile terminals, such as mobile phones, tablet computers, robots, vehicles or drones. Although this embodiment discloses a method for scene reconstruction during automatic parking, there is no technical obstacle to applying the aforementioned method to robots or drones for scene reconstruction. Figure 1 FIG. 4 is a flow chart showing a method for scene reconstruction in an automatic parking process provided by this embodiment. Figure 1 As shown, the process includes the following steps:
[0032] Step S101, obtain multiple laser radar point cloud data in the same scene, perform point cloud fusion on the multiple laser radar point cloud data, and obtain a point cloud data set after reconstructing the current scene, wherein the point cloud data set includes multiple fused point clouds.
[0033] The vehicle-mounted laser radar measures the distance and direction of objects in the surrounding environment by emitting laser beams, and then determines the relative position of the vehicle and obstacles. When the vehicle-mounted laser radar emits enough laser beams, the laser beams will be gathered into a point cloud, outlining the three-dimensional environment information of the vehicle, and obtaining the laser radar point cloud data recorded in the embodiment of the present disclosure.
[0034] LiDAR (Light Detection and Ranging, referred to as LiDAR) point cloud data is a data set of spatial points scanned by a 3D LiDAR device. Each point contains 3D coordinate information, including x, y, and z values. LiDAR is a radar system that emits a detection signal, such as a laser beam, to the target, and then measures the arrival time or strength of the reflected or scattered signal to determine the target's distance, direction, motion state, and surface optical properties.
[0035] After point cloud fusion, more comprehensive environmental information can be obtained; by fusing multiple point cloud data, the noise in a single point cloud can be reduced and the point cloud quality can be improved; the spatial resolution and accuracy of point cloud data can be improved, which helps to achieve more accurate 3D modeling and environmental perception.
[0036] Step S103, converting the fused point cloud into a two-dimensional elliptical patch, wherein the parameters of the two-dimensional elliptical patch include: a three-dimensional position of a patch center point, a two-dimensional elliptical patch covariance matrix, a spherical harmonic function, and transparency.
[0037] The 3D position of the patch center is the mean of the 3D Gaussian. The 2D elliptical patch covariance matrix determines the Gaussian shape. Spherical harmonics are used to fit the view-dependent appearance. Transparency, also known as opacity, uses the sigmoid function to map the parameter to [0, 1] for splashing. Each point in the 3D point cloud is modeled by a 2D elliptical patch.
[0038] For the problem that the plane cannot be well expressed in the relevant algorithms, the use of two-dimensional elliptical patches to represent the scene can be closer to the scene surface, better represent the local surface, and achieve a smoother three-dimensional reconstruction effect.
[0039] Step S105 , based on the two-dimensional picture of the current scene, the current scene obtained from the two-dimensional picture is rendered in real time by a two-dimensional elliptical patch, and the current scene is three-dimensionally reconstructed based on the rendering result.
[0040] For multiple two-dimensional images of the current scene, the current scene can be rendered in real time based on the two-dimensional elliptical patch using the Gaussian splash algorithm to obtain the rendering result. Feature extraction is performed based on the rendering result; the position and posture of the camera are determined, and the rendering result is mapped to the three-dimensional space based on the position and posture of the camera; the surface is reconstructed based on the extracted features to obtain a reconstructed three-dimensional model. Multiple two-dimensional images of the current scene can be obtained based on a camera installed on a vehicle, or based on the detection of the current scene by a robot image acquisition device, or based on the shooting of the current scene by a drone, or based on the image acquisition of the current scene by mobile equipment.
[0041] The method for scene reconstruction during automatic parking provided in this embodiment can reduce the difficulty of reconstruction by fusing lidar point cloud data during the initialization of Gaussian splash point cloud, improve the accuracy of reconstruction in scenes with unclear textures, and achieve high-precision reconstruction; converting the fused point cloud into a two-dimensional elliptical patch can improve the smoothness of reconstruction; in this way, combining LiDAR point cloud and Gaussian splash, it is possible to reconstruct the three-dimensional point cloud acquired by the lidar into a dense three-dimensional scene with color, which has the characteristics of high smoothness and high precision, and can also provide better scene reconstruction for automatic labeling, which can improve the efficiency of labeling and improve the accuracy of labeling.
[0042] For most laser radars, although the laser is emitted and received very quickly, each point that constitutes the point cloud is not generated at the same time. The data accumulated within the preset time interval is output as a frame of point cloud. If the absolute position of the laser radar body or the vehicle where the laser radar is installed changes within the preset time interval, the coordinate system of each point in this frame of point cloud will be different. Intuitively, this frame of point cloud data will undergo a certain degree of "deformation" and cannot truly correspond to the detected environmental information, resulting in the self-motion distortion of the laser radar.
[0043] In some embodiments, the aforementioned method for scene reconstruction during automatic parking further includes: performing point cloud fusion after dedistorting the laser radar point cloud data. Motion dedistortion can be estimated by other sensors such as inertial navigation or wheel speed meter. In this way, the accuracy of three-dimensional reconstruction can be improved, and it is also easier to extract feature points in the scene.
[0044] In some embodiments, multiple lidar point cloud data are point cloud fused based on an initial voxel step size; the fused point cloud is point cloud thinned based on a second voxel step size to obtain a point cloud data set, wherein the initial voxel step size is smaller than the second voxel step size.
[0045] In this embodiment, the initial voxel step size can be determined according to the size of the current three-dimensional space and the actual fusion requirements. For example, it can be set to 0.01 meters. Setting the initial voxel step size smaller than the second voxel step size can make the reconstructed point cloud in the point cloud data set relatively dense and facilitate the subsequent normal vector calculation. Calculate the normal vector N of the fused point cloud, and obtain multiple three-dimensional points near the fused point cloud. , where i=1, 2, …, n. N has , multiple 3D points Arranged into a matrix A=[ ], according to the property of normal vector, A×N=0, we can get N.
[0046] Point cloud thinning can be performed by downsampling filtering. The second voxel step size can also be determined according to the current three-dimensional space range and the actual fusion requirements. For example, it can be set to 0.05 meters. By setting the second voxel step size to be larger than the initial voxel step size, a relatively sparse point cloud reconstruction result can be obtained. Point cloud thinning based on the second voxel step size can maintain the shape characteristics of the point cloud. At the same time, redundant information in the point cloud data can be removed, thereby improving the processing speed and efficiency of the point cloud data and reducing the memory burden of subsequent three-dimensional reconstruction.
[0047] In some embodiments, the two-dimensional elliptical patch covariance matrix includes: a scale matrix, the last element on the diagonal of the scale matrix is zero and is not updated, and other elements on the diagonal of the scale matrix are updated during the rendering process.
[0048] In this embodiment, the scale matrix is initialized as a diagonal matrix, and real-time rendering is performed in the form of a two-dimensional elliptical patch, and the last element on the diagonal of the scale matrix is set to zero and is not updated. The two-dimensional elliptical patch is scaled by the scale matrix.
[0049] By setting the scale matrix, a two-dimensional elliptical patch is used to replace the three-dimensional Gaussian in the Gaussian splash. Compared with the singularity of the intersection of the three-dimensional Gaussian, the two-dimensional elliptical patch can better fit the surface of the real scene than the three-dimensional ellipse, the quality of the rendered depth will be higher, and a smoother three-dimensional reconstruction effect can be achieved.
[0050] In some embodiments, a two-dimensional elliptical patch covariance matrix includes: a rotation matrix, the rotation matrix includes a normal vector, a first vector, and a second vector of the fused point cloud; the normal vector of the fused point cloud is obtained based on preset point cloud information of the point cloud during the point cloud fusion process, the first vector is perpendicular to the normal vector of the fused point cloud, and the second vector is obtained based on the normal vector of the fused point cloud and the first vector.
[0051] In this embodiment, the normal vector of any fused point cloud The preset point cloud information of the point cloud includes multiple three-dimensional points within the preset distance range of the point cloud, and the normal vector of the fused point cloud is calculated based on the multiple three-dimensional points. The first vector The normal vector of any fused point cloud vertical, , the second vector , we can get the rotation matrix [ ].
[0052] By fusing the normal vectors of the point cloud to initialize the rotation matrix of the two-dimensional elliptical patch, the network can converge faster; the direction and posture of the two-dimensional elliptical patch are adjusted through the rotation matrix to achieve more accurate three-dimensional reconstruction.
[0053] In some embodiments, three-dimensional reconstruction of the current scene is performed based on the rendering results, including: obtaining color and depth information D of pixels in the two-dimensional image based on the rendering results; defining a three-dimensional space based on the current scene, dividing the three-dimensional space into voxels to obtain a first voxel unit, and obtaining the distance between the center point of the first voxel unit and the scene surface based on the depth information; establishing a surface model of the current scene based on the distance, and performing three-dimensional reconstruction based on the surface model.
[0054] In this embodiment, the idea of truncated sign function is used to perform 3D reconstruction based on the rendering result. The truncated sign function (TSDF) divides the current scene into three-dimensional cubes of length × width × height. These three-dimensional cubes are called first voxels. Each first voxel includes two variables, one is the tsdf value used to generate the reconstructed surface, and the other is the RGB value used to reconstruct the surface texture.
[0055] The first voxel at (0,0,0) in the TSDF model corresponds to the actual scene coordinates ( ) point, the point with coordinates (x, y, z) in the current scene corresponds to ( ) points, where corresponds to the length of the first voxel, corresponds to the width of the first voxel, Corresponds to the height of the first voxel.
[0056] The specific implementation process of 3D surface reconstruction is as follows:
[0057] Step S31: Calculate the position of the first voxel x in the current reconstructed scene in the world coordinate system , the coordinate of x in the TSDF model is ( ),
[0058] .
[0059] Step S32: Calculate the position of the first voxel x in the camera coordinate system, that is, the rotation R and translation T of the camera relative to the world coordinate system. The position of the first voxel x in the camera coordinate system ,
[0060]
[0061] The camera extrinsic parameters are determined by the camera motion, that is, the position and orientation of the camera, and the camera intrinsic parameters are determined by the camera hardware. Each camera view has its own camera coordinate system. To aggregate the information of each camera view into the same spatial coordinate system, the camera coordinates need to be converted into world coordinates through the camera extrinsic parameters.
[0062] Step S33: Calculate the depth of the first voxel x relative to the camera , according to the camera imaging model,
[0063]
[0064] in, represents the intrinsic parameter matrix of the camera, represents the pixel coordinates of the first voxel x projected on the camera imaging plane; the sdf value sdf(x) of the first voxel x is calculated as follows:
[0065] sdf(x)=D( )-
[0066] The depth map of the current scene is D, and the depth value of the first voxel x is D( ), sdf(x) greater than 0 indicates that the first voxel x is between the camera and the object surface, sdf(x) less than 0 indicates that the first voxel x is behind the object surface, and sdf(x) equal to 0 indicates that the first voxel x is on the object surface.
[0067] Step S34: Calculate the tsdf value of the first voxel x. The specific calculation method is as follows:
[0068]
[0069] Among them, when -t≤sdf(x)≤t, ∈[-1,1]; when sdf(x)>t, =1; sdf(x)<-t, -1, t is the threshold of the depth difference between the first voxel x and the corresponding point P of the cross section, and P is the intersection of the straight line between the camera and the first voxel x and the cross section of the object in the current scene. When the first voxel x is very close to the surface, the tsdf value is close to 0; when the first voxel x is very far from the surface, the tsdf value is close to 1 or -1. When initializing, the tsdf value of all the first voxels is set to 1, which is equivalent to no surface in this TSDF model.
[0070] Step S34: Calculate the TSDF weight of the first voxel x. The calculation is as follows:
[0071]
[0072] in, is the angle between the projection light and the surface normal vector.
[0073] Step S35: The current frame is fused with the global fusion result. If the current frame is the first frame, the first frame is the fusion result. If the current frame is not the first frame, the current frame needs to be fused with the previous fusion result. , is the fusion weight value,
[0074] The fused TSDF value of the first voxel x is calculated as follows:
[0075]
[0076] Step S36: The RGB image corresponding to the current scene depth map is RGB, then the RGB value rgb(x)=RGB( ).
[0077] The TSDF algorithm is used to reconstruct the three-dimensional surface. The calculation is simple and there is no complicated calculation. The details of the generated grid are well preserved, and the three-dimensional point cloud of the lidar can be quickly converted into a dense reconstruction with color.
[0078] In some embodiments, for a two-dimensional picture of the current scene, the current scene obtained from the two-dimensional picture is rendered in real time based on a two-dimensional elliptical patch, including: rendering an image based on the two-dimensional elliptical patch; obtaining the difference between the rendered image and the two-dimensional picture, and calculating the loss based on the difference; adjusting parameters based on the loss, optimizing the parameters, and performing adaptive density control on the two-dimensional elliptical patch to obtain a rendering result.
[0079] In this embodiment, the current scene obtained from the two-dimensional image is rendered in real time based on the two-dimensional elliptical patch, using a random gradient descent method, which is similar to a neural network, but without the concept of layers. The optimization is based on continuous rendering iterations, and the rendered image is compared with the two-dimensional image. The two-dimensional elliptical patch is adaptively controlled in density, including: for areas with missing geometric features, that is, when small-scale geometric figures are not fully covered, the two-dimensional elliptical patch is cloned, that is, the two-dimensional Gaussian is cloned, a two-dimensional elliptical patch of the same size is created, and the created two-dimensional elliptical patch of the same size is moved in the direction of the position gradient to clone the two-dimensional Gaussian; the two-dimensional elliptical patch is distributed to cover the area of a large area in the scene, the two-dimensional elliptical patch is split, the two-dimensional elliptical patch is split into smaller patches, and the original two-dimensional elliptical patch is replaced by the split patch; the transparency of the two-dimensional elliptical patch is too low, and the two-dimensional elliptical patch is deleted. In the process of real-time rendering of the current scene, the parameters of the two-dimensional elliptical patch are updated and optimized.
[0080] The rendering process is to use computing resources to calculate the visual image of the 3D model under the influence of factors such as viewpoint, light and motion trajectory according to the pre-defined scene settings. The 3D model that has not been rendered is only composed of simple geometric shapes and materials, and the visual effect is poor. After rendering, the details of the 3D model, such as changing light and shadow, rich colors and delicate textures, can be presented, and you can feel a more realistic picture.
[0081] In the process of real-time rendering of the current scene, adaptive density control is performed to help the 2D elliptical patches better fit the fine grains and details, and unnecessary 2D elliptical patches can be trimmed.
[0082] In some embodiments, for a two-dimensional picture of the current scene, the current scene obtained from the two-dimensional picture is rendered in real time based on a two-dimensional elliptical patch, including: obtaining a camera cone based on the two-dimensional picture, obtaining multiple target patches whose center points are within the camera cone, projecting the target patches onto the two-dimensional picture, the projected target patches covering at least one pixel, and there are multiple covered pixels; for the covered pixels, calculating the depth of the target patch at the covered pixel, and weighted averaging the transparency corresponding to the target patch based on the depth to obtain the predicted depth of the covered pixel; inputting the direction vector of the covered pixel into the spherical harmonic function corresponding to the target patch to obtain the initial predicted color of the covered pixel, and weighted averaging the transparency corresponding to the target patch based on the initial predicted color to obtain the final predicted color of the covered pixel; and obtaining a rendering result based on the predicted depth and the final predicted color.
[0083] In this embodiment, the camera cone includes: the aspect ratio of the image, the camera field of view, the near clipping plane and the far clipping plane; the camera field of view is calculated by the focal length and the image size; the training sampling points must be within the cone range, the section close to the camera is the near clipping plane, and the section far from the camera is the far clipping plane. The camera cone is calculated from the two-dimensional picture observed by the camera installed on the vehicle, and the camera cone is transferred to the world coordinate system, and multiple target patches whose center points are within the camera cone range are obtained. The target patches are transferred to the camera coordinate system according to the camera external parameters, and the target patches are projected to the two-dimensional picture according to the camera internal parameters. The projected target patches cover multiple pixels in the two-dimensional picture.
[0084] For pixels in a two-dimensional image, they will be covered by multiple projected target patches. Based on the target patch covering the current pixel, the patch list of the current pixel is obtained. Get the intersection of the current pixel and the patch in the patch list, and calculate the distance of the intersection projected on the direction vector of the current pixel. This distance is the depth of the target patch at the covered pixel. For the patches in the patch list, the depth is weighted averaged according to the transparency to obtain the predicted depth of the covered pixel. Construct a loss function based on the final predicted color of the pixel, and back-propagate to update the parameters of the two-dimensional elliptical patch until the loss function no longer decreases, and obtain the rendering result.
[0085] In this way, after obtaining the optimized two-dimensional elliptical patch parameters, we can realize image rendering of any perspective based on the observed image of the current scene; we can render the depth of the image of a given perspective to achieve dense three-dimensional reconstruction. We can obtain more accurate point cloud reconstruction. Since the point cloud fused by LiDAR has spatial noise points, we can eliminate some noise points by using the color constraints of the two-dimensional elliptical patch.
[0086] In some embodiments, the aforementioned method for scene reconstruction during automatic parking, after performing three-dimensional reconstruction based on the surface model, further includes: approximating the isosurface by linear interpolation based on the surface model, extracting the isosurface in space, approximating it with a triangular surface, extracting the surface information of the scene, and obtaining a colored reconstruction result of the current scene.
[0087] In this embodiment, after the TSDF reconstruction is completed, the idea of the marching cube algorithm can be used to extract the surface information of the current scene. The marching cube algorithm is a surface reconstruction algorithm for three-dimensional volume data. The algorithm divides the three-dimensional volume data into small cube units and determines whether the unit intersects with the surface based on the numerical conditions inside each unit. Then, based on the intersection conditions, a predefined triangle template is used to reconstruct the surface.
[0088] After TSDF reconstruction is completed, the marching cube algorithm is used to extract the surface information of the current scene, which has the advantages of good quality of generated mesh and high parallelism.
[0089] In some embodiments, the aforementioned method for scene reconstruction during automatic parking further includes: after the three-dimensional reconstruction is completed, a new camera and trajectory are added to the current scene, and a new image is rendered and generated in a preset field of view to achieve data augmentation.
[0090] In this embodiment, by modifying the installation position of the vehicle body camera, the vehicle is moved along a new route to obtain a new moving trajectory of the vehicle. Rendering is performed based on the new picture, the pixels in the new picture are traversed, and the color value of the pixel is predicted using the rendering process to obtain the rendering result of the new picture. The new picture can be applied to the training of deep learning tasks related to autonomous driving.
[0091] In this way, data augmentation can be achieved, training data can be enriched, a new data sequence can be obtained without actual overhead, and network overfitting can be avoided when data is limited.
[0092] In this embodiment, a device for scene reconstruction during automatic parking is also provided, which is used to implement the above embodiments and preferred implementations, and will not be repeated for what has been described. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0093] This embodiment provides a device for scene reconstruction during automatic parking. Figure 2 FIG. 4 shows a schematic diagram of the structure of the device for scene reconstruction in the automatic parking process provided by this embodiment. Figure 2As shown, including:
[0094] The point cloud fusion module 501 is used to obtain multiple laser radar point cloud data in the same scene, and perform point cloud fusion on the multiple laser radar point cloud data to obtain a point cloud data set after reconstructing the current scene. The point cloud data set includes multiple fused point clouds.
[0095] The conversion module 503 is used to convert the fused point cloud into a two-dimensional elliptical patch, wherein the parameters of the two-dimensional elliptical patch include: the three-dimensional position of the patch center point, the two-dimensional elliptical patch covariance matrix, spherical harmonics and transparency.
[0096] The reconstruction module 505 is used to render the current scene obtained from the two-dimensional picture in real time through a two-dimensional elliptical patch based on the two-dimensional picture of the current scene, and perform three-dimensional reconstruction of the current scene based on the rendering result.
[0097] In the process of Gaussian splash point cloud initialization, by fusing LiDAR point cloud data, the difficulty of reconstruction can be reduced. In scenes with unclear textures, the accuracy of reconstruction can be improved to achieve high-precision reconstruction. Converting the fused point cloud into a two-dimensional elliptical patch can improve the smoothness of reconstruction. In this way, combining LiDAR point cloud and Gaussian splash, the three-dimensional point cloud obtained by the LiDAR can be reconstructed into a dense three-dimensional scene with color, which has the characteristics of high smoothness and high precision. It can also provide better scene reconstruction for automatic annotation, improve the efficiency of annotation, and improve the accuracy of annotation.
[0098] In some optional implementations, the point cloud fusion module 501 includes:
[0099] The first point cloud fusion unit is used for performing point cloud fusion on a plurality of laser radar point cloud data based on an initial voxel step size.
[0100] The second point cloud fusion unit is used to perform point cloud thinning on the fused point cloud based on the second voxel step size to obtain a point cloud data set, wherein the initial voxel step size is smaller than the second voxel step size.
[0101] Setting the initial voxel step size to be smaller than the second voxel step size can make the reconstructed point cloud in the point cloud data set relatively dense, and can also facilitate the subsequent normal vector calculation; performing point cloud sparse processing based on the second voxel step size can maintain the shape characteristics of the point cloud, and at the same time, can remove redundant information in the point cloud data, thereby improving the processing speed and efficiency of the point cloud data and reducing the memory burden of subsequent three-dimensional reconstruction.
[0102] In some optional implementations, the conversion module 502 includes:
[0103] The first conversion unit is used to obtain a scale matrix of the two-dimensional elliptical patch covariance matrix. The last element on the diagonal of the scale matrix is zero and is not updated. Other elements on the diagonal of the scale matrix are updated during the rendering process.
[0104] By setting the scale matrix, a two-dimensional elliptical patch is used to replace the three-dimensional Gaussian in the Gaussian splash. Compared with the singularity of the intersection of the three-dimensional Gaussian, the two-dimensional elliptical patch can better fit the surface of the real scene than the three-dimensional ellipse, the quality of the rendered depth will be higher, and a smoother three-dimensional reconstruction effect can be achieved.
[0105] The second conversion unit is used to obtain the rotation matrix of the two-dimensional elliptical patch covariance matrix, and the rotation matrix includes the normal vector of the fused point cloud, the first vector and the second vector; the normal vector of the fused point cloud is obtained based on the preset point cloud information of the point cloud during the point cloud fusion process, the first vector is perpendicular to the normal vector of the fused point cloud, and the second vector is obtained based on the normal vector of the fused point cloud and the first vector.
[0106] By fusing the normal vectors of the point cloud to initialize the rotation matrix of the two-dimensional elliptical patch, the network can converge faster; the direction and posture of the two-dimensional elliptical patch are adjusted through the rotation matrix to achieve more accurate three-dimensional reconstruction.
[0107] In some optional implementations, the reconstruction module 503 includes:
[0108] The first reconstruction unit is used to render an image based on the two-dimensional elliptical patch; obtain the difference between the rendered image and the two-dimensional picture, and calculate the loss based on the difference; adjust the parameters based on the loss, optimize the parameters, and perform adaptive density control on the two-dimensional elliptical patch to obtain the rendering result.
[0109] In the process of real-time rendering of the current scene, adaptive density control is performed to help the 2D elliptical patches better fit the fine grains and details, and unnecessary 2D elliptical patches can be trimmed.
[0110] The second reconstruction unit is used to obtain color and depth information of pixels in the two-dimensional image based on the rendering result; define a three-dimensional space based on the current scene, divide the three-dimensional space into voxels to obtain a first voxel unit, and obtain the distance between the center point of the first voxel unit and the scene surface based on the depth information; establish a surface model of the current scene based on the distance, and perform three-dimensional reconstruction based on the surface model.
[0111] The TSDF algorithm is used to reconstruct the three-dimensional surface. The calculation is simple and there is no complicated calculation. The details of the generated grid are well preserved, and the three-dimensional point cloud of the lidar can be quickly converted into a dense reconstruction with color.
[0112] In some optional implementations, the first reconstruction unit includes:
[0113] The first reconstruction first subunit is used to obtain a camera cone based on a two-dimensional image, obtain multiple target patches whose center points are within the camera cone, and project the target patches onto the two-dimensional image. The projected target patches cover at least one pixel, and there are multiple covered pixels.
[0114] The first reconstruction second subunit is used to calculate the depth of the target surface at the covered pixel, and to obtain the predicted depth of the covered pixel by weighted averaging the transparency corresponding to the target surface based on the depth.
[0115] The first reconstruction third subunit is used to input the direction vector of the covered pixel into the spherical harmonic function corresponding to the target patch to obtain the initial predicted color of the covered pixel, and perform weighted averaging on the transparency corresponding to the target patch based on the initial predicted color to obtain the final predicted color of the covered pixel.
[0116] The first reconstruction fourth subunit is used to obtain a rendering result based on the predicted depth and the final predicted color.
[0117] In the process of Gaussian splash point cloud initialization, by fusing LiDAR point cloud data, the difficulty of reconstruction can be reduced. In scenes with unclear textures, the accuracy of reconstruction can be improved to achieve high-precision reconstruction. Converting the fused point cloud into a two-dimensional elliptical patch can improve the smoothness of reconstruction. In this way, combining LiDAR point cloud and Gaussian splash, the three-dimensional point cloud obtained by the LiDAR can be reconstructed into a dense three-dimensional scene with color, which has the characteristics of high smoothness and high precision. It can also provide better scene reconstruction for automatic annotation, improve the efficiency of annotation, and improve the accuracy of annotation.
[0118] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0119] The device for scene reconstruction during automatic parking in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0120] The embodiment of the present invention also provides a computer device having the above Figure 2 The device shown is used for scene reconstruction during automatic parking.
[0121] See also Figure 3 , Figure 3is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 3 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 3 A processor 10 is taken as an example.
[0122] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0123] The aforementioned memory 20 stores instructions executable by at least one processor 10, so that the aforementioned at least one processor 10 executes the method shown in the above embodiment.
[0124] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0125] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0126] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 3 The example of connecting through bus is taken in the following.
[0127] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device may be a touch screen.
[0128] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0129] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0130] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for scene reconstruction during automatic parking, characterized in that: The method comprises: Acquire multiple laser radar point cloud data in the same scene, perform point cloud fusion on the multiple laser radar point cloud data, and obtain a point cloud data set after reconstructing the current scene, wherein the point cloud data set includes multiple fused point clouds; Converting the fused point cloud into a two-dimensional elliptical patch, wherein the parameters of the two-dimensional elliptical patch include: a three-dimensional position of a patch center point, a two-dimensional elliptical patch covariance matrix, a spherical harmonic function, and transparency; Based on the two-dimensional picture of the current scene, the current scene obtained from the two-dimensional picture is rendered in real time by the two-dimensional elliptical patch, and the current scene is three-dimensionally reconstructed based on the rendering result; Wherein, based on the two-dimensional picture of the current scene, real-time rendering of the current scene obtained from the two-dimensional picture by using the two-dimensional elliptical patch includes: Based on the two-dimensional image, a camera cone is obtained, a plurality of target facets whose center points are within the range of the camera cone are obtained, and the target facets are projected onto the two-dimensional image, wherein the projected target facets cover at least one pixel and there are a plurality of covered pixels; For the covered pixel, calculate the depth of the target patch at the covered pixel, and perform weighted averaging of the transparency corresponding to the target patch based on the depth to obtain the predicted depth of the covered pixel; Inputting the direction vector of the covered pixel into the spherical harmonic function corresponding to the target patch to obtain the initial predicted color of the covered pixel, and performing weighted averaging on the transparency corresponding to the target patch based on the initial predicted color to obtain the final predicted color of the covered pixel; Obtaining the rendering result based on the predicted depth and the final predicted color; Performing three-dimensional reconstruction of the current scene based on the rendering result includes: Obtaining color and depth information of pixels in the two-dimensional image based on the rendering result; Defining a three-dimensional space based on the current scene, performing voxel division on the three-dimensional space to obtain a first voxel unit, and obtaining a distance between a center point of the first voxel unit and a scene surface based on the depth information; A surface model of the current scene is established based on the distance, and the three-dimensional reconstruction is performed based on the surface model.
2. The method according to claim 1, characterized in that The plurality of laser radar point cloud data are subjected to the point cloud fusion based on an initial voxel step size; The fused point cloud is thinned based on the second voxel step size to obtain the point cloud data set, wherein the initial voxel step size is smaller than the second voxel step size.
3. The method according to claim 1 or 2, characterized in that: The two-dimensional elliptical patch covariance matrix includes: A scale matrix, wherein the last element on the diagonal of the scale matrix is zero and is not updated, and other elements on the diagonal of the scale matrix are updated during the rendering process.
4. The method according to claim 2, characterized in that: The two-dimensional elliptical patch covariance matrix includes: A rotation matrix, wherein the rotation matrix includes a normal vector, a first vector, and a second vector of the fused point cloud; The normal vector of the fused point cloud is obtained based on preset point cloud information of the point cloud during the point cloud fusion process, the first vector is perpendicular to the normal vector of the fused point cloud, and the second vector is obtained based on the normal vector of the fused point cloud and the first vector.
5. The method according to claim 1, characterized in that For the two-dimensional picture of the current scene, rendering the current scene obtained from the two-dimensional picture in real time based on the two-dimensional elliptical surface patch includes: Rendering an image based on the two-dimensional elliptical patch; Obtaining a difference between the rendered image and the two-dimensional image, and calculating a loss based on the difference; The parameters are adjusted based on the loss, the parameters are optimized, and the density of the two-dimensional elliptical patch is adaptively controlled to obtain the rendering result.
6. A device for scene reconstruction during automatic parking, characterized in that: The device comprises: A point cloud fusion module is used to obtain multiple laser radar point cloud data in the same scene, and perform point cloud fusion on the multiple laser radar point cloud data to obtain a point cloud data set after reconstructing the current scene, wherein the point cloud data set includes multiple fused point clouds; A conversion module, used for converting the fused point cloud into a two-dimensional elliptical patch, wherein the parameters of the two-dimensional elliptical patch include: a three-dimensional position of a patch center point, a two-dimensional elliptical patch covariance matrix, a spherical harmonic function and transparency; A reconstruction module is used to render the current scene obtained from the two-dimensional picture of the current scene in real time through the two-dimensional elliptical patch based on the two-dimensional picture of the current scene, and perform three-dimensional reconstruction of the current scene based on the rendering result; wherein, based on the two-dimensional picture of the current scene, the current scene obtained from the two-dimensional picture is rendered in real time through the two-dimensional elliptical patch, including: obtaining a camera cone based on the two-dimensional picture, obtaining multiple target patches whose patch center points are within the range of the camera cone, projecting the target patches to the two-dimensional picture, the projected target patches covering at least one pixel, and there are multiple covered pixels; for the covered pixels, calculating the depth of the target patch at the covered pixel, and performing weighted averaging on the transparency corresponding to the target patch based on the depth to obtain the predicted depth of the covered pixel ; Input the direction vector of the covered pixel into the spherical harmonic function corresponding to the target patch to obtain the initial predicted color of the covered pixel, and perform weighted averaging on the transparency corresponding to the target patch based on the initial predicted color to obtain the final predicted color of the covered pixel; obtain the rendering result based on the predicted depth and the final predicted color; perform three-dimensional reconstruction of the current scene based on the rendering result, including: obtaining color and depth information of pixels in the two-dimensional image based on the rendering result; defining a three-dimensional space based on the current scene, performing voxel division on the three-dimensional space to obtain a first voxel unit, and obtaining the distance between the center point of the first voxel unit and the scene surface based on the depth information; establishing a surface model of the current scene based on the distance, and performing the three-dimensional reconstruction based on the surface model.
7. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for scene reconstruction during automatic parking according to any one of claims 1 to 5 by executing the computer instructions.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for scene reconstruction during automatic parking according to any one of claims 1 to 5.
