Step-by-step depth completion method based on neural radiation field and terminal
Through a step-by-step depth completion method based on neural radiation fields, combined with density distribution prediction and rendering technology, the problem of insufficient image guidance capability in sparse depth map completion is solved, and depth map generation with higher precision and clarity is achieved.
Patent Information
- Application Number
- CN202411001854.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-10-25
AI Technical Summary
Existing self-supervised depth map completion methods lack image guidance capabilities when inputting sparse depth maps, resulting in a decrease in depth information accuracy and inability to effectively utilize the performance of neural networks.
A step-by-step depth completion method based on neural radiation fields is used to obtain new views through density distribution prediction and rendering. The preliminary completion and refinement network completes the sparse depth map, and uses a loss function for supervised training to improve the depth map. accuracy and boundary clarity.
It effectively improves the accuracy and boundary clarity of self-supervised depth completion. Through the guided prediction of scene density distribution by image information, the clarity of object contour depth is improved, and a denser depth map of higher quality is obtained.
Smart Images

Figure CN118839745A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a step-by-step depth completion method and terminal based on neural radiation field. Background Art
[0002] The ability of a car to accurately perceive the depth (distance) of objects in the surrounding scene is the basis for making safe decisions. Humans hope that smart driving cars can capture scene information around the vehicle through on-board cameras and lidars to make decisions based on their thinking and judgment, and make safe decisions when they perceive changes in the surrounding environment. How to obtain accurate and dense depth maps from image information obtained by cameras and sparse depth information obtained by lidars is an urgent problem to be solved.
[0003] The self-supervised methods currently used for depth map completion still lack a large amount of real depth information, and the quality of sparse depth images limits the ability of neural networks to process information, resulting in failure to exert their original performance. Therefore, many self-supervised methods will perform a simple densification before the sparse depth image is input into the neural network, so that the empty pixels inside the two-dimensional image are closed. At this time, when the features are extracted through the deep branch network, better results will be achieved. Generally, simple densification methods include pooling operations, scaffolding interpolation and other methods.
[0004] However, the above methods focus on sparse depth images without giving much consideration to the image's guiding ability, and simple densification operations will result in a decrease in the accuracy of depth information. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a step-by-step depth completion method and terminal based on neural radiation field, which improves the accuracy and boundary clarity of self-supervised depth completion.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0007] A step-by-step depth completion method based on neural radiation field, comprising the steps of:
[0008] S1. Predict and render the density distribution of the input image in a neural radiance field-based network to obtain scene depth and new views for supervision.
[0009] S2, inputting the new view, the predicted depth information and the sparse depth map into the preliminary completion network, and performing preliminary completion on the sparse depth map to obtain a preliminary depth map;
[0010] S3, inputting the preliminary depth map and the sparse depth map into a refinement network, and refining the depth information to obtain a dense depth map;
[0011] S4. Use the loss function to supervise the training process of the entire network.
[0012] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0013] A step-by-step depth completion terminal based on neural radiation field comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the step-by-step depth completion method based on neural radiation field as described above are implemented.
[0014] The beneficial effects of the present invention are: providing a step-by-step depth completion method and terminal based on neural radiation fields, by considering the importance of image information in the guided depth completion method, the network based on the neural radiation field predicts the scene density distribution, effectively solving the problem of unclear object contour depth, and then using the initial completion network and the refinement network to complete the rendered new view and the predicted depth information and different details of the sparse depth map to obtain a higher quality dense depth map, and finally combining the loss function to supervise the training process of the entire network, effectively improving the accuracy and boundary clarity of self-supervised depth completion. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a flow chart of a step-by-step depth completion method based on neural radiation field according to an embodiment of the present invention;
[0016] Figure 2 It is an overall framework diagram of a step-by-step depth completion method based on neural radiation field according to an embodiment of the present invention;
[0017] Figure 3 A schematic diagram of a structure for predicting scene density in an embodiment of the present invention;
[0018] Figure 4 Schematic diagram of the structure of a volume rendering module in an embodiment of the present invention;
[0019] Figure 5 Schematic diagram of the structure of a step-by-step depth completion terminal based on neural radiation field according to an embodiment of the present invention.
[0020] Description of labels:
[0021] 1. A step-by-step depth completion terminal based on neural radiation field; 2. Memory; 3. Processor. DETAILED DESCRIPTION
[0022] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0023] Please refer to Figures 1 to 4 , a step-by-step depth completion method based on neural radiation field, comprising the steps of:
[0024] S1. Predict and render the density distribution of the input image in a neural radiance field-based network to obtain scene depth and new views for supervision.
[0025] S2, inputting the new view, the predicted depth information and the sparse depth map into the preliminary completion network, and performing preliminary completion on the sparse depth map to obtain a preliminary depth map;
[0026] S3, inputting the preliminary depth map and the sparse depth map into a refinement network, and performing refinement of the depth information;
[0027] S4. Use the loss function to supervise the training process of the entire network.
[0028] From the above description, it can be seen that the beneficial effects of the present invention are: providing a step-by-step depth completion method based on neural radiation fields, by considering the importance of image information in the guided depth completion method, the network based on the neural radiation field predicts the scene density distribution, effectively solving the problem of unclear object contour depth, and then using the initial completion network and the refinement network to complete the rendered new view and the predicted depth information and different details of the sparse depth map to obtain a higher quality dense depth map, and finally combining the loss function to supervise the training process of the entire network, effectively improving the accuracy and boundary clarity of self-supervised depth completion.
[0029] Furthermore, the step S1 is specifically as follows:
[0030] In a neural radiance field-based network, a new view is synthesized for an input RGB image and an RGB depth map in an integrated view rendering process. The input RGB image is used as a supervisory signal in the synthesis of the new view, and the neural radiance field is used to predict the density field and depth information of the scene to obtain the scene depth.
[0031] From the above description, it can be seen that the neural radiation field prediction network can theoretically predict the density field of the scene, which has a good guiding role in the depth mixing problem between the foreground and background of the object. The predicted depth image serves as important information for the subsequent network; at the same time, the scene depth and new view are obtained through the prediction and rendering steps of the neural radiation field-based network, which provides important guiding clues for the completion of the sparse depth map in the completion stage.
[0032] Furthermore, in step S1, density distribution prediction is performed on the input image, specifically:
[0033] S11, the geometric structure of the scene is represented as a function fitting, and the three-dimensional point p in the scene is mapped to the volume density σ to obtain a complete density scene;
[0034] S12, according to the input image I, first predict a pixel-aligned feature map F through the encoder-decoder network, then the network generates a feature f at each pixel position x = F(x) can be viewed as a local geometric descriptor along a ray from the camera origin through the corresponding pixel;
[0035] S13. Consider a density value at a 3D point p within the camera frustum and project the 3D point p back to the input image x. I ′=π I (p) and the feature at the projection position Perform bilinear sampling and transform the features The pixel position encoding γ(x I ′) and the distance d between the three-dimensional point p and the camera origin are encoded to obtain γ(d) and input into the multi-layer perceptron Φ, where Φ represents the density prediction decoder, which can predict the density value of the three-dimensional point p at a given coordinate position in the three-dimensional space according to the input features and position encoding, x I ′ is the pixel position of the three-dimensional point p relative to the input image I after projection, π I It is the projection process of projecting the 3D point p back to the input image I. Each 3D point p corresponds to the pixel position of the input image I.
[0036] S14, multilayer perceptron Φ infers the density value σ of each 3D point p in the scene based on the visual features in the 2D image and the geometric information relative to the camera position P :
[0037]
[0038] S15. The decoder uses global information to reconstruct each three-dimensional point p, and the reconstructed features are output in four dimensions. Finally, the global feature extraction network outputs feature information in four dimensions.
[0039] From the above description, it can be seen that in order to learn the density distribution of the two-dimensional image feature mapping to the three-dimensional space, it is necessary to further process the feature map, project the three-dimensional points in the scene and perform bilinear sampling, so that the multi-layer perceptron learns to infer the density value of each three-dimensional point position in the scene based on the visual features in the two-dimensional image and the collective information relative to the camera position, and uses the encoder to reconstruct each three-dimensional point using global information to form correlation between pixel points.
[0040] Furthermore, the input image is rendered in step S1, specifically:
[0041] S16. When rendering the new perspective view, project the 3D point p back onto the input plane k of the input image I, and then use the bilinear interpolation method to obtain the color sampling value c at the projected position. p,k =I k (π k (p)), where I k is the pixel position of the three-dimensional point p relative to the input plane k after projection, π k The projection process of the three-dimensional point p back to the input plane k;
[0042] S17, combined with the density value σ of each three-dimensional point p P and color sample value c p,k , synthesizing a new view using volume rendering techniques, including emitting virtual rays from the camera along a path and evaluating density and color information at S discrete points on the ray path. For each pixel in the new view, this path is defined as a ray emitted from the camera center and passing through the pixel. The ray is used along the ray using discrete steps x i To approximate the color integral and determine the final pixel color
[0043] S18. In each discrete step, calculate the density value of the three-dimensional point p and the corresponding color, and take into account the probability T that the integral path from the camera to the current point is not blocked by other objects i , that is, the possibility that the ray did not end at the previous point, the calculation process for rendering the new view is as follows:
[0044] α i =exp(1-σ xi δ i ) (2);
[0045]
[0046] Among them, σ xi is the discrete step x i The volume density under i For x i With x i+1 The distance between i To end at x i With x i+1 The rays between j To end at x j With x j+1 The rays between is the discrete step x i The color sampling value at each discrete point below is calculated in the same way. The expected light termination depth corresponds to the depth in the depth map. Let d i For x iDistance from the ray origin:
[0047]
[0048] in, is the expected ray depth.
[0049] From the above description, it can be seen that when rendering a new view, the color of each 3D point is not directly predicted from the scene representation. Instead, the color sampling value is obtained by using the bilinear interpolation method after transmission, and the volume rendering technology is used in combination with the density value to synthesize the new view, so as to effectively utilize the rich color information in the input image to guide the color synthesis of each pixel in the new view.
[0050] Furthermore, the step S1 also includes:
[0051] Based on the rendering method of sampling colors from the input image, for pixels in the new view without a real image, it is guaranteed to have the same color when color sampling and rendering are performed in all input images.
[0052] From the above description, we can see that for a pixel in a new view without a real image, its density information comes only from the input image, but its color information comes from color sampling of multiple frames of input images. In order to constrain the synthesis effect of this part of the perspective and improve the performance of the network, it is necessary to collect colors in all input images and ensure that they have the same color when rendering.
[0053] Furthermore, the step S2 is specifically as follows:
[0054] S21, using the RGB image to predict the scene density to obtain an RGB depth map, the synthesized new view and the sparse depth image as inputs to the initial completion network, and the initial completion network extracts the visual features of the RGB image at the encoding end, while using the visual features of the RGB image as the main information source and the depth image information rendered with the scene density as the depth auxiliary information to extract the depth features of the RGB depth map;
[0055] S22. Preliminarily complete the depth mixed area caused by the depth change of the foreground and background of the object in the sparse depth map through the depth features of the RGB depth map to obtain a preliminary depth map.
[0056] From the above description, it can be seen that the visual features of the RGB image are the main information source, and the depth image information rendered by the scene density is the depth auxiliary information, which can play a key role in completing the depth mixed area caused by the depth change of the foreground and background of the object in the sparse depth map.
[0057] Furthermore, the step S3 is specifically as follows:
[0058] S31, the initial completion network fuses the upsampled outputs of each layer into the encoder layers of the refinement network. The calculation process of the fusion part is shown in the following formula:
[0059]
[0060] Among them, ⊙ is the matrix cascade calculation, To initially complete the output of each dimension of the network decoding end, In order to refine the dimensional features of the network coding end, F E ′ is the features of each layer of the refined network after fusion;
[0061] S32, the refinement network concatenates the preliminary depth map obtained by the initial completion network and the sparse depth map as input, and refines a new dense depth map under the guidance of the existing initial completion depth information.
[0062] From the above description, it can be seen that the overall structure of the refinement network is similar to that of the initial completion network. By upsampling and decoding the sparse depth map, a new dense depth map is refined under the guidance of the existing initial completion depth information, and a depth image with smaller error and higher quality can be obtained.
[0063] Furthermore, the step S4 is specifically as follows:
[0064] S41. Using image reconstruction loss, for a single sample, calculate the feature map F from the input image I and randomly divide all frames into two sets I loss and I render , then the input image I will randomly appear in any of the two sets;
[0065] S42. Reconstruct set I from sampled colors using camera pose and predicted density render The frames in, the reconstructed frames and the set I loss The photometric loss between frames in serves as a supervisory signal for scene density;
[0066] S43, randomly sample N pixels N i Using photometric measurements, for set I loss Each N i , from each frame k∈I render Get rebuilt
[0067] Aggregate N by taking the minimum per-pixel value over different frames k i and each The error between them is calculated using a combination of L1 and SSIM to calculate the photometric difference and edge-aware smoothing terms, as shown in the following formula:
[0068]
[0069] Among them, L1 and SSIM represent the photometric difference loss function and edge-aware depth smoothness loss function respectively. Represents multiple pixels N i The average normalized estimated ray termination inverse depth, L ph and L e They are reconstruction loss function and smoothness loss function respectively, and the total loss function L at the calculation of neural radiation field N Aggregate them when L1 and λ SSIM are the relative weights of the photometric difference loss function and the edge-aware depth smoothness loss function, δ x and δ y The gradients in the x and y directions are:
[0070] Then the consistency constraint function L c The calculation of is as follows:
[0071]
[0072] Where c = card (I render ), c is the number of images used to render the new view, k and k' are two different frames in the rendering set, and the total loss function of the prediction density scene network L N The calculation formula is as follows:
[0073]
[0074] Input the sparse depth map in the initial completion network into Z s As a supervisory signal, calculate the loss function L of the sparse depth map d As shown below:
[0075]
[0076] in, is the completed depth value, then the final loss function L of the entire self-supervised depth completion framework is:
[0077] L=L N +λ d L d (12).
[0078] Furthermore, the formula of the photometric difference loss function L1 loss is as follows:
[0079]
[0080] Where n is the pixel index value, N is the total number of pixels, x(n) and y(n) represent the processed value and the true value;
[0081] The loss function L2 formula is as follows:
[0082]
[0083] The formula of the edge-aware depth smoothness loss function SSIM is as follows:
[0084] SSIM(x,y)=f(l(x,y),c(x,y),s(x,y)) (15);
[0085] Where l(x,y) is the brightness similarity, and the formula is as follows:
[0086]
[0087] Among them, μ x represents the average brightness of image x, μ y represents the average brightness of image y, x i is the pixel value of each pixel, C1=(K1M) 2 , used to prevent the denominator from being 0, K1<<1 is a constant, and M is the dynamic range of grayscale;
[0088] c(x,y) is the contrast similarity, and the formula is as follows:
[0089]
[0090] Among them, σ x Represents the standard deviation of the pixel values of image x, σ y Represents the standard deviation of the image y pixel value, C2=(K2M) 2 , used to prevent the denominator from being 0, K2<<1 is a constant;
[0091] s(x,y) is the structural similarity, and the formula is as follows:
[0092]
[0093] Where C3 = (K3M) 2 , used to prevent the denominator from being 0, K3<<1 is a constant.
[0094] From the above description, we can see that the training goal of the network for predicting density scenes is to optimize the encoder-decoder network and the multi-layer perceptron to predict the scene density based only on the input image, thereby constructing other new views. This is similar to the neural radiance field and self-supervised depth prediction methods. Therefore, image reconstruction loss is used to ensure the accuracy and boundary clarity of self-supervised depth completion.
[0095] Please refer to Figure 5A step-by-step depth completion terminal based on neural radiation field includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the step-by-step depth completion method based on neural radiation field as described above are implemented.
[0096] From the above description, it can be seen that the beneficial effects of the present invention are: based on the same technical concept, in conjunction with the above-mentioned step-by-step depth completion method based on neural radiation field, a step-by-step depth completion terminal based on neural radiation field is provided, and by considering the importance of image information in the guided depth completion method, the network based on neural radiation field predicts the scene density distribution, effectively solving the problem of unclear object contour depth, and then using the initial completion network and the refinement network to complete the rendered new view and the predicted depth information and different details of the sparse depth map to obtain a higher quality dense depth map, and finally the loss function is combined to supervise the training process of the entire network, effectively improving the accuracy and boundary clarity of self-supervised depth completion.
[0097] The present invention provides a step-by-step depth completion method and terminal based on neural radiation field, which are mainly used in the scene of obtaining an accurate and dense depth map from the image information obtained by the camera and the sparse depth information obtained by the laser radar. The following is a specific description in conjunction with a specific embodiment:
[0098] Please refer to Figures 1 to 3 , Embodiment 1 of the present invention is:
[0099] A step-by-step depth completion method based on neural radiation fields, such as Figure 1 and Figure 2 As shown, the steps include:
[0100] S1. Density distribution prediction and rendering of input images in a neural radiance field based network to obtain scene depth and new views for supervision.
[0101] Among them Figure 3 As shown in the figure, step S1 mainly synthesizes the new view of the input RGB image and integrates the RGB depth map in the view rendering process. The input RGB image is used as a supervisory signal in the synthesis of the new view. The neural radiance field prediction network can theoretically predict the density field of the scene, which has a good guiding role in the depth mixing problem between the background and the foreground of the object. The predicted depth image can be used as important information for the subsequent network. The scene depth and new view are obtained through the prediction and rendering steps of the neural radiance field-based network, which provides important guiding clues for the completion of the sparse depth map in the completion stage.
[0102] S2. Input the new view, the predicted depth information and the sparse depth map into the preliminary completion network, and perform preliminary completion on the sparse depth map to obtain a preliminary depth map.
[0103] S3. Input the preliminary depth map and the sparse depth map into the refinement network and refine the depth information.
[0104] S4. Use the loss function to supervise the training process of the entire network.
[0105] That is, in this embodiment, in order to address the problem of viewpoint synthesis quality degradation of NeRF when few-view images are available, by considering the importance of image information in the guided depth completion method, the network based on the neural radiation field predicts the scene density distribution, effectively solving the problem of unclear object contour depth, and then using the initial completion network and the refinement network to complete the rendered new view and the predicted depth information and different details of the sparse depth map to obtain a higher quality dense depth map. Finally, the loss function is combined to supervise the training process of the entire network, which effectively improves the accuracy and boundary clarity of self-supervised depth completion.
[0106] Please refer to Figure 4 , Embodiment 2 of the present invention is:
[0107] A step-by-step depth completion method based on neural radiation field, based on the above-mentioned embodiment 1, in this embodiment, density distribution prediction is performed on the input image in step S1, specifically:
[0108] The geometric structure of the scene is represented as a function fit, and the 3D point p in the scene is mapped to the volume density σ to obtain a complete density scene.
[0109] According to the input image I, a pixel-aligned feature map F is first predicted by the encoder-decoder network. This is achieved by learning the local geometric distribution around each pixel in the image through the network. Then the feature f generated by the network at each pixel position x =F(x) can be viewed as a local geometric descriptor along a ray from the camera origin through the corresponding pixel.
[0110] In order to learn the density distribution of the 2D image feature map to the 3D space, the feature map needs to be further processed. That is, consider the density value at a 3D point p located in the camera frustum and project the 3D point p back to the input image x I ′=π I (p) and the feature at the projection position Perform bilinear sampling and transform the features The pixel position encoding γ(x I′) and the distance d between the three-dimensional point p and the camera origin are encoded to obtain γ(d) and input into the multi-layer perceptron Φ, where Φ represents the density prediction decoder, which can predict the density value of the three-dimensional point p at a given coordinate position in the three-dimensional space according to the input features and position encoding, x I ′ is the pixel position of the three-dimensional point p relative to the input image I after projection, π I It is the projection process of projecting the 3D point p back to the input image I, and each 3D point p corresponds to the pixel position of the input image I.
[0111] In this way, the multilayer perceptron Φ infers the density value σ of each 3D point p in the scene based on the visual features in the 2D image and the geometric information relative to the camera position. P :
[0112]
[0113] In order to form the correlation between pixels, the decoder uses global information to reconstruct each 3D point p, and the reconstructed features are output in four dimensions. Finally, the global feature extraction network outputs feature information in four dimensions.
[0114] That is, in this embodiment, in order to learn the density distribution of the two-dimensional image feature mapping to the three-dimensional space, it is necessary to further process the feature map, project the three-dimensional points in the scene and perform bilinear sampling, so that the multilayer perceptron learns to infer the density value of each three-dimensional point position in the scene based on the visual features in the two-dimensional image and the collective information relative to the camera position, and uses the encoder to reconstruct each three-dimensional point using global information to form correlation between pixel points.
[0115] Meanwhile, in this embodiment, the input image is rendered in step S1, such as Figure 4 As shown, specifically:
[0116] When rendering a new view, instead of predicting the color of each point directly from the scene representation, the 3D point p is projected back onto the input plane k of the input image I, and then a bilinear interpolation method is used to obtain the color sample value c at the projected position. p,k =I k (π k (p)), where I k is the pixel position of the three-dimensional point p relative to the input plane k after projection, π k The projection process of the three-dimensional point p back to the input plane k;
[0117] Then combine the density value σ of each three-dimensional point p P and color sample value c p,k, using volume rendering technology to synthesize new views. The key here is to use the rich color information in the input image to guide the color synthesis of each pixel in the new view. The volume rendering steps follow a discretization strategy, which is similar to the traditional neural radiation field. The specific operation includes emitting virtual light along a path from the camera and evaluating the density and color information at S discrete points on the light path. For each pixel in the new view, this path is defined as a ray emitted from the center of the camera and passing through the pixel. The method uses discrete steps x along the ray. i To approximate the color integral and determine the final pixel color
[0118] At the same time, in each discrete step, the density value of the three-dimensional point p and the corresponding color are calculated, and the probability T that the integral path from the camera to the current point is not blocked by other objects is taken into account i , that is, the possibility that the ray did not end at the previous point, the calculation process for rendering the new view is as follows:
[0119] α i =exp(1-σ xi δ i ) (2);
[0120]
[0121] in, is the discrete step x i The volume density under i For x i With x i+1 The distance between i To end at x i With x i+1 The rays between j To end at x j With x j+1 The rays between is the discrete step x i The color sampling value at each discrete point below is calculated in the same way. The expected light termination depth corresponds to the depth in the depth map. Let d i For x i Distance from the ray origin:
[0122]
[0123] in, is the expected ray depth.
[0124] That is, when rendering a new view, the color of each 3D point is not directly predicted from the scene representation. Instead, the color sampling value is obtained by using the bilinear interpolation method after transmission, and the volume rendering technology is used in combination with the density value to synthesize the new view, so as to effectively utilize the rich color information in the input image to guide the color synthesis of each pixel in the new view.
[0125] In addition, in this embodiment, step S1 also includes:
[0126] Based on the rendering method of sampling colors from the input images, for pixels in the new view without real images, the colors sampled in all input images are guaranteed to have the same color when rendering.
[0127] That is, for a pixel in a new view without a real image, its density information comes only from the input image, but its color information comes from color sampling of multiple frames of input images. In order to constrain the synthesis effect of this part of the perspective and improve the performance of the network, it is necessary to collect colors in all input images and ensure that they have the same color when rendering.
[0128] In this embodiment, step S2 is specifically as follows:
[0129] The RGB depth map obtained by predicting the scene density with the RGB image, the synthesized new view and the sparse depth image are used as the input of the preliminary completion network. The preliminary completion network extracts the visual features of the RGB image at the encoding end, and extracts the depth features of the RGB depth map using the visual features of the RGB image as the main information source and the depth image information rendered with the scene density as the depth auxiliary information.
[0130] Then, the depth features of the RGB depth map are used to preliminarily complete the depth mixed area in the sparse depth map caused by the depth change of the foreground and background of the object to obtain a preliminary depth map.
[0131] In this step, the network uses the visual features of the RGB image as the main information source, and the depth image information rendered by the scene density is used as the depth auxiliary information, which can play a key role in completing the depth mixed area caused by the depth change of the background in front of the object in the sparse depth map.
[0132] In this embodiment, the overall structure of the refined network in step S3 is similar to that of the initial completion network, that is, step S3 is specifically as follows:
[0133] The initial completion network fuses the upsampled outputs of each layer into the encoder layers of the refinement network. The calculation process of the fusion part is shown in the following formula:
[0134]
[0135] Among them, ⊙ is the matrix cascade calculation, To initially complete the output of each dimension of the network decoding end, In order to refine the dimensional features of the network coding end, F E ′ is the fused features of each layer of the refined network.
[0136] Then the refinement network concatenates the preliminary depth map obtained by the initial completion network and the sparse depth map as input, and refines the new dense depth map under the guidance of the existing initial completion depth information.
[0137] That is, when the refinement network upsamples and decodes the sparse depth map, it refines a new dense depth map under the guidance of the existing initial completion depth information, and can obtain a depth image with smaller error and higher quality.
[0138] In addition, in step S4, the training goal of the network for predicting density scenes is to optimize the encoder-decoder network and the multi-layer perceptron to predict scene density based only on the input image, thereby constructing other new views. Similar to the neural radiance field and self-supervised depth prediction methods, this embodiment also uses image reconstruction loss. In this embodiment, step S4 is specifically:
[0139] For a single sample, we first compute the feature map F from the input image I and randomly divide all frames into two sets I loss and I render , then the input image I will randomly appear in any of the two sets.
[0140] The camera pose and predicted density are then used to reconstruct the set I from the sampled colors render The frames in, the reconstructed frames and the set I loss The photometric loss between frames in is used as a supervisory signal for scene density.
[0141] Then randomly sample N pixels N i Using photometric measurements, for set I loss Each N i , from each frame k∈I render Get rebuilt
[0142] Then aggregate N by taking the minimum per-pixel value over different frames k i and each Therefore, if the predicted density is correct, it will produce very good reconstructions with low errors.
[0143] The photometric difference as well as the edge-aware smoothing term are then calculated using a combination of L1 and SSIM as shown below:
[0144]
[0145] Among them, L1 and SSIM represent the photometric difference loss function and edge-aware depth smoothness loss function respectively. Represents multiple pixels N i The average normalized estimated ray termination inverse depth, L ph and L e They are reconstruction loss function and smoothness loss function respectively, and the total loss function L at the calculation of neural radiation field N Aggregate them when L1 and λ SSIM are the relative weights of the photometric difference loss function and the edge-aware depth smoothness loss function, δ x and δ y are the gradients in the x and y directions respectively.
[0146] Then the consistency constraint function L c The calculation of is as follows:
[0147]
[0148] Where c = card (I render ), c is the number of images used to render the new view, k and k' are two different frames in the rendering set, and the total loss function of the prediction density scene network L N The calculation formula is as follows:
[0149]
[0150] Then input the sparse depth map in the initial completion network into Z s As a supervisory signal, although the sparse depth information is generally sparse, the depth values represented by some pixels with information are more accurate and reliable than the predicted depth values.
[0151] Then calculate the loss function L of the sparse depth map d As shown below:
[0152]
[0153] in, is the completed depth value, then the final loss function L of the entire self-supervised depth completion framework is:
[0154] L=L N +λ d L d (12).
[0155] Finally, the calculated final loss function is used to supervise the training process of the entire network.
[0156] In this embodiment, the formula of the photometric difference loss function L1 loss is provided as follows:
[0157]
[0158] Among them, n is the pixel index value, N is the total number of pixels, and x(n) and y(n) represent the processed value and the true value.
[0159] The loss function formula L2 is as follows:
[0160]
[0161] The formula of edge-aware depth smoothness loss function SSIM is as follows:
[0162] SSIM(x,y)=f(l(x,y),c(x,y),s(x,y)) (15).
[0163] Where l(x,y) is the brightness similarity, and the formula is as follows:
[0164]
[0165] Among them, μ x represents the average brightness of image x, μ y represents the average brightness of image y, x i is the pixel value of each pixel, C1=(K1M) 2 , used to prevent the denominator from being 0, K1<<1 is a constant, and M is the dynamic range of grayscale.
[0166] c(x,y) is the contrast similarity, and the formula is as follows:
[0167]
[0168] Among them, σ x represents the standard deviation of the pixel values of the x image, σ y Represents the standard deviation of the pixel values of the y image, C2=(K2M) 2 , used to prevent the denominator from being 0, K2<<1 is a constant.
[0169] s(x,y) is the structural similarity, and the formula is as follows:
[0170]
[0171] Where C3 = (K3M) 2 , used to prevent the denominator from being 0, K3<<1 is a constant.
[0172] That is, the training goal of the network that predicts density scenes is to optimize the encoder-decoder network and predict the scene density based only on the input image, thereby constructing other new views. This is similar to the neural radiance field and self-supervised depth prediction methods. Therefore, image reconstruction loss is used to ensure the accuracy and boundary clarity of self-supervised depth completion.
[0173] Please refer to Figure 5 , Embodiment 3 of the present invention is:
[0174] A step-by-step depth completion terminal 1 based on neural radiation field includes a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, the steps in the step-by-step depth completion method based on neural radiation field of the above-mentioned embodiment 1 or embodiment 2 are completed.
[0175] In summary, the present invention provides a step-by-step depth completion method and terminal based on neural radiation field. By considering the importance of image information in the guided depth completion method, the network based on the neural radiation field predicts the scene density distribution, effectively solving the problem of unclear object contour depth, and then uses the initial completion network and the refinement network to complete the rendered new view and the predicted depth information and different details of the sparse depth map to obtain a higher quality dense depth map. Finally, the loss function is combined to supervise the training process of the entire network, effectively improving the accuracy and boundary clarity of self-supervised depth completion.
[0176] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A step-by-step depth completion method based on neural radiation field, characterized in that: Includes steps: S1. Predict and render the density distribution of the input image in a neural radiance field-based network to obtain scene depth and new views for supervision. S2, inputting the new view, the predicted depth information and the sparse depth map into the preliminary completion network, and performing preliminary completion on the sparse depth map to obtain a preliminary depth map; S3, inputting the preliminary depth map and the sparse depth map into a refinement network, and refining the depth information to obtain a dense depth map; S4. Use the loss function to supervise the training process of the entire network.
2. The step-by-step depth completion method based on neural radiation field according to claim 1, characterized in that: The step S1 is specifically as follows: In a neural radiance field-based network, a new view is synthesized for an input RGB image and an RGB depth map in an integrated view rendering process. The input RGB image is used as a supervisory signal in the synthesis of the new view, and the neural radiance field is used to predict the density field and depth information of the scene to obtain the scene depth.
3. The step-by-step depth completion method based on neural radiation field according to claim 1, characterized in that: In step S1, density distribution prediction of the input image is performed, specifically: S11, the geometric structure of the scene is represented as a function fitting, and the three-dimensional point p in the scene is mapped to the volume density σ to obtain a complete density scene; S12, according to the input image I, first predict a pixel-aligned feature map F through the encoder-decoder network, then the network generates a feature f at each pixel position x = F(x) can be viewed as a local geometric descriptor along a ray from the camera origin through the corresponding pixel; S13. Consider a density value at a 3D point p within the camera frustum and project the 3D point p back to the input image x. I ′=π I (p) and the feature f at the projection position x′I =F(x I ′) performs bilinear sampling and transforms the feature f x′I The pixel position encoding γ(x I ′) and the distance d between the three-dimensional point p and the camera origin are encoded to obtain γ(d) and input into the multi-layer perceptron Φ, where Φ represents the density prediction decoder, which can predict the density value of the three-dimensional point p at a given coordinate position in the three-dimensional space according to the input features and position encoding, x I ′ is the pixel position of the three-dimensional point p relative to the input image I after projection, π I It is the projection process of projecting the 3D point p back to the input image I. Each 3D point p corresponds to the pixel position of the input image I. S14, multilayer perceptron Φ infers the density value σ of each 3D point p in the scene based on the visual features in the 2D image and the geometric information relative to the camera position P : S15. The decoder uses global information to reconstruct each three-dimensional point p, and the reconstructed features are output in four dimensions. Finally, the global feature extraction network outputs feature information in four dimensions.
4. The step-by-step depth completion method based on neural radiation field according to claim 3, characterized in that: The input image is rendered in step S1, specifically: S16. When rendering the new perspective view, project the 3D point p back onto the input plane k of the input image I, and then use the bilinear interpolation method to obtain the color sampling value c at the projected position. p,k =I k (π k (p)), where I k is the pixel position of the three-dimensional point p relative to the input plane k after projection, π k The projection process of the three-dimensional point p back to the input plane k; S17, combined with the density value σ of each three-dimensional point p P and color sample value c p,k , synthesizing a new view using volume rendering techniques, including emitting virtual rays from the camera along a path and evaluating density and color information at S discrete points on the ray path. For each pixel in the new view, this path is defined as a ray emitted from the camera center and passing through the pixel. The ray is used along the ray using discrete steps x i To approximate the color integral and determine the final pixel color S18. In each discrete step, calculate the density value of the three-dimensional point p and the corresponding color, and take into account the probability T that the integral path from the camera to the current point is not blocked by other objects i , that is, the possibility that the ray did not end at the previous point, the calculation process for rendering the new view is as follows: in, is the discrete step x i The volume density under i For x i With x i+1 The distance between i To end at x i With x i+1 The rays between j To end at x j With x j+1 The rays between is the discrete step x i The color sampling value at each discrete point below is calculated in the same way. The expected light termination depth corresponds to the depth in the depth map. Let d i For x i Distance from the ray origin: in, is the expected ray depth.
5. The step-by-step depth completion method based on neural radiation field according to claim 4, characterized in that: The step S1 also includes: Based on the rendering method of sampling colors from the input image, for pixels in the new view without a real image, it is guaranteed to have the same color when color sampling and rendering are performed in all input images.
6. The step-by-step depth completion method based on neural radiation field according to claim 2, characterized in that: The step S2 is specifically as follows: S21, using the RGB image to predict the scene density to obtain an RGB depth map, the synthesized new view and the sparse depth image as inputs to the initial completion network, and the initial completion network extracts the visual features of the RGB image at the encoding end, while using the visual features of the RGB image as the main information source and the depth image information rendered with the scene density as the depth auxiliary information to extract the depth features of the RGB depth map; S22. Preliminarily complete the depth mixed area caused by the depth change of the foreground and background of the object in the sparse depth map through the depth features of the RGB depth map to obtain a preliminary depth map.
7. The step-by-step depth completion method based on neural radiation field according to claim 6, characterized in that: The step S3 is specifically as follows: S31, the initial completion network fuses the upsampled outputs of each layer into the encoder layers of the refinement network. The calculation process of the fusion part is shown in the following formula: Among them, ⊙ is the matrix cascade calculation, To initially complete the output of each dimension of the network decoding end, In order to refine the dimensional features of the network coding end, F E ′ is the features of each layer of the refined network after fusion; S32, the refinement network concatenates the preliminary depth map obtained by the initial completion network and the sparse depth map as input, and refines a new dense depth map under the guidance of the existing initial completion depth information.
8. The step-by-step depth completion method based on neural radiation field according to claim 7, characterized in that: The step S4 is specifically as follows: S41. Using image reconstruction loss, for a single sample, calculate the feature map F from the input image I and randomly divide all frames into two sets I loss and I render , then the input image I will randomly appear in any of the two sets; S42. Reconstruct set I from sampled colors using camera pose and predicted density render The frames in, the reconstructed frames and the set I loss The photometric loss between frames in serves as a supervisory signal for scene density; S43, randomly sample N pixels N i Using photometric measurements, for set I loss Each N i , from each frame k∈I render Get rebuilt Aggregate N by taking the minimum per-pixel value over different frames k i and each The error between them is calculated using a combination of L1 and SSIM to calculate the photometric difference and edge-aware smoothing terms, as shown in the following formula: Among them, L1 and SSIM represent the photometric difference loss function and edge-aware depth smoothness loss function respectively. Represents multiple pixels N i The average normalized estimated ray termination inverse depth, L ph and L e They are reconstruction loss function and smoothness loss function respectively, and the total loss function L at the calculation of neural radiation field N Aggregate them, and λ SSIM are the relative weights of the photometric difference loss function and the edge-aware depth smoothness loss function, δ x and δ y The gradients in the x and y directions are: Then the consistency constraint function L c The calculation of is as follows: Where c = card (I render ), c is the number of images used to render the new view, k and k' are two different frames in the rendering set, and the total loss function of the prediction density scene network L N The calculation formula is as follows: Input the sparse depth map in the initial completion network into Z s As a supervisory signal, calculate the loss function L of the sparse depth map d As shown below: in, is the completed depth value, then the final loss function L of the entire self-supervised depth completion framework is: L=L N +λ d L d (12) 9. The step-by-step depth completion method based on neural radiation field according to claim 8, characterized in that: The formula of the photometric difference loss function L1 loss is as follows: Where n is the pixel index value, N is the total number of pixels, x(n) and y(n) represent the processed value and the true value; The loss function L2 formula is as follows: The formula of the edge-aware depth smoothness loss function SSIM is as follows: SSIM(x,y)=f(l(x,y),c(x,y),s(x,y)) (15); Where l(x,y) is the brightness similarity, and the formula is as follows: Among them, μ x represents the average brightness of image x, μ y represents the average brightness of image y, x i is the pixel value of each pixel, C1=(K1M) 2 , used to prevent the denominator from being 0, K1<<1 is a constant, and M is the dynamic range of grayscale; c(x,y) is the contrast similarity, and the formula is as follows: Among them, σ x Represents the standard deviation of the pixel values of image x, σ y Represents the standard deviation of the image y pixel value, C2=(K2M) 2 , used to prevent the denominator from being 0, K2<<1 is a constant; s(x,y) is the structural similarity, and the formula is as follows: Where C3 = (K3M) 2 , used to prevent the denominator from being 0, K3<<1 is a constant.
10. A step-by-step depth completion terminal based on neural radiation field, characterized in that: It comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps in a step-by-step depth completion method based on a neural radiation field as described in any one of claims 1 to 9 are implemented.
Citation Information
Cited By
Human intestinal tract dense depth estimation method
CN119180852A
Multi-source video collaborative imaging algorithm and device
CN120182328A
Multi-source video collaborative imaging method and device
CN120182328B
Monocular depth completion method based on three-dimensional Gaussian and sparse truth value anchoring
CN120782834A
Depth map completion method based on double-branch progressive fusion
CN121280501A
