Three-dimensional reconstruction method of indoor scenes in breeding houses based on straight line sampling and straight line constraints

By using straight line sampling and straight line constraint methods in the three-dimensional reconstruction of the scene in the breeding house, combined with neural radiation fields and volume rendering, and using normals and depth maps as constraints, the problem of low reconstruction accuracy in textureless areas is solved and high accuracy is achieved. Quality 3D reconstruction.

CN118365808BActive Publication Date: 2024-08-30INST OF AGRI ECONOMY & INFORMATION AAAS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410802641.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-08-30
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

Existing technology is difficult to handle textureless and planar areas in the 3D reconstruction of scenes in breeding houses, resulting in low reconstruction accuracy and geometric-radiation ambiguity problems. Traditional multi-view stereo matching algorithms and depth camera noise affect stability. Based on implicit Neural representation methods are difficult to generate high-quality three-dimensional models in textureless areas.

Method used

Using a method based on straight line sampling and straight line constraints, through neural radiation field (NeRF) combined volume rendering, using normal maps and depth maps as geometric constraints, and performing straight line feature detection and matching on multi-view images, adding straight line constraints to improve 3D reconstruction quality.

Benefits of technology

It effectively reduces geometric distortion and deformation, improves the quality of three-dimensional reconstruction of the environment inside the breeding house, ensures the generation of geometric details and texture details in texture-free areas, and significantly improves reconstruction accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118365808B
    Figure CN118365808B
Patent Text Reader

Abstract

The present invention discloses a 3D reconstruction method for a scene in a breeding house based on straight line sampling and straight line constraints. In order to make full use of the advantages of implicit 3D reconstruction, a framework based on neural radiation field and volume rendering is adopted to perform 3D reconstruction of the indoor scene of the breeding house. In order to reduce the problem of geometric distortion and deformation that easily occurs in the 3D reconstruction of the indoor environment of the breeding house based on implicit representation, geometric priors are added as additional constraints, including depth and normal constraints. In order to improve the reconstruction quality of the indoor scene, an additional straight line feature is added as a constraint to regularize the volume rendering to further improve the reconstruction quality of the indoor environment of the breeding house. The present invention avoids the problem of geometric distortion and deformation that occurs in the 3D reconstruction of the indoor environment of the breeding house.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to three-dimensional reconstruction and image processing technology, and in particular to a three-dimensional reconstruction method for a scene in a breeding house based on straight line sampling and straight line constraints. Background Art

[0002] The 3D reconstruction of scenes inside farms is the research foundation and key technology for smart farming, farming monitoring and detection and other smart agricultural applications. However, the environment inside the farm is simple, with a large number of areas with single structures and textures, which poses a huge challenge to the 3D reconstruction algorithm of scenes inside farms.

[0003] The 3D reconstruction algorithm based on traditional methods usually uses the Multi-View Stereo (MVS) method for 3D reconstruction. The multi-view stereo matching algorithm uses manually designed features and similarity metrics to calculate dense correspondences, and then restores the 3D point cloud of the scene based on the epipolar constraints of the corresponding feature points. Although these methods have good reconstruction results for scenes with rich textures, due to the large number of textureless plane areas in the scenes of the breeding house, these traditional multi-view algorithms are difficult to reconstruct satisfactory results, so it is difficult to apply them to applications such as smart breeding. Since the depth camera can capture the depth information of the scene, the stability and accuracy of camera tracking in the breeding house environment where there are a large number of textureless areas have been greatly improved. Newcombe et al. first proposed a 3D reconstruction algorithm based on RGB-D cameras called KinectFusion. The algorithm uses the nearest neighbor iteration to track and locate the RGB-D camera in real time, and introduces the truncated signed distance field (TSDF) to implicitly represent the reconstructed 3D surface and fuse the depth data, and finally obtain a high-quality 3D reconstruction model. However, due to the high noise, low resolution, limited measurement range and susceptibility to light of depth cameras, camera drift is prone to occur in indoor scenes with a large number of weakly textured planar areas. Therefore, the three-dimensional reconstruction of the indoor environment of the breeding house based on depth cameras inevitably has the problem of low reconstruction accuracy.

[0004] With the continuous development and progress of deep learning technology, some deep learning-based methods have begun to try to introduce implicit neural representation for 3D reconstruction. Implicit neural representation can continuously represent 3D geometric shapes in 3D space, so in theory, 3D models of arbitrary resolution can be generated. Therefore, implicit neural representation, as an emerging scene representation method, has received extensive research and attention in recent years. Mildenhall et al. combined Neural Radiance Fields (NeRF) with volume rendering to achieve photo-realistic image rendering. This method only needs to input multi-view images of objects or scenes as supervision conditions to generate implicit neural representations corresponding to the images, thereby completing photo-realistic new view synthesis in complex scenes. Inspired by NeRF, a series of subsequent works verified the powerful expression ability of NeRF in implicit representation 3D reconstruction and reconstructed amazing 3D reconstruction effects. However, since indoor scenes contain a large number of textureless areas and planar areas, the 3D reconstruction algorithm based on implicit representation inevitably encounters the problem of Shape-Radiance Ambiguity.

[0005] In order to solve this problem, some methods began to add additional geometric priors and semantic priors as regularization terms to alleviate the problem of low accuracy of the reconstructed model caused by geometric-radiance ambiguity, such as plane, normal and semantic information. However, these methods generally use point sampling. Since there are a large number of textureless plane areas in the scene of the breeding house, most of the sampling points will fall in the textureless plane area during random sampling. In 3D reconstruction, geometric details basically do not appear in these areas, resulting in the lack of geometric details and texture details at the points in the plane area. Therefore, using these points to constrain the 3D reconstruction based on implicit representation cannot obtain satisfactory 3D reconstruction results for the scene in the breeding house. Summary of the invention

[0006] Purpose of the invention: The purpose of the present invention is to solve the deficiencies in the prior art and to provide a three-dimensional reconstruction method for scenes in a breeding house based on straight line sampling and straight line constraints.

[0007] Technical solution: A three-dimensional reconstruction method for a scene in a breeding house based on straight line sampling and straight line constraints of the present invention comprises the following steps:

[0008] Step 1: Obtain color images of different viewing angles in the breeding house, and use the stereo matching algorithm Colmap to calculate the camera posture T corresponding to each image; use the camera posture T to fuse the information of different viewing angles to obtain the initial point cloud model M; at the same time, based on the fused initial point cloud model M, use the estimated camera posture T to back-project the point cloud model M to each viewport to obtain the depth map D corresponding to the viewport;

[0009] Step 2: performing denoising and sharpening preprocessing on the original multi-view color image obtained in step 1;

[0010] Step 3: For the preprocessed image, a normal estimation method based on a single image is used to obtain a normal map N corresponding to each color image;

[0011] Step 4: Input the multiple original view images from step 1 into Neural Radiance Fields (NeRF) to obtain a 3D reconstructed model. At the same time, the normal map N and the depth map D are used as additional geometric constraints to regularize the 3D reconstructed model. The specific method is as follows:

[0012] Step 4.1, performing random point sampling and volume rendering on the input multi-view image;

[0013] Step 4.2: Perform line feature detection on the input multi-view images to obtain all straight line features on each image, and then use the feature matching algorithm to perform straight line matching on the images of adjacent viewpoints. The straight line matching method here is: for adjacent viewpoints, randomly sample a viewport as an auxiliary viewport from a viewport whose rotation angle does not exceed 15 degrees or whose movement distance does not exceed 0.5 meters;

[0014] Step 4.3, point sampling loss function: first randomly sample 1024 pixels in each viewport, use NeRF and volume rendering to calculate the color value, depth value and normal value of the pixel, and then use the rendered color value, depth value and normal value together with the original color image, the depth value obtained in step 1 and the normal value obtained in step 3 as supervision to ensure that the color, depth and normal generated by the rendering should be as similar as possible to the color of the original color image, the depth obtained in step 1 and the normal obtained in step 3, that is, the color consistency, depth consistency and normal consistency constraints, so that the parameters of NeRF can be effectively trained;

[0015] Step 4.4, line sampling loss function: In order to improve the quality of reconstruction by constraining NeRF with straight line features, 10 straight lines are randomly sampled as new features in the straight line features of straight line detection on each image at a time while sampling. First, all the pixels falling on the straight line are used to calculate each color, depth and normal according to the point sampling in step 4.3, and the point sampling loss is used to constrain them. At the same time, because these points fall on the same straight line, the straight line constraint is added, and the projection points of all these sampled pixel points in the three-dimensional space should be collinear; in addition, these three-dimensional points projected to the auxiliary viewport should fall on the corresponding matching straight line.

[0016] Furthermore, the step 2 uses a 3×3 convolution to perform convolution processing on images of all viewing angles.

[0017] Furthermore, the detailed method of point sampling and volume rendering in step 4.1 is as follows:

[0018] Given the coordinate position x and line of sight direction r of any point in three-dimensional space, two multi-layer perceptrons are used to estimate the value s and color c of the signed distance field (SDF) of the current position respectively;

[0019] Then, the density function of each sampling point position x is estimated based on the SDF value of the sampling point in space and the distance from the sampling point to the surface of the object. , The calculation formula is as follows:

[0020] (1)

[0021] is a control parameter, for example, it can be set to 0.25, the density function To represent the probability that the light is blocked when passing through the current position x;

[0022] At this point, the color value of each pixel on the original view image is obtained by integrating the color and density of all sampling points in the line of sight direction. :

[0023] (2)

[0024] in, k is the index of the sampling point on the line of sight, δ is the distance between adjacent sampling points, Indicates how much light can propagate to x; The first k The density value of the sampling points, Indicates sampling points and The distance between sampling points;

[0025] The rendering method of formula (2) can be used to re-render the entire image, and then the difference between the rendered image and the original view image is used to optimize the parameters of the multi-layer perceptron in NeRF using gradient propagation.

[0026] Furthermore, the detailed method of step 4.2 is:

[0027] First, all the straight lines on each image are extracted using the line detection operator, and a random viewport image is selected from other viewport images closest to the current viewport as an auxiliary image;

[0028] Then, the feature matching algorithm is used to calculate the straight line matching pairs between them; the lines are sampled at the same time as the point sampling, that is, 10 straight lines (line features) are randomly sampled in each image to participate in the NeRF-based calculation and volume rendering;

[0029] Calculate the color, depth, and normal of all pixels on the line in the same way as point sampling (step 4.3 describes the calculation process of pixels on the line), and use the color of the original image, as well as the estimated depth map and normal map as regularization for supervision;

[0030] In order to utilize the straight line constraint, the assumption that all the three-dimensional space points corresponding to the straight line features are collinear is used as the straight line constraint to improve the quality of surface reconstruction;

[0031] Assuming that the coordinates of the two endpoints of the line in space are A and B, then the distance from any point P on the line to AB is:

[0032] (3)

[0033] Next, the auxiliary line constraint projects the obtained 3D points onto the corresponding auxiliary viewport, so that the obtained 3D points all fall on the matching line of the auxiliary viewport image. Using the camera posture T estimated in step 1, we project the 3D space line AB corresponding to the pixel points on the line onto the corresponding auxiliary viewport color image using the camera posture and camera intrinsic parameters of the auxiliary viewport to obtain the line A'B', then all the points on the line A'B' should fall on the matching line.

[0034] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0035] (1) The present invention adopts a framework based on neural radiation field and volume rendering to perform three-dimensional reconstruction of the indoor scene of the breeding house. By adding geometric priors as additional constraints (depth and normal constraints), the problem of geometric distortion and deformation that is prone to occur in the three-dimensional reconstruction of the breeding house environment is reduced.

[0036] (2) The present invention further improves the quality of the reconstruction of the environment inside the breeding house by adding additional straight line features as constraints to regularize the volume rendering. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a schematic diagram of the overall framework of the present invention;

[0038] Figure 2 It is a schematic diagram of the straight line matching process in the present invention;

[0039] Figure 3 It is a schematic diagram comparing the present invention with the existing solution in the embodiment; wherein, Figure 3 (a) is the reconstruction result of the present invention using geometric priors and straight line constraints, Figure 3 (b) is a schematic diagram of the reconstruction result when the prior art does not apply these constraints. DETAILED DESCRIPTION

[0040] The technical solution of the present invention is described in detail below, but the protection scope of the present invention is not limited to the embodiments.

[0041] Existing reconstruction methods often add additional geometric priors and semantic priors as regularization terms to alleviate the problem of low accuracy of the reconstructed model caused by geometric-radiance ambiguity, such as planes, normals, and semantic information. However, due to the large number of textureless plane areas in the scenes of the breeding house, most of its sampling points fall within the textureless plane areas. To solve this technical problem, the present invention proposes a 3D reconstruction strategy that combines straight line sampling and straight line constraints to ensure that effective geometry generation can be obtained in the boundary areas with rich geometric details.

[0042] like Figure 1 As shown, the three-dimensional reconstruction method of the scene in the breeding house based on straight line sampling and straight line constraint of the present invention comprises the following steps:

[0043] Step 1: Obtain color images of different viewing angles in the breeding house, and use the stereo matching algorithm Colmap to calculate the camera posture T corresponding to each image; use the camera posture T to fuse the information of different viewing angles to obtain the initial point cloud model M; based on the fused initial point cloud model M, use the estimated camera posture T to back-project the point cloud model M to each viewport to obtain the depth map D corresponding to the viewport (using the existing calculation method);

[0044] Step 2: performing denoising and sharpening preprocessing on the original multi-view color image obtained in step 1;

[0045] Step 3: For the preprocessed image, a normal estimation method based on a single image is used to obtain a normal map N corresponding to each color image;

[0046] Step 4: Input the multiple original view images of step 1 into the neural radiation field NeRF to obtain a 3D reconstruction model. At the same time, the normal map N and the depth map D are used as additional geometric constraints to regularize the 3D reconstruction model. The specific method is as follows:

[0047] Step 4.1, perform random point sampling and volume rendering on the input multi-view image (using the existing volume rendering method);

[0048] Step 4.2, perform line feature detection on the input multi-view image to obtain all straight line features on each color image, and then use the feature matching algorithm to perform line matching on the images of adjacent viewpoints. The adjacent viewpoint refers to randomly sampling a viewport from all viewports within a rotation angle of no more than 15 degrees or a movement distance of no more than 0.5 meters as an auxiliary viewport of the current viewport;

[0049] Step 4.3, point sampling loss function: first randomly sample 1024 pixels in each current viewport, use NeRF and volume rendering to calculate and render the color value, depth value and normal value of each pixel (the method for obtaining the depth value and normal value of each pixel here is consistent with step 1 and step 2, and the existing method can be used), and then use the rendered color, depth value and normal value and the original color map as well as the depth value (i.e., depth map D) and normal value (i.e., normal map N) as supervision to ensure the rendered color; color consistency, depth consistency and normal consistency constraints are required here to train the parameters of NeRF;

[0050] Step 4.4, line sampling loss function: While sampling points, randomly sample 10 lines from the line features of the line detection on each image as new features each time; use all the pixel points falling on the line to calculate each color, depth and normal according to step 4.3 point sampling, and use point sampling loss to constrain the color, depth and normal. At the same time, since all the sampling points fall on the same line, add a line constraint so that the projection points of all the sampling points in the three-dimensional space should be collinear. Here, when using NeRF volume rendering, position encoding must be performed first (that is, projecting the quantity in the low-dimensional space into the high-dimensional space to capture more high-frequency signals), such as Figure 1 middle and The current calculation method is as follows:

[0051] ;

[0052] Represents the three-dimensional coordinates of the sampling point in space, .

[0053] This embodiment of The value of L can be 10. The value of L in can be 4; by encoding the spatial sampling point position x and the line of sight direction of the point position x respectively r Position encoding is performed to capture as much high-frequency detail as possible.

[0054] like Figure 2 As shown, the detailed method of line sampling and line constraint in this embodiment is:

[0055] First, all the straight lines on each image are extracted using the line detection operator, and a random viewport image is selected from other viewport images closest to the current viewport as an auxiliary image;

[0056] Then, the feature matching algorithm is used to calculate the straight line matching pairs between them; the lines are sampled at the same time as the point sampling, that is, 10 straight lines (line features) are randomly sampled in each image to participate in the NeRF-based calculation and volume rendering;

[0057] Calculate the color, depth, and normal of all pixels on the line in the same way as point sampling (step 4.3 describes the calculation process of pixels on the line), and use the color of the original image, as well as the estimated depth map and normal map as regularization for supervision;

[0058] In order to utilize the straight line constraint, the assumption that all the three-dimensional space points corresponding to the straight line features are collinear is used as the straight line constraint to improve the quality of surface reconstruction;

[0059] Assuming that the coordinates of the two endpoints of the line in space are A and B, then the distance from any point P on the line to AB is:

[0060] (3)

[0061] Next, the auxiliary line constraint projects the obtained 3D points onto the corresponding auxiliary viewport, so that the obtained 3D points all fall on the matching line of the auxiliary viewport image. Using the camera posture T estimated in step 1, we project the 3D space line AB corresponding to the pixel points on the line onto the corresponding auxiliary viewport color image using the camera posture and camera intrinsic parameters of the auxiliary viewport to obtain the line A'B', then all the points on the line A'B' should fall on the matching line.

[0062] like Figure 3 As shown, this embodiment makes an experimental comparison between the existing NeRF method and the technical solution of the present invention. Figure 3 (a) shows the reconstruction result of the present invention using geometric priors and straight line constraints. Figure 3 (b) shows the reconstruction results of the existing NeRF method without using these constraints. Figure 3 It can be seen that the present invention reduces the problem of geometric distortion and deformation that easily occurs in the three-dimensional reconstruction of the environment inside the breeding house by adding geometric priors as additional constraints (depth and normal constraints). The quality of the reconstruction of the environment inside the breeding house is significantly better than that of the existing solutions.

Claims

1. A 3D reconstruction method for scenes in a breeding house based on straight line sampling and straight line constraints. It is characterized in that The following steps are involved: Step 1: Obtain color images of different viewing angles in the breeding house, and use the stereo matching algorithm Colmap to calculate the camera posture T corresponding to each image; use the camera posture T to fuse the information of different viewing angles to obtain the initial point cloud model M; According to the fused initial point cloud model M, using the estimated camera posture T, the point cloud model M is back-projected to each viewport to obtain the depth map D corresponding to the viewport; Step 2: performing denoising and sharpening preprocessing on the original multi-view color image obtained in step 1; Step 3: For the preprocessed image, a normal estimation method based on a single image is used to obtain a normal map N corresponding to each color image; Step 4: Input the multiple original view images of step 1 into the neural radiation field NeRF to obtain a 3D reconstruction model. At the same time, the normal map N and the depth map D are used as additional geometric constraints to regularize the 3D reconstruction model. The specific method is as follows: Step 4.1, performing random point sampling and volume rendering on the input multi-view image; Step 4.2, perform line feature detection on the input multi-view image to obtain all straight line features on each color image, and then use the feature matching algorithm to perform line matching on the images of adjacent viewpoints. The adjacent viewpoint refers to randomly sampling a viewport from all viewports within a rotation angle of no more than 15 degrees or a movement distance of no more than 0.5 meters as an auxiliary viewport of the current viewport; Step 4.3, point sampling loss function: first randomly sample 1024 pixels in each current viewport, use NeRF and volume rendering to calculate and render the color value, depth value and normal value of each pixel, and then use the rendered color, depth value and normal value with the original color image as well as the depth value and normal value as supervision to ensure the rendered color; color consistency, depth consistency and normal consistency constraints are required here to train the parameters of NeRF; Step 4.4, line sampling loss function: while sampling points, randomly sample 10 lines from the line features of the line detection on each image as new features each time; use all the pixels falling on the line to calculate the color, depth and normal of each pixel according to the point sampling method in step 4.3, and use the point sampling loss to constrain the color, depth and normal. At the same time, since all the sampling points on the line fall on the same line, these sampling points belong to the same line in three-dimensional space, and add a line constraint so that the projection points of all sampling points in three-dimensional space should be collinear; The detailed method of step 4.2 above is: First, all straight lines on each color image are extracted using a line detection operator, and a random viewport image is selected from other viewport images closest to the current viewport as an auxiliary image; and a feature matching algorithm is used to calculate the straight line matching pairs between the current viewport and the auxiliary viewport; The details of step 4.4 above are: While sampling points, 10 line features are randomly sampled on each color image to participate in NeRF-based calculation and volume rendering; Assuming that the coordinates of the two endpoints of the line in space are A and B respectively, then the distance calculation formula from any point P on the line to AB is as follows: (3) Next, the auxiliary straight line constraint projects the obtained 3D points onto the corresponding auxiliary viewport, so that the obtained 3D points all fall on the straight line matched by the auxiliary viewport image; Using the camera posture T obtained in step 1, the straight line AB in the three-dimensional space corresponding to the pixel points on the straight line is projected onto the corresponding auxiliary viewport color image using the camera posture and camera intrinsic parameters of the auxiliary viewport to obtain the straight line A'B'. Then all the points on the straight line A'B' should fall on the matching straight line.

2. The method for three-dimensional reconstruction of a scene in a breeding house based on straight line sampling and straight line constraints according to claim 1, It is characterized in that The step 2 uses a 3×3 convolution to perform convolution processing on images of all viewing angles.

3. The method for three-dimensional reconstruction of a scene in a breeding house based on straight line sampling and straight line constraints according to claim 1, It is characterized in that The detailed method of point sampling and volume rendering in step 4.1 is as follows: Given the coordinate position x and sight direction r of any point in three-dimensional space, two multi-layer perceptrons are used to estimate the SDF value s and color c of the signed distance field at the current position respectively; Then, the density function of each sampling point position x is estimated based on the SDF value of the sampling point in space and the distance from the sampling point to the surface of the object. , The calculation formula is as follows: (1) is the control parameter, the density function To represent the probability that the light is blocked when passing through the current position x; At this point, the color value of each pixel on the original view image is obtained by integrating the color and density of all sampling points in the line of sight direction. : (2) in, k is the index of the sampling point on the line of sight, is the distance between adjacent sampling points, How much light can propagate to until; The first k The density value of the sampling points, Indicates sampling points and The distance between sampling points; Then, the entire image is re-rendered using formula (2), and the difference between the rendered image and the original view image is used to optimize the parameters of the multi-layer perceptron in NeRF using gradient propagation.

Citation Information

Patent Citations

  • Three-dimensional reconstruction method and system for indoor scene

    CN116797742A

  • Neural implicit curved surface reconstruction method based on deep fusion constraint

    CN117745932A