RGB-D scene reconstruction method based on normal guidance
Through the RGB-D scene reconstruction method based on normal guidance, combined with surface normal estimation and truncated signed distance function, the problem of loss of fitting details in weak texture areas is solved, and more accurate indoor scene mesh surface reconstruction is achieved, which is suitable for Virtual reality and other fields.
Patent Information
- Application Number
- CN202411104990.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-10-25
AI Technical Summary
Existing scene reconstruction technology easily loses details when fitting weak texture areas, and lacks geometric constraints, leading to noise and missing problems.
An RGB-D scene reconstruction method based on normal guidance is adopted. Through a hybrid representation of surface normal estimation, truncated signed distance function and radiation volume representation, a multi-layer perceptron is used to achieve scene reconstruction, and the mesh model is extracted using the Marching Cubes method.
It improves the reconstruction accuracy and smoothness of weak texture areas and generates more accurate indoor scene mesh surfaces, which is suitable for virtual reality, augmented reality and other fields.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] The present invention relates to a normal-guided RGB-D scene reconstruction method. During the reconstruction process, the geometric information provided by the normal map is used to constrain the fitting of the scene surface. This method can better maintain the smooth geometric features of weak texture areas (such as white walls and ground) in the scene, and belongs to the field of computer vision and graphics. Background Art
[0002] With the continuous advancement of technology, it is easy to capture scene data using consumer-grade cameras and reconstruct complete three-dimensional scenes through algorithms. These reconstruction results are widely used in architectural design, virtual reality, augmented reality, and robot navigation. In order to achieve realistic and detailed scenes, higher requirements are placed on the quality of scene reconstruction.
[0003] In the past, one type of traditional indoor reconstruction algorithm used a structured light scanner or a 3D laser scanner to scan a 3D scene and then represent the scene in the form of a point cloud. Another type uses a camera to capture a series of images, extracts feature points from the captured images, and then uses a multi-view stereo matching method to reconstruct the scene, and finally represents it in the form of a point cloud, voxel, or mesh. Since the camera is subject to its own limitations when collecting image data, the collected image data may be noisy and missing. In addition, since the cumulative error of the posture data may be generated during the movement of the camera, these factors will eventually affect the quality of reconstruction. Recently, with the widespread application of deep learning in the fields of computer vision and computer graphics, models such as convolutional neural networks, multi-layer perceptrons, and generative adversarial networks can be used to quickly and accurately reconstruct scenes. Given images and related data from different perspectives as input, a deep learning network model is used to reconstruct the scene, and the results are usually represented in the form of point clouds, voxels, meshes, implicit functions, etc. Compared with representation methods such as point clouds, voxels, and meshes, implicit representation can accurately reconstruct the complex details of the scene and efficiently store continuous and smooth surfaces.
[0004] Existing reconstruction methods are mainly divided into scene reconstruction methods based on explicit representation and scene reconstruction methods based on implicit representation. Compared with scene reconstruction methods based on explicit representation, scene reconstruction methods based on implicit representation are widely used in deep learning, but they also have certain defects. Scene reconstruction methods based on explicit representation use point clouds, voxels and grids to represent surfaces. Point clouds lack topological structures and are sensitive to noise. The coarseness of the voxel surface depends on the size of the voxel block. Small voxel blocks have high memory usage, while large voxel blocks have rough reconstructed surfaces. The topology of the grid is difficult to change and the computational complexity is high. Scene reconstruction methods based on explicit representation cannot obtain accurate results when facing complex indoor scenes. Scene reconstruction methods based on implicit representation can represent the entire scene surface as a function, and use a deep learning-based network model to fit the relevant parameters in this function. After obtaining this function and related parameters, the grid extraction method is used to represent the scene surface from the implicit function.
[0005] Mildenhall et al. proposed using NeRF to render and reconstruct 3D scenes from 2D images in NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis. This method has triggered a major change in the field of 3D reconstruction. NeRF applies volume rendering to reconstruction, using two multi-layer perceptrons to render images and fit implicit functions respectively. This method can reconstruct and render high-quality scenes from limited images, and the implicit representation method can more accurately describe complex geometric shapes and texture details. However, this method is less effective in dealing with areas with less texture and local geometry in the scene. Therefore, Azinović et al. proposed combining RGB images and depth maps to reconstruct indoor scenes in Neural RGB-D Surface Reconstruction, and used a hybrid scene representation based on the implicit surface representation of the truncated signed distance function (TSDF) and the radiant volume representation to represent the scene. This method can generate scenes with richer and more accurate details, but the reconstruction effect of areas with less texture needs to be improved. Wang et al. proposed in "NeuRIS: Neural Reconstruction of Indoor Scenes Using Normal Priors" to use normals as prior information to supervise the fitting of texture-free areas in the scene, but this method will lose geometric details in the coarse-to-fine reconstruction process.
[0006] Through analysis, it is found that the above work is prone to losing details in the weak texture areas of the reconstructed scene. It is necessary to focus on how to ensure the local geometric information of the weak texture areas in the scene while ensuring the details in the scene. Most of the previous methods only combine RGB images and depth maps to reconstruct the surface. Due to the lack of noise in the RGB image and the depth map, the fitted surface has poor effect in the weak texture area, affecting the quality of reconstruction. Summary of the invention
[0007] The present invention aims to solve the problem of noise and missing when fitting weak texture areas due to lack of geometric constraints in existing scene reconstruction technology. Specifically, a normal-guided RGB-D scene reconstruction method is proposed to address the shortcomings of existing volume rendering-based scene reconstruction methods in fitting planar areas.
[0008] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0009] The RGB-D scene reconstruction method based on normal guidance comprises the following steps:
[0010] Step S1: Select a public data set and randomly select a scene from the data set, and obtain RGB images from different perspectives and the corresponding depth map and camera pose matrix, number of RGB images Control within 200-500 images, and adjust the resolution of RGB images and depth maps to , Integer;
[0011] Among them, RGB images with Denote the depth map by The camera posture is expressed by express, , the camera pose matrix : , is a Rotation matrix: , is a The translation vector of : ;
[0012] Step S2, estimating the input RGB image using the surface normal estimation method proposed in document 1 to obtain a normal map;
[0013] Document 1: Gwangbin Bae, Andrew J. Davison, Rethinking inductive biases for surface normal estimation, Proceedings of the IEEE / CVF Conference on Computer Vision and Pattern Recognition, 2024: 9535-9545.
[0014] Step S3: The camera posture is transformed from the original coordinate system to the OpenGL coordinate system, the transformation matrix: ;
[0015] in, , , represents the transformed camera pose, Indicates the camera posture before conversion. Both the original coordinate system and the OpenGL coordinate system are right-handed coordinate systems. The original coordinate system: +X axis to the right, +Y axis upward, +Z axis outward (pointing outside the screen); the OpenGL coordinate system: +X axis to the right, +Y axis upward, +Z axis forward (pointing into the screen);
[0016] Step S4: Preprocess the RGB images at different viewing angles and the corresponding depth maps and normal map data;
[0017] Step S4.1, RGB image data matrix To express, Indicates In RGB images OK Column pixels, is a The color vector is: , normalize its value to In scope: , Represents the normalized color vector;
[0018] in, ;
[0019] Step S4.2, Depth map data matrix To express, Indicates Depth map OK Column pixels, Is a value representing the depth, normalizing the pixel value to In scope: , Indicates the normalized depth value, 1000 means the depth collected by the sensor is within 0 to 1000 cm;
[0020] Step S4.3, Matrix for normal map data To express, Indicates In the normal diagram OK Column pixels, is a The color vector is: , which means the direction of the three-dimensional space, normalize the pixel value to In scope: , represents the normalized normal vector, and then the normalized normal vector modulus is set to 1 to obtain the unit normal vector: , represents the unit normal vector;
[0021] Step S5: convert the camera posture after step S3 Perform translation and scaling transformations so that the translation vector in the camera posture matrix The value is controlled at Within the range, translation transformation: , rotation transformation: , , , The parameter value representing the uniform translation of all camera poses, represents the parameter value of uniform rotation, Represents the transformed camera posture;
[0022] Step S6: The entire network model consists of a truncated signed distance function and an implicit surface representation based on a radiation volume representation. Two multi-layer perceptrons (radiance perceptron and shape perceptron) are used to implement this hybrid representation. The shape perceptron predicts the truncated signed distance function and the depth value, and the radiation perceptron predicts the rendered color value. The camera pose after the transformation in step S5 The position and direction in three-dimensional space, The direction of the ray is , along the Equidistant sampling in ray direction Points , the shape perceptron is based on sampling points The sinusoidal position encoding is input and the output is the truncated signed distance to the nearest surface of the sampling point The radiance sensor takes the view direction encoded by the sinusoidal position and the intermediate features of the shape sensor as input and outputs the surface color ;
[0023] in, , , , represents the number of camera poses, which is the same as the number of RGB images mentioned in step S1;
[0024] Step S6.1: In the entire network model, the scene geometry is represented as a truncated signed distance function , for the Ray upsampling Sampling points , which returns the distance from the sampling point to the nearest surface: ,in Represents the cutoff distance, which is used to retain important information of points close to the surface and improve computational and storage efficiency. Represents the corresponding signed distance value: , represents the signed distance function, represents the learnable parameters, and then directly calculates the first On the ray The weight of the sampling points: , Represents volume density, whose value is predicted by the network. The farther the sampling point is from the scene surface, the lower the weight of the sampling point;
[0025] Step S6.2: Use sinusoidal position coding to The first Sampling points To encode: , Represents the target dimension of the encoding, inputs the encoded position into the shape perceptron, and finally outputs the signed distance value , the rendered ;
[0026] Step S6.3: The radiation sensor takes the direction of the ray Color features of the shape sensor output is the input, and the final output is The weighted sum of all sampling points on the ray is used as the total rendering color value of this ray. ;
[0027] Among them, along the Ray sampling The weighted sum of sampling points: ;
[0028] Step S6.4: Based on the signed distance value output by the shape sensor Estimate the distance from the sampling point to the center of the camera that emitted the ray as the depth value , No. The depth of a ray to the scene surface is approximated as a weighted sum of the depths along the ray to the camera center: ;
[0029] Step S7, by calculating the signed distance function The spatial gradient at the sampling point is used to approximate the surface normal: , and then to the Ray The spatial gradients of the sampling points are weighted and the normal vector for rendering is calculated: ;
[0030] Step S8: Randomly sample from the input RGB image, depth map and normal map pixels to optimize the scene representation network, rendering the color value , Depth value and the normal vector and the color value of the sampled pixel after preprocessing in step S4 , Depth value and the normal vector The loss is calculated separately, and the true truncated signed distance is expressed as: , Indicates On the ray The depth value of the sampling point, the total loss function is defined as: ;
[0031] in, , , , , , Represents the weight of the corresponding loss, and the truncated signed distance loss is defined as: , color loss is defined as: , the depth loss is defined as: , the normal loss is defined as: ;
[0032] Step S9, extracting a grid model from the trained truncated signed distance function using the Marching Cubes method proposed in Reference 2;
[0033] Document 2: William E. Lorensen, Harvey E. Cline, Marching cubes: A highresolution 3D surface construction algorithm, Seminal graphics: pioneeringefforts that shaped the field, 1998: 347-353.
[0034] So far, from step S1 to step S9, a normal-guided RGB-D scene reconstruction method is completed. Beneficial Effects
[0035] Compared with the existing scene reconstruction technology, the RGB-D scene reconstruction method based on normal guidance in the present invention has the following advantages and beneficial effects:
[0036] 1. Reconstruct a more accurate indoor scene mesh surface based on the characteristics of normal constraints on plane geometry fitting;
[0037] 2. Compared with existing methods, this method focuses more on how to generate smoother indoor scene surfaces;
[0038] 3. It has wide applications in virtual reality, augmented reality, film animation and other fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 This is an example of ScanNet data set data in a normal-guided RGB-D scene reconstruction method of the present invention;
[0040] Figure 2 This is an example of the indoor scene surface remodeling process in a normal-guided RGB-D scene reconstruction method of the present invention;
[0041] Figure 3 It is a normal guidance module in a RGB-D scene reconstruction method based on normal guidance of the present invention; DETAILED DESCRIPTION
[0042] The following is a detailed description of an implementation of an RGB-D scene reconstruction method based on local normal guidance according to the present invention with reference to the accompanying drawings. Example
[0043] This embodiment describes the detailed implementation of applying the normal-guided RGB-D scene reconstruction method of the present invention to reconstruct the mesh surface of an indoor scene.
[0044] The specific implementation steps of the present invention are as follows:
[0045] Step A1: Select the ScanNet dataset, which is a widely used 3D indoor scene dataset. It contains data from 1513 scenes, of which 1201 scenes are used for training and 312 scenes are used for testing. The dataset includes RGB images, depth maps, camera poses, and semantic labels of indoor environments. Select any scene in the dataset and extract RGB images, depth maps, camera poses, and other data from it. Figure 1 As shown, extract the image from the folder isometrically and convert the RGB image and the corresponding depth map, camera posture and other data The number should be controlled within 200-500 to facilitate subsequent training;
[0046] Among them, RGB images with Denote the depth map by The camera posture is expressed by express, , adjust the resolution of all RGB images and depth images to , camera pose : , is a Rotation matrix: , is a The translation vector of : ;
[0047] Step A2: The RGB image at each viewing angle is estimated using the surface normal estimation method proposed in reference 1 to obtain the normal map;
[0048] Document 1: Gwangbin Bae, Andrew J. Davison, Rethinking inductive biases for surface normal estimation, Proceedings of the IEEE / CVF Conference on Computer Vision and Pattern Recognition, 2024: 9535-9545.
[0049] Step A3: The camera posture is transformed from the original coordinate system to the OpenGL coordinate system, and the transformation matrix is: ;
[0050] in, , , represents the transformed camera pose, Indicates the camera posture before conversion. Both the original coordinate system and the OpenGL coordinate system are right-handed coordinate systems. The original coordinate system: +X axis to the right, +Y axis upward, +Z axis outward (pointing outside the screen); the OpenGL coordinate system: +X axis to the right, +Y axis upward, +Z axis forward (pointing into the screen);
[0051] Step A4: Set the scene Preprocessing: RGB images, depth maps, estimated normal maps, and processed camera poses from each perspective;
[0052] Step A4.1, RGB image data matrix To express, Indicates In RGB images OK The pixel points of the column are normalized to In scope: ;
[0053] in, , Indicates a The color vector is: , Represents the normalized color vector;
[0054] Step A4.2, Depth map data matrix To express, Indicates Depth map OK The pixel points of the column are normalized to In scope: ;
[0055] in, Represents a 16-bit grayscale value, Indicates the normalized depth value, 1000 means the depth range collected by the sensor is within 0 to 1000 cm;
[0056] Step A4.3: Matrix for normal map data To express, Indicates In the normal diagram OK The pixel values of the column are normalized to In scope: , and then convert the normalized normal vector into a unit normal vector: ;
[0057] in, is a The color vector is: , which means the direction perpendicular to the scene surface, represents the normalized normal vector, represents the unit normal vector;
[0058] Step A5: Convert the camera posture after step A3 Perform translation and scaling, and translate the vector in the camera attitude matrix The value is controlled at Within the range, translation transformation: , rotation transformation: ;
[0059] in, , , represents the translation parameter, represents the rotation parameter, Represents the transformed camera posture;
[0060] Step A6: In the model, the truncated signed distance function To represent the entire scene, two multi-layer perceptrons (shape perceptron and radiation perceptron) are used to achieve this mixed representation. The reconstruction process is as follows: Figure 2 As shown, do the following sub-steps:
[0061] Among them, the input dimension of the shape multilayer perceptron is 8, the width is 256, and the output dimension is 4, and the input dimension of the radiation multilayer perceptron is 8, the width is 256, and the output dimension is 1;
[0062] Step A6.1: Camera posture according to step A5 Its corresponding RGB image , 1024 rays are emitted from the 3D space position of the camera posture toward the camera direction, in the 256 points are sampled on each ray, and each point is recorded as ;
[0063] in, , , ;
[0064] Step A6.2: The first sampling points, truncated signed distance function The distance from the point to the nearest surface can be returned, and the weights of sampling points outside the cutoff distance can be set to 0, thereby retaining important information of points close to the surface;
[0065] Among them, the truncated signed distance function: , represents the cutoff distance, Represents the corresponding signed distance value: , represents the signed distance function, represents a learnable parameter;
[0066] Step A6.3: Based on the symbol distance value calculated in step A6.2 , according to the formula Calculate weights, sampling points The farther away from the scene surface, the lower the weight;
[0067] in, Represents volume density, whose value is predicted by the network;
[0068] Step A6.4: Use sinusoidal position coding to The first Sampling points To encode: , input the encoded position into the shape sensor, output the signed distance value, and then get the rendered truncated signed distance value according to the truncated signed distance function ;
[0069] in, represents the target dimension of encoding;
[0070] Step A6.5: In the direction of the ray Color features of the shape sensor output As input, output all sampling points on each ray The weighted sum of ;
[0071] in, , No. The weighted sum formula of 256 sampling points on a ray is: ;
[0072] Step A6.6: Signed distance value obtained by shape perception Estimate the distance from the sampling point to the center of the camera that emits the ray as the depth value for rendering , the distance from the scene surface to the camera is approximately The weighted sum of the distances from the 256 sampling points on the ray to the camera center: ;
[0073] Step A7: Normal guidance process Figure 3 As shown, the sampling point coordinates calculated in step 6.4 are sine position encoded As input, calculate the signed distance function The spatial gradient at the sampling point is used to approximate the normal vector of the scene surface: , and then calculate the rendered normal vector by taking the weighted sum of the spatial gradients of the 256 sampling points of each ray: ;
[0074] Step A8: Randomly sample 1024 pixels from the RGB image, depth map, and normal map processed in step A4 to optimize the scene representation network, and convert the color values rendered in step A6.5 into , the color value rendered in step A6.6 , the normal value rendered in step A7 The pixel values of the corresponding sampled RGB images are , the pixel value of the sampled depth map , pixel values of the normal map Compare the loss calculation, the true truncated signed distance is expressed as: , Indicates On the ray The depth value of the sampling point, the total loss function is defined as: ;
[0075] in, , the truncated signed distance loss is defined as: , color loss is defined as: , the depth loss is defined as: , the normal loss is defined as: ,Finally, the entire scene representation network is optimized by minimizing the total loss function through iterative training;
[0076] Step A9, extracting a grid model from the truncated signed distance function using the Marching Cubes method mentioned in Reference 2;
[0077] Document 2: William E. Lorensen, Harvey E. Cline, Marching cubes: A highresolution 3D surface construction algorithm, Seminal graphics: pioneeringefforts that shaped the field, 1998: 347-353.
[0078] The experimental environment is Ubuntu 20.04 operating system, based on the open source deep learning framework Pytorch, and the hardware platform is Intel(R) Xeon(R) Gold 5218R CPU @ 2.10GHz and NVIDIA RTX3090 GPU. This experiment aims to test the reconstruction capability of the normal-guided RGB-D scene reconstruction method mentioned above in this example.
[0079] The ScanNet dataset used in this experiment is a 3D indoor scene dataset, which contains a total of 1513 indoor scenes captured by RGB-D sensors. Each indoor scene contains RGB images, depth maps, camera posture and other data.
[0080] During the training process, each iteration randomly samples from the input image and related data. pixels, and use this input for training.
[0081] Initialize network parameters in the training of the normal-guided RGB-D scene reconstruction method and randomly sample the number of pixels , the number of sampling points on each ray , truncated signed distance , RGB loss weight , depth loss weight , normal loss weight . Set the number of iterations , the accuracy of the grid model finally obtained by training the model is 78.5%.
[0082] 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 structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A normal-guided RGB-D scene reconstruction method, characterized in that: The following steps are involved: S1. Select a public dataset and randomly select a scene from the dataset. Obtain RGB images from multiple perspectives and the corresponding depth map and camera pose matrix T as input data from the scene. Adjust the resolution of the RGB image and depth map to a×b, where a and b are integers. S2, using the surface normal estimation method proposed in document 1 to estimate the normal map of the RGB image under multi-view in step S1; Document 1: Gwangbin Bae, Andrew J. Davison, Rethinking inductive biases for surface normal estimation, Proceedings of the IEEE / CVF Conference on ComputerVision and Pattern Recognition, 2024:9535-9545. S3, convert the camera posture from the original coordinate system to the OpenGL coordinate system; S4, preprocessing the RGB image and the corresponding depth map and normal map data respectively; S5, performing translation and scaling transformation on the camera posture converted in step S3, so that each value in the camera posture matrix is within the range of [-1,1]; S6. The entire network model uses an implicit function to represent the surface. Here, the truncated signed distance function s is used. t To represent the scene surface, two multi-layer perceptrons (shape perceptron and radiation perceptron) are used to implement this hybrid representation. Based on the position and direction of the camera posture transformed in step S5 in the three-dimensional space, m rays are emitted, and the ray directions are {r1, r2, …, r m }, sample e sampling points p equidistantly along the ray direction u,v ,u={1,2,…,m},v={1,2,…,e}, the shape sensor takes the sinusoidal position encoding of the sampling point as input and outputs the signed distance value s(p u,v ), the radiation sensor takes the view direction encoded by the sinusoidal position and the color features of the intermediate output of the shape sensor as input, and outputs the surface color value S7, approximate the surface normal vector n(p) by calculating the spatial gradient of the signed distance function at the sampling point u,v ), and then perform a weighted average of the normal vectors of the sampling points of each ray to calculate the final rendered normal vector S8, randomly sampling m pixels from the input RGB image, depth map and normal map respectively to optimize the scene representation network, for each pixel, using its camera posture to generate m rays, sampling a set of points along the rays, and calculating the loss value by comparing the color, depth value and normal value rendered by the rays with the input true value respectively, reducing the loss value through training, and optimizing the truncated signed distance function; S9, using the Marching Cubes method proposed in Reference 2 to extract the grid model from the trained truncated signed distance function; Document 2: William E. Lorensen, Harvey E. Cline, Marching cubes: A high resolution 3D surface construction algorithm, Seminal graphics: pioneering efforts that shaped the field, 1998: 347-353.
2. The RGB-D scene reconstruction method based on normal guidance according to claim 1, characterized in that: In step S4, the normal map is preprocessed and the kth normal map is transformed into a matrix To express, The pixel in row i and column j of the k-th normal image, is a 3×1 color vector: Its meaning indicates the direction of three-dimensional space, and the pixel value is normalized to the range of [-1,1]: represents the normalized normal vector, and then the normalized normal vector modulus is set to 1 to obtain the unit normal vector: represents the unit normal vector; Among them, i={1,2,…,a},j={1,2,…,b}.
3. The RGB-D scene reconstruction method based on normal guidance according to claim 1, characterized in that: In step S7, the signed distance value s(p u,v ) Estimate the sampling point p u,v The spatial gradient of is used to approximate the surface normal vector: Then take the weighted sum of the spatial gradients of the e sampling points of the u-th ray to get the rendered normal vector: Where u = {1, 2, ..., m}, v = {1, 2, ..., e}, s represents the signed distance function, ω u,v Represents the weight of each sampling point, which is obtained according to the signed distance function: σ represents the volume density, whose value is predicted by the network, and tr represents the cutoff distance value.
4. The RGB-D scene reconstruction method based on normal guidance according to claim 1, characterized in that: In step S8, the normal rendered in step S7 is compared with the input normal data to obtain the loss function according to the Euclidean norm: Where u = {1, 2, ..., m}, n' u represents the normal vector after preprocessing in step S4, Represents the normal vector for rendering.
