Three-dimensional object reconstruction method, device, storage medium and electronic device
Through the reconstruction model trained based on 3D models of different object categories, single-viewpoint RGB images are encoded and decoded to generate triangular patches, which solves the problem of incomplete and unrealistic 3D shapes in traditional methods and achieves higher authenticity. and integrity.
Patent Information
- Application Number
- CN202211104970.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-09
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-09-09
AI Technical Summary
When reconstructing single-viewpoint RGB images, traditional three-dimensional reconstruction methods lack the exploration and utilization of priori object structure, resulting in the generated three-dimensional shape being incomplete and unrealistic.
The reconstruction model trained based on 3D models of different object categories is used to encode and decode the single-viewpoint RGB image to generate triangular patches, thereby constructing a 3D object and making full use of the prior knowledge of the shape of the 3D object.
It improves the authenticity and completeness of three-dimensional object reconstruction, improves the robustness of shape estimation, and avoids the resolution limitations of voxel representation and the insufficient topological structure processing capabilities of triangle patch representation.
Smart Images

Figure CN115393526B
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a three-dimensional object reconstruction method, a three-dimensional object reconstruction system, a computer storage medium and an electronic device. Background Art
[0002] With the development of computer vision and graphics technology, the technology of reconstructing 3D shapes from natural images has been applied to robotics, augmented reality, e-commerce, visualization, animation production, interior design, indoor scene reconstruction and other fields.
[0003] Traditional 3D reconstruction methods usually require taking images of the object from multiple viewpoints and require known camera parameters to reconstruct the 3D coordinates of the pixels. In many application scenarios, this condition is difficult to achieve. Although with the development of deep learning-based object reconstruction methods, 3D shapes can be estimated from single-view or multi-view RGB images without complex camera calibration steps, the lack of prior knowledge of the object structure may result in incomplete and unrealistic 3D shapes.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of this application. Summary of the invention
[0005] The purpose of the present application is to provide a three-dimensional object reconstruction method, a three-dimensional object reconstruction system, a computer storage medium and an electronic device, thereby improving the authenticity and integrity of the three-dimensional shape reconstructed based on a single-viewpoint RGB image at least to a certain extent.
[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0007] According to a first aspect of the present application, a three-dimensional object reconstruction method is provided, comprising:
[0008] Acquire a single-viewpoint RGB image to be processed, input the single-viewpoint RGB image to be processed into a reconstruction model, encode the single-viewpoint RGB image to be processed through the reconstruction model to obtain a shape code corresponding to the single-viewpoint RGB image to be processed, and decode the shape code to obtain a triangular facet corresponding to the single-viewpoint RGB image to be processed, wherein the reconstruction model is obtained based on three-dimensional model training corresponding to different object categories;
[0009] A three-dimensional object corresponding to the single-viewpoint RGB image to be processed is constructed according to the triangular facets.
[0010] According to a second aspect of the present application, a three-dimensional object reconstruction device is provided, comprising:
[0011] An image processing module is used to obtain a single-viewpoint RGB image to be processed, input the single-viewpoint RGB image to be processed into a reconstruction model, encode the single-viewpoint RGB image to be processed through the reconstruction model to obtain a shape code corresponding to the single-viewpoint RGB image to be processed, and decode the shape code to obtain a triangular facet corresponding to the single-viewpoint RGB image to be processed, wherein the reconstruction model is obtained based on three-dimensional model training corresponding to different object categories;
[0012] A reconstruction module is used to construct a three-dimensional object corresponding to the single-viewpoint RGB image to be processed according to the triangular facets.
[0013] According to a third aspect of the present application, there is provided a computer storage medium on which a computer program is stored, characterized in that the computer program implements the above-mentioned three-dimensional object reconstruction method when executed by a processor.
[0014] According to a fourth aspect of the present application, there is provided an electronic device, characterized in that it includes:
[0015] Processor; and
[0016] A memory, configured to store executable instructions of the processor;
[0017] Wherein, the processor is configured to perform the above-mentioned three-dimensional object reconstruction method by executing the executable instructions.
[0018] It can be seen from the above technical solutions that the three-dimensional object reconstruction method, three-dimensional object reconstruction device, computer storage medium and electronic device in the exemplary embodiments of the present application have at least the following advantages and positive effects:
[0019] The three-dimensional object reconstruction method in the present application encodes the single-viewpoint RGB image to be processed through the reconstruction model to obtain the shape code corresponding to the single-viewpoint RGB image to be processed, and decodes the shape code to obtain the triangular facet corresponding to the single-viewpoint RGB image to be processed, and then constructs the three-dimensional object corresponding to the single-viewpoint RGB image to be processed according to the triangular facet, wherein the reconstruction model is obtained based on the training of three-dimensional models corresponding to different object categories. In the present application, since the reconstruction model is obtained based on the training of three-dimensional models corresponding to different object categories, the reconstruction model fully mines and learns the prior knowledge of the shape of the three-dimensional object. Therefore, when reconstructing the three-dimensional object of the single-viewpoint RGB image, the prior knowledge of the shape of the three-dimensional object can be fully utilized, thereby improving the authenticity and integrity of the reconstructed three-dimensional object.
[0020] It should be understood that the above general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 The structural diagram of the system architecture of the three-dimensional object reconstruction method in the embodiment of the present application is schematically shown.
[0023] Figure 2 The flowchart of the three-dimensional object reconstruction method in the embodiment of the present application is schematically shown.
[0024] Figure 3 The structural diagram of the reconstruction model in the embodiment of the present application is schematically shown.
[0025] Figure 4 The structural diagram of the shape coding prediction sub-model 301 in the embodiment of the present application is schematically shown.
[0026] Figure 5 The structural diagram of the shape representation sub-model 302 in the embodiment of the present application is schematically shown.
[0027] Figure 6 The flowchart of training the reconstruction model in the embodiment of the present application is schematically shown.
[0028] Figure 7 The flowchart of training the shape coding prediction sub-model to be trained in an embodiment of the present application is schematically shown.
[0029] Figure 8 The structural block diagram of the three-dimensional object reconstruction device in the present application is schematically shown.
[0030] Fig. 9 The structure block diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0031] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0032] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0033] The terms "a", "an", "the" and "said" are used in this specification to indicate the presence of one or more elements / components / etc.; the terms "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first" and "second" etc. are used only as labels and are not intended to limit the quantity of their objects.
[0034] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0035] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0036] In the related technologies of the present application, the representation method of three-dimensional shape is a key technical module in object reconstruction. Three-dimensional voxel representation and triangular patch mesh representation are the most common representation methods. Three-dimensional voxels can represent shapes with large topological structure differences, but are limited by the resolution of voxel representation, and the ability to represent shape details is insufficient, and the reconstructed shape has obvious step-like artifacts; the three-dimensional reconstruction method based on triangular patch representation has limitations in processing shapes with topological differences.
[0037] With the development of artificial intelligence, a variety of object reconstruction methods based on deep learning have emerged. For example, methods such as 3D recursive reconstruction neural network (3D-R2N2) and Pix2Vox use a two-dimensional convolutional encoder to extract the shape features of the image, and use a three-dimensional convolutional decoder to receive the feature embedding and reconstruct the voxel representation of the three-dimensional shape; methods such as Pixel2Mesh and Pixel2Mesh++ use a two-dimensional convolutional network to extract image features, and use a graph convolutional network to receive the features and deform the given triangular patch template shape to gradually fit the three-dimensional shape of the target. However, the above methods directly predict the voxel representation or triangular patch mesh representation of the shape, lack the mining and utilization of the object structure prior, and may generate incomplete and unrealistic three-dimensional shapes.
[0038] For example, Mem3D uses a memory network to retrieve the 3D shape most relevant to the RGB image and uses it as a structural prior to estimate the voxel representation of the 3D shape. Mesh R-CNN converts the predicted voxel representation into a triangular mesh representation and fine-tunes it in two stages, but it may still generate irregular and unrealistic shapes.
[0039] In view of the problems existing in the related art, the present application proposes a three-dimensional object reconstruction method.
[0040] Before describing in detail the technical solutions in the embodiments of the present application, the technical terms that may be involved in the embodiments of the present application are first explained and illustrated.
[0041] (1) Single-view image: usually refers to a 2D image.
[0042] (2)SDF: Signed Distance Field, a vector rendering method.
[0043] (3) Multi Head Pooling Attention: Multi Head Pooling Attention, referred to as MHPA, enables the multi-scale transformer (multi-scale encoder) to operate with gradually changing spatiotemporal resolution.
[0044] (4) Marching Cube algorithm: In the process of isosurface extraction, a series of two-dimensional slice data are regarded as a three-dimensional data field, from which materials with a certain threshold are extracted and connected into triangular faces in a certain topological form. Therefore, the MC algorithm is also called the "Isosurface Extraction" algorithm.
[0045] After introducing the technical terms that may be involved in the embodiments of the present application, the three-dimensional object reconstruction method in the present application is described in detail.
[0046] Figure 1 The following schematically shows an exemplary system architecture block diagram applying the technical solution of the present application.
[0047] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a server 102, and a network 103. The terminal device 101 may include various electronic devices with display screens, such as smart phones, tablet computers, laptop computers, desktop computers, smart TVs, smart car terminals, head-mounted devices, etc. The server 102 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The network 103 may be a communication medium of various connection types that can provide a communication link between the terminal device 101 and the server 102, such as a wired communication link or a wireless communication link.
[0048] According to implementation requirements, the system architecture in the embodiment of the present application may have any number of terminal devices, networks and servers. For example, the server may be a server group composed of multiple server devices.
[0049] The technical solution provided in the embodiment of the present application can be applied to the terminal device 101 or the server 102. When the three-dimensional object reconstruction method in the present application is executed by the server 102, the server can be a cloud server that provides cloud computing services.
[0050] Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, allowing various application systems to obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". From the user's perspective, the resources in the "cloud" are infinitely scalable and can be obtained at any time, used on demand, expanded at any time, and paid for by use.
[0051] As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.
[0052] According to the logical function division, the PaaS (Platform as a Service) layer can be deployed on the IaaS (Infrastructure as a Service) layer, and the SaaS (Software as a Service) layer can be deployed on the PaaS layer. SaaS can also be deployed directly on IaaS. PaaS is a platform for software operation, such as databases, web containers, etc. SaaS is a variety of business software, such as web portals, SMS mass senders, etc. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.
[0053] In the embodiment of the present application, a reconstruction model is used to reconstruct a three-dimensional object from a single-viewpoint RGB image. The reconstruction model is a machine learning model and involves artificial intelligence.
[0054] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0055] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0056] Computer Vision Technology (CV) Computer vision is a science that studies how to make machines "see". To put it more specifically, it refers to machine vision such as using cameras and computers to replace human eyes to identify and measure targets, and further perform graphic processing so that the computer processing becomes an image that is more suitable for human eye observation or transmission to instrument detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image information annotation, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and map construction, etc.
[0057] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.
[0058] The following is a detailed description of the technical solutions such as the three-dimensional object reconstruction method, three-dimensional object reconstruction device, computer-readable medium, and electronic device provided by the present application in combination with specific implementation methods.
[0059] Figure 2 A flowchart of a three-dimensional object reconstruction method is shown. Figure 2 As shown, the three-dimensional object reconstruction method includes:
[0060] Step S210: obtaining a single-viewpoint RGB image to be processed, inputting the single-viewpoint RGB image to be processed into a reconstruction model, encoding the single-viewpoint RGB image to be processed through the reconstruction model to obtain a shape code corresponding to the single-viewpoint RGB image to be processed, and decoding the shape code to obtain a triangular facet corresponding to the single-viewpoint RGB image to be processed, wherein the reconstruction model is obtained based on three-dimensional model training corresponding to different object categories;
[0061] Step S220: constructing a three-dimensional object corresponding to the single-viewpoint RGB image to be processed according to the triangular facets.
[0062] The three-dimensional object reconstruction method of the present application encodes the single-viewpoint RGB image to be processed through the reconstruction model to obtain the shape code corresponding to the single-viewpoint RGB image to be processed, and decodes the shape code to obtain the triangular facets corresponding to the single-viewpoint RGB image to be processed, and then constructs the three-dimensional object corresponding to the single-viewpoint RGB image to be processed according to the triangular facets, wherein the reconstruction model is obtained based on the training of three-dimensional models corresponding to different object categories. In the present application, since the reconstruction model is obtained based on the training of three-dimensional models corresponding to different object categories, the reconstruction model fully mines and learns the prior knowledge of the shape of the three-dimensional object. Therefore, when reconstructing the three-dimensional object of the single-viewpoint RGB image, the prior knowledge of the shape of the three-dimensional object can be fully utilized, which improves the robustness of the shape estimation and improves the authenticity and integrity of the reconstructed three-dimensional object.
[0063] Below Figure 2 Each step of the three-dimensional object reconstruction method shown is described in detail.
[0064] In step S210, a single-viewpoint RGB image to be processed is obtained, and the single-viewpoint RGB image to be processed is input into a reconstruction model, and the single-viewpoint RGB image to be processed is encoded by the reconstruction model to obtain a shape code corresponding to the single-viewpoint RGB image to be processed, and the shape code is decoded to obtain a triangular facet corresponding to the single-viewpoint RGB image to be processed, wherein the reconstruction model is obtained based on three-dimensional model training corresponding to different object categories.
[0065] In an exemplary embodiment of the present application, the object for three-dimensional object reconstruction is a single-viewpoint RGB image to be processed, and the single-viewpoint RGB image to be processed may be a two-dimensional RGB image, specifically, a two-dimensional RGB image corresponding to different object categories, such as a two-dimensional RGB image of an airplane, a train, a sofa, etc. When reconstructing a three-dimensional object from a single-viewpoint RGB image to be processed, a reconstruction model is used in an embodiment of the present application. The reconstruction model is a model with encoding and decoding functions, and can encode the single-viewpoint RGB image to be processed to obtain a shape code corresponding to the single-viewpoint RGB image to be processed. Furthermore, the shape code can also be decoded to obtain a triangular facet corresponding to the single-viewpoint RGB image to be processed.
[0066] Figure 3 The structural diagram of the reconstruction model is shown schematically. Figure 3As shown, the reconstruction model 300 includes a shape coding prediction submodel 301, a shape representation submodel 302, and a 3D isosurface determination submodel 303. The shape coding prediction submodel 301 is used to encode the input single-viewpoint RGB image to be processed to obtain the shape coding corresponding to the single-viewpoint RGB image to be processed; the shape representation submodel 302 is used to decode the shape coding to obtain the SDF set corresponding to the single-viewpoint RGB image to be processed, and the SDF set is the SDF representation corresponding to the single-viewpoint RGB image to be processed for predicting the shape of the object; the 3D isosurface determination submodel 303 can extract an isosurface from the SDF set according to the SDF values contained therein, and obtain a triangular facet for reconstructing a 3D object corresponding to the single-viewpoint RGB image to be processed according to the isosurface.
[0067] Next, the specific composition structures and image processing flow of the shape coding prediction sub-model 301, the shape representation sub-model 302 and the three-dimensional isosurface determination sub-model 303 are described in detail.
[0068] Figure 4 The schematic diagram of the structure of the shape coding prediction sub-model 301 is shown schematically. Figure 4 The shape coding prediction submodel 301 includes an image block feature embedding layer 401, multiple Transformer multi-scale coding layers 402 and a shape embedding prediction layer 403 connected in sequence, wherein the multiple Transformer multi-scale coding layers 402 can specifically include three Transformer multi-scale coding layers, namely a first Transformer multi-scale coding layer 402-1, a second Transformer multi-scale coding layer 402-2 and a third Transformer multi-scale coding layer 402-3.
[0069] After the single-view RGB image to be processed is input into the shape coding prediction sub-model 301, the shape coding prediction sub-model 301 first divides the single-view RGB image to be processed into a plurality of image blocks, and then the image blocks are input into the image block feature embedding layer 401, through which the image block feature embedding layer 401 can perform feature extraction on each image block to obtain an image block feature sequence G. Specifically, when performing image block segmentation, for a single-view RGB image with an input size of h×w, it can be divided into blocks of a size of h0×w0, thereby forming an image sequence of length l=h / h0×w / w0. When the single-view RGB image to be processed cannot be divided into an integer number of h0×w0 image blocks, the single-view RGB image to be processed can be resampled to convert the size of the single-view RGB image from h×w to h'×w' divisible by h0×w0, and then the resampled single-view RGB image to be processed is divided into blocks to obtain an image sequence of length h' / h0×w' / w0. Among them, the resampling can be upsampling or downsampling, which is not specifically limited in the embodiments of the present application. In addition, h0 and w0 can be any values greater than zero and less than h and w. When performing feature extraction, feature extraction can be performed on each image block, and an image block feature sequence is formed based on the extracted features. The image block feature sequence can be marked as Where m is the dimension of feature embedding for each image block.
[0070] In an exemplary embodiment of the present application, the image block feature embedding layer 401 is composed of a fully connected layer, which can extract features from each image block and generate an image block feature sequence based on all the extracted features.
[0071] After generating the image block feature sequence, the image block feature embedding layer 401 outputs the image block feature sequence G to multiple Transformer multi-scale coding layers, and each Transformer multi-scale coding layer sequentially extracts features of different dimensions from the image block feature sequence to obtain a high-dimensional feature embedding vector corresponding to the single-viewpoint RGB image. In the embodiment of the present application, since the Transformer structure is a bidirectional feature extraction, it is possible to construct long-range information associations of shape features, which can improve the accuracy of three-dimensional object reconstruction compared to convolution operations that can only achieve local interactions.
[0072] In an exemplary embodiment of the present application, the Transformer multi-scale coding layer includes a plurality of coding units consisting of a multi-head pooling attention layer and a fully connected layer, and the number of coding units contained in different Transformer multi-scale coding layers is different. The Transformer multi-scale coding layer can be considered as a multi-scale visual transformer, in which the multi-head pooling attention layer contained therein can merge the potential tensor sequence to reduce the sequence length participating in the input, and the sequence length corresponds to the spatiotemporal resolution. Therefore, under the action of the multi-head pooling attention layer, the Transformer multi-scale coding layer can operate with gradually changing spatiotemporal resolution, that is, after receiving the image block feature sequence, multiple Transformer multi-scale encoders can gradually increase the dimension m of feature embedding, while reducing the length l of the image block feature sequence, and represent local low-dimensional shape feature information with features with higher spatial resolution, and represent high-dimensional shape feature information with features with lower spatial resolution.
[0073] In an exemplary embodiment of the present application, the multiple Transformer multi-scale coding layers 402 may specifically include a first Transformer multi-scale coding layer 402-1, a second Transformer multi-scale coding layer 402-2 and a third Transformer multi-scale coding layer 402-3, each Transformer multi-scale coding layer corresponds to a resolution, then the Transformer multi-scale coding layer in the embodiment of the present application can extract information at three resolution levels, wherein the first Transformer multi-scale coding layer 402-1 can extract a feature G1 with a higher spatial resolution, the third Transformer multi-scale coding layer 402-3 can extract a feature G3 with a lower spatial resolution, and the feature G2 of the spatial resolution extracted by the second Transformer multi-scale coding layer 402-2 is between the spatial resolutions extracted by the first Transformer multi-scale coding layer 402-1 and the third Transformer multi-scale coding layer 402-3.
[0074] For each encoding unit consisting of a multi-head pooling attention layer and a fully connected layer, the features that can be extracted can be determined according to formulas (1)-(2):
[0075] G'=MHPA(LN(G))+G (1)
[0076] E(G)=MLP(LN(G'))+G' (2)
[0077] Among them, G is the image feature input to the encoding unit, MPHA is the multi-head pooling attention layer, MLP is the fully connected layer, LN represents layer regularization, and E is the encoding unit.
[0078] By extracting the input image features in sequence through the coding units in each Transformer multi-scale coding layer, features of different spatial resolutions can be obtained. Accordingly, by extracting the image block feature sequence in sequence through the first Transformer multi-scale coding layer 402-1, the second Transformer multi-scale coding layer 402-2 and the third Transformer multi-scale coding layer 402-3, a high-dimensional feature embedding vector G3 corresponding to the single-viewpoint RGB image can be obtained.
[0079] Next, the third Transformer multi-scale coding layer 402-3 outputs the high-dimensional feature embedding vector to the shape embedding prediction layer 403. The shape embedding prediction layer 403 can perform feature extraction on the high-dimensional feature embedding vector to obtain the shape code S corresponding to the single-viewpoint RGB image to be processed. The shape code S uniquely determines the SDF corresponding to the three-dimensional shape of the object, so the shape code S can be decoded to obtain the corresponding SDF representation. In an embodiment of the present application, the shape embedding prediction layer 403 is composed of a fully connected layer. At this point, the reconstruction model has completed the encoding process of the single-viewpoint RGB image to be processed, and then the shape code S needs to be decoded through the shape representation sub-model.
[0080] Figure 5 The schematic diagram of the structure of the shape representation sub-model 302 is shown schematically. Figure 5 As shown, the shape representation submodel 302 includes a coordinate transformation layer 501 and an implicit template processing layer 502. The function of the coordinate transformation layer 501 is to establish a corresponding relationship between the three-dimensional space coordinates of a certain shape instance and the standard coordinate space where the implicit template shape is located. When the shape code S and a set of three-dimensional space coordinate sets c are simultaneously input into the coordinate transformation layer 501, the coordinate transformation layer 501 can transform the three-dimensional space coordinates of the corresponding shape into the standard coordinate space according to the shape code S, and obtain the three-dimensional space coordinate set c' on the corresponding implicit template shape; after receiving the three-dimensional space coordinate set c' output by the coordinate transformation layer 501, the implicit template processing layer 502 can output the SDF value of the implicit template shape at each coordinate position in the three-dimensional space coordinate set c', which is the SDF value of the shape corresponding to the shape code S at each coordinate position in the three-dimensional space coordinate set c'. Among them, the three-dimensional space coordinate set c is a coordinate set composed of the coordinates of multiple sampling points obtained by sampling the three-dimensional chessboard. When sampling the three-dimensional chessboard, sampling can be performed at intervals of a preset number of grids. Of course, sampling can also be performed according to other rules, and the embodiments of the present application do not make specific limitations on this.
[0081] In an exemplary embodiment of the present application, the coordinate transformation layer 501 includes a coordinate transformation unit composed of an LSTM layer 501-1 and an affine transformation layer 501-2, such as Figure 5 As shown, the shape code S and the three-dimensional space coordinate set c are simultaneously input into the coordinate conversion layer 501. The first coordinate conversion unit extracts features and performs coordinate conversion on the shape code S and the three-dimensional space coordinate set c, and outputs the first conversion information. Then, the second coordinate conversion unit extracts features and performs coordinate conversion on the shape code S and the first conversion information, and outputs the second conversion information. This is repeated until the last coordinate conversion unit outputs the converted three-dimensional space coordinate set c'. The implicit template processing layer is composed of a fully connected layer, and a deep SDF representation network of the implicit template is constructed. The implicit template processing layer represents the SDF of the shape of the three-dimensional object in a compact form. Unlike the voxel representation method of the shape, which is limited by the resolution, the deep SDF representation network has a better representation capability for shape details.
[0082] The implicit template processing layer 502 can output an SDF set D corresponding to the three-dimensional space coordinate set c' according to the three-dimensional space coordinate set c', and each SDF value in the SDF set corresponds to each coordinate point in the three-dimensional space coordinate set c'. After receiving the SDF set, the three-dimensional isosurface submodel 303 can use the Marching Cube method to determine the isosurface according to the same SDF value in the SDF set, and then determine the triangular facets according to the isosurfaces. Based on the obtained triangular facets, a three-dimensional object corresponding to the single-viewpoint RGB image to be processed can be constructed, such as Figure 5 As shown by the dotted arrow in the middle.
[0083] In step S220, a three-dimensional object corresponding to the single-viewpoint RGB image to be processed is constructed according to the triangular facets.
[0084] In an exemplary embodiment of the present application, after obtaining the triangular patch representation, surface rendering can be performed based on the triangular patch representation with the aid of computer graphics technology and a lighting model to fit a three-dimensional object.
[0085] In an exemplary embodiment of the present application, before using a reconstruction model to perform three-dimensional reconstruction on a single-viewpoint RGB image to be processed, the reconstruction model to be trained needs to be trained to obtain a reconstruction model with stable performance.
[0086] The structure of the reconstruction model to be trained is the same as that of the reconstruction model, including a shape coding prediction sub-model to be trained, a shape representation sub-model to be trained and a three-dimensional isosurface determination sub-model. Since the three-dimensional isosurface determination sub-model only uses the Marching Cube method to determine the isosurface, and determines the triangular facets based on the isosurface, the accuracy of the three-dimensional model obtained after three-dimensional reconstruction can be guaranteed as long as the accuracy of the acquired SDF value set is guaranteed. Therefore, when training the reconstruction model to be trained, only the shape coding prediction sub-model to be trained and the shape representation sub-model to be trained need to be trained, and there is no need to train the three-dimensional isosurface determination sub-model.
[0087] Next, the training method of the shape encoding prediction sub-model to be trained and the shape representation sub-model to be trained is described in detail.
[0088] In an exemplary embodiment of the present application, a first data set can be obtained, and a reconstruction model to be trained can be trained according to the first data set to obtain a reconstruction model for three-dimensional object reconstruction. The first data set is constructed according to a data set containing three-dimensional CAD models of multiple object categories. For example, the ShapeNet data set can be used to construct the first data set. Of course, other data sets can also be used to construct the first data set, which is not specifically limited in the embodiment of the present application. After obtaining three-dimensional CAD models of multiple object categories, the point coordinates contained in each three-dimensional CAD model are first normalized so that the three-dimensional CAD model is located inside the unit sphere, and then the normalized three-dimensional CAD model is sampled to obtain the SDF value corresponding to each sampling point, and an SDF set is constructed according to each sampling point and the corresponding SDF value, and finally the first data set is constructed according to the three-dimensional CAD model and the SDF set. Among them, when sampling the 3D CAD model to obtain the SDF value corresponding to each sampling point, sampling can be performed inside, outside and on the surface of the 3D CAD model, and then the vertical distance between the sampling point and the model surface is recorded as the SDF value. Since the internal sampling points and the external sampling points point to the surface in different directions, they can be distinguished by different symbols. Specifically, when the sampling point is an internal sampling point, the SDF value is recorded as a negative value, and when the sampling point is an external sampling point, the SDF value is recorded as a positive value. In order to improve the authenticity and completeness of the 3D reconstruction, the number of sampling points near the model surface is increased during sampling so that the shape representation model can learn more features of the template shape.
[0089] During training, the shape coding prediction sub-model to be trained and the shape representation sub-model to be trained are trained separately. First, the shape representation sub-model to be trained is trained. After the training is completed, the parameters in the shape representation sub-model to be trained are fixed, and then the shape coding prediction sub-model to be trained is trained again.
[0090] Figure 6The schematic diagram of the process of training the reconstruction model is shown schematically, as shown in Figure 6 As shown, in step S601, the shape representation sub-model to be trained is trained according to the first data set to obtain the shape representation sub-model; in step S602, a second data set is obtained, and a third data set consisting of a single-view RGB image and a shape coding corresponding to the single-view RGB image is constructed according to the shape representation sub-model and the second data set, wherein the second data set includes the single-view RGB image and a three-dimensional model corresponding to the single-view RGB image; in step S603, the shape coding prediction sub-model to be trained is trained according to the third data set to obtain the shape coding prediction sub-model.
[0091] In step S601, the shape representation submodel to be trained includes a coordinate transformation layer to be trained and an implicit template processing layer to be trained. The coordinate transformation layer to be trained can transform the three-dimensional space coordinates corresponding to the same three-dimensional CAD model in the first data set into a standard coordinate system corresponding to the implicit template. Then, the predicted SDF set can be determined according to each standard space coordinate through the implicit template processing layer to be trained. Finally, a first loss function is constructed according to the predicted SDF set and the SDF set in the first data set. The model parameters are adjusted according to the first loss function to obtain the shape representation submodel. There are two inputs to the coordinate transformation layer to be trained, one is the initialization shape code corresponding to the three-dimensional CAD model, and the other is a three-dimensional space coordinate set, which is generated by sampling the three-dimensional chessboard.
[0092] The calculation formula of the first loss function is shown in formulas (3)-(6), specifically:
[0093]
[0094]
[0095]
[0096] clamp(D,ε)=min(ε,max(-ε,D)) (6)
[0097] Among them, θ H is the learnable parameter in the implicit template processing layer to be trained, θ T is the learnable parameter in the coordinate transformation layer to be trained, S is the shape code, S is initialized to Gaussian noise before training, Lrec is the SDF reconstruction loss, Lreg is the regularization term, To predict the SDF set, D* is the SDF set in the first data set, ε is a value in [0,1], is the i-th coordinate transformation unit in the coordinate transformation layer to be trained, P is the total number of coordinate transformation units, and h(·) is the Huber operator.
[0098] When training the shape representation model, θ H ,θ T and S are parameters to be optimized. However, since the shape code is an input of the coordinate transformation layer to be trained, the shape code S is initialized to Gaussian noise before training. At the same time, the three-dimensional space coordinates obtained by sampling based on the three-dimensional chessboard are used as another input of the shape representation model to be trained. After receiving the spatial coordinate set consisting of the shape code S and the three-dimensional space coordinates corresponding to the sampling points, the transformed coordinate layer to be trained can convert the three-dimensional space coordinates into the standard coordinate system and output the corresponding transformed space coordinate set. The implicit template processing layer to be trained can process the transformed space coordinate set to obtain the corresponding predicted SDF set. The purpose of model training is to make the deviation between the predicted SDF set and the SDF set corresponding to the three-dimensional CAD model close to zero. Therefore, the parameters of the shape representation model to be trained can be optimized by minimizing the first loss function to obtain the optimal model parameters, and then obtain a shape representation model with stable performance.
[0099] Since the 3D CAD models of different object categories are used to train the shape representation model, the trained shape representation model can learn the shape priors of various objects, and then perform accurate 3D shape prediction when performing 3D reconstruction on different single-viewpoint RGB images.
[0100] After completing the training of the shape representation model to be trained, a data set consisting of a single-viewpoint RGB image and the corresponding shape coding can be constructed to train the shape coding prediction sub-model to be trained. The structure of the shape coding prediction sub-model to be trained is the same as that of the shape coding prediction sub-model, including an image block feature embedding layer to be trained, multiple Transformer multi-scale coding layers to be trained, and a shape embedding prediction layer to be trained.
[0101] In step S602, a second data set is obtained, which includes a pair of single-viewpoint RGB images and corresponding three-dimensional models. According to the three-dimensional model corresponding to the single-viewpoint RGB image in the second data set and the trained shape representation model, the shape coding corresponding to the single-viewpoint RGB image can be determined, and then a third data set can be constructed according to the single-viewpoint RGB image and the corresponding shape coding.
[0102] When the shape encoding corresponding to the single-viewpoint RGB image can be determined based on the three-dimensional model corresponding to the single-viewpoint RGB image in the second data set and the trained shape representation model, the SDF true value set is first determined based on the three-dimensional model, and then the learnable parameter θ in formula (3) is fixed. H and θ T , and then optimize the first loss function to obtain the shape code S* corresponding to the single-view RGB image.
[0103] Further, the shape coding prediction sub-model to be trained can be trained according to the third data set. Figure 7 The schematic diagram of the process of training the shape coding prediction sub-model to be trained is shown as follows: Figure 7 As shown, in step S701, the single-view RGB image in the third data set is input into the shape coding prediction sub-model to be trained, and features of the single-view RGB image are extracted by the shape coding prediction sub-model to be trained to obtain a predicted shape coding corresponding to the single-view RGB image; in step S702, a second loss function is constructed according to the predicted shape coding and the shape coding corresponding to the single-view RGB image, and model parameters are adjusted according to the second loss function to obtain the shape coding prediction sub-model.
[0104] Among them, in step S701, the process of extracting features of the single-view RGB image by the shape coding prediction sub-model to be trained is the same as the process of extracting features of the single-view RGB image by the shape coding prediction sub-model in the above embodiment, which will not be repeated here. The calculation formula of the second loss function in step S702 is shown in formula (7):
[0105] L Enc =||Enc(I)-S * ||2 (7)
[0106] Among them, I is the input single-view RGB image, Enc(I) is the predicted shape code, and S* is the shape code corresponding to the single-view RGB image.
[0107] Through the training process recorded in the above embodiment, the training of the reconstruction model to be trained can be completed, the reconstruction model with stable performance can be obtained, and the newly acquired single-view RGB image can be reconstructed for three-dimensional objects. Since the three-dimensional CAD model and its corresponding SDF representation are used to train the shape representation model to be trained during the model training process, so that the shape representation model learns the prior knowledge of the shape corresponding to the three-dimensional model, then when the single-view RGB image is reconstructed in three dimensions by the reconstruction model, the reconstruction of the three-dimensional object can be assisted according to the learned prior knowledge of the shape. In addition, in the embodiment of the present application, the SDF value corresponding to the three-dimensional object corresponding to the single-view SDF image is predicted, and then the triangular facet used to construct the three-dimensional object is determined according to the SDF value. Since the SDF representation method is a compact continuous representation, it can handle shapes with complex topology and retain structural details. Therefore, the three-dimensional object reconstruction method in the embodiment of the present application can avoid the problem that the voxel representation method is limited by resolution, the representation ability of shape details is insufficient, and there are obvious artifacts, and it also avoids the problem that the triangular facet representation method is insufficient in processing shapes with complex topological structures, and ensures the authenticity and integrity of the reconstructed object.
[0108] The three-dimensional object reconstruction method in this application can be applied to industries or fields involving computer vision, such as the construction industry, the medical industry, augmented reality, animation production, interior design, etc. In order to make the three-dimensional object reconstruction method in this application clearer, the three-dimensional object reconstruction method in this application is specifically described below using augmented reality as an example.
[0109] Augmented reality is a technology that cleverly integrates virtual information with the real world. It widely uses a variety of technical means such as multimedia, three-dimensional modeling, real-time tracking and registration, intelligent interaction, and sensing. It simulates computer-generated virtual information such as text, images, three-dimensional models, music, and videos, and applies them to the real world. The two types of information complement each other, thereby achieving "enhancement" of the real world.
[0110] As an example, a three-dimensional object reconstruction device can be set in an AR head-mounted device. The AR head-mounted device can shoot a real scene and send the generated single-viewpoint RGB image to the three-dimensional object reconstruction device. The three-dimensional object reconstruction device can call the reconstruction model to encode the single-viewpoint RGB image to generate a shape code corresponding to the single-viewpoint RGB image, and then decode the shape code, convert the three-dimensional space coordinates of the shape corresponding to the shape code into three-dimensional space coordinates in the standard coordinate space, and obtain the SDF set corresponding to the three-dimensional space coordinates in the standard coordinate space, and then determine the isosurface according to the SDF set, and determine the triangular facets according to the isosurface, and finally fit the three-dimensional model according to the determined triangular facets to generate a three-dimensional object corresponding to the single-viewpoint RGB image in the virtual space, thereby increasing the authenticity and immersion of augmented reality and improving the user experience.
[0111] The three-dimensional object reconstruction method in the embodiment of the present application encodes the single-viewpoint RGB image to be processed through the reconstruction model to obtain the shape code corresponding to the single-viewpoint RGB image to be processed, and decodes the shape code to obtain the triangle patch information corresponding to the single-viewpoint RGB image to be processed, and then constructs the three-dimensional object corresponding to the single-viewpoint RGB image to be processed according to the triangle patch information, wherein the reconstruction model is obtained based on the three-dimensional model training corresponding to different object categories. In the present application, since the reconstruction model is obtained based on the three-dimensional model training corresponding to different object categories, the reconstruction model fully mines and learns the prior knowledge of the shape of the three-dimensional object. Therefore, when reconstructing the three-dimensional object of the single-viewpoint RGB image, the prior knowledge of the shape of the three-dimensional object can be fully utilized, thereby improving the robustness of the shape estimation and improving the authenticity and integrity of the reconstructed three-dimensional object.
[0112] The present application also provides a three-dimensional object reconstruction device, Figure 8 FIG. 4 shows a schematic diagram of the structure of a three-dimensional object reconstruction device. Figure 8 As shown, the three-dimensional object reconstruction device 800 may include an image processing module 801 and a reconstruction module 802. Among them:
[0113] The image processing module 801 is used to obtain a single-viewpoint RGB image to be processed, input the single-viewpoint RGB image to be processed into a reconstruction model, encode the single-viewpoint RGB image to be processed through the reconstruction model to obtain a shape code corresponding to the single-viewpoint RGB image to be processed, and decode the shape code to obtain a triangular facet corresponding to the single-viewpoint RGB image to be processed, wherein the reconstruction model is obtained based on three-dimensional model training corresponding to different object categories;
[0114] The reconstruction module 802 is used to construct a three-dimensional object corresponding to the single-viewpoint RGB image to be processed according to the triangular facets.
[0115] In one embodiment of the present application, the reconstruction model includes a shape coding prediction sub-model, a shape representation sub-model and a three-dimensional isosurface determination sub-model; the image processing module 801 includes:
[0116] An encoding unit, configured to encode the to-be-processed single-viewpoint RGB image by using the shape coding prediction sub-model to obtain the shape coding;
[0117] A decoding unit, configured to decode the shape code by using the shape representation sub-model to obtain a signed distance field SDF set corresponding to the shape code;
[0118] A patch acquisition unit is used to determine the isosurface according to the SDF set by determining the submodel through the three-dimensional isosurface, and to determine the triangular patch based on the isosurface.
[0119] In one embodiment of the present application, the shape coding prediction sub-model includes an image block feature embedding layer, a plurality of Transformer multi-scale coding layers and a shape embedding prediction layer connected in sequence; the coding unit is configured as follows:
[0120] The single-viewpoint RGB image to be processed is divided into blocks through the image block feature embedding layer, and features are extracted from the image blocks obtained by the division to obtain an image block feature sequence;
[0121] Performing feature extraction of different dimensions on the image block feature sequence through each of the Transformer multi-scale coding layers to obtain a high-dimensional feature embedding vector corresponding to the single-viewpoint RGB image to be processed;
[0122] The high-dimensional feature embedding vector is subjected to feature extraction through the shape embedding prediction layer to obtain the shape coding.
[0123] In one embodiment of the present application, the image block feature embedding layer and the shape embedding prediction layer are both composed of fully connected layers, the multiple Transformer multi-scale coding layers include a first Transformer multi-scale coding layer, a second Transformer multi-scale coding layer and a third Transformer multi-scale coding layer, and each of the Transformer multi-scale coding layers includes multiple coding units composed of a multi-head pooling attention layer and a fully connected layer.
[0124] In one embodiment of the present application, the shape representation sub-model includes a coordinate transformation layer and an implicit template processing layer; the decoding unit is configured as follows:
[0125] Inputting the shape code and a set of three-dimensional space coordinates into the coordinate transformation layer, wherein the set of three-dimensional space coordinates is generated by sampling a three-dimensional checkerboard;
[0126] The three-dimensional space coordinates in the three-dimensional space coordinate set are converted into target three-dimensional space coordinates in a standard coordinate space by the coordinate transformation layer, wherein the standard coordinate space is a coordinate space corresponding to an implicit template;
[0127] The SDF set corresponding to the implicit template shape corresponding to the shape coding is determined according to the target three-dimensional space coordinates through the implicit template processing layer.
[0128] In an exemplary embodiment of the present application, the coordinate transformation layer includes a plurality of coordinate conversion units consisting of a long short-term memory network layer and an affine transformation layer.
[0129] In an exemplary embodiment of the present application, the patch acquisition unit is configured as follows:
[0130] The same SDF value is extracted from the SDF value set, and the isosurface is constructed according to the three-dimensional space coordinates corresponding to the same SDF value.
[0131] In an exemplary embodiment of the present application, the three-dimensional object reconstruction device 800 further includes:
[0132] The model training module is used to obtain a first data set before inputting the single-viewpoint RGB image to be processed into the reconstruction model, and train the reconstruction model to be trained according to the first data set to obtain the reconstruction model.
[0133] In an exemplary embodiment of the present application, the acquiring of the first data set is configured as follows:
[0134] Obtain a dataset containing 3D CAD models of multiple object categories;
[0135] Normalizing the point coordinates contained in the three-dimensional CAD model corresponding to each of the object categories, and sampling the normalized three-dimensional CAD model to obtain an SDF set consisting of a plurality of sampling points and SDF values corresponding to each of the sampling points;
[0136] The first data set is constructed according to the three-dimensional CAD model and the SDF set.
[0137] In an exemplary embodiment of the present application, the reconstruction model to be trained includes a shape coding prediction sub-model to be trained and a shape representation sub-model to be trained; the model training module includes:
[0138] A first training unit, configured to train the shape representation sub-model to be trained according to the first data set to obtain the shape representation sub-model;
[0139] a data set construction unit, configured to obtain a second data set, and construct a third data set consisting of a single-viewpoint RGB image and a shape code corresponding to the single-viewpoint RGB image according to the shape representation sub-model and the second data set, wherein the second data set includes the single-viewpoint RGB image and a three-dimensional model corresponding to the single-viewpoint RGB image;
[0140] The second training unit is used to train the shape coding prediction sub-model to be trained according to the third data set to obtain the shape coding prediction sub-model.
[0141] In an exemplary embodiment of the present application, the shape representation sub-model to be trained includes a coordinate transformation layer to be trained and an implicit template processing layer to be trained; the first training unit includes:
[0142] A coordinate conversion unit, configured to convert the three-dimensional space coordinates corresponding to the same three-dimensional CAD model in the first data set into a standard coordinate system through the coordinate transformation layer to be trained, so as to obtain standard space coordinates, wherein the standard coordinate system is a coordinate system corresponding to the implicit template;
[0143] An SDF generating unit, configured to determine a predicted SDF set according to the standard space coordinates through the implicit template processing layer to be trained;
[0144] The first training unit is used to construct a first loss function according to the predicted SDF set and the SDF set in the first data set, and adjust the model parameters according to the first loss function to obtain the shape representation sub-model.
[0145] In an exemplary embodiment of the present application, the first training unit is configured as follows:
[0146] The calculation formula of the first loss function is shown in formulas (1)-(4):
[0147]
[0148]
[0149]
[0150] clamp(D,ε)=min(ε,max(-ε,D)) (4)
[0151] Among them, θ H is the learnable parameter in the implicit template processing layer to be trained, θ Tis the learnable parameter in the coordinate transformation layer to be trained, S is the shape code, S is initialized to Gaussian noise before training, Lrec is the SDF reconstruction loss, Lreg is the regularization term, To predict the SDF set, D* is the SDF set in the first data set, ε is a value in [0,1], is the i-th coordinate transformation unit in the coordinate transformation layer to be trained, P is the total number of coordinate transformation units, and h(·) is the Huber operator.
[0152] In an exemplary embodiment of the present application, the data set construction unit is configured as follows:
[0153] Determine an SDF true value set according to the three-dimensional model corresponding to the single-viewpoint RGB image contained in the second data set;
[0154] Fixing the learnable parameters in the first loss function, and optimizing the loss function according to the SDF true value set to obtain a shape encoding corresponding to the single-viewpoint RGB image;
[0155] The third data set is constructed according to the single-viewpoint RGB image and the shape coding corresponding to the single-viewpoint RGB image.
[0156] In an exemplary embodiment of the present application, the second training unit includes:
[0157] a shape coding prediction unit, configured to input the single-view RGB image in the third data set into the shape coding prediction sub-model to be trained, and perform feature extraction on the single-view RGB image through the shape coding prediction sub-model to be trained to obtain a predicted shape code corresponding to the single-view RGB image;
[0158] The second training unit is used to construct a second loss function according to the predicted shape coding and the shape coding corresponding to the single-viewpoint RGB image, and adjust the model parameters according to the second loss function to obtain the shape coding prediction sub-model.
[0159] In an exemplary embodiment of the present application, the second training unit is configured as follows: the calculation formula of the second loss function is as shown in formula (5):
[0160] L Enc =||Enc(I)-S * ||2 (5)
[0161] Wherein, I is the input single-view RGB image, Enc(I) is the predicted shape code, and S* is the shape code corresponding to the single-view RGB image.
[0162] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0163] In addition, although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0164] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0165] Fig. 9 A computer system structure block diagram of an electronic device for implementing an embodiment of the present application is schematically shown, and the electronic device may be arranged in a terminal device or a server.
[0166] It should be noted that Fig. 9 The computer system 900 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0167] like Fig. 9As shown, the computer system 900 includes a central processing unit 901 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 902 (ROM) or the program loaded from the storage part 908 to the random access memory 903 (RAM). Various programs and data required for system operation are also stored in the random access memory 903. The central processing unit 901, the read-only memory 902 and the random access memory 903 are connected to each other through a bus 904. An input / output interface 905 (Input / Output interface, i.e., I / O interface) is also connected to the bus 904.
[0168] In some embodiments, the following components are connected to the input / output interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a local area network card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the input / output interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.
[0169] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the central processor 901, various functions defined in the system of the present application are executed.
[0170] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable medium or any combination of the above two. Computer-readable media can be, for example, - but not limited to - electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable media can include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (Erasable Programmable Read Only Memory, EPROM), flash memory, optical fibers, portable compact disk read-only memories (Compact Disc Read-Only Memory, CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present application, a computer-readable medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0171] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0172] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0173] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable an electronic device to execute the method according to the implementation methods of the present application.
[0174] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A three-dimensional object reconstruction method, characterized in that: include: Acquire a single-viewpoint RGB image to be processed, input the single-viewpoint RGB image to be processed into a reconstruction model, encode the single-viewpoint RGB image to be processed through the reconstruction model to obtain a shape code corresponding to the single-viewpoint RGB image to be processed, and decode the shape code to obtain a triangular facet corresponding to the single-viewpoint RGB image to be processed, wherein the reconstruction model is obtained based on three-dimensional model training corresponding to different object categories; Constructing a three-dimensional object corresponding to the single-viewpoint RGB image to be processed according to the triangular facets; Wherein, the reconstruction model includes a shape coding prediction sub-model, a shape representation sub-model and a three-dimensional isosurface determination sub-model; The encoding of the to-be-processed single-viewpoint RGB image by the reconstruction model to obtain a shape code corresponding to the to-be-processed single-viewpoint RGB image, and decoding the shape code to obtain a triangular facet corresponding to the to-be-processed single-viewpoint RGB image, comprises: Encoding the to-be-processed single-viewpoint RGB image by means of the shape coding prediction sub-model to obtain the shape coding; Decoding the shape code by using the shape representation submodel to obtain a signed distance field (SDF) set corresponding to the shape code; The submodel is determined by the three-dimensional isosurface, an isosurface is determined according to the SDF set, and the triangular face patch is determined based on the isosurface.
2. The method according to claim 1, characterized in that The shape coding prediction sub-model includes an image block feature embedding layer, a plurality of Transformer multi-scale coding layers and a shape embedding prediction layer connected in sequence; The step of encoding the to-be-processed single-viewpoint RGB image by using the shape coding prediction sub-model to obtain the shape coding comprises: The single-viewpoint RGB image to be processed is divided into blocks through the image block feature embedding layer, and features are extracted from the image blocks obtained by the division to obtain an image block feature sequence; Performing feature extraction of different dimensions on the image block feature sequence through each of the Transformer multi-scale coding layers to obtain a high-dimensional feature embedding vector corresponding to the single-viewpoint RGB image to be processed; The high-dimensional feature embedding vector is subjected to feature extraction through the shape embedding prediction layer to obtain the shape coding.
3. The method according to claim 2, characterized in that The image block feature embedding layer and the shape embedding prediction layer are both composed of fully connected layers, the multiple Transformer multi-scale coding layers include a first Transformer multi-scale coding layer, a second Transformer multi-scale coding layer and a third Transformer multi-scale coding layer, and each of the Transformer multi-scale coding layers includes multiple coding units composed of multi-head pooling attention layers and fully connected layers.
4. The method according to claim 1, characterized in that: The shape representation sub-model includes a coordinate transformation layer and an implicit template processing layer; The decoding of the shape code by the shape representation submodel to obtain a signed distance field SDF set corresponding to the shape code includes: Inputting the shape code and a set of three-dimensional space coordinates into the coordinate transformation layer, wherein the set of three-dimensional space coordinates is generated by sampling a three-dimensional checkerboard; The three-dimensional space coordinates in the three-dimensional space coordinate set are converted into target three-dimensional space coordinates in a standard coordinate space by the coordinate transformation layer, wherein the standard coordinate space is a coordinate space corresponding to an implicit template; The SDF set corresponding to the implicit template shape corresponding to the shape coding is determined according to the target three-dimensional space coordinates through the implicit template processing layer.
5. The method according to claim 4, characterized in that The coordinate transformation layer includes a plurality of coordinate transformation units consisting of a long short-term memory network layer and an affine transformation layer.
6. The method according to claim 1, characterized in that The determining of the isosurface by the submodel through the three-dimensional isosurface according to the SDF set includes: The same SDF value is extracted from the SDF value set, and the isosurface is constructed according to the three-dimensional space coordinates corresponding to the same SDF value.
7. The method according to claim 1, characterized in that Before inputting the to-be-processed single-viewpoint RGB image into the reconstruction model, the method further comprises: A first data set is obtained, and a reconstruction model to be trained is trained according to the first data set to obtain the reconstruction model.
8. The method according to claim 7, characterized in that The obtaining of the first data set includes: Obtain a dataset containing 3D CAD models of multiple object categories; Normalizing the point coordinates contained in the three-dimensional CAD model corresponding to each of the object categories, and sampling the normalized three-dimensional CAD model to obtain an SDF set consisting of a plurality of sampling points and SDF values corresponding to each of the sampling points; The first data set is constructed according to the three-dimensional CAD model and the SDF set.
9. The method according to claim 7 or 8, characterized in that: The reconstruction model to be trained includes a shape coding prediction sub-model to be trained and a shape representation sub-model to be trained; The training of the to-be-trained reconstruction model according to the first data set to obtain the reconstruction model comprises: Training the shape representation sub-model to be trained according to the first data set to obtain the shape representation sub-model; Acquire a second data set, and construct a third data set consisting of a single-viewpoint RGB image and a shape code corresponding to the single-viewpoint RGB image according to the shape representation sub-model and the second data set, wherein the second data set includes the single-viewpoint RGB image and a three-dimensional model corresponding to the single-viewpoint RGB image; The shape coding prediction sub-model to be trained is trained according to the third data set to obtain the shape coding prediction sub-model.
10. The method according to claim 9, characterized in that The shape representation sub-model to be trained includes a coordinate transformation layer to be trained and an implicit template processing layer to be trained; The step of training the shape representation sub-model to be trained according to the first data set to obtain the shape representation sub-model includes: The three-dimensional space coordinates corresponding to the same three-dimensional CAD model in the first data set are converted into a standard coordinate system through the coordinate transformation layer to be trained to obtain standard space coordinates, wherein the standard coordinate system is a coordinate system corresponding to the implicit template; Determining a predicted SDF set according to the standard space coordinates through the implicit template processing layer to be trained; A first loss function is constructed according to the predicted SDF set and the SDF set in the first data set, and model parameters are adjusted according to the first loss function to obtain the shape representation sub-model.
11. The method according to claim 10, characterized in that The constructing a first loss function according to the predicted SDF value set and the SDF value set in the first data set includes: The calculation formula of the first loss function is shown in formulas (1)-(4): clamp(D,ε)=min(ε,max(-ε,D)) (4) Among them, θ H is the learnable parameter in the implicit template processing layer to be trained, θ T is the learnable parameter in the coordinate transformation layer to be trained, S is the shape code, S is initialized to Gaussian noise before training, Lrec is the SDF reconstruction loss, Lreg is the regularization term, To predict the SDF set, D* is the SDF set in the first data set, ε is a value in [0,1], is the i-th coordinate transformation unit in the coordinate transformation layer to be trained, P is the total number of coordinate transformation units, and h(·) is the Huber operator.
12. The method according to claim 11, characterized in that The step of acquiring a second data set and constructing a third data set consisting of a single-viewpoint RGB image and a shape code corresponding to the single-viewpoint RGB image according to the shape representation sub-model and the second data set includes: Determine an SDF true value set according to the three-dimensional model corresponding to the single-viewpoint RGB image contained in the second data set; Fixing the learnable parameters in the first loss function, and optimizing the loss function according to the SDF true value set to obtain a shape encoding corresponding to the single-viewpoint RGB image; The third data set is constructed according to the single-viewpoint RGB image and the shape coding corresponding to the single-viewpoint RGB image.
13. The method according to claim 9, characterized in that The step of training the shape coding prediction sub-model to be trained according to the third data set to obtain the shape coding prediction sub-model comprises: Inputting the single-view RGB image in the third data set into the shape coding prediction sub-model to be trained, and performing feature extraction on the single-view RGB image through the shape coding prediction sub-model to be trained to obtain a predicted shape code corresponding to the single-view RGB image; A second loss function is constructed according to the predicted shape coding and the shape coding corresponding to the single-viewpoint RGB image, and model parameters are adjusted according to the second loss function to obtain the shape coding prediction sub-model.
14. The method according to claim 13, characterized in that The constructing a second loss function according to the predicted shape coding and the shape coding corresponding to the single-viewpoint RGB image comprises: The calculation formula of the second loss function is shown in formula (5): L Enc =||Enc(I)-S * ||2 (5) Wherein, I is the input single-view RGB image, Enc(I) is the predicted shape code, and S* is the shape code corresponding to the single-view RGB image.
15. A three-dimensional object reconstruction device, characterized in that: include: An image processing module is used to obtain a single-viewpoint RGB image to be processed, input the single-viewpoint RGB image to be processed into a reconstruction model, encode the single-viewpoint RGB image to be processed through the reconstruction model to obtain a shape code corresponding to the single-viewpoint RGB image to be processed, and decode the shape code to obtain a triangular facet corresponding to the single-viewpoint RGB image to be processed, wherein the reconstruction model is obtained based on three-dimensional model training corresponding to different object categories; A reconstruction module, used for constructing a three-dimensional object corresponding to the single-viewpoint RGB image to be processed according to the triangular facets; Wherein, the reconstruction model includes a shape coding prediction sub-model, a shape representation sub-model and a three-dimensional isosurface determination sub-model; The encoding of the to-be-processed single-viewpoint RGB image by the reconstruction model to obtain a shape code corresponding to the to-be-processed single-viewpoint RGB image, and decoding the shape code to obtain a triangular facet corresponding to the to-be-processed single-viewpoint RGB image, comprises: Encoding the to-be-processed single-viewpoint RGB image by means of the shape coding prediction sub-model to obtain the shape coding; Decoding the shape code by using the shape representation submodel to obtain a signed distance field (SDF) set corresponding to the shape code; The submodel is determined by the three-dimensional isosurface, an isosurface is determined according to the SDF set, and the triangular face patch is determined based on the isosurface.
16. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the three-dimensional object reconstruction method according to any one of claims 1 to 14 is implemented.
17. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the three-dimensional object reconstruction method according to any one of claims 1 to 14 by executing the executable instructions.
