A method for three-dimensional reconstruction of an object and related equipment
By using deformation tracking and voxel fusion methods in 3D reconstruction, the regular distribution of voxel blocks is used to quickly find adjacent nodes, which solves the problems of slow calculation speed and high power consumption in the existing technology, and improves the efficiency of 3D reconstruction. .
Patent Information
- Application Number
- CN201910485031.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-05-31
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2039-05-31
AI Technical Summary
In the existing technology, the nodes used for deformation tracking in the 3D reconstruction process are downsampled from the grid Mesh, resulting in irregular distribution of nodes in space. Adjacent relationships need to be found through traversal search, resulting in slow calculation speed and High power consumption.
Using deformation tracking and voxel fusion methods, multiple node nodes are located on voxel blocks, and each voxel block corresponds to a node. Adjacent nodes can be quickly found through the regular distribution of voxel blocks and the amount of calculation is reduced.
Significantly improves the efficiency of 3D reconstruction, reduces the amount of calculation and power consumption, and increases the speed of rendering.
Smart Images

Figure CN112017228B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method for three-dimensional reconstruction of an object and related equipment. Background Art
[0002] Three-dimensional (3D) reconstruction is one of the key technologies in augmented reality (AR) / virtual reality (VR) applications. Its purpose is to obtain the three-dimensional geometry (such as surface shape) and texture (such as surface color) information of the environment and objects in the scene, so as to render the three-dimensional image of the object. The following is an AR / VR scene that uses 3D reconstruction. The scene is used to collect point clouds, reconstruct 3D, compress and encode, and transmit objects, so that local objects can be rendered and displayed in other devices with realistic three-dimensional effects. The specific implementation process is as follows:
[0003] 1. Point cloud acquisition: Use one or more depth camera modules to collect color visible light RGB images and depth maps of objects at multiple times.
[0004] 2. 3D reconstruction: Deformation tracking and voxel fusion are used to process the RGB images and depth maps at multiple moments to obtain the fused mesh and the deformation parameters at each moment in the multiple moments. The deformation tracking is implemented based on the embedded deformation graph.
[0005] 3. Texture generation: Generate texture maps and texture coordinates based on the RGB image and mesh information at each moment.
[0006] 4. Compression encoding transmission and AR / VR presentation: The fused Mesh, deformation parameters at each moment, texture map / texture coordinates, and deformation parameters at each moment are compressed and encoded and sent to the receiving end. Correspondingly, the receiving end decodes and restores the fused Mesh, texture map, texture coordinates, and deformation parameters at each moment, and renders them on a display device (such as an AR display device, a VR display device, etc.) for viewing.
[0007] As shown in Table 1, the deformation parameters at each moment include the deformation parameters of each node at that moment. Each node includes the position coordinate information (X, Y, Z) of the node and the rigid deformation parameters (Alpha, Beta, Gamma, Tx, Ty, Tz) of the node, where Alpha, Beta, and Gamma are rotation parameters (expressed in Euler angles), and Tx, Ty, and Tz are translation parameters.
[0008] Table 1
[0009]
[0010] In the prior art, the nodes used in deformation tracking are obtained by downsampling from the mesh. Since the mesh is usually irregular, the nodes downsampled from the mesh are usually distributed irregularly in space, which means that the neighbor relationship between each node must be obtained through search and comparison. The 3D reconstruction process requires the use of this neighbor relationship, which involves a large number of traversal search operations, which slows down the operation speed and consumes more power. Summary of the invention
[0011] The embodiment of the present invention discloses a method for three-dimensional reconstruction of an object and related equipment, which can significantly reduce the amount of calculation in the reconstruction process and improve the efficiency of reconstruction.
[0012] In a first aspect, an embodiment of the present application provides a method for three-dimensionally reconstructing an object, the method comprising:
[0013] Collecting color visible light segment RGB images of the object at multiple moments and depth maps at the multiple moments; wherein the RGB image at each moment includes RGB images collected from multiple positions of the object, and the depth map at each moment includes depth maps collected from the multiple positions of the object;
[0014] The object is reconstructed through deformation tracking and voxel fusion according to the RGB images at the multiple moments and the depth maps at the multiple moments; wherein the multiple nodes used in the deformation tracking are located on the voxel blocks used in the voxel fusion, and one voxel block corresponds to only one node, and the number of the voxel blocks is greater than or equal to the number of the nodes.
[0015] In the above method, each node used in the deformation tracking is located on a voxel block, and different nodes are located on different voxel blocks. Therefore, when determining the adjacent nodes of any node, the adjacent nodes of any node can be quickly found based on the regular distribution of these nodes, without the need for tedious traversal and search through downsampling, which significantly reduces the amount of calculation and improves the efficiency of 3D reconstruction.
[0016] In combination with the first aspect, in a first possible implementation manner of the first aspect, reconstructing the object according to the RGB images at the multiple moments and the depth maps at the multiple moments through deformation tracking and voxel fusion includes:
[0017] Performing deformation tracking and voxel fusion on the RGB images at the multiple moments and the depth maps at the multiple moments to obtain a fused mesh of the object and a deformation parameter of the object at each of the multiple moments;
[0018] The mesh at each moment is generated according to the fused mesh and the deformation parameters at each moment, or the mesh at some moments is generated according to the fused mesh and the deformation parameters at some moments among the multiple moments.
[0019] In combination with the first aspect, or any of the above possible implementations of the first aspect, in a second possible implementation of the first aspect, the deformation parameters at each moment are obtained by constraining the total deformation energy, the total deformation energy includes a regularization term, the regularization term is calculated based on the multiple nodes and the adjacent nodes of the multiple nodes, and the adjacent nodes of any node are nodes on voxel blocks that have been allocated memory in each adjacent voxel block of the voxel block where the any node is located. It can be seen that each node used in the deformation tracking is located on a voxel block, and different nodes are located on different voxel blocks. Based on this premise, the adjacent nodes of any node are defined as nodes on voxel blocks that have been allocated memory in each adjacent voxel block of the voxel block where the any node is located; therefore, when searching for the adjacent nodes of any node in the deformation tracking process, there is no need to perform tedious traversal and search by downsampling, but the adjacent nodes of the any node can be found based on the adjacent voxel blocks of the voxel block where the any node is located, which significantly reduces the amount of calculation and improves the efficiency of 3D reconstruction.
[0020] In combination with the first aspect, or any one of the above possible implementations of the first aspect, in a third possible implementation of the first aspect, the deformation parameters at each moment are obtained by constraining the total deformation energy, and the total deformation energy includes data items, and the data items are calculated according to the deformation field of the point in space. The deformation field of any point in the space is obtained by interpolating the calculated deformation parameters of the nearby nodes of the arbitrary point, and the nearby nodes of the arbitrary point are the nodes on the voxel blocks that have been allocated memory in each adjacent voxel block of the voxel block where the arbitrary point is located.
[0021] In this way, the deformation field is calculated based on the nodes on the adjacent voxel blocks of the voxel block where any point p is located, without the need to find the adjacent nodes through tedious search and traversal to calculate the deformation field, which significantly reduces the amount of calculation.
[0022] In combination with the first aspect, or any of the foregoing possible implementations of the first aspect, in a fourth possible implementation of the first aspect, after reconstructing the object according to the RGB images at the multiple moments and the depth maps at the multiple moments through deformation tracking and voxel fusion, the method further includes:
[0023] According to the relationship between the node and the voxel block, the position coordinates (x0, y0, z0) of the target node in the deformation parameters at each moment are converted into reference coordinates (x1, y1, z1), wherein x1=floor(x0 / L)-K, y1=floor(y0 / L)-K, z1=floor(z0 / L)-K; L is the side length of the voxel block, and K is a preset integer; the target node is any node used in the deformation tracking process; and each node used in the deformation tracking process is in the same coordinate system;
[0024] The fused mesh and the deformation parameters at each moment after performing the transformation are encoded and sent.
[0025] In this way, the original coordinates of the node are replaced by reference coordinates during encoding. Since the reference coordinates are integers rather than floating-point numbers, the encoding of the reference coordinates has a lower bit rate and higher efficiency than encoding the original coordinates of the node.
[0026] In combination with the first aspect, or any of the foregoing possible implementations of the first aspect, in a fifth possible implementation of the first aspect, the method further includes:
[0027] Generate a texture map and texture coordinates according to the RGB image at each of the multiple moments and the fused grid;
[0028] The texture map and texture coordinates are encoded and sent.
[0029] In combination with the first aspect, or any one of the foregoing possible implementations of the first aspect, in a sixth possible implementation of the first aspect, the node is located at a center point, or a corner point, or a diagonal corner point of the voxel block.
[0030] In a second aspect, an embodiment of the present application provides a device for three-dimensional reconstruction of an object, the device comprising a camera module, a memory, and a processor, wherein the memory is used to store program instructions:
[0031] The camera module is used to collect color visible light segment RGB images of an object at multiple moments and depth maps at the multiple moments; wherein the RGB image at each moment includes RGB images collected from multiple positions of the object, and the depth map at each moment includes depth maps collected from the multiple positions of the object;
[0032] The memory is used to store program instructions, and the processor is used to call the program instructions to perform the following operations:
[0033] The object is reconstructed through deformation tracking and voxel fusion according to the RGB images at the multiple moments and the depth maps at the multiple moments; the multiple nodes used in the deformation tracking are located on the voxel blocks used in the voxel fusion, and one voxel block corresponds to only one node, and the number of the voxel blocks is greater than or equal to the number of the nodes.
[0034] In the above device, each node used in the deformation tracking is located on a voxel block, and different nodes are located on different voxel blocks. Therefore, when determining the adjacent nodes of any node, the adjacent nodes of any node can be quickly found based on the regular distribution of these nodes, without the need for tedious traversal and search through downsampling, which significantly reduces the amount of calculation and improves the efficiency of 3D reconstruction.
[0035] In combination with the second aspect, in a first possible implementation manner of the second aspect, when reconstructing the object through deformation tracking and voxel fusion according to the RGB images at the multiple moments and the depth maps at the multiple moments, the processor is specifically used to call the program instruction to perform the following operations:
[0036] Performing deformation tracking and voxel fusion on the RGB images at the multiple moments and the depth maps at the multiple moments to obtain a fused mesh of the object and a deformation parameter of the object at each of the multiple moments;
[0037] The mesh at each moment is generated according to the fused mesh and the deformation parameters at each moment, or the mesh at some moments is generated according to the fused mesh and the deformation parameters at some moments among the multiple moments.
[0038] In combination with the second aspect, or any of the above possible implementations of the second aspect, in a second possible implementation of the second aspect, the deformation parameters at each moment are obtained by constraining the total deformation energy, the total deformation energy includes a regularization term, the regularization term is calculated based on the multiple nodes and the adjacent nodes of the multiple nodes, and the adjacent nodes of any node are nodes on voxel blocks that have been allocated memory in each adjacent voxel block of the voxel block where the any node is located. It can be seen that each node used in the deformation tracking is located on a voxel block, and different nodes are located on different voxel blocks. Based on this premise, the adjacent nodes of any node are defined as nodes on voxel blocks that have been allocated in each adjacent voxel block of the voxel block where the any node is located; therefore, when searching for the adjacent nodes of any node in the deformation tracking process, there is no need to perform tedious traversal and search by downsampling, but the adjacent nodes of the any node can be found based on the adjacent voxel blocks of the voxel block where the any node is located, which significantly reduces the amount of calculation and improves the efficiency of 3D reconstruction.
[0039] In combination with the second aspect, or any one of the above possible implementations of the second aspect, in a third possible implementation of the second aspect, the deformation parameters at each moment are obtained by constraining the total deformation energy, and the total deformation energy includes data items, and the data items are calculated according to the deformation field of the point in space. The deformation field of any point in the space is interpolated according to the calculated deformation parameters of the nearby nodes of the arbitrary point, and the nearby nodes of the arbitrary point are the nodes on the voxel blocks that have been allocated memory in each adjacent voxel block of the voxel block where the arbitrary point is located.
[0040] In this way, the deformation field is calculated based on the nodes on the adjacent voxel blocks of the voxel block where any point p is located, without the need to find the adjacent nodes through tedious search and traversal to calculate the deformation field, which significantly reduces the amount of calculation.
[0041] In combination with the second aspect, or any of the foregoing possible implementations of the second aspect, in a fourth possible implementation of the second aspect, after reconstructing the object through deformation tracking and voxel fusion according to the RGB images at the multiple moments and the depth maps at the multiple moments, the processor is further used to call the program instruction to perform the following operations:
[0042] According to the relationship between the node and the voxel block, the position coordinates (x0, y0, z0) of the target node in the deformation parameters at each moment are converted into reference coordinates (x1, y1, z1), wherein x1=floor(x0 / L)-K, y1=floor(y0 / L)-K, z1=floor(z0 / L)-K; L is the side length of the voxel block, and K is a preset integer; the target node is any node used in the deformation tracking process; and each node used in the deformation tracking process is in the same coordinate system;
[0043] The fused mesh and the deformation parameters at each moment after performing the transformation are encoded and sent.
[0044] In this way, the original coordinates of the node are replaced by reference coordinates during encoding. Since the reference coordinates are integers rather than floating-point numbers, the encoding of the reference coordinates has a lower bit rate and higher efficiency than encoding the original coordinates of the node.
[0045] In combination with the second aspect, or any of the foregoing possible implementations of the second aspect, in a fifth possible implementation of the second aspect, the processor is further configured to call the program instruction to perform the following operations:
[0046] Generate a texture map and texture coordinates according to the RGB image at each of the multiple moments and the fused grid;
[0047] The texture map and texture coordinates are encoded and sent.
[0048] In combination with the second aspect, or any of the foregoing possible implementations of the second aspect, in a sixth possible implementation of the second aspect, the node is located at a center point, or a corner point, or a diagonal corner point of the voxel block.
[0049] In a third aspect, an embodiment of the present application provides a device for three-dimensionally reconstructing an object, the device comprising:
[0050] A camera module, used to collect color visible light segment RGB images of an object at multiple moments and depth maps at the multiple moments; wherein the RGB image at each moment includes RGB images collected from multiple orientations of the object, and the depth map at each moment includes depth maps collected from the multiple orientations of the object;
[0051] A dynamic reconstruction module is used to reconstruct the object through deformation tracking and voxel fusion according to the RGB images at the multiple moments and the depth maps at the multiple moments; wherein the multiple nodes used in the deformation tracking are located on the voxel blocks used in the voxel fusion, and one voxel block corresponds to only one node, and the number of the voxel blocks is greater than or equal to the number of the nodes.
[0052] In the above device, each node used in the deformation tracking is located on a voxel block, and different nodes are located on different voxel blocks. Therefore, when determining the adjacent nodes of any node, the adjacent nodes of any node can be quickly found based on the regular distribution of these nodes, without the need for tedious traversal and search through downsampling, which significantly reduces the amount of calculation and improves the efficiency of 3D reconstruction.
[0053] In combination with the third aspect, in a first possible implementation manner of the third aspect, the dynamic reconstruction module is used to reconstruct the object through deformation tracking and voxel fusion according to the RGB images at the multiple moments and the depth maps at the multiple moments, specifically:
[0054] Performing deformation tracking and voxel fusion on the RGB images at the multiple moments and the depth maps at the multiple moments to obtain a fused mesh of the object and a deformation parameter of the object at each of the multiple moments;
[0055] The mesh at each moment is generated according to the fused mesh and the deformation parameters at each moment, or the mesh at some moments is generated according to the fused mesh and the deformation parameters at some moments among the multiple moments.
[0056] In combination with the third aspect, or any of the above possible implementations of the third aspect, in a second possible implementation of the third aspect, the deformation parameters at each moment are obtained by constraining the total deformation energy, the total deformation energy includes a regularization term, the regularization term is calculated based on the multiple nodes and the adjacent nodes of the multiple nodes, and the adjacent nodes of any node are nodes on voxel blocks that have been allocated memory in each adjacent voxel block of the voxel block where the any node is located. Each node used in the deformation tracking is located on a voxel block, and different nodes are located on different voxel blocks. Based on this premise, the adjacent nodes of any node are defined as nodes on voxel blocks that have been allocated in each adjacent voxel block of the voxel block where the any node is located; therefore, when searching for the adjacent nodes of any node in the deformation tracking process, there is no need to perform tedious traversal and search by downsampling, but the adjacent nodes of the any node can be found based on the adjacent voxel blocks of the voxel block where the any node is located, which significantly reduces the amount of calculation and improves the efficiency of 3D reconstruction.
[0057] In combination with the third aspect, or any possible implementation of the third aspect mentioned above, in a third possible implementation of the third aspect, the deformation parameters at each moment are obtained by constraining the total deformation energy, and the total deformation energy includes data items, and the data items are calculated according to the deformation field of the point in space, and the deformation field of any point in the space is obtained by interpolating the calculated deformation parameters of the nearby nodes of the arbitrary point, and the nearby nodes of the arbitrary point are the nodes on the voxel blocks that have been allocated memory in each adjacent voxel block of the voxel block where the arbitrary point is located.
[0058] In this way, the deformation field is calculated based on the nodes on the adjacent voxel blocks of the voxel block where any point p is located, without the need to find the adjacent nodes through tedious search and traversal to calculate the deformation field, which significantly reduces the amount of calculation.
[0059] In combination with the third aspect, or any of the foregoing possible implementations of the third aspect, in a fourth possible implementation of the third aspect, a coding transmission module is further included, wherein the coding transmission module is used to, after the dynamic reconstruction module reconstructs the object according to the RGB images at the multiple moments and the depth maps at the multiple moments through deformation tracking and voxel fusion:
[0060] According to the relationship between the node and the voxel block, the position coordinates (x0, y0, z0) of the target node in the deformation parameters at each moment are converted into reference coordinates (x1, y1, z1), wherein x1=floor(x0 / L)-K, y1=floor(y0 / L)-K, z1=floor(z0 / L)-K; L is the side length of the voxel block, and K is a preset integer; the target node is any node used in the deformation tracking process; and each node used in the deformation tracking process is in the same coordinate system;
[0061] The fused mesh and the deformation parameters at each moment after performing the transformation are encoded and sent.
[0062] In this way, the original coordinates of the node are replaced by reference coordinates during encoding. Since the reference coordinates are integers rather than floating-point numbers, the encoding of the reference coordinates has a lower bit rate and higher efficiency than encoding the original coordinates of the node.
[0063] In combination with the third aspect, or any of the foregoing possible implementations of the third aspect, in a fifth possible implementation of the third aspect, a texture generation module is further included, which is used to:
[0064] Generate a texture map and texture coordinates according to the RGB image at each of the multiple moments and the fused grid;
[0065] The texture map and texture coordinates are encoded and sent.
[0066] In combination with the third aspect, or any one of the foregoing possible implementations of the third aspect, in a sixth possible implementation of the third aspect, the node is located at a center point, or a corner point, or a diagonal corner point of the voxel block.
[0067] In a fourth aspect, an embodiment of the present application provides a decoding method, the method comprising:
[0068] Receive the encoding result sent by the encoding end;
[0069] Decoding a fused mesh for the object and deformation parameters of the object at each of multiple moments from the encoding result, wherein the fused mesh and the deformation parameters of the object at each of multiple moments are obtained through deformation tracking and voxel fusion; the deformation parameters include reference coordinates and deformation information of a target node, and each factor in the reference coordinates is a positive integer; the target node is any node used when performing deformation tracking on the object;
[0070] According to the relationship between the node node used in the deformation tracking and the voxel block used in the voxel fusion, the reference coordinates (x1, y1, z1) of the target node in the deformation parameter are converted into position coordinates (x0, y0, z0); the multiple nodes node used in the deformation tracking are located on the voxel block, and one voxel block corresponds to only one node, and the number of the voxel blocks is greater than or equal to the number of the nodes; wherein, x0 = (x1 + K) * L + a1, y0 = (y1 + K) * L + b1, z0 = (z1 + K) * L + c1, L is the side length of the voxel block, K is a preset integer, and a1, b1 and c1 are quantities determined according to the position of the target node on the voxel block;
[0071] The mesh at each moment is generated according to the deformation parameters at each moment after the conversion is performed and the fused mesh, and the geometric shape of the object is rendered according to the mesh at each moment.
[0072] In the above method, the coordinates in the deformation parameters parsed from the encoding result are integer coordinates rather than floating-point coordinates, that is, the encoding end needs to encode integer coordinates rather than floating-point coordinates during encoding, so the encoding bit rate is lower and the efficiency is higher.
[0073] In a fifth aspect, an embodiment of the present application provides a decoding device, the device comprising a camera module, a memory and a processor, wherein the memory is used to store program instructions, and the processor is used to call the program instructions to perform the following operations:
[0074] Receive the encoding result sent by the encoding end;
[0075] Decoding a fused mesh for the object and deformation parameters of the object at each of multiple moments from the encoding result, wherein the fused mesh and the deformation parameters of the object at each of multiple moments are obtained through deformation tracking and voxel fusion; the deformation parameters include reference coordinates and deformation information of a target node, and each factor in the reference coordinates is a positive integer; the target node is any node used when performing deformation tracking on the object;
[0076] According to the relationship between the node node used in the deformation tracking and the voxel block used in the voxel fusion, the reference coordinates (x1, y1, z1) of the target node in the deformation parameter are converted into position coordinates (x0, y0, z0); the multiple nodes node used in the deformation tracking are located on the voxel block, and one voxel block corresponds to only one node, and the number of the voxel blocks is greater than or equal to the number of the nodes; wherein, x0 = (x1 + K) * L + a1, y0 = (y1 + K) * L + b1, z0 = (z1 + K) * L + c1, L is the side length of the voxel block, K is a preset integer, and a1, b1 and c1 are quantities determined according to the position of the target node on the voxel block;
[0077] The mesh at each moment is generated according to the deformation parameters at each moment after the conversion is performed and the fused mesh, and the geometric shape of the object is rendered according to the mesh at each moment.
[0078] In the above method, the coordinates in the deformation parameters parsed from the encoding result are integer coordinates rather than floating-point coordinates, that is, the encoding end needs to encode integer coordinates rather than floating-point coordinates during encoding, so the encoding bit rate is lower and the efficiency is higher.
[0079] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which is used to store program instructions. When the program instructions are executed on a processor, the method described in the first aspect or any possible implementation manner of the first aspect is implemented.
[0080] In a seventh aspect, an embodiment of the present application provides a computer program product, which, when running on a processor, implements the method described in the first aspect or any possible implementation manner of the first aspect.
[0081] By implementing the embodiment of the present invention, each node used in the deformation tracking is located on a voxel block, and different nodes are located on different voxel blocks. Therefore, when determining the adjacent nodes of any node, the adjacent nodes of any node can be quickly found based on the regular distribution of these nodes, without the need for tedious traversal and search through downsampling, which significantly reduces the amount of calculation and improves the efficiency of 3D reconstruction. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] The following is an introduction to the drawings used in the embodiments of the present invention.
[0083] Figure 1 is a schematic diagram of an image processing system architecture provided by an embodiment of the present invention;
[0084] Figure 2is a flow chart of a voxel block-based image processing method provided by an embodiment of the present invention;
[0085] Figure 3 is a schematic diagram of a partial scene of a voxel block provided by an embodiment of the present invention;
[0086] Figure 4 is a schematic diagram of the relationship between voxel block accuracy and voxel block side length provided by an embodiment of the present invention;
[0087] Figure 5 is a schematic diagram of a scene of voxel block index search provided by an embodiment of the present invention;
[0088] Figure 6 is a schematic diagram of a 2D conversion of a three-dimensional truncated signed distance function body provided by an embodiment of the present invention;
[0089] Figure 7 is a schematic diagram of the distribution of a grid and nodes provided by an embodiment of the present invention;
[0090] Figure 8 is a schematic diagram of the structure of a device provided by an embodiment of the present invention;
[0091] Fig. 9 It is a structural schematic diagram of another device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0092] The embodiments of the present invention are described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0093] The embodiments of the present application are applied to dynamic 3D reconstruction and rendering, and the rendering results can be used on mobile phones, AR devices, VR helmet devices, and other video display devices. In the first solution, after a device performs 3D reconstruction and rendering, the rendering result is displayed on the device; in the second solution, after a device performs 3D reconstruction and rendering, the rendering result is sent to other devices for display. In addition, 3D reconstruction and rendering are also divided into two cases. The first case is to reconstruct and render the geometric shape of the target object (such as an object); the second case is to reconstruct and render both the geometric shape and color of the target object. The following is combined with Figure 1 The overall process of the second situation under the second scheme is briefly introduced. The principles of other schemes and other situations can be referred to by analogy and will not be elaborated on again.
[0094] See also Figure 1 , Figure 11 is a schematic diagram of a system architecture of image processing provided by an embodiment of the present application, the system includes a first device 101 and a second device 102, wherein the first device 101 includes a camera module 1011, a dynamic reconstruction module 1012, a texture generation module 1013 and a coding transmission module 1014. The second device 102 includes a receiving decoding module 1021. The first device 101 and the second device 102 may also include other modules according to functional requirements. The above-mentioned modules are introduced below.
[0095] The camera module 1011 is used to collect data on the object to obtain a depth map of the object at multiple moments and a color visible light segment RGB image. The first device 101 may have one or more camera modules 1011. Optionally, each camera module 1011 generally includes an RGB camera and a depth camera. The first device 101 includes a synchronization mechanism between the cameras to ensure that they can shoot at the same time and output RGB images and depth maps respectively. Usually, each camera module will be placed at different positions around the object to be collected (or photographed) to cover different parts of the object as much as possible in space. At the same time, each camera module will also synchronously capture multiple moment data, such as RGB images and depth images, to obtain the deformation of the object at each moment in time, wherein the RGB image at each moment includes RGB images collected from multiple positions of the object, and the depth map at each moment includes depth maps collected from the multiple positions of the object. Optionally, the "moment" in the embodiment of the present application can also be described as a "frame".
[0096] The dynamic reconstruction module 1012 is used to dynamically reconstruct the RGB image and the depth map to obtain the fused mesh and the deformation parameters at each moment. The geometric shape of the object can be rendered based on the information obtained here.
[0097] The texture generation module 1013 is used to generate texture maps and texture coordinates for the RGB image, the fused mesh and the deformation parameters at each moment. The color of the object can be rendered based on the information obtained here.
[0098] The encoding and transmission module 1014 is used to encode the fused mesh, texture map, texture coordinates and deformation parameters at each moment, and then send the encoding result to the receiving and decoding module of the second device 102.
[0099] The receiving and decoding module 1021 is used to receive the encoded result sent by the encoding and transmission module 1014, and then decode it to restore the above-mentioned fused mesh, texture map, texture coordinates and deformation parameters at each moment. After that, the display device on the second device 102 can render and display the decoded information.
[0100] See also Figure 2 , Figure 2 The present invention provides a voxel block-based image processing method, which can be based on Figure 1 The method is implemented as shown in the system architecture diagram, and includes but is not limited to the following steps:
[0101] Step S201: The first device collects color visible light segment RGB images of an object at multiple moments and depth maps at the multiple moments.
[0102] Specifically, the first device is equipped with a camera module (including one or more cameras), or the camera module is not on the first device, but is deployed near the first device or at a distance from the first device. The first device is connected to the camera module by wire or wirelessly, so the first device can acquire the color visible light RGB images and depth maps of the object at multiple moments through the camera module; optionally, there are multiple camera modules, which are respectively deployed at different positions of the object, so the RGB image at each moment includes the RGB images acquired from multiple positions of the object, and the depth map at each moment includes the depth maps acquired from the multiple positions of the object. Optionally, the object can be a dynamic object.
[0103] Step S202: The first device reconstructs the object through deformation tracking and voxel fusion according to the color visible light segment RGB images at the multiple moments and the depth maps at the multiple moments.
[0104] Specifically, deformation tracking and voxel fusion are first performed on the color visible light segment RGB images and depth maps of the multiple moments to obtain a fused mesh (the mesh is usually a triangular mesh, but can also be other mesh forms) and deformation parameters of each of the multiple moment images. For example, based on the depth map and RGB image of the first moment, a mesh corresponding to the first moment is obtained by voxel fusion (since the mesh is only obtained by fusion of data from one moment, it is affected by noise and data missing / holes, and generally has low quality); when the depth map and RGB image of the second moment are obtained, the deformation parameters of the deformation model are first determined by deformation tracking, and then the deformation model and deformation parameters are used to deform the input depth data of the second moment back to the shape corresponding to the first moment, and then the deformed data of the second moment (such as the deformed depth map) is fused to the mesh generated based on the first moment (due to Two-moment data are used, and the quality of the fused mesh is higher); when the depth map / RGB image of the third moment is obtained, the deformation model deformation parameters are first determined by deformation tracking, and then the deformation model and deformation parameters are used to deform the input depth data of the third moment back to the shape corresponding to the first moment, and then the deformed third moment data (such as the deformed depth map) is fused to the mesh generated based on the first moment and the second moment (because three-moment data are used, the quality of the fused mesh is higher); this is repeated until all input moment data (i.e., the multiple moment images) are processed. After processing, the fused mesh and the deformation parameters of each moment in the multiple moments can be obtained. Then, the mesh of each moment can be generated according to the fused mesh and the deformation parameters of each moment. Optionally, only the mesh of the moments other than the key moments (such as key frames) in the multiple moments can be generated, and the fused mesh can be directly used as the mesh of the key moment, so that each moment has a corresponding mesh.
[0105] Optionally, if there is a display device on the first device, the first device can render the mesh at each moment through the display device, thereby obtaining the geometric shape at each moment, and then displaying it. Of course, if there is no display device on the first device, the display and rendering operations may not be performed, and therefore the mesh at each moment may not be generated.
[0106] In an embodiment of the present application, the deformation parameters at each moment are obtained by constraining the total deformation energy, and the total deformation energy includes a regularization term, and the regularization term is calculated based on the multiple nodes and the adjacent nodes of the multiple nodes. The adjacent nodes of any node are the nodes on the voxel blocks that have been allocated memory in each adjacent voxel block of the voxel block where the any node is located (usually, the voxel blocks on the surface of the object or near the surface will be allocated memory). It should be noted that each node node used for deformation tracking is located on the voxel block, there is only one node on a voxel block, and the number of voxel blocks is more than the number of nodes. Nodes located on voxel blocks include those located inside or on the surface of the space occupied by the voxel block. For example, each node node is located at the center point of a voxel block, or a corner point, or a diagonal corner point, or other positions of the corresponding voxel block, which are illustrated below with examples.
[0107] For example, if the side length of the voxel block is L, the voxel block A is numbered (m,n,k) and the corner point position coordinates are (m*L,n*L,k*L):
[0108] If the node node on voxel block A is located at the center point of voxel block A(m,n,k), then the position coordinates of the node node on voxel block A(m,n,k) are (m*L+L / 2,n*L+L / 2,k*L+L / 2).
[0109] If the node node on voxel block A is located at the corner point of voxel block A(m,n,k), then the position coordinates of the node node on voxel block A(m,n,k) are (m*L,n*L,k*L).
[0110] If the node node on voxel block A is located at the diagonal corner point of voxel block A(m,n,k), then the position coordinates of the node node on voxel block A(m,n,k) are (m*L+L,n*L+L,k*L+L).
[0111] If the node node on voxel block A is located at other positions of voxel block A(m,n,k) (except the center point, corner point, and diagonal corner point), then the position coordinates of the node node on voxel block A(m,n,k) are (m*L+d,n*L+d,k*L+d), where L>d>0, and d is not equal to L / 2.
[0112] It can be seen that each node used in the deformation tracking is located on a voxel block, and different nodes are located on different voxel blocks. Based on this premise, the neighboring nodes of any node are defined as the nodes on the voxel blocks that have been allocated memory in each neighboring voxel block of the voxel block where the node is located; therefore, when searching for the neighboring nodes of any node in the deformation tracking process, there is no need to perform tedious traversal and search by downsampling, but the neighboring nodes of any node can be found based on the neighboring voxel blocks of the voxel block where the node is located, which significantly reduces the amount of calculation and improves the efficiency of 3D reconstruction.
[0113] Optionally, the above-mentioned total deformation energy also includes a data item, which is calculated based on the deformation field of the point in the space (the space is a pre-configured space that can accommodate the above-mentioned object, and the space is used to divide the voxel blocks to be used in the deformation tracking and voxel fusion process), and the deformation field of any point in the space is obtained by interpolating the calculated deformation parameters of the nearby nodes of the arbitrary point (optionally, the calculation of the deformation field of any point and the calculation of the deformation parameters of each node are mutually iterative, and multiple iterations are required to obtain the final required deformation parameters and deformation field), and the nearby nodes of any point are the nodes on the voxel blocks that have been allocated memory in each adjacent voxel block of the voxel block where the arbitrary point is located. For example, for any point p in the space composed of voxel blocks, determine the voxel block to which the point p belongs. If the position coordinates of point p are (x, y, z), the voxel block to which point p belongs is numbered (floor (x / L), floor (y / L), floor (z / L)). Floor() is an operation that rounds a floating point number down. The corresponding voxel block can be found by the voxel block number (for example, by searching through a hash table, and the specific search operation is not an innovation of the present invention). Next, determine the neighborhood voxel blocks of the voxel block (a total of 27 voxel blocks in the 3x3x3 space centered on the voxel block, excluding the central voxel block itself, there are 26). For the adjacent voxel blocks that have been allocated memory among the 26 adjacent voxel blocks, calculate the Euclidean distance between point p and the nodes on each adjacent voxel block that has been allocated memory. Then, a weight is calculated for each node based on the distance between point p and each node (usually the weight calculation formula is w=exp(-d*d / lamda), where w is the weight, d is the Euclidean distance, and lamda is a constant parameter), and then calculate the deformation field of point p based on the deformation parameters of each node and the weight calculated for each node.
[0114] In this way, the deformation field is calculated based on the nodes on the adjacent voxel blocks of the voxel block where any point p is located, without the need to find the adjacent nodes through tedious search and traversal to calculate the deformation field, which significantly reduces the amount of calculation.
[0115] In the embodiment of the present application, the deformation parameters at each moment include the deformation information of each node corresponding to the moment, for example, Euler angles in multiple dimensions and directional translations in multiple directions. In addition, the position coordinates of each node corresponding to the moment may also be included.
[0116] Step S203: The first device generates a texture map and texture coordinates according to the RGB image at each moment in the multiple moment data and the fused grid.
[0117] Specifically, the texture map and texture coordinates are used to render the color of the image at each moment.
[0118] Optionally, if subsequent rendering does not require the color of the object, then obtaining the mesh at each of the multiple moments is equivalent to completing the reconstruction; if subsequent rendering requires the color of the object, then obtaining the mesh at each of the multiple moments, as well as the texture map and texture coordinates is equivalent to completing the reconstruction.
[0119] Step S204: the first device encodes the fused mesh, texture map, texture coordinates, and the deformation parameters at each moment to obtain an encoding result.
[0120] Specifically, the target information includes the above-mentioned fused mesh, texture map, texture coordinates, and the deformation parameters at each moment; in the first case, the deformation parameters at each moment need to be updated once before encoding, so the deformation parameters encoded during encoding are updated deformation parameters. In the second case, the deformation parameters at each moment do not need to be updated before encoding, so the deformation parameters encoded during encoding are unupdated deformation parameters. The update here refers to converting the position coordinates of each node in the deformation parameters into reference coordinates. It should be noted that since there is a node on each voxel block in the present application, the position coordinates of the node can be converted based on the position of the node and the voxel block (the basis of the preset algorithm).
[0121] For example, assume that the position coordinates of the target node (i.e., any node) are c(x0, y0, z0), and its three coordinate components x0, y0, and z0 are all floating point numbers, which are the coordinates of the node in the x direction, y direction, and z direction, respectively. In this embodiment, the node position coordinates are converted into reference coordinates C(x1, y1, z1). Specifically, for example, let C = floor(c / L), where L is the side length of the voxel block (floating point number), x1 = floor(x0 / L)-K, y1 = floor(y0 / L)-K, z1 = floor(z 0 / L)-K; L is the side length of the voxel block, and K is a preset integer. It can be seen that the three coordinate components x1, y1, and z1 of the reference coordinate C are integers, and using C instead of c for encoding is more efficient. The following is a comparison with the prior art to show the effect.
[0122] In the prior art, the node is not associated with the voxel block, so the position of the node is irregular. For example, the position coordinates of several nodes can be (0.502, 0.307, 0.211), (0.531, 0.325, 0.201), (0.529, 0.415, 0.278). In the present application, the position coordinates c of several nodes are (0.08, 0.112, 0.24), (0.08, 0.144, 0.272), (0.112, 0.112, 0.176). If the side length of the voxel block is 0.032 meters, the corresponding reference coordinates C can be calculated according to the formula as (2, 3, 7), (2, 4, 8), (3, 3, 5). All dimensions are integers. Therefore, using C instead of c for encoding has a lower bit rate and higher efficiency.
[0123] Since the second device (i.e., the decoding end) needs to use the node's position coordinates after decoding, and the node's position coordinates are often relatively complex floating-point numbers, if the first device (encoding end) directly encodes the node's position coordinates required by the second device and sends them to the second device, then the amount of calculation in the encoding process will be very large. In order to reduce the amount of calculation in the encoding process, the present application first converts the node's position coordinates into coordinates represented by integers through a preset algorithm, and then encodes the coordinates represented by the integer.
[0124] It should be noted that, since the target node uniquely corresponds to the voxel block where it is located, the number of the voxel block where the target node is located can also be directly used as the above-mentioned reference coordinate. Since the number of the voxel block is also an integer, encoding the reference coordinate has a lower bit rate and higher efficiency.
[0125] Step S205: The first device sends the encoding result to the decoding end.
[0126] Step S206: The second device receives the encoding result sent by the first device.
[0127] Specifically, after receiving the encoding result, the second device decodes it to obtain the above-mentioned fused mesh, texture map, texture coordinates, and the deformation parameters at each moment.
[0128] For the above situation one, after the second device obtains the fused mesh texture map, texture coordinates, and deformation parameters at each of the above moments, it can render the geometric shape and color of the object through the display device and display it.
[0129] For the above situation 2, after the second device obtains the fused mesh texture map, texture coordinates, and the deformation parameters at each moment, it is necessary to restore the deformation parameters to obtain the restored deformation parameters. The restoration here mainly restores the coordinates (i.e., reference coordinates) represented by integers in the deformation parameters to position coordinates represented by floating-point numbers based on the position relationship between the voxel block and the node. This is the reverse conversion of the conversion in step S204. For example, it is restored to the position coordinates of the node represented by floating-point numbers through the above preset algorithm. For example, if the position coordinate of the node is at the center point of the voxel block, then if there are three reference coordinates, namely (2,3,7), (2,4,8), and (3,3,5), then based on the preset algorithm, converting (2,3,7) can obtain a node position coordinate c(0.08,0.112,0.24), based on the preset algorithm, converting (2,4,8) can obtain a node position coordinate c(0.08,0.144,0.272), and based on the preset algorithm, converting (3,3,5) can obtain a node position coordinate c(0.112,0.112,0.176).
[0130] Optionally, the conversion relationship from the reference coordinates C (x1, y1, z1) to the position coordinates c (x0, y0, z0) can be: x0 = (x1+K)*L+a1, y0 = (y1+K)*L+b1, z0 = (z1+K)*L+c1, where L is the side length of the voxel block, K is a preset integer, and a1, b1 and c1 are quantities determined according to the position of the target node on the voxel block.
[0131] After the second device obtains the fused mesh texture map, texture coordinates, and the restored deformation parameters at each of the above moments, it can render and display the geometric shape and color of the object through the display device.
[0132] In the embodiment of the present application, the above-mentioned target information may not include texture maps and texture coordinates, so the second device will not decode the texture maps and texture coordinates, and thus can render the geometric shape of the object through the display device but not the color, so when displayed through the display device, only the geometric shape needs to be displayed. In another optional scheme, the second device does not continuously perform texture rendering, and does not need to generate a mesh at each moment based on the deformation parameters at each moment and the fused mesh. Some functions can be realized based on the fused mesh, such as 3D printing, which generally only needs to print out the 3D shape of the object at one moment. In this case, it can be realized based on the fused mesh (of course, the deformation parameters can also be used to deform the fused mesh to a specific geometric shape and then perform 3D printing, so that only the deformation parameters at a certain moment are required, rather than the deformation parameters at each moment).
[0133] Optionally, the first device and the second device can also be regarded as two different modules (or units, or devices, etc.) on the same hardware device. That is, one module of the hardware device is used to collect RGB images and depth maps at multiple moments, and then reconstruct the mesh at each moment based on the information, and may also obtain texture coordinates and texture maps; then the module encodes the obtained information and sends the encoding result to another module; the other module decodes the encoding result and renders the geometric shape of the object based on the decoded information, and may also render the color of the object.
[0134] exist Figure 2 In the described method, each node used in the deformation tracking is located on a voxel block, and different nodes are located on different voxel blocks. Therefore, when determining the adjacent nodes of any node, the adjacent nodes of any node can be quickly found based on the regular distribution of these nodes, without the need for tedious traversal and search through downsampling, which significantly reduces the amount of calculation and improves the efficiency of 3D reconstruction.
[0135] In order to better understand the technical implementation of the present application, the voxel fusion and deformation tracking technologies involved are introduced below.
[0136] Voxel Fusion:
[0137] The fundamental reason for the voxel fusion step is that the quality of the depth map (also called point cloud) directly obtained by the depth sensor in the camera module is not high enough, and there are problems such as noise and holes. In order to improve the quality of the reconstructed model, it is necessary to fuse the depth map data at multiple times to obtain a higher quality three-dimensional model. This has been explained in the previous article. The truncated signed distance function (TSDF) is a commonly used voxel fusion method. Unlike methods such as meshes that express the surface of objects and thus represent geometric shapes, TSDF is an implicit surface method. In the TSDF representation, the entire space is divided into a large number of small cubes in 3D space, namely voxels (which is a direct extension of the concept of pixels in two-dimensional images in three dimensions), such as Figure 3 As shown in the figure, each voxel stores the corresponding TSDF value and weight. The TSDF value is usually a floating point value. The closer the value is to zero, the closer the voxel is to the surface of the photographed object. A value greater than zero indicates that the voxel is on the front side (such as the outside of the body), and a value less than zero indicates that the voxel is on the back side (such as the inside of the body). During the 3D reconstruction process, a TSDF volume is maintained. Whenever the depth data of a new image is to be fused in, the TSDF value and weight of each voxel in the TSDF volume are updated according to a specific algorithm. After all the depth data is fused, the marching cubes algorithm is used to extract the Mesh at the current moment from the TSDF volume.
[0138] like Figure 4 As shown, Figure 4The human body image on the left contains fewer voxels, and the corresponding voxel side length is larger. The human body image on the right contains more voxels, and the corresponding voxel side length is smaller. The smaller the voxel side length, the higher the accuracy of the TSDF volume expression, and in a sense, the upper limit of the geometric reconstruction accuracy that can be achieved will also be higher. However, the smaller the voxel side length, the more voxels are required to express the same volume space, and thus the required amount of computation and storage. For example, for a 2m x 2m x 2m space with a 4mm resolution, the number of voxels exceeds 100 million. For most common objects, usually only the TSDF values of the voxels near the surface will actually affect the three-dimensional geometry, and the number of these voxels near the surface is usually one order of magnitude lower than the total number of voxels in the entire space. Therefore, as long as a data structure can be used to store and calculate only the voxels near the surface of an object (such as the object mentioned above), the amount of computation and storage can be greatly reduced (usually reduced to about 10% for common objects). Such a data structure is a hierarchical storage structure, that is, the space is first divided into large voxel blocks (voxel blocks such as 8x8x8 voxel size, or 4x4x4 voxel size, or 16x16x16 voxel size, or other specifications), so that only a small number of voxel blocks are needed to cover the space near the surface of the photographed object. After that, the voxel blocks on the surface of the object and its vicinity are further divided into voxel sizes and allocated a corresponding number of voxels (such as 8x8x8, or 4x4x4, or 16x16x16, etc.) for filling.
[0139] For the retrieval of voxel blocks on the surface of an object and its vicinity (finding a voxel block covering a certain point in space), a hash table is generally used. Figure 5 The description generates a hash code from the three-dimensional (3D) coordinates of a voxel block, and then searches the hash table for the index of the voxel block (i.e., its position in the voxel block array) based on the hash code. Figure 6 This is a 2D schematic diagram of a 3D TSDF volume. The upper part of the figure shows a surface in space (a 2D surface is represented by a curve), and each rectangle in space represents a voxel block (a rectangle after 2D). As can be seen from the figure, only the voxel blocks near the surface need to be stored (recorded in the hash table and voxelblock array).
[0140] Deformation Tracking:
[0141] In order to describe the specific deformation process of the object during deformation tracking and voxel fusion, it is necessary to introduce the concept of a deformation field. The deformation field is a (multi-dimensional) function of a spatial position (three-dimensional coordinates X / Y / Z of a spatial point), and the function value is the deformation parameter of the spatial position (the specific deformation parameter depends on the specific model used, which can be translation or translation + rotation). In theory, the deformation field can be defined directly on the voxel voxel, that is, a set of corresponding deformation parameters is obtained for each voxel. This method is simple and intuitive, but the number of voxels is too large, resulting in too many deformation parameters that need to be obtained. Therefore, the method usually used is to describe the deformation field using a deformation model such as an embedded deformation graph (Embeded Deformation Graph).
[0142] The Embeded Deformation Graph deformation model actually considers the deformation field to be piecewise rigid, and the deformation field in any infinitesimal space is a rigid body transformation. Therefore, it is only necessary to select some sparse discrete points in the space, namely nodes, and obtain the rigid body transformation parameters for these nodes (such as translation + rotation, a total of 6 parameters). The deformation field corresponding to the point in the space between the nodes is obtained by interpolating the rigid body transformation of the nodes near the point. Therefore, the operation of obtaining the neighboring nodes is a frequently used operation in the Embeded Deformation Graph deformation model. In this way, the complex non-rigid deformation in the entire space is transformed into the rigid deformation of a few nodes plus the deformation obtained by interpolation in the space between the nodes.
[0143] The Embeded Deformation Graph actually describes the continuous spatial non-rigid deformation through some sparse discrete nodes in the space. Therefore, how to select these nodes becomes a problem. Figure 7 It is a schematic diagram of a surface and the nodes on the surface. Figure 7 The mid-surface is represented by a mesh, and the small protrusions on the mesh are nodes (in fact, nodes do not cause small protrusions in the mesh, but are marked as protrusions here for ease of understanding). Figure 7 In the right part of the figure, after the surface undergoes non-rigid deformation, the node will always remain on the mesh.
[0144] The method of the embodiment of the present invention is described in detail above, and the device of the embodiment of the present invention is provided below.
[0145] See also Figure 8 , Figure 8 80 is a schematic diagram of a structure of a device 80 for three-dimensional reconstruction of an object provided by an embodiment of the present invention. The device may also be referred to as a first device (eg, Figure 1 The first device 101 in the description is distinguished from other devices (such as the device at the encoding end, which can be called the second device), wherein the detailed description of each unit of the first device 101 is as follows.
[0146] The camera module 801 is used to collect color visible light segment RGB images of an object at multiple moments and depth maps at the multiple moments; wherein the RGB image at each moment includes RGB images collected from multiple orientations of the object, and the depth map at each moment includes depth maps collected from the multiple orientations of the object;
[0147] The dynamic reconstruction module 802 is used to reconstruct the object through deformation tracking and voxel fusion according to the RGB images at the multiple moments and the depth maps at the multiple moments; wherein the multiple nodes used in the deformation tracking are located on the voxel blocks used in the voxel fusion, and one voxel block corresponds to only one node, and the number of the voxel blocks is greater than or equal to the number of the nodes.
[0148] In the above device, each node used in the deformation tracking is located on a voxel block, and different nodes are located on different voxel blocks. Therefore, when determining the adjacent nodes of any node, the adjacent nodes of any node can be quickly found based on the regular distribution of these nodes, without the need for tedious traversal and search through downsampling, which significantly reduces the amount of calculation and improves the efficiency of 3D reconstruction.
[0149] In a possible implementation, the dynamic reconstruction module 802 is used to reconstruct the object through deformation tracking and voxel fusion according to the RGB images at the multiple moments and the depth maps at the multiple moments, specifically:
[0150] Performing deformation tracking and voxel fusion on the RGB images at the multiple moments and the depth maps at the multiple moments to obtain a fused mesh of the object and a deformation parameter of the object at each of the multiple moments;
[0151] The mesh at each moment is generated according to the fused mesh and the deformation parameters at each moment, or the mesh at some moments is generated according to the fused mesh and the deformation parameters at some moments among the multiple moments.
[0152] In another possible implementation, the deformation parameters at each moment are obtained by constraining the total deformation energy, and the total deformation energy includes a regularization term, which is calculated based on the multiple nodes and the adjacent nodes of the multiple nodes. The adjacent nodes of any node are nodes on voxel blocks that have been allocated memory in each adjacent voxel block of the voxel block where the any node is located. Each node used in the deformation tracking is located on a voxel block, and different nodes are located on different voxel blocks. Based on this premise, the adjacent nodes of any node are defined as nodes on voxel blocks that have been allocated in each adjacent voxel block of the voxel block where the any node is located; therefore, when searching for the adjacent nodes of any node in the deformation tracking process, there is no need to perform tedious traversal and search by downsampling, but the adjacent nodes of the any node can be found based on the adjacent voxel blocks of the voxel block where the any node is located, which significantly reduces the amount of calculation and improves the efficiency of 3D reconstruction.
[0153] In another possible implementation, the deformation parameters at each moment are obtained by constraining the total deformation energy, and the total deformation energy includes data items, and the data items are calculated based on the deformation field of the point in space. The deformation field of any point in the space is obtained by interpolating the calculated deformation parameters of the nearby nodes of the arbitrary point, and the nearby nodes of the arbitrary point are the nodes on the voxel blocks that have been allocated memory in each adjacent voxel block of the voxel block where the arbitrary point is located.
[0154] In this way, the deformation field is calculated based on the nodes on the adjacent voxel blocks of the voxel block where any point p is located, without the need to find the adjacent nodes through tedious search and traversal to calculate the deformation field, which significantly reduces the amount of calculation.
[0155] In yet another possible implementation, a coding transmission module is further included, wherein the coding transmission module is used for, after the dynamic reconstruction module reconstructs the object according to the RGB images at the multiple moments and the depth maps at the multiple moments through deformation tracking and voxel fusion:
[0156] According to the relationship between the node and the voxel block, the position coordinates (x0, y0, z0) of the target node in the deformation parameters at each moment are converted into reference coordinates (x1, y1, z1), wherein x1=floor(x0 / L)-K, y1=floor(y0 / L)-K, z1=floor(z0 / L)-K; L is the side length of the voxel block, and K is a preset integer; the target node is any node used in the deformation tracking process; and each node used in the deformation tracking process is in the same coordinate system;
[0157] The fused mesh and the deformation parameters at each moment after performing the transformation are encoded and sent.
[0158] In this way, the original coordinates of the node are replaced by reference coordinates during encoding. Since the reference coordinates are integers rather than floating-point numbers, the encoding of the reference coordinates has a lower bit rate and higher efficiency than encoding the original coordinates of the node.
[0159] In yet another possible implementation, the device further includes a texture generation module, which is used to:
[0160] Generate a texture map and texture coordinates according to the RGB image at each of the multiple moments and the fused grid;
[0161] The texture map and texture coordinates are encoded and sent.
[0162] In yet another possible implementation, the node is located at a center point, a corner point, or a diagonal corner point of the voxel block.
[0163] It should be noted that the implementation of each unit can also refer to Figure 2 The corresponding description of the method embodiment shown.
[0164] exist Figure 8 In the described device 80, each node used in the deformation tracking is located on a voxel block, and different nodes are located on different voxel blocks. Therefore, when determining the neighboring nodes of any node, the neighboring nodes of any node can be quickly found based on the regular distribution of these nodes, without the need for tedious traversal and search through downsampling, which significantly reduces the amount of calculation and improves the efficiency of 3D reconstruction.
[0165] See also Fig. 9 , Fig. 9 The present invention is a schematic block diagram of an implementation method of a device 90 for three-dimensional reconstruction of an object according to an embodiment of the present application. The device 900 may include a processor 910, a memory 930, a camera module 940, and a bus system 950. The processor and the memory are connected via a bus system, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory. In an embodiment of the present application, the bus system 950 may include a power bus, a control bus, a status signal bus, etc. in addition to a data bus. However, for the sake of clarity, various buses are labeled as bus system 950 in the figure.
[0166] The processor 910 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0167] The camera module 940 is used to collect color visible light segment RGB images of the object at multiple moments and depth maps at the multiple moments; wherein the RGB image at each moment includes RGB images collected from multiple positions of the object, and the depth map at each moment includes depth maps collected from the multiple positions of the object.
[0168] The memory 930 may include a read-only memory (ROM) device or a random access memory (RAM) device. Any other suitable type of storage device may also be used as the memory 930. The memory 930 may include code and data 931 accessed by the processor 910 using the bus 950. The memory 930 may further include an operating system 933 and an application 935, which (or program instructions) allows the processor 910 to perform the following operations:
[0169] The object is reconstructed through deformation tracking and voxel fusion according to the RGB images at the multiple moments and the depth maps at the multiple moments; the multiple nodes used in the deformation tracking are located on the voxel blocks used in the voxel fusion, and one voxel block corresponds to only one node, and the number of the voxel blocks is greater than or equal to the number of the nodes.
[0170] In the above device, each node used in the deformation tracking is located on a voxel block, and different nodes are located on different voxel blocks. Therefore, when determining the adjacent nodes of any node, the adjacent nodes of any node can be quickly found based on the regular distribution of these nodes, without the need for tedious traversal and search through downsampling, which significantly reduces the amount of calculation and improves the efficiency of 3D reconstruction.
[0171] In a possible implementation, when reconstructing the object through deformation tracking and voxel fusion according to the RGB images at the multiple moments and the depth maps at the multiple moments, the processor is specifically configured to call the program instruction to perform the following operations:
[0172] Performing deformation tracking and voxel fusion on the RGB images at the multiple moments and the depth maps at the multiple moments to obtain a fused mesh of the object and a deformation parameter of the object at each of the multiple moments;
[0173] The mesh at each moment is generated according to the fused mesh and the deformation parameters at each moment, or the mesh at some moments is generated according to the fused mesh and the deformation parameters at some moments among the multiple moments.
[0174] In another possible implementation, the deformation parameters at each moment are obtained by constraining the total deformation energy, and the total deformation energy includes a regularization term, which is calculated based on the multiple nodes and the adjacent nodes of the multiple nodes, and the adjacent nodes of any node are nodes on voxel blocks that have been allocated memory in each adjacent voxel block of the voxel block where the any node is located. It can be seen that each node used in the deformation tracking is located on a voxel block, and different nodes are located on different voxel blocks. Based on this premise, the adjacent nodes of any node are defined as nodes on voxel blocks that have been allocated in each adjacent voxel block of the voxel block where the any node is located; therefore, when searching for the adjacent nodes of any node in the deformation tracking process, there is no need to perform tedious traversal and search by downsampling, but the adjacent nodes of the any node can be found based on the adjacent voxel blocks of the voxel block where the any node is located, which significantly reduces the amount of calculation and improves the efficiency of 3D reconstruction.
[0175] In another possible implementation, the deformation parameters at each moment are obtained by constraining the total deformation energy, and the total deformation energy includes data items, and the data items are calculated based on the deformation field of the point in space. The deformation field of any point in the space is obtained by interpolating the calculated deformation parameters of the nearby nodes of the arbitrary point, and the nearby nodes of the arbitrary point are the nodes on the voxel blocks that have been allocated memory in each adjacent voxel block of the voxel block where the arbitrary point is located.
[0176] In this way, the deformation field is calculated based on the nodes on the adjacent voxel blocks of the voxel block where any point p is located, without the need to find the adjacent nodes through tedious search and traversal to calculate the deformation field, which significantly reduces the amount of calculation.
[0177] In another possible implementation, after reconstructing the object through deformation tracking and voxel fusion according to the RGB images at the multiple moments and the depth maps at the multiple moments, the processor is further configured to call the program instruction to perform the following operations:
[0178] According to the relationship between the node and the voxel block, the position coordinates (x0, y0, z0) of the target node in the deformation parameters at each moment are converted into reference coordinates (x1, y1, z1), wherein x1=floor(x0 / L)-K, y1=floor(y0 / L)-K, z1=floor(z0 / L)-K; L is the side length of the voxel block, and K is a preset integer; the target node is any node used in the deformation tracking process; and each node used in the deformation tracking process is in the same coordinate system;
[0179] The fused mesh and the deformation parameters at each moment after performing the transformation are encoded and sent.
[0180] In this way, the original coordinates of the node are replaced by reference coordinates during encoding. Since the reference coordinates are integers rather than floating-point numbers, the encoding of the reference coordinates has a lower bit rate and higher efficiency than encoding the original coordinates of the node.
[0181] In yet another possible implementation, the processor is further configured to call the program instruction to perform the following operations:
[0182] Generate a texture map and texture coordinates according to the RGB image at each of the multiple moments and the fused grid;
[0183] The texture map and texture coordinates are encoded and sent.
[0184] In yet another possible implementation, the node is located at a center point, a corner point, or a diagonal corner point of the voxel block.
[0185] Optionally, the device 900 may also include one or more output devices, such as a display 970. In one example, the display 970 may be a touch-sensitive display that combines a display with a touch-sensitive unit operable to sense touch input. The display 970 may be connected to the processor 910 via the bus 950.
[0186] The embodiment of the present invention further provides a chip system, the chip system includes at least one processor, a memory and an interface circuit, the memory, the interface circuit and the at least one processor are interconnected through a line, the at least one memory stores program instructions; when the program instructions are executed by the processor, the Figure 2 The method flow is shown.
[0187] The embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, which, when executed on a processor, implement Figure 2 The method flow is shown.
[0188] The embodiment of the present invention further provides a computer program product, which, when executed on a processor, implements Figure 2 The method flow is shown.
[0189] In summary, by implementing the embodiments of the present invention, each node used in the deformation tracking is located on a voxel block, and different nodes are located on different voxel blocks. Therefore, when determining the adjacent nodes of any node, the adjacent nodes of any node can be quickly found based on the regular distribution of these nodes, without the need for tedious traversal and search by downsampling, which significantly reduces the amount of calculation and improves the efficiency of 3D reconstruction.
[0190] Those skilled in the art will appreciate that the functions described in conjunction with the various illustrative logic blocks, modules, and algorithm steps disclosed herein can be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions described in the various illustrative logic blocks, modules, and steps can be stored or transmitted as one or more instructions or codes on a computer-readable medium and executed by a hardware-based processing unit. Computer-readable media may include computer-readable storage media, which corresponds to tangible media, such as data storage media, or includes any communication media that facilitates the transfer of computer programs from one place to another (e.g., according to a communication protocol). In this manner, computer-readable media may generally correspond to (1) non-temporary tangible computer-readable storage media, or (2) communication media, such as signals or carrier waves. Data storage media may be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, codes, and / or data structures for implementing the techniques described in this application. A computer program product may include computer-readable media.
[0191] As an example and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage, flash memory, or any other medium that can be used to store the desired program code in the form of instructions or data structures and can be accessed by a computer. Also, any connection is properly referred to as a computer-readable medium. For example, if instructions are transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio and microwave are included in the definition of media. However, it should be understood that the computer-readable storage media and data storage media do not include connections, carrier waves, signals or other temporary media, but are actually directed to non-temporary tangible storage media. As used herein, disks and optical disks include compact disks (CDs), laser optical disks, optical optical disks, digital versatile disks (DVDs), and Blu-ray disks, where disks typically reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0192] Instructions may be executed by one or more processors, such as one or more digital signal processors (DSPs), general purpose microprocessors, application specific integrated circuits (ASICs), field programmable logic arrays (FPGAs), or other equivalent integrated or discrete logic circuits. Thus, the term "processor" as used herein may refer to any of the aforementioned structures or any other structures suitable for implementing the techniques described herein. Additionally, in some aspects, the functions described by the various illustrative logic blocks, modules, and steps described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or incorporated in a combined codec. Moreover, the techniques may be fully implemented in one or more circuits or logic elements.
[0193] The technology of the present application can be implemented in a variety of devices or apparatuses, including a wireless handset, an integrated circuit (IC) or a set of ICs (e.g., a chipset). Various components, modules, or units are described in this application to emphasize the functional aspects of the device for performing the disclosed technology, but they do not necessarily need to be implemented by different hardware units. In fact, as described above, the various units can be combined in a device in conjunction with appropriate software and / or firmware, or provided by interoperating hardware units (including one or more processors as described above).
[0194] The above is only an exemplary embodiment of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for three-dimensional reconstruction of an object, characterized in that: include: Collecting color visible light segment RGB images of the object at multiple moments and depth maps at the multiple moments; wherein the RGB image at each moment includes RGB images collected from multiple positions of the object, and the depth map at each moment includes depth maps collected from the multiple positions of the object; Reconstructing the object through deformation tracking and voxel fusion according to the RGB images at the multiple moments and the depth images at the multiple moments; wherein the multiple nodes used in the deformation tracking are located on the voxel blocks used in the voxel fusion, and one voxel block corresponds to only one node, and the number of the voxel blocks is greater than or equal to the number of the nodes; The reconstructing the object according to the RGB images at the multiple moments and the depth maps at the multiple moments through deformation tracking and voxel fusion includes: Performing deformation tracking and voxel fusion on the RGB images at the multiple moments and the depth maps at the multiple moments to obtain a fused mesh of the object and a deformation parameter of the object at each of the multiple moments; The fused mesh and the deformation parameters at each moment are used to generate the mesh at each moment, or the fused mesh and the deformation parameters at some moments among the multiple moments are used to generate the mesh at the some moments.
2. The method according to claim 1, characterized in that The deformation parameters at each moment are obtained by constraining the total deformation energy, and the total deformation energy includes a regularization term, and the regularization term is calculated based on the multiple nodes and the adjacent nodes of the multiple nodes. The adjacent nodes of any node are the nodes on the voxel blocks that have been allocated memory in each adjacent voxel block of the voxel block where the any node is located.
3. The method according to claim 1 or 2, characterized in that: The deformation parameters at each moment are obtained by constraining the total deformation energy, and the total deformation energy includes data items, and the data items are calculated based on the deformation field of the point in space. The deformation field of any point in the space is obtained by interpolating the calculated deformation parameters of the nearby nodes of the arbitrary point, and the nearby nodes of the arbitrary point are the nodes on the voxel blocks that have been allocated memory in each adjacent voxel block of the voxel block where the arbitrary point is located.
4. The method according to claim 1 or 2, characterized in that: After reconstructing the object according to the RGB images at the multiple moments and the depth maps at the multiple moments through deformation tracking and voxel fusion, the method further includes: According to the relationship between the node and the voxel block, the position coordinates (x0, y0, z0) of the target node in the deformation parameters at each moment are converted into reference coordinates (x1, y1, z1), wherein x1=floor(x0 / L)-K, y1=floor(y0 / L)-K, z1=floor(z0 / L)-K; L is the side length of the voxel block, and K is a preset integer; the target node is any node used in the deformation tracking process; and each node used in the deformation tracking process is in the same coordinate system; The fused mesh and the deformation parameters at each moment after performing the transformation are encoded and sent.
5. The method according to claim 4, characterized in that The method further comprises: Generate a texture map and texture coordinates according to the RGB image at each of the multiple moments and the fused grid; The texture map and texture coordinates are encoded and sent.
6. The method according to claim 1 or 2, characterized in that: The node is located at the center point or corner point of the voxel block.
7. A device for three-dimensional reconstruction of an object, characterized in that: It includes a camera module, a memory and a processor, among which: The camera module is used to collect color visible light segment RGB images of an object at multiple moments and depth maps at the multiple moments; wherein the RGB image at each moment includes RGB images collected from multiple positions of the object, and the depth map at each moment includes depth maps collected from the multiple positions of the object; The memory is used to store program instructions, and the processor is used to call the program instructions to perform the following operations: Reconstructing the object through deformation tracking and voxel fusion according to the RGB images at the multiple moments and the depth images at the multiple moments; the multiple nodes used in the deformation tracking are located on the voxel blocks used in the voxel fusion, and one voxel block corresponds to only one node, and the number of the voxel blocks is greater than or equal to the number of the nodes; When reconstructing the object through deformation tracking and voxel fusion according to the RGB images at the multiple moments and the depth maps at the multiple moments, the processor is specifically used to call the program instructions to perform the following operations: Performing deformation tracking and voxel fusion on the RGB images at the multiple moments and the depth maps at the multiple moments to obtain a fused mesh of the object and a deformation parameter of the object at each of the multiple moments; The fused mesh and the deformation parameters at each moment are used to generate the mesh at each moment, or the fused mesh and the deformation parameters at some moments among the multiple moments are used to generate the mesh at the some moments.
8. The device according to claim 7, characterized in that The deformation parameters at each moment are obtained by constraining the total deformation energy, and the total deformation energy includes a regularization term, and the regularization term is calculated based on the multiple nodes and the adjacent nodes of the multiple nodes. The adjacent nodes of any node are the nodes on the voxel blocks that have been allocated memory in each adjacent voxel block of the voxel block where the any node is located.
9. The device according to claim 7 or 8, characterized in that The deformation parameters at each moment are obtained by constraining the total deformation energy, and the total deformation energy includes data items, and the data items are calculated based on the deformation field of the point in space. The deformation field of any point in the space is obtained by interpolating the calculated deformation parameters of the nearby nodes of the arbitrary point, and the nearby nodes of the arbitrary point are the nodes on the voxel blocks that have been allocated memory in each adjacent voxel block of the voxel block where the arbitrary point is located.
10. The device according to claim 7 or 8, characterized in that After reconstructing the object through deformation tracking and voxel fusion according to the RGB images at the multiple moments and the depth maps at the multiple moments, the processor is further used to call the program instructions to perform the following operations: According to the relationship between the node and the voxel block, the position coordinates (x0, y0, z0) of the target node in the deformation parameters at each moment are converted into reference coordinates (x1, y1, z1), wherein x1=floor(x0 / L)-K, y1=floor(y0 / L)-K, z1=floor(z0 / L)-K; L is the side length of the voxel block, and K is a preset integer; the target node is any node used in the deformation tracking process; and each node used in the deformation tracking process is in the same coordinate system; The fused mesh and the deformation parameters at each moment after performing the conversion are encoded and sent.
11. The device according to claim 10, characterized in that The processor is further configured to call the program instructions to perform the following operations: Generate a texture map and texture coordinates according to the RGB image at each of the multiple moments and the fused grid, The texture map and texture coordinates are encoded and sent.
12. The device according to claim 7 or 8, characterized in that The node is located at the center point or corner point of the voxel block.
13. A device for three-dimensional reconstruction of an object, characterized in that: The method comprises a unit for executing the method according to any one of claims 1 to 6.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program instructions, and when the program instructions are executed on a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Image reconstruction method and image reconstruction system
CN106296764A
Real-time three-dimensional model reconstruction method and system based on deep video stream
CN108320330A
Three-dimensional reconstruction method, device and system for dynamic scenes, server and medium
CN108335353A
Method and device for reconstructing three-dimensional point cloud
CN108701374A
A voxel terrain management method
CN109712227A
