A three-dimensional model reconstruction method and device

By segmenting and processing the data collected by the RGBD camera, a high-precision geometric and texture model is generated, which solves problems such as texture gaps and texture misalignment, improves the reconstruction accuracy and efficiency of the 3D model, and achieves high-precision 3D model reconstruction.

CN114049464BActive Publication Date: 2024-09-27JUHAOKAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111347495.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-15
Publication Date
2024-09-27
Estimated Expiration
2041-11-15

AI Technical Summary

Technical Problem

In the existing 3D model reconstruction technology, texture reconstruction has problems such as texture gaps and texture misalignment, resulting in low texture reconstruction quality. Moreover, the texture space of the machine learning-based method is too smooth and the resolution is low, making it difficult to obtain a high-precision 3D model.

Method used

Use the trained model to segment the depth map and RGB image collected by the RGBD camera, generate the target depth map and target RGB image, obtain a high-precision geometric model through upsampling and smoothing, and combine it with the high-resolution RGB image for texture Mapping, reducing texture gaps and texture misalignment, and improving texture accuracy.

Benefits of technology

It improves the reconstruction accuracy of 3D models, reduces texture gaps and texture misalignment problems, does not require manual participation, improves reconstruction efficiency and texture accuracy, and is suitable for high-precision 3D model reconstruction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114049464B
    Figure CN114049464B
Patent Text Reader

Abstract

The present application relates to the technical fields of computer vision and computer graphics, and provides a method and device for reconstructing a three-dimensional model. The method and device adopt a trained model, and generate an initial geometric model and an initial texture model based on the original depth map collected by each common civilian-grade RGBD camera and the image after preprocessing the original RGB image. The initial geometric model is upsampled and smoothed to obtain a more refined, more realistic and natural target geometric model. Furthermore, according to the calibration results of each RGBD camera and the collected original RGB image, the color value of each vertex on the target geometric model is obtained to obtain a target texture model consistent with the target geometric model, thereby reducing the problems of texture gap, texture misalignment, and uneven texture illumination when the target geometric model is mapped to the high-resolution RGB image, without the need for artificial parameters, and improving the reconstruction efficiency and texture accuracy, thereby improving the accuracy of the reconstructed three-dimensional model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of computer vision and computer graphics, and in particular to a method and device for reconstructing a three-dimensional model. Background Art

[0002] The reconstruction of people or objects in the field of 3D reconstruction mainly includes two parts, namely, geometric reconstruction to display the external contour of the model and texture reconstruction to display the color of the model's appearance. Among them, texture reconstruction is performed after geometric reconstruction, mainly to color each vertex and face of the 3D model, that is, to obtain the RGB value of each vertex on the spatial geometric model, and then perform texture calculation on the RGB values ​​of the three vertices contained in each triangular face to obtain the color value of the corresponding face, thereby completing the texture reconstruction of the entire model.

[0003] At present, there are two main ways to reconstruct textures: one is a texture reconstruction method based on traditional graphics. This method maps the RGB images of multiple perspectives to the geometrically reconstructed three-dimensional model. First, the geometric vertices of the three-dimensional model are matched one by one with the UV coordinates of the pixels in the RGB image, and then the texture calculation is performed on the triangular facets. This method can obtain a high-precision texture reconstruction model, but if the graphics algorithm is used for automatic mapping, there will be problems such as texture gaps and texture dislocations, which will reduce the quality of texture reconstruction. Therefore, animators need to manually correct the mapping relationship. The second is a texture reconstruction method based on machine learning. This method reconstructs the texture of the entire geometrically reconstructed three-dimensional model based on a single RGB image. Due to the lack of color data, this method uses Generative Adversarial Networks (GAN) for reasoning and infers the texture space of the entire three-dimensional model based on limited visible color data. This method can avoid the problems of texture gaps and texture dislocations, but there is no texture splicing and synthesis process, which results in the texture space being too smooth, the texture reconstruction resolution being low, and the effect being poor. Summary of the invention

[0004] The embodiments of the present application provide a method and device for reconstructing a three-dimensional model, so as to improve the reconstruction accuracy of the three-dimensional model.

[0005] In a first aspect, an embodiment of the present application provides a method for reconstructing a three-dimensional model, comprising:

[0006] Obtain the original depth map and original RGB image synchronously collected by each calibrated RGBD camera;

[0007] According to each original RGB image, generate an RGB image of the same resolution corresponding to the corresponding original depth map;

[0008] According to the mask images corresponding to the respective original depth maps, the corresponding original depth maps and the RGB images with the same resolution are segmented respectively to obtain the corresponding target depth maps and target RGB images;

[0009] Using the trained model, the initial geometric model and initial texture model of the target object are obtained according to each target depth map and each target RGB image;

[0010] Upsampling the initial geometric model to obtain a target geometric model, and smoothing vertex data at seams of the target geometric model;

[0011] According to the calibration results of each RGBD camera, the color value of each vertex on the target geometric model is obtained from each original RGB image to obtain a target texture model;

[0012] A three-dimensional model of the target object is reconstructed according to the target geometric model and the target texture model.

[0013] In a second aspect, an embodiment of the present application provides a reconstruction terminal, including a display, a memory, at least one external communication interface and a processor, wherein the display, the memory, the at least one external communication interface and the processor are connected via a bus;

[0014] The memory stores computer program instructions, and the processor performs the following operations according to the computer program instructions:

[0015] Acquire, through the at least one external communication interface, the original depth map and the original RGB image synchronously acquired by each calibrated RGBD camera;

[0016] According to each original RGB image, generate an RGB image of the same resolution corresponding to the corresponding original depth map;

[0017] According to the mask images corresponding to the respective original depth maps, the corresponding original depth maps and the RGB images with the same resolution are segmented respectively to obtain the corresponding target depth maps and target RGB images;

[0018] Using the trained model, the initial geometric model and initial texture model of the target object are obtained according to each target depth map and each target RGB image;

[0019] Upsampling the initial geometric model to obtain a target geometric model, and smoothing vertex data at seams of the target geometric model;

[0020] According to the calibration results of each RGBD camera, the color value of each vertex on the target geometric model is obtained from each original RGB image to obtain a target texture model;

[0021] A three-dimensional model of the target object is reconstructed according to the target geometric model and the target texture model, and displayed on the display.

[0022] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to enable a reconstruction terminal to execute the three-dimensional model reconstruction method provided by the embodiment of the present application.

[0023] The above-mentioned embodiments of the present application are applicable to common civilian-grade RGBD cameras. For the original depth map collected by each RGBD camera, a corresponding depth map with the same resolution is generated, and the original depth map and the RGB image with the same resolution are segmented by a mask image. The trained model is used to obtain the initial geometry model and the initial texture model according to the segmented target depth map and the target RGB image. Since the depth resolution of the RGBD camera is low, the accuracy of the initial geometry model and the initial texture model is low. Therefore, the initial geometry model is upsampled to obtain a more refined target geometry model, and the target geometry model is smoothed to make the target geometry model more realistic and natural. Furthermore, according to the calibration results of each RGBD camera and the collected original RGB image, the color values ​​of each vertex on the target geometry model are obtained to obtain a target texture model consistent with the target geometry model. Since the RGB image of the RGBD camera has a high resolution, it can meet the reconstruction requirements of high-precision models. By upsampling the initial geometric model, when the target geometric model is texture mapped with the high-resolution RGB image, problems such as texture gap, texture misalignment, and uneven texture illumination are reduced. No artificial parameters are required, which improves the reconstruction efficiency and texture accuracy, thereby improving the accuracy of the reconstructed 3D model. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0025] Figure 1 The following is an exemplary diagram of the acquisition system architecture provided by the embodiment of the present application;

[0026] Figure 2The flowchart of the calibration method of each RGBD camera provided in the embodiment of the present application is exemplarily shown;

[0027] Figure 3 The flowchart of the reconstruction method of the three-dimensional model provided in the embodiment of the present application is exemplarily shown;

[0028] Figure 4 The deep learning network model provided by the embodiment of the present application is exemplified;

[0029] Figure 5 The flowchart of the upsampling method provided in the embodiment of the present application is exemplarily shown;

[0030] Figure 6 The flowchart of the reconstruction process of the target texture model provided by the embodiment of the present application is exemplarily shown;

[0031] Figure 7 The structure diagram of a reconstruction terminal provided in an embodiment of the present application is exemplarily shown. DETAILED DESCRIPTION

[0032] In order to make the purpose, implementation mode and advantages of the present application clearer, the exemplary implementation mode of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0033] Based on the exemplary embodiments described in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the claims attached to this application. In addition, although the disclosure in this application is introduced according to one or several exemplary examples, it should be understood that each aspect of the disclosure can also constitute a complete implementation method separately.

[0034] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.

[0035] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover but not exclude inclusion, for example, a product or device comprising a series of components is not necessarily limited to those components clearly listed, but may include other components not clearly listed or inherent to these products or devices.

[0036] The term "module" as used in this application refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic or combination of hardware and / or software code that is capable of performing the functions associated with that element.

[0037] Three-dimensional reconstruction involves shape, motion and material data. First, it is necessary to obtain collected data from various sensor devices, and then use the three-dimensional reconstruction method to process the collected data to reconstruct the three-dimensional model.

[0038] In recent years, with the continuous development of imaging technology, visual 3D reconstruction technology based on RGB cameras has gradually become a research hotspot. Subsequently, the emergence of RGBD cameras and the proposal and optimization of dense SLAM algorithms have further improved the quality and efficiency of 3D reconstruction.

[0039] 3D reconstruction is a key frontier issue in the fields of computer vision and computer graphics. This technology can be widely used in the fields of augmented reality, remote immersive communication, 3D video live broadcast, etc. It has changed the way people socialize and has high research value. Compared with the social system based on 2D video, the social system of real-time 3D reconstruction reproduces the face-to-face immersion in the first generation of social methods.

[0040] The core technologies of the remote 3D social system involve real-time 3D reconstruction technology, 2D or 3D data encoding and decoding and transmission technology, immersive rendering display technology, etc. Among them, 3D reconstruction data includes vertex data, patch data, and texture data that describe 3D geometry. Vertex data includes vertex position, vertex normal, and vertex color. Based on these data, 3D reconstruction of geometry and texture is performed.

[0041] Three-dimensional reconstruction mainly includes two steps: geometric reconstruction and texture reconstruction. Among them, texture reconstruction is performed after geometric reconstruction. First, the RGB value of each vertex on the spatial geometric model is obtained, and then the texture calculation is performed on the RGB values ​​of the three vertices contained in each triangular face to obtain the color value of the corresponding face, thereby completing the texture reconstruction of the entire model. At present, texture reconstruction mainly includes texture reconstruction methods based on traditional graphics and texture reconstruction methods based on machine learning.

[0042] In the texture reconstruction method based on traditional graphics, one or more RGB images of the target object are analyzed and processed to generate a point cloud of the three-dimensional model of the target object. For each point in the point cloud, the pixel corresponding to the point is found from the RGB image, and the color value of the corresponding pixel is used as the color value of the point. Further, the color value of the corresponding triangular patch is obtained based on the color mean of the three points. This method can obtain a high-precision texture reconstruction model, but if the graphics algorithm is used for automatic mapping, there will be problems such as texture gaps and texture misalignment, which reduces the quality of texture reconstruction. Therefore, the animator needs to manually correct the mapping relationship.

[0043] In the texture reconstruction method based on machine learning, machine learning and deep learning methods are used to construct a GAN network. This network is a semi-supervised model. By training a large number of samples, incomplete input data can be completed to obtain a complete input data based on learning. This input data can be a two-dimensional RGB image, or a three-dimensional point cloud or mesh model. This method inputs a front RGB image of the target object into the trained GAN network to generate a texture model that corresponds one-to-one with the geometric model, thereby completing the texture reconstruction of the three-dimensional model. This method can avoid the problems of texture gaps and texture misalignment, but there is no texture splicing and synthesis process, which results in the texture space being too smooth, the resolution of the reconstructed texture is low, and the effect is poor.

[0044] In areas where reconstruction requires high precision (such as film, television, games, animation and other industries), high-quality geometry and texture reconstruction requires expensive multi-camera array "bird cages" and other professional equipment and professional personnel. Moreover, this reconstruction is non-real-time and requires a lot of time to obtain a high-precision three-dimensional model.

[0045] High-precision texture reconstruction requires high-resolution RGB information, which needs to correspond to the number of vertices of the geometric model. However, the depth resolution of the current civilian-grade RGBD cameras is low, generally 640*576 (pixels), and cannot directly reconstruct high-precision, high-vertex-count and high-facet geometric models. Therefore, when high-resolution RGB information is texture mapped with low-resolution geometric models, serious problems such as texture gaps, texture misalignment, and uneven texture illumination will occur. If low-resolution texture reconstruction and machine learning-based texture inference methods are used, the lack of actual data will lead to inaccurate and unrealistic texture space, resulting in low precision of texture reconstruction and difficulty in obtaining high-precision 3D models.

[0046] In view of this, the embodiments of the present application provide a method and device for reconstructing a three-dimensional model, which can start and efficiently perform texture reconstruction for high-resolution RGB images and low-resolution depth maps collected by ordinary civilian-grade RGBD cameras. Compared with texture reconstruction based on traditional graphics, no human intervention is required, which avoids problems such as texture gaps and texture misalignment, which reduces the quality of texture reconstruction; compared with texture reconstruction methods based on machine learning, the resolution of the texture model is improved. Therefore, when reconstructing a three-dimensional model based on the texture model and geometric model provided in the embodiments of the present application, the accuracy of the three-dimensional model is improved.

[0047] Among them, the texture reconstruction method of the embodiment of the present application adopts a vertex color acquisition method. Compared with the texture map mapping method, the vertex color acquisition method can avoid texture gaps and texture dislocations caused by texture splicing and fusion, and does not require texture mapping calculations, and does not require real-time updates of texture maps. The feasibility of real-time communication of three-dimensional models is stronger, and it can be applied to holographic communications, virtual live broadcasts and other scenarios.

[0048] It should be noted that the resolution in the embodiments of the present application refers to the comparison between the depth map and the RGB image.

[0049] The implementation of the present application is described in detail below with reference to the accompanying drawings.

[0050] Usually, an RGBD camera includes a color camera (RGB camera) and a depth camera (IR camera). The color camera is used to collect RGB data, and the depth camera is used to collect depth data. Since the field of view (FOV) of the depth camera and the color camera are different, most RGBD cameras based on FOV are limited by FOV. Therefore, when the range of the acquisition system is too large, the pixels of the object to be reconstructed in the RGBD camera will be less. In the case of low resolution of depth data collected by ordinary civilian-grade RGBD cameras, there is less effective data, making it difficult to reconstruct high-precision geometric models.

[0051] In this regard, the present application embodiment has built a set of Figure 1 The acquisition system shown can expand the FOV range of the RGBD camera and collect richer RGB data and depth data. Specifically, the entire acquisition system includes multiple RGBD cameras, which are arranged in an upper and lower two-layer architecture, such as 4 cameras on the upper layer and 4 cameras on the lower layer. The upper and lower RGBD cameras are both facing the object to be reconstructed. The upper RGBD cameras are tilted and the lower cameras are horizontally placed. In addition, the angle range between the pitch angle of the lower RGBD camera and the horizontal direction is [-15°, 15°]. The interval between the upper and lower RGBD cameras is about 0.5 meters, and the longitudinal and lateral intervals between the lower RGBD cameras are 2-3 meters respectively.

[0052] By tilting the upper RGBD camera, the longitudinal FOV is expanded, and rich data in the longitudinal direction of the object to be reconstructed can be obtained. By placing the lower RGBD camera horizontally, the lateral FOV is expanded, and rich data in the lateral direction of the object to be reconstructed can be obtained.

[0053] It should be noted that the embodiment of the present application does not impose any restrictive requirements on the number and type of RGBD cameras. For example, 8 Kinect cameras may be used, and 6 structured light cameras may also be used.

[0054] After the acquisition system is built, calibrate each RGBD camera in the system. For the calibration process, refer to Figure 2 :

[0055] S201: Select a reference camera from various RGBD cameras.

[0056] In S201 , any one of the RGBD cameras may be used as a reference camera, and the coordinate systems of the other RGBD cameras are aligned to the coordinate system of the reference camera based on the coordinate system of the reference camera.

[0057] S202: Using a checkerboard calibration method, determine target intrinsic parameters of each RGBD camera and initial extrinsic parameters of other RGBD cameras in each RGBD camera relative to a reference camera.

[0058] In S202, the checkerboard is placed in the acquisition system, and each RGBD camera synchronously acquires checkerboard images of different positions and postures, and Zhang's calibration method is used to determine the target intrinsic parameters of each RGBD camera and the initial extrinsic parameters of other RGBD cameras relative to the reference camera.

[0059] S203: respectively obtain a depth map of a multi-frame target object synchronously captured by each RGBD camera at a set time interval.

[0060] An optional implementation is that when executing S203, the target object (which can be a person or an object) enters the acquisition system, and each RGBD camera synchronously acquires the depth map of the target object at a set time interval (such as 2 seconds), wherein the target object can move 30-50 cm at the time interval, and the position and posture of the target object in each time interval are kept different. Optionally, the number of time intervals can be set to 5.

[0061] S204: converting each depth map within each time interval into point cloud data, and fusing the point cloud data within the same time interval to obtain a point cloud data set corresponding to each time interval.

[0062] An optional implementation is that when executing S204, multiple depth maps synchronously collected by each RGBD camera in 5 time intervals are converted into point cloud data, and the point cloud data of each RGBD camera in the same time interval are fused to obtain 5 frames of point cloud data sets. Since the target object moves in different time intervals, the common field of view area of ​​each RGBD camera is increased, thereby increasing the overlap data of the fused 5 frames of point cloud data sets, thereby improving the accuracy of calibration.

[0063] S205: According to the initial extrinsic parameters, the fused point cloud data sets are iterated at the nearest point to determine the target extrinsic parameters of each RGBD camera.

[0064] In S205, the initial extrinsic parameters determined by the checkerboard calibration are used as the initial values ​​of the Iterative Closest Point (ICP) iteration, and the bundle adjustment (BA) method is used to solve each point cloud data set to obtain the target extrinsic parameters of each RGBD camera.

[0065] Among them, the ICP algorithm uses the least squares to estimate the transformation matrix and is one of the most classic data registration algorithms. When the ICP algorithm is used to calculate the calibration matrix, it has certain requirements for the initial position of the point cloud to be registered. If the selected initial position is unreasonable, the algorithm will fall into a local optimum. Therefore, the BA algorithm can be used to solve it. Bundle refers to the beam of light projected from a point in three-dimensional space onto the image plane, and the reprojection error is constructed using these Bundles, which can be used to optimize the initial intrinsic and initial extrinsic parameters of the camera (including: rotation matrix and translation matrix).

[0066] In the specific implementation, the point clouds corresponding to the two RGBD cameras with a common field of view are recorded as the source point cloud dataset P and the target point cloud dataset Q respectively. According to the set constraints, the nearest point pair (p i ,q i ), based on the nearest neighbor pair (pi ,q i ) calculates the rotation matrix R and translation matrix t, and uses the calculated matrix to transform the source point cloud dataset P to the coordinate system of the target point cloud dataset Q. The pose error function f(R, t) is used to estimate the error between the transformed source point cloud dataset and the target point cloud dataset. If the error is greater than the preset threshold, it continues to iterate until the error requirement is met. The pose error function f(R, t) is as follows:

[0067]

[0068] Among them, n is the number of the nearest point pairs in the two point cloud datasets, p i is the i-th data point in the source point cloud dataset, q i is the i-th data point in the target point cloud dataset, R is the rotation matrix, and t is the translation matrix.

[0069] After calibrating each RGBD camera, each RGBD camera synchronously collects multiple depth maps of the empty scene as the background for subsequent foreground and background segmentation.

[0070] based on Figure 1 The system architecture shown, Figure 3 The method for reconstructing a three-dimensional model provided in the embodiment of the present application is exemplified. Figure 3 As shown in the figure, the process is executed by the reconstruction terminal and mainly includes the following steps:

[0071] S301: Acquire original depth maps and original RGB images synchronously captured by each calibrated RGBD camera.

[0072] In S301, the resolutions of the color camera and the depth camera in a general FOV-based RGBD camera are different. The maximum resolution of the RGB image can reach 4096×2160 pixels (ie, 4K), while the maximum resolution of the depth map can reach 640*576 pixels. Therefore, the resolution of the original RGB image is higher than the resolution of the original depth map.

[0073] The placement of each RGBD camera can be found in Figure 1 , see the calibration process Figure 2 , which will not be repeated here.

[0074] For some interactive scenarios that do not require high reconstruction accuracy, 2K original RGB images can also be collected to reduce the amount of transmitted data.

[0075] S302: Generate an RGB image with the same resolution corresponding to the corresponding original depth map according to each original RGB image.

[0076] In S302, the optical centers of the color camera and the depth camera in the same RGBD camera are different, and the viewing angles of the color camera and the depth camera are different, resulting in a viewing angle difference between the original RGB image and the original depth map collected by the same RGBD camera. By eliminating the viewing angle difference, the original RGB image and the original depth map collected by each RGBD camera are aligned to obtain an RGB image with the same resolution as the original depth map collected by each RGBD camera.

[0077] S303: According to the mask images corresponding to the original depth maps, the corresponding original depth maps and the RGB images with the same resolution are segmented respectively to obtain the corresponding target depth maps and target RGB images.

[0078] In S303, based on the depth map of the empty scene collected after calibration of each RGBD camera and the original depth map containing the target object collected by each RGBD camera, the foreground and background are segmented to obtain the mask image corresponding to each original depth map. Using each mask image, the corresponding original depth map and the RGB image with the same resolution are segmented to extract the target depth map and target RGB image of the target object.

[0079] S304: Using the trained model, according to each target depth map and each target RGB image, an initial geometric model and an initial texture model of the target object are obtained.

[0080] In the embodiment of the present application, the three-dimensional reconstruction model is trained in advance, such as Figure 4 As shown in the figure, some high-resolution depth maps and RGB images are collected as training samples and input into a deep neural network based on implicit functions. One branch of the network can obtain the spatial truncated signed distance function (TSDF) value of the model based on the input depth map, and then obtain the vertices and patches of the model according to the marching cube algorithm. Finally, the normal of the vertex is calculated through the vertices and patches to complete the geometric reconstruction. The other branch can obtain the vertex color of the model based on the input RGB image to complete the texture reconstruction.

[0081] Based on the trained model, in S304, the original depth map collected by each RGBD camera and the RGB image with the same resolution corresponding to the original depth map are input into the trained model, and the model can directly output the initial geometric model and initial texture model of the three-dimensional model end-to-end.

[0082] S305: Up-sampling the initial geometric model to obtain a target geometric model, and smoothing vertex data at seams of the target geometric model.

[0083] The surface of the initial geometric model contains multiple facets (which can be triangles or quadrilaterals), and each facet contains multiple vertices. The following takes a triangular facet i as an example to describe the upsampling process of the initial geometric model. Figure 5 :

[0084] S3051: Determine a new vertex according to the mean of the three-dimensional coordinates of each vertex included in the face patch i.

[0085] In S3051, according to the indices of the three vertices included in the facet i, the three-dimensional coordinates of the three vertices in space are obtained, and the mean of the three-dimensional coordinates of the three vertices is determined, and the point corresponding to the mean in space is taken as a new vertex.

[0086] S3052: Combine the new vertex with each vertex included in the patch i to generate multiple new patches.

[0087] In S3052, the new vertex is combined with every two vertices of the three vertices to generate three new facets.

[0088] S3053: Determine the normal and area of ​​face patch i, and determine the moving distance of the new vertex according to the area of ​​face patch i.

[0089] In S3053, the moving distance of the new vertex is an empirical coefficient multiplied by the area of ​​the facet i.

[0090] S3054: Move the new vertex a determined distance along the normal direction of facet i.

[0091] By upsampling the initial geometric model, a target geometric model with a complete and smooth surface can be obtained. Compared with the initial geometric model, the number of vertices and faces of the target geometric model are increased, thereby improving the fineness of the geometric model.

[0092] In S305, after obtaining the target geometric model, the seams of the target geometric model can be determined according to the common field of view of each RGBD camera, and the vertex data (including vertex normal, vertex position, vertex color, etc.) at the seams can be smoothed to improve the reconstruction quality of the geometric model.

[0093] S306: According to the calibration results of each RGBD camera, the color value corresponding to each vertex on the target geometric model is obtained from each original RGB image to obtain the target texture model.

[0094] Take one vertex j among the vertices on the target geometric model as an example, the color value acquisition process is shown in Figure 6 :

[0095] S3061: According to the calibration results of each RGBD camera, the vertex j is projected into each original RGBD image respectively.

[0096] By calibrating each RGBD camera, we can obtain the intrinsic and extrinsic parameters of each RGBD camera. According to the intrinsic and extrinsic parameters of each RGBD camera, we project the vertex j into the original RGBD image collected by each RGBD camera. The projection formula is as follows:

[0097] x~K[R|t]X Formula 2

[0098] Among them, X represents the three-dimensional coordinates of vertex j, x represents the pixel coordinates of the corresponding pixel point of vertex j in the original depth map, R and t are the external parameters of the corresponding RGBD camera, and K is the internal parameter of the corresponding RGBD camera.

[0099] S3062: Compare the depth value of vertex j with the pixel values ​​of corresponding pixels in each original depth map, and determine whether vertex j appears in the field of view of the target RGBD camera corresponding to the original depth map according to the comparison result.

[0100] For each of the original depth maps, do the following:

[0101] Determine the difference between the depth value of vertex j (usually the z value of the three-dimensional coordinate of vertex j) and the pixel value of the corresponding pixel in the current original depth map, and compare the determined difference with a preset threshold (such as 0.02 cm). If the difference is less than the preset threshold, it is determined that vertex j appears in the field of view of the target RGBD camera corresponding to the current original depth map; otherwise, it is determined that vertex j does not appear in the field of view of the target RGBD camera corresponding to the current original depth map.

[0102] S3063: Project vertex j into the original RGB image captured by the target RGBD camera, and use the color value of the projected point as the color value of vertex j.

[0103] In S3063, after it is determined that vertex j appears in the field of view of the target RGBD camera, formula 2 is used to project vertex j into the original RGB image captured by the target RGBD camera, and the color value of the projection point of vertex j in the original RGB image is obtained, and the obtained color value is used as the color value of vertex j (i.e., the values ​​of the R component, the G component, and the B component).

[0104] In some embodiments, when vertex j appears in the field of view of multiple target RGBD cameras at the same time, it is necessary to determine the weight corresponding to each target RGBD camera. Specifically, the depth value of vertex j in each target RGBD camera is obtained, each depth value obtained is normalized, and the weight corresponding to the corresponding target RGBD camera is determined according to the normalized result. The formula is as follows:

[0105]

[0106] Among them, w h represents the depth value of vertex j in the hth target RGBD camera, l represents the number of target RGBD cameras, ω h Represents the weight corresponding to the h-th target RGBD camera.

[0107] After determining the weights corresponding to each target RGBD camera, in S3063, vertex j is projected into the original RGB images collected by each target RGBD camera according to formula 2, and the color values ​​of the projection points of vertex j in each original RGB image are obtained respectively, and each color value corresponding to vertex j is weighted to obtain the final color value of vertex j. Specifically, the final color value of vertex j is determined according to the weights of each target RGBD camera and the color values ​​obtained from the original RGB images collected by each target RGBD camera. The formula for the color value is as follows:

[0108] C new =∑ h ω h *c h Formula 4

[0109] Among them, C new represents the final color value of vertex j, ω h represents the weight corresponding to the h-th target RGBD camera, c h Represents the color value of the corresponding pixel of vertex j in the original RGB image captured by the hth target RGBD camera.

[0110] It should be noted that when vertex j does not appear in the field of view of each RGBD camera, the color value of vertex j in the initial texture model is used as the final color value.

[0111] S307: Reconstructing a three-dimensional model of the target object according to the target geometric model and the target texture model.

[0112] In S307, the number of vertices and faces in the target geometric model is richer, which improves the refinement of the geometric model, and the color value of each vertex in the target texture model is collected from the high-resolution original RGB image, and the texture accuracy is higher. Therefore, when the three-dimensional model of the target object is reconstructed according to the target geometric model and the target texture model, the accuracy of the three-dimensional model can be improved.

[0113] In order to further improve the reconstruction quality of the texture model, in some embodiments, after executing 306 and before executing S307, the target texture model may be updated. Specifically, the preset sliding window is slid in the space of the target geometric model according to the set step size, and the color values ​​of each vertex in N consecutive preset sliding windows are merged, so as to update the target texture model and obtain a smooth and complete three-dimensional texture model composed of high-resolution vertex color values. Wherein, N is an integer greater than or equal to 1.

[0114] For example, a sliding window is set, which contains 30 vertices at most, and the color values ​​of each vertex in three consecutive sliding windows are fused and multiplied by a three-dimensional convolution kernel to obtain a three-dimensional texture model.

[0115] In the above-mentioned embodiment of the present application, the original depth map collected by the ordinary civilian-grade RGBD camera is used to generate the initial geometric model, and the high-precision target geometric model is obtained by upsampling the initial geometric model. In this way, the color value of each vertex in the target geometric model can be obtained based on the high-resolution original RGB image collected by the RGBD camera, and the target texture model consistent with the target geometric model can be obtained. Compared with the texture reconstruction method based on traditional graphics, this method solves the problems of texture gap, texture dislocation, and uneven texture illumination in graphic mapping, improves the quality of texture reconstruction, does not require manual participation, reduces the reconstruction cost, improves the reconstruction efficiency, and can realize the automation of the texture reconstruction method based on machine learning; and compared with the texture reconstruction method based on machine learning, this method has higher texture reconstruction accuracy and lower complexity, and can solve the problems of texture distortion and stretching in real-time dynamic update of texture. Furthermore, when three-dimensional reconstruction is performed based on the target geometric model and the target texture model, a higher-precision three-dimensional model can be obtained.

[0116] Based on the same technical concept, an embodiment of the present application provides a reconstruction terminal, which can execute the reconstruction method process of the three-dimensional model provided in the embodiment of the present application and achieve the same technical effect, which will not be repeated here.

[0117] See also Figure 7 , the reconstruction terminal includes a processor 701, a memory 702, a display 803 and at least one external communication interface 704, and the at least one external communication interface 704, the display 703 and the memory 702 are connected to the processor 701 via a bus 705;

[0118] The memory 702 stores computer program instructions, and the processor 701 performs the following operations according to the computer program instructions:

[0119] Obtaining, through at least one external communication interface 704, the original depth map and the original RGB image synchronously acquired by each calibrated RGBD camera;

[0120] According to each original RGB image, generate an RGB image of the same resolution corresponding to the corresponding original depth map;

[0121] According to the mask images corresponding to each original depth map, the corresponding original depth map and the RGB image with the same resolution are segmented respectively to obtain the corresponding target depth map and target RGB image;

[0122] Using the trained model, the initial geometric model and initial texture model of the target object are obtained according to each target depth map and each target RGB image;

[0123] Upsampling the initial geometric model to obtain the target geometric model, and smoothing the vertex data at the seams of the target geometric model;

[0124] According to the calibration results of each RGBD camera, the color value of each vertex on the target geometric model is obtained from each original RGB image to obtain the target texture model;

[0125] A three-dimensional model of the target object is reconstructed according to the target geometric model and the target texture model, and is displayed by the display 703 .

[0126] Optionally, after obtaining the target texture model and before reconstructing the three-dimensional model of the target object, the processor 701 further executes:

[0127] Slide the preset sliding window in the space of the target geometric model according to the set step size;

[0128] The color values ​​of each vertex in N consecutive preset sliding windows are merged to update the target texture model, where N is an integer greater than or equal to 1.

[0129] Optionally, the processor 701 obtains the color value of each vertex on the target geometric model from each original RGB image according to the calibration results of each RGBD camera. The specific operation is:

[0130] For each of the vertices, do the following:

[0131] According to the calibration results of each RGBD camera, a vertex is projected into each original RGBD image;

[0132] Compare the depth value of a vertex with the pixel values ​​of the corresponding pixels in each original depth map, and determine whether a vertex appears in the field of view of the target RGBD camera corresponding to the corresponding original depth map based on the comparison results;

[0133] Project a vertex into the original RGB image collected by the target RGBD camera, and use the color value of the projected point as the color value of a vertex.

[0134] Optionally, the processor 701 compares the depth value of a vertex with the pixel values ​​of corresponding pixels in each original depth map, and determines whether a vertex appears in the field of view of the target RGBD camera corresponding to the corresponding original depth map according to the comparison result. The specific operation is:

[0135] For each of the original depth maps, perform the following operations:

[0136] Determine the difference between the depth value of a vertex and the pixel value of the corresponding pixel in an original depth map;

[0137] If the difference is less than a preset threshold, it is determined that a vertex appears in the field of view of a target RGBD camera corresponding to an original depth map, otherwise, it is determined that a vertex does not appear in the field of view of a target RGBD camera corresponding to an original depth map.

[0138] Optionally, when a vertex appears in the field of view of multiple target RGBD cameras at the same time, the processor 701 determines the color value of the vertex in the following manner:

[0139] Get the color value of a vertex in the original RGB image collected by each target RGBD camera respectively;

[0140] Weight the color values ​​of a vertex to get the final color value of the vertex.

[0141] Optionally, the processor 701 weights each color value of a vertex to obtain a final color value of the vertex, and the specific operations include:

[0142] Normalize the depth value of a vertex in each target RGBD camera, and determine the weight corresponding to the corresponding target RGBD camera according to the normalization result;

[0143] The final color value of a vertex is determined based on the weights of each target RGBD camera and the color values ​​obtained.

[0144] Optionally, the processor 701 upsamples the initial geometric model to obtain a target geometric model, and the specific operations include:

[0145] For each patch of the initial geometry, do the following:

[0146] Determine a new vertex based on the mean of the three-dimensional coordinates of each vertex contained in a patch;

[0147] Combine the new vertex with each vertex contained in a patch to generate multiple new patches;

[0148] Determine the normal and area of ​​a patch, and determine the moving distance of the new vertex based on the area of ​​a patch;

[0149] Moves new vertices by a certain distance along the normal direction of a patch.

[0150] Optionally, the processor 701 calibrates each RGBD camera in the following manner:

[0151] Select a reference camera from each RGBD camera;

[0152] The checkerboard calibration method is used to determine the target intrinsic parameters of each RGBD camera and the initial extrinsic parameters of other RGBD cameras in each RGBD camera relative to the reference camera;

[0153] Acquire multiple depth images of the target object synchronously collected by each RGBD camera at a set time interval, wherein the position and posture of the target object in each time interval are different;

[0154] Convert each depth map in each time interval into point cloud data, and fuse the point cloud data in the same time interval to obtain a point cloud data set corresponding to each time interval;

[0155] According to the initial extrinsic parameters, the nearest point iteration is performed on each fused point cloud data set to determine the target extrinsic parameters of each RGBD camera.

[0156] Optionally, each RGBD camera is divided into two layers, the upper RGBD camera is placed horizontally, and the lower RGBD camera is placed obliquely, and the angle between the pitch angle of the lower RGBD camera and the horizontal direction is [-15°, 15°].

[0157] The embodiment of the present application also provides a computer-readable storage medium for storing some instructions, which, when executed, can complete the method of the aforementioned embodiment.

[0158] The embodiments of the present application also provide a computer program product for storing a computer program, wherein the computer program is used to execute the method of the aforementioned embodiment.

[0159] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

[0160] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.

Claims

1. A method for reconstructing a three-dimensional model, characterized in that: include: Obtain the original depth map and original RGB image synchronously collected by each calibrated RGBD camera; According to each original RGB image, generate an RGB image of the same resolution corresponding to the corresponding original depth map; According to the mask images corresponding to the original depth maps, the corresponding original depth maps and the RGB images with the same resolution are segmented respectively to obtain the corresponding target depth maps and target RGB images; Using the trained model, the initial geometric model and initial texture model of the target object are obtained according to each target depth map and each target RGB image; Upsampling the initial geometric model to obtain a target geometric model, and smoothing vertex data at seams of the target geometric model; According to the calibration results of each RGBD camera and / or the initial texture model, the color value of each vertex on the target geometric model is obtained from each original RGB image to obtain the target texture model, wherein the calibration results of each RGBD camera include the target extrinsic parameters of each RGBD camera, and the target extrinsic parameters of each RGBD camera are obtained in the following manner: selecting a reference camera from each RGBD camera; using a checkerboard calibration method to determine the target intrinsic parameters of each RGBD camera and the initial extrinsic parameters of other RGBD cameras in each RGBD camera relative to the reference camera; respectively obtaining a multi-frame depth map of the target object synchronously collected by each RGBD camera at a set time interval; converting each depth map in each time interval into point cloud data, and fusing the point cloud data in the same time interval to obtain a point cloud data set corresponding to each time interval; performing nearest point iteration on each fused point cloud data set according to the initial extrinsic parameters to determine the target extrinsic parameters of each RGBD camera; A three-dimensional model of the target object is reconstructed according to the target geometric model and the target texture model.

2. The method according to claim 1, characterized in that After obtaining the target texture model and before reconstructing the three-dimensional model of the target object, the method further includes: Sliding a preset sliding window on the space of the target geometric model according to a set step size; The color values ​​of each vertex in N consecutive preset sliding windows are merged to update the target texture model, where N is an integer greater than or equal to 1.

3. The method according to claim 1, characterized in that The step of obtaining, from each of the original RGB images, the color value of each vertex on the target geometric model according to the calibration results of each of the RGBD cameras and / or the initial texture model includes: For each of the vertices, perform the following operations: According to the calibration results of each RGBD camera, project the one vertex into each original depth map respectively; compare the depth value of the one vertex with the pixel value of the corresponding pixel point in each original depth map respectively, and determine whether the one vertex appears in the field of view of the target RGBD camera corresponding to the corresponding original depth map according to the comparison result; If yes, project the one vertex into the original RGB image captured by the target RGBD camera, and use the color value of the projected point as the color value of the one vertex; If not, the color value of any vertex in the initial texture model is used as the color value of the one vertex.

4. The method according to claim 3, characterized in that The step of comparing the depth value of the vertex with the pixel values ​​of corresponding pixels in each of the original depth maps, and determining whether the vertex appears in the field of view of the target RGBD camera corresponding to the corresponding original depth map according to the comparison result, includes: For each of the original depth maps, perform the following operations: Determine a difference between a depth value of the vertex and a pixel value of a corresponding pixel in the original depth map; If the difference is less than a preset threshold, it is determined that the vertex appears in the field of view of the target RGBD camera corresponding to the one original depth map; otherwise, it is determined that the vertex does not appear in the field of view of the target RGBD camera corresponding to the one original depth map.

5. The method according to claim 3, characterized in that When the vertex appears in the field of view of multiple target RGBD cameras at the same time, the color value of the vertex is determined in the following manner: Respectively obtain the color value of the vertex in the original RGB image captured by each target RGBD camera; Weighting is performed on each color value of the vertex to obtain a final color value of the vertex.

6. The method according to claim 5, characterized in that The step of weighting the color values ​​of the vertex to obtain a final color value of the vertex includes: Normalizing the depth values ​​of the one vertex in each of the target RGBD cameras, and determining a weight corresponding to the corresponding target RGBD camera according to the normalization result; The final color value of the vertex is determined according to the weights of the target RGBD cameras and the acquired color values.

7. The method according to claim 1, characterized in that The initial geometric model is upsampled to obtain a target geometric model: For each face of the initial geometric model, perform the following operations: Determine a new vertex according to the average of the three-dimensional coordinates of each vertex included in the face patch; Combining the new vertex with each vertex included in the one patch to generate a plurality of new patches; Determine the normal and area of ​​the one patch, and determine the moving distance of the new vertex according to the area of ​​the one patch; The new vertex is moved a determined distance along the normal direction of the one face patch.

8. The method according to any one of claims 1 to 7, characterized in that Each RGBD camera is calibrated in the following way: Selecting a reference camera from among the RGBD cameras; Using a checkerboard calibration method, determine target intrinsic parameters of each of the RGBD cameras, and initial extrinsic parameters of other RGBD cameras among the RGBD cameras relative to the reference camera; Respectively obtain a plurality of depth images of the target object synchronously collected by each RGBD camera at a set time interval, wherein the position and posture of the target object in each time interval is different; Convert each depth map in each time interval into point cloud data, and fuse the point cloud data in the same time interval to obtain a point cloud data set corresponding to each time interval; According to the initial extrinsic parameters, the closest point iteration is performed on each fused point cloud data set to determine the target extrinsic parameters of each RGBD camera.

9. The method according to any one of claims 1 to 7, characterized in that The RGBD cameras are divided into two layers, the upper layer RGBD cameras are placed horizontally, and the lower layer RGBD cameras are placed obliquely, and the angle between the pitch angle of the lower layer RGBD cameras and the horizontal direction is [-15°, 15°].

10. A reconstruction terminal, characterized in that: It includes a display, a memory, at least one external communication interface and a processor, wherein the display, the memory, the at least one external communication interface and the processor are connected via a bus; The memory stores computer program instructions, and the processor performs the following operations according to the computer program instructions: Acquire, through the at least one external communication interface, the original depth map and the original RGB image synchronously acquired by each calibrated RGBD camera; According to each original RGB image, generate an RGB image of the same resolution corresponding to the corresponding original depth map; According to the mask images corresponding to the original depth maps, the corresponding original depth maps and the RGB images with the same resolution are segmented respectively to obtain the corresponding target depth maps and target RGB images; Using the trained model, the initial geometric model and initial texture model of the target object are obtained according to each target depth map and each target RGB image; Upsampling the initial geometric model to obtain a target geometric model, and smoothing vertex data at seams of the target geometric model; According to the calibration results of each RGBD camera and / or the initial texture model, the color value of each vertex on the target geometric model is obtained from each original RGB image to obtain the target texture model, wherein the calibration results of each RGBD camera include the target extrinsic parameters of each RGBD camera, and the target extrinsic parameters of each RGBD camera are obtained in the following manner: selecting a reference camera from each RGBD camera; using a checkerboard calibration method to determine the target intrinsic parameters of each RGBD camera and the initial extrinsic parameters of other RGBD cameras in each RGBD camera relative to the reference camera; respectively obtaining a multi-frame depth map of the target object synchronously collected by each RGBD camera at a set time interval; converting each depth map in each time interval into point cloud data, and fusing the point cloud data in the same time interval to obtain a point cloud data set corresponding to each time interval; performing nearest point iteration on each fused point cloud data set according to the initial extrinsic parameters to determine the target extrinsic parameters of each RGBD camera; A three-dimensional model of the target object is reconstructed according to the target geometric model and the target texture model, and displayed on the display.