Three-dimensional model reconstruction method, device, computer equipment and storage medium

By acquiring and splicing image features, the problem of image distortion in traditional 3D model reconstruction is solved, and more accurate and continuous 3D model reconstruction is achieved.

CN112102477BActive Publication Date: 2024-09-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202010969615.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-15
Publication Date
2024-09-27
Estimated Expiration
2040-09-27

AI Technical Summary

Technical Problem

In traditional 3D model reconstruction technology, the obtained shape map and texture map are prone to distortion, resulting in inaccurate 3D model reconstruction.

Method used

By obtaining the image feature coefficients of the input image, the global feature map and the initial local feature map of the texture and shape are obtained respectively, and edge smoothing is performed to obtain the target local feature map, and the global feature map and the target local feature map are processed based on the texture and shape. Stitching, reducing image distortion and improving the accuracy of 3D models.

Benefits of technology

It effectively reduces image distortion during the reconstruction process of the 3D model, improves the accuracy and continuity of the reconstruction results, ensures smooth edges of the 3D model, and reduces the probability of distortion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112102477B
    Figure CN112102477B
Patent Text Reader

Abstract

The present application relates to a three-dimensional model reconstruction method, device, computer equipment and storage medium. The three-dimensional model reconstruction method comprises: obtaining image feature coefficients of an input image; obtaining a global feature map and an initial local feature map of the input image based on texture and shape respectively according to the image feature coefficients; performing edge smoothing processing on the initial local feature map to obtain a target local feature map; splicing the global feature map and the target local feature map based on texture and shape respectively to obtain a target texture image and a target shape image; performing three-dimensional model reconstruction processing according to the target texture image and the target shape image to obtain a target three-dimensional model. The above scheme is not prone to image distortion by performing edge smoothing processing on the local feature map, and can reconstruct a target three-dimensional model with smooth edges.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a three-dimensional model reconstruction method, device, computer equipment and storage medium, as well as a three-dimensional reconstruction model training method, device, computer equipment and storage medium. Background Art

[0002] With the development of image processing technology, artificial intelligence technologies such as 2D (2-dimension) image processing and 3D (3-dimension) model reconstruction have emerged. For example, a new 3D face model can be reconstructed based on an input face image.

[0003] Conventional technology obtains shape maps, texture maps, etc. of input images, and reconstructs a 3D model based on the obtained shape maps, texture maps, etc. However, the shape maps and texture maps obtained by conventional technology are prone to distortion, resulting in inaccurate reconstructed 3D models.

[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 the present invention, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] Based on this, it is necessary to provide a three-dimensional model reconstruction method, device, computer equipment and storage medium that can reduce image distortion, as well as a three-dimensional reconstruction model training method, device, computer equipment and storage medium to address the above technical problems.

[0006] A three-dimensional model reconstruction method, the method comprising: obtaining image feature coefficients of an input image; obtaining a global feature map and an initial local feature map of the input image based on texture and shape according to the image feature coefficients; performing edge smoothing processing on the initial local feature map to obtain a target local feature map; splicing the global feature map and the target local feature map based on texture and shape respectively to obtain a target texture image and a target shape image; performing three-dimensional model reconstruction processing according to the target texture image and the target shape image to obtain a target three-dimensional model.

[0007] A training method for a three-dimensional reconstruction model, the method comprising: obtaining image feature coefficients and rendering coefficients of a training image; inputting the image feature coefficients into a three-dimensional reconstruction model based on deep learning, so that the three-dimensional reconstruction model: according to the image feature coefficients, respectively obtains a global feature map and an initial local feature map of the training image based on texture and shape, performs edge smoothing processing on the initial local feature map to obtain a target local feature map; splices the global feature map and the target local feature map based on texture and shape, respectively, to obtain a target texture image and a target shape image; performs three-dimensional model reconstruction processing according to the target texture image and the target shape image to obtain a predicted three-dimensional model; performs image rendering processing on the predicted three-dimensional model according to the rendering coefficient to obtain a predicted two-dimensional image; trains the three-dimensional reconstruction model according to the error between the training image and the predicted two-dimensional image until a convergence condition is met to obtain a trained three-dimensional reconstruction model.

[0008] In one embodiment, the acquisition of image feature coefficients and rendering coefficients of a training image includes: performing layer-by-layer convolution processing on the training image through a convolutional autoencoder; the convolutional autoencoder includes a decoder and an encoder; the decoder obtains texture feature coefficients and shape feature coefficients of the training image as the image feature coefficients according to the result of the layer-by-layer convolution processing; the encoder obtains torsion coefficients and illumination coefficients of the training image as the rendering coefficients according to the result of the layer-by-layer convolution processing.

[0009] A three-dimensional model reconstruction device, the device comprising: a first coefficient acquisition module, used to obtain image feature coefficients of an input image; a feature map acquisition module, used to obtain a global feature map and an initial local feature map of the input image based on texture and shape according to the image feature coefficients; a smoothing processing module, used to perform edge smoothing processing on the initial local feature map to obtain a target local feature map; a feature map splicing module, used to splice the global feature map and the target local feature map based on texture and shape respectively to obtain a target texture image and a target shape image; a first model reconstruction module, used to perform three-dimensional model reconstruction processing according to the target texture image and the target shape image to obtain a target three-dimensional model.

[0010] In one embodiment, the smoothing processing module includes: a boundary acquisition submodule, used to obtain the boundary of the initial local feature map; a distance acquisition submodule, used to obtain the distance between each pixel point in the initial local feature map and the boundary; a first edge smoothing submodule, used to perform edge smoothing on the initial local feature map according to the distance to obtain the target local feature map.

[0011] In one embodiment, the first edge smoothing submodule includes: an edge area acquisition unit, which is used to acquire the edge area of ​​the initial local feature map according to the distance; a weight value determination unit, which is used to determine the feature weight value corresponding to each pixel point of the edge area according to the distance, so that the feature weight value corresponding to the distant pixel point is greater than the feature weight value corresponding to the close pixel point; a feature map construction unit, which is used to generate a gradual smoothing feature map according to the feature weight value; the feature value of each pixel point in the gradual smoothing feature map is obtained according to the feature weight value; and a feature value multiplication unit, which is used to multiply the feature value of each pixel point in the gradual smoothing feature map with the feature value of the corresponding pixel point in the initial local feature map, and obtain the target local feature map according to the multiplication result.

[0012] In one embodiment, the input image is a facial image; the target local feature map includes key part feature maps corresponding to key parts of the face; the feature map splicing module includes: a filling submodule, used to fill the external area of ​​each key part feature map with a feature value respectively, so as to obtain a filled key part feature map with the same size as the global feature map; a merging submodule, used to merge each of the filled key part feature maps to obtain a facial organ feature map; a splicing submodule, used to splice the global feature map and the facial organ feature map based on texture and shape respectively, to obtain the target texture image and the target shape image.

[0013] In one embodiment, the key facial parts include at least one of a left eye, a right eye, a nose, and a mouth.

[0014] In one embodiment, the global feature map includes a global texture feature map and a global shape feature map, and the target local feature map includes a local texture feature map and a local shape feature map; the feature map splicing module includes: a texture convolution submodule, used to splice the global texture feature map and the local texture feature map, and convolve the spliced ​​feature map to integrate the global texture features and the local texture features to obtain the target texture image; a shape convolution submodule, used to splice the global shape feature map and the local shape feature map, and convolve the spliced ​​feature map to integrate the global shape features and the local shape features to obtain the target shape image.

[0015] In one embodiment, the global feature map and the target local feature map each correspond to at least one feature channel; the texture convolution submodule is further used to splice the global texture feature map and the local texture feature map in each of the feature channels, and to convolve the feature maps spliced ​​from each of the feature channels to integrate the global texture features and the local texture features to obtain the target texture image; the shape convolution submodule is further used to splice the global shape feature map and the local shape feature map in each of the feature channels, and to convolve the feature maps spliced ​​from each of the feature channels to integrate the global shape features and the local shape features to obtain the target shape image.

[0016] In one embodiment, the first coefficient acquisition module includes: a convolution submodule, used to perform layer-by-layer convolution processing on the input image through a convolution autoencoder; a feature coefficient acquisition submodule, used to obtain the texture feature coefficient and shape feature coefficient of the input image according to the result of the layer-by-layer convolution processing as the image feature coefficient.

[0017] In one embodiment, the feature map acquisition module includes: a global decoding submodule, which is used for the deconvolution layer in the global decoder to perform feature decoding on the input image according to the image feature coefficient to obtain the global feature map; and a local decoding submodule, which is used for the deconvolution layer in the local decoder to perform feature decoding on the input image according to the image feature coefficient to obtain the initial local feature map.

[0018] In one embodiment, the local decoder includes a facial key part decoder; the local decoding submodule is further used to perform feature decoding on the input image according to the image feature coefficient by the deconvolution layer in the facial key part decoder, and determine the decoded key part feature map as the initial local feature map.

[0019] In one embodiment, the input image is a facial image; the device further includes: a target feature point acquisition module, used to acquire global feature points of the two-dimensional image corresponding to the target three-dimensional model to obtain target feature points; a template model acquisition module, used to acquire the template three-dimensional model; a template feature point acquisition module, used to acquire local feature points of the two-dimensional image corresponding to the template three-dimensional model to obtain template feature points; a face-changing module, used to input the target feature points and the template feature points as paired data into the face-changing model, so that the face-changing model outputs a face-changed three-dimensional model; the face-changed three-dimensional model contains the global features in the target three-dimensional model and the local features in the template three-dimensional model.

[0020] In one embodiment, the template model acquisition module includes: a template image acquisition submodule, which is used to acquire a preset template facial image; a template feature map acquisition submodule, which is used to acquire a template global feature map and an initial template local feature map based on texture and shape of the template facial image; a second edge smoothing submodule, which is used to perform edge smoothing processing on the initial template local feature map to obtain a target template local feature map; a feature map splicing submodule, which is used to splice the template global feature map and the target template local feature map based on texture and shape respectively to obtain a template facial texture image and a template facial shape image; a template three-dimensional model reconstruction submodule, which is used to perform three-dimensional model reconstruction processing based on the template facial texture image and the template facial shape image to obtain the template three-dimensional model.

[0021] A training device for a three-dimensional reconstruction model, the device comprising: a second coefficient acquisition module, used to acquire image feature coefficients and rendering coefficients of a training image; a second model reconstruction module, used to input the image feature coefficients into a three-dimensional reconstruction model based on deep learning, so that the three-dimensional reconstruction model: according to the image feature coefficients, respectively acquires a global feature map and an initial local feature map based on texture and shape of the training image, performs edge smoothing processing on the initial local feature map to obtain a target local feature map; splices the global feature map and the target local feature map based on texture and shape respectively to obtain a target texture image and a target shape image; performs three-dimensional model reconstruction processing according to the target texture image and the target shape image to obtain a predicted three-dimensional model; an image rendering module, used to perform image rendering processing on the predicted three-dimensional model according to the rendering coefficients to obtain a predicted two-dimensional image; a reconstruction model training module, used to train the three-dimensional reconstruction model according to the error between the training image and the predicted two-dimensional image until a convergence condition is met to obtain a trained three-dimensional reconstruction model.

[0022] In one embodiment, the second coefficient acquisition module includes: a layer-by-layer convolution submodule, used to perform layer-by-layer convolution processing on the training image through a convolution autoencoder; the convolution autoencoder includes a decoder and an encoder; an image feature coefficient acquisition submodule, used to obtain the texture feature coefficient and shape feature coefficient of the training image as the image feature coefficient according to the result of the layer-by-layer convolution processing by the decoder; a rendering coefficient acquisition submodule, used to obtain the torsion coefficient and illumination coefficient of the training image as the rendering coefficient according to the result of the layer-by-layer convolution processing by the encoder.

[0023] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program: obtaining image feature coefficients of an input image; obtaining a global feature map and an initial local feature map of the input image based on texture and shape respectively according to the image feature coefficients; performing edge smoothing processing on the initial local feature map to obtain a target local feature map; splicing the global feature map and the target local feature map based on texture and shape respectively to obtain a target texture image and a target shape image; performing three-dimensional model reconstruction processing according to the target texture image and the target shape image to obtain a target three-dimensional model.

[0024] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program: obtaining image feature coefficients and rendering coefficients of a training image; inputting the image feature coefficients into a three-dimensional reconstruction model based on deep learning, so that the three-dimensional reconstruction model: according to the image feature coefficients, respectively obtaining a global feature map and an initial local feature map based on texture and shape of the training image, performing edge smoothing processing on the initial local feature map to obtain a target local feature map; respectively splicing the global feature map and the target local feature map based on texture and shape to obtain a target texture image and a target shape image; performing three-dimensional model reconstruction processing according to the target texture image and the target shape image to obtain a predicted three-dimensional model; performing image rendering processing on the predicted three-dimensional model according to the rendering coefficient to obtain a predicted two-dimensional image; training the three-dimensional reconstruction model according to the error between the training image and the predicted two-dimensional image until a convergence condition is met to obtain a trained three-dimensional reconstruction model.

[0025] A computer-readable storage medium stores a computer program, which implements the following steps when executed by a processor: obtaining image feature coefficients of an input image; obtaining a global feature map and an initial local feature map of the input image based on texture and shape according to the image feature coefficients; performing edge smoothing processing on the initial local feature map to obtain a target local feature map; splicing the global feature map and the target local feature map based on texture and shape respectively to obtain a target texture image and a target shape image; performing three-dimensional model reconstruction processing according to the target texture image and the target shape image to obtain a target three-dimensional model.

[0026] A computer-readable storage medium stores a computer program, which implements the following steps when executed by a processor: obtaining image feature coefficients and rendering coefficients of a training image; inputting the image feature coefficients into a 3D reconstruction model based on deep learning, so that the 3D reconstruction model: according to the image feature coefficients, respectively obtains a global feature map and an initial local feature map based on texture and shape of the training image, performs edge smoothing on the initial local feature map to obtain a target local feature map; splices the global feature map and the target local feature map based on texture and shape, respectively, to obtain a target texture image and a target shape image; performs 3D model reconstruction processing on the target texture image and the target shape image to obtain a predicted 3D model; performs image rendering processing on the predicted 3D model according to the rendering coefficients to obtain a predicted 2D image; trains the 3D reconstruction model according to the error between the training image and the predicted 2D image until a convergence condition is met to obtain a trained 3D reconstruction model.

[0027] The above-mentioned three-dimensional model reconstruction method, device, computer equipment and storage medium, as well as the three-dimensional reconstruction model training method, device, computer equipment and storage medium, respectively obtain a global feature map and an initial local feature map based on texture and shape of the input image according to the image feature coefficients; perform edge smoothing on the initial local feature map to obtain a target local feature map, and the edge area of ​​the target local feature map is in a smooth state; splice the global feature map and the target local feature map based on texture and shape respectively to obtain a target texture image and a target shape image with smooth edges; the target three-dimensional model reconstructed according to the target texture image and the target shape image is not prone to distortion. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 A diagram of an application environment of a three-dimensional model reconstruction method in an embodiment;

[0029] Figure 2 A schematic diagram of a process of a three-dimensional model reconstruction method in one embodiment;

[0030] Figure 3 is a schematic diagram of a discontinuous edge of a texture image in one embodiment;

[0031] Figure 4 is a schematic diagram of a discontinuous edge of a texture image in another embodiment;

[0032] Figure 5 A schematic diagram of a discontinuous edge of a shape image in one embodiment;

[0033] Figure 6 A schematic diagram of the structure of a gradual smoothing feature map in one embodiment;

[0034] Figure 7 A schematic diagram of the effect of gradual smoothing processing in one embodiment;

[0035] Figure 8 A schematic diagram of the effect of filling and merging feature values ​​of a key part feature graph in one embodiment;

[0036] Fig. 9 A schematic diagram of a process of obtaining a target facial organ feature map in one embodiment;

[0037] Fig.10 A feature map processing flow of multiple feature channels in one embodiment;

[0038] Fig.11 Schematic diagram of the structure of a convolutional autoencoder in one embodiment;

[0039] Fig.12 A schematic diagram of a process of obtaining a face-swapped image in one embodiment;

[0040] Fig.13 A schematic diagram of a flow chart of a three-dimensional model reconstruction method in another embodiment;

[0041] Fig.14 A comparison diagram of a 2D texture map in one embodiment;

[0042] Fig.15 This is a comparison diagram of edge effects of a 2D texture image in an embodiment;

[0043] Fig.16 is a comparison diagram of a 2D shape diagram in one embodiment;

[0044] Fig.17 A schematic diagram of a flow chart of a training method for a three-dimensional reconstruction model in one embodiment;

[0045] Fig.18 A schematic diagram of a flow chart of a training method for a three-dimensional reconstruction model in another embodiment;

[0046] Fig.19 is a structural block diagram of a three-dimensional model reconstruction device in one embodiment;

[0047] Fig. 20 It is a structural block diagram of a training device for three-dimensional reconstruction model in another embodiment. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0049] The three-dimensional model reconstruction method, device, computer equipment and storage medium provided in the embodiments of the present application, as well as the training method, device, computer equipment and storage medium of the three-dimensional reconstruction model, can be implemented based on artificial intelligence (AI) technology. Among them, artificial intelligence is the theory, method, technology and application system of using 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, which 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 the machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that involves a wide range of fields, including both hardware-level technology and software-level technology. Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. Artificial intelligence software technology mainly includes several major directions such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0050] Specifically, each embodiment of the present application can be implemented based on computer vision technology (Computer Vision, CV). Among them, computer vision is a science that studies how to make machines "see". To put it more concretely, it refers to the use of cameras and computers to replace human eyes to identify, follow and measure targets, and further perform graphic processing to make computer processing into images that are 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 multidimensional data. Computer vision technology generally includes image processing, image recognition, image semantic understanding, image retrieval, OCR (Optical Character Recognition, optical character recognition), video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and map construction, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.

[0051] In addition, various embodiments of the present application can be applied to artificial intelligence cloud services. The so-called artificial intelligence cloud service is generally referred to as AIaaS (AI as a Service, Chinese for "AI as a service"). This is a mainstream service mode of an artificial intelligence platform. Specifically, the AIaaS platform will split several common AI services and provide independent or packaged services in the cloud. This service model is similar to opening an AI theme mall: all developers can access one or more artificial intelligence services provided by the platform through an API (Application Programming Interface) interface, for example, reconstructing the input image in three dimensions and outputting it in two dimensions. Some senior developers can also use the AI ​​framework and AI infrastructure provided by the platform to deploy and operate their own cloud artificial intelligence services.

[0052] The three-dimensional model reconstruction method and the three-dimensional reconstruction model training method provided in this application can be applied to Figure 1 In the computer device shown in FIG. 1 , the computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 1 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI (Wireless Fidelity), an operator network, NFC (Near Field Communication) or other technologies. When the computer program is executed by the processor, a three-dimensional model reconstruction method or a three-dimensional reconstruction model training method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, which can be used to output a target three-dimensional model. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc. The input device can be used to receive an input image or a training image.

[0053] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0054] In one embodiment, a 3D model reconstruction method is provided. The 3D model reconstruction method can be implemented based on a 3D reconstruction model (which can be a neural network based on deep learning, and the 3D reconstruction model can reconstruct a 3D model based on an input image). Figure 1 The terminal in is used as an example to illustrate. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application is not limited here.

[0055] Specifically, Figure 2 As shown, the method comprises the following steps:

[0056] S201, obtaining image feature coefficients of an input image.

[0057] The input image may be an image containing various types of objects, such as a face image, an animal image, a building image, etc. In one embodiment, the input image may be composed of global features and local features. Taking a face image as an example, the global features may be the rough features of the entire face, and the local features may be the detailed features of facial organs (such as eyes, nose, mouth, ears, etc.). In addition, the input image may be one image or multiple images containing different information. When there are multiple input images, these input images may be processed synchronously or asynchronously, and the corresponding multiple target three-dimensional models may be reconstructed respectively.

[0058] In one embodiment, the features corresponding to the image (which may be referred to as image features) may be color features, texture features (texture features are visual features that reflect homogeneous phenomena in an image, which reflect the slowly changing or periodically changing surface structure organization and arrangement properties of the surface of an object), shape features (which may include contour features and region features, wherein contour features are mainly for the outer boundaries of an object, and region features are related to the entire shape region), and spatial relationship features (which may refer to the arrangement relationship between objects in an image), etc. The image feature coefficient may be a coefficient that characterizes the image feature, and may be a coefficient that describes the global, local, texture, shape, and other features of the image. In one embodiment, the image feature coefficient may be a texture feature coefficient, a shape feature coefficient, etc. Among them, the texture feature coefficient may refer to a coefficient that describes the texture feature, and specifically, may refer to a coefficient that describes the surface structure organization and arrangement properties of an image; the shape feature coefficient may refer to a coefficient that describes the shape feature, and specifically, may refer to a coefficient that describes the image contour, image region, and the like.

[0059] In one embodiment, obtaining the image feature coefficients of the input image can be achieved through a network model based on deep learning. Specifically, the network model can be an autoencoder, etc. Among them, deep learning (DL) is a new research direction in the field of machine learning (ML). It is introduced into machine learning to make it closer to the original goal-artificial intelligence. At the same time, deep learning is the inherent laws and representation levels of learning sample data. The information obtained in these learning processes is of great help in the interpretation of data such as images. Its ultimate goal is to enable machines to have analytical learning capabilities like humans and to be able to recognize data such as images.

[0060] S202: According to the image feature coefficients, respectively obtain a global feature map and an initial local feature map of the input image based on texture and shape.

[0061] Among them, the global feature map can be a feature map used to describe the global information of the input image. The global feature map can represent the overall image information. Its size can be the same as or smaller than the input image. It focuses on the integrity of the image and is more robust to noise. The local feature map can be a feature map used to describe the local information of the input image. It can be a feature map corresponding to at least one local area. The size of the local feature map can be smaller than or equal to the global feature map. The area concerned by the local feature map is smaller, aiming to generate more details. In one embodiment, taking a facial image as an example, the global feature map can be a global feature map of the face that represents the overall facial situation. The global feature map of the face contains blurred overall facial information. The local feature map can be a key part feature map that represents the local area situation of the eyes, mouth, nose, ears, hair, eyebrows, etc. This key part feature map contains clear local area detail information, such as: eye position, contour, eyeball size, pupil color, etc.

[0062] In one embodiment, the texture-based global feature map may be a global texture feature map, and the shape-based global feature map may be a global shape feature map; the texture-based initial local feature map may be an initial local texture feature map, and the shape-based initial local feature map may be an initial local shape feature map. In one embodiment, the global texture feature map and the initial local texture feature map of the input image may be obtained according to the texture feature coefficients, and the global shape feature map and the initial local shape feature map of the input image may be obtained according to the shape feature coefficients.

[0063] S203, performing edge smoothing processing on the initial local feature map to obtain a target local feature map.

[0064] In this step, the initial local feature map is edge-smoothed, and the image obtained after edge-smoothing is used as the target local feature map. Specifically, the initial local texture feature map and the initial local shape feature map are edge-smoothed respectively to obtain the target local texture feature map and the target local shape feature map as the target local feature map.

[0065] The edge smoothing process may refer to smoothing the edge area of ​​the image. The smoothing process may be a gradual change process of the feature value, for example, gradually reducing the color channel value of the image in a certain direction.

[0066] In addition, the embodiment of the present invention can realize the processing of global and local features through a dual-branch local detail enhancement (Global-local) model. After the local detail enhancement model receives the input image, one branch regresses the global information (global feature map) and one branch regresses the local information (local feature map). It should be noted that it is generally necessary to splice the global feature map and the local feature map (see S204 for the process of splicing the feature map) to obtain a target image containing complete information.

[0067] S204, splicing the global feature map and the target local feature map based on texture and shape respectively to obtain a target texture image and a target shape image.

[0068] The target texture image is a texture image obtained by integrating global texture features and local texture features, and the target shape image is a shape image obtained by integrating global shape features and local shape features. Both the target texture image and the target shape image can be two-dimensional images.

[0069] This step splices the global feature map and the target local feature map to obtain a target image containing global features and local features, and the target image includes a target texture image and a target shape image. In one embodiment, this step splices the global feature map and the target local feature map based on texture to obtain a target texture image, and splices the global feature map and the target local feature map based on shape to obtain a target shape image.

[0070] In some embodiments, edge smoothing may also be performed on the global feature map, and the global feature map after edge smoothing may be spliced ​​with the target local feature map to obtain corresponding target texture images and target shape images.

[0071] S205: Perform three-dimensional model reconstruction processing according to the target texture image and the target shape image to obtain a target three-dimensional model.

[0072] The three-dimensional model refers to a digital model file containing the three-dimensional spatial coordinates of each sampling point on the surface of the object.

[0073] The implementation process of S205 may be: reconstructing the spatial contour of the three-dimensional model according to the target shape image, and attaching the target texture image to the surface of the spatial contour, so as to obtain the target three-dimensional model carrying texture information.

[0074] In one embodiment, the size of the local feature map is often smaller than the global feature map, and to splice the global feature map and the local feature map, it is necessary to make the two sizes the same, and then fuse the pixels at the same position to obtain an image fused with global features and local features. Based on this, it is necessary to fill the local feature map with feature values ​​(padding) to make the local feature map consistent with the size of the global feature map. For example, by filling the local feature map with 0 (i.e., setting the feature values ​​of the pixels in the outer area of ​​the local feature map to 0) to achieve the same size as the global feature map, and then splicing at the same size. This will lead to a problem, that is, the edge mutation of the local feature map after splicing. After the local feature map is spliced ​​with the global feature map, during the convolution process, when the convolution kernel does not move to the position corresponding to the local feature map, due to the reason of filling 0, the convolution receives only the information of the global feature map. When the convolution kernel moves to the position corresponding to the local feature map, it can simultaneously receive the information of the global feature map and the local feature map. However, when the convolution kernel moves to the edge of the local feature map, the information received by the convolution kernel suddenly increases from only global information to global information + local information, which will cause the output of the convolution at this position to mutate compared to before. This mutation will lead to discontinuity in the final generated result. Figure 3 The texture image is obtained by splicing the global texture feature map and the local texture feature map in the traditional technology. The image on the right is an enlarged image of the eye edge area 301 in the texture feature map on the left. It can be seen that there is an obvious discontinuity at the edge of the texture image. When enlarged to the whole face, this discontinuity will also cause the texture image to be distorted as a whole. Figure 4 FIG. 1 is a schematic diagram of a discontinuous edge of a texture image in an embodiment, wherein: Figure 4 (a) is normal texture, Figure 4 (b) is the distorted texture. Obviously, Figure 4 (b) The edge of the mouth area is distorted. On the other hand, this discontinuity will also act on the shape image, causing uncontrollable distortion at the edge of the local feature map. Figure 5 FIG. 1 is a schematic diagram of a discontinuous edge of a shape image in an embodiment, wherein: Figure 5 (a) is the normal shape, Figure 5 (b) is the distorted shape, where 501 represents the mouth area. It can be clearly seen that Figure 5 (b) The edge of the mouth area is broken. In addition, this discontinuity will also cause obvious block phenomenon in the model reconstruction process, making the final reconstructed target 3D model have discontinuous mutations, for example, there is obvious color jump in the corner of the eye.

[0075] In the three-dimensional model reconstruction method of the embodiment of the present invention, a global feature map and an initial local feature map based on texture and shape of an input image are respectively obtained according to image feature coefficients; the initial local feature map is edge-smoothed to obtain a target local feature map, and the edge area of ​​the target local feature map is in a smooth state; the global feature map and the target local feature map are spliced ​​based on texture and shape respectively to obtain a target texture image and a target shape image with smooth edges; the target three-dimensional model is reconstructed according to the target texture image and the target shape image, which effectively reduces the discontinuity problem of the texture image and the shape image, and suppresses the distortion problem of the reconstructed target three-dimensional model.

[0076] In one embodiment, performing edge smoothing on the initial local feature map to obtain a target local feature map includes: obtaining a boundary of the initial local feature map; obtaining a distance between each pixel in the initial local feature map and the boundary; and performing edge smoothing on the initial local feature map according to the distance to obtain the target local feature map.

[0077] Among them, the boundary of the initial local feature map may refer to the outermost boundary line of the initial local feature map. Since the initial local feature map may correspond to boundaries in different directions, the number of boundaries may be more than one (for example, for a box boundary, there are four boundaries). Based on this, the distance between each pixel point and the boundary in the initial local feature map may refer to the distance between each pixel point and the nearest boundary.

[0078] In this embodiment, the initial local feature map is edge-smoothed according to the distance between each pixel and the boundary. The smoothing process may be to adjust the feature value of each pixel (the feature value may be a color value such as an RGB value of the pixel, or a brightness value, etc.) according to a certain gradient, for example, setting the color of the pixel from the center of the image to the boundary of the image to be increasingly darker.

[0079] In one embodiment, different gradients of smoothing may be performed for different distance sizes. For example, in a certain direction, a higher degree of eigenvalue adjustment is performed for distant pixels (pixels farther from the boundary), and a lower degree of eigenvalue adjustment is performed for close pixels.

[0080] In one embodiment, a pre-constructed edge smoothing model can be used to perform feature learning on the initial local feature map, determine the boundary of the initial local feature map, determine the distance between each pixel point in the initial local feature map and the boundary, and then perform edge smoothing on the initial local feature map based on the distance to obtain a target local feature map, so as to solve the discontinuity caused by the convolution stage while ensuring accuracy.

[0081] In the above embodiment, the distance between each pixel point and the boundary in the initial local feature map is determined, and edge smoothing is performed according to the distance, so that pixels at different distances have different feature values, achieving the effect of edge transition, so that the convolution kernel has a smooth transition when moving from the position corresponding to the global feature map to the position corresponding to the local feature map, thereby preventing the local feature map from being discontinuous after splicing.

[0082] In one embodiment, the edge smoothing process is performed on the initial local feature map according to the distance to obtain the target local feature map, including: obtaining the edge area of ​​the initial local feature map according to the distance; determining the feature weight value corresponding to each pixel point of the edge area according to the distance, so that the feature weight value corresponding to the distant pixel point is greater than the feature weight value corresponding to the close pixel point; generating a gradual smoothing feature map according to the feature weight value; the feature value of each pixel point in the gradual smoothing feature map is obtained according to the feature weight value; the feature value of each pixel point in the gradual smoothing feature map is multiplied by the feature value of the corresponding pixel point in the initial local feature map, and obtaining the target local feature map according to the multiplication result.

[0083] When there is more than one initial local feature map, the corresponding gradual smooth feature map can be determined specifically. Taking the initial local feature map including the left eye local feature map, the right eye local feature map, the nose local feature map and the mouth local feature map as an example, the left eye gradual smooth feature map, the right eye gradual smooth feature map, the nose gradual smooth feature map and the mouth gradual smooth feature map can be determined specifically.

[0084] Taking the initial local feature maps as the left eye local feature map, the right eye local feature map, the nose local feature map and the mouth local feature map as examples, the gradient smoothing feature map f i It can be expressed as the following formula:

[0085]

[0086] Among them, i∈(nose,mouth,lefteye,righteye), f i The size of the corresponding initial local feature map L i (Including: L nose , L mouth , L lefteye , L righteye) are the same size; h represents the vertical axis distance between a pixel point in the gradient smooth feature map and the reference point (which can be the point at the lower left corner of the feature map); w represents the horizontal axis distance between a pixel point in the gradient smooth feature map and the reference point; (h, w) represents a pixel point in the gradient smooth feature map; k is the distance between the point (h, w) and the nearest boundary; λ i Represents the evaluation coefficient of a gradient smoothing feature map, which is used to characterize the width of the edge area. Its size can be determined according to the size of the corresponding initial local feature map. For example, h i represents the height of an initial local feature map; w i represents the width of an initial local feature map; i <h<h i -λ i ,λ i <w<w i -λ i It represents the non-edge area (also called the central area) in the corresponding initial local feature map, and the feature weight value of the non-edge area is set to 1; other(h,w) represents the edge area in the corresponding initial local feature map, and the feature weight value of the edge area is determined in a linear or step-by-step manner according to the distance between each pixel and the boundary. The greater the distance, the greater the feature weight value.

[0087] The feature weight value is determined in a step-by-step manner, and the gradual smoothing feature map obtained according to the feature weight value is as follows: Figure 6 As shown, the outer solid line box represents the boundary 601, and the area between the outer solid line box and the inner solid line box represents the edge area, which includes three gradient areas 602, 603 and 604. The grayscale values ​​of the pixels in areas 602, 603 and 604 gradually change from low to high, forming a gradient smooth feature map with a gradually transitioning edge.

[0088] In one embodiment, for setting the feature weight value, the weight value can be set within the range of [0, 1]. For example, the feature weight value of the farthest pixel farthest from the boundary in the edge area is set to 0.9, and the feature weight value of the closest pixel closest to the boundary is set to 0.1. In addition, the area outside the edge area in the initial local feature map can be referred to as a non-edge area, and the feature weight value of the non-edge area can be 1, that is, the feature value of the non-edge area is not adjusted. In one embodiment, generating a gradual smooth feature map according to the feature weight value can be: constructing a blank feature map with the same size as the initial local feature map, the initial feature value of each pixel in the blank feature map is 0, and the calculated feature weight value is used as the new feature value of the corresponding pixel. After updating the feature value of each pixel, a gradual smooth feature map is obtained.

[0089] After obtaining the gradient smoothing feature map, multiply the gradient smoothing feature map with the feature value of the pixel at the corresponding position in the initial local feature map. Taking the left eye as an example, when performing feature value multiplication, the feature value of each pixel in the gradient smoothing feature map of the left eye and the feature value of the corresponding pixel in the local feature map of the left eye can be multiplied, and the left eye target local feature map can be obtained according to the multiplication result. In addition, taking the feature value as the gray value as an example, for a certain position, it corresponds to the pixel a1 in the gradient smoothing feature map and the pixel a2 in the initial local feature map. Assuming that the feature value of a1 is 0.5 and the feature value of a2 is 200, then multiply 0.5 by 200 to obtain a new gray value of 100. This gray value of 100 is the feature value of the corresponding pixel in the target local feature map.

[0090] In one embodiment, Figure 7 FIG. 4 shows a schematic diagram of the effect of edge smoothing, where: Figure 7 (a) represents the initial local feature map, Figure 7 (b) represents the gradient smoothing feature map. Figure 7 As can be seen from (a), the edge of the initial local feature map is more obvious and jumpy. If it is directly spliced ​​with the global feature map, edge discontinuity problems are likely to occur. Figure 7 The edge area in (b) is smoothed, and the edge transition is smooth, showing a strong center and weak edge effect, and the effect strength gradually decreases from the center to the edge. After multiplying the edge smoothing feature map with the corresponding pixel point in the initial local feature map, we get the following: Figure 7 (c) shows the local feature map of the target. It can be seen that Figure 7 The edge of the target local feature map in (c) is too smooth. After splicing it with the global feature map, a target image with continuous edges can be obtained.

[0091] In the above embodiment, a corresponding feature weight value is set for each pixel point in the edge area according to the distance, and a gradual smooth feature map is generated accordingly, and then the feature value of the corresponding pixel point in the initial local feature map is adjusted by the gradual smooth feature map, and the target local feature map is obtained after the adjustment. The edge smoothing of the local feature map is realized by a simple and intuitive method, and the target local feature map with smooth edges can be quickly obtained, thereby solving the discontinuous edges generated after the local feature map and the global feature map are spliced ​​and convolved, and reducing the distortion problem of the final target image.

[0092] In one embodiment, the input image is a facial image; the target local feature map includes key part feature maps corresponding to key parts of the face; the global feature map and the target local feature map are spliced ​​based on texture and shape to obtain a target texture image and a target shape image, including: filling the outer area of ​​each key part feature map with a characteristic value to obtain a filled key part feature map with the same size as the global feature map; merging each of the filled key part feature maps to obtain a facial organ feature map; splicing the global feature map and the facial organ feature map based on texture and shape to obtain the target texture image and the target shape image.

[0093] The face may refer to a human face, an animal face, etc. In one embodiment, the key parts of the face may be eyes (including left and right eyes), nose, mouth, ears, etc. Figure 8 Schematic diagram of the effect of filling and merging feature values ​​of key part feature maps in one embodiment; after filling feature values ​​(for example, filling with 0) of the key part feature maps corresponding to the nose, mouth, left eye and right eye, the filled key part feature maps (nose, mouth, left eye and right eye) can be respectively as follows Figure 8 As shown in (a), (b), (c) and (d) in FIG. 1 , 801 / 802 / 803 / 804 represent the regions where the nose, mouth, left eye and right eye are located, respectively. By merging these key filling feature maps, the regions 801, 802, 803 and 804 where the nose, mouth, left eye and right eye are located are integrated together, and the following can be obtained: Figure 8 (e) Facial organ feature map shown.

[0094] In the above embodiment, by filling the key part feature map with characteristic values, a filled key part feature map with the same size as the global feature map is obtained. The global feature map and the filled key part feature map of the same size can be conveniently superimposed together so that the convolution kernel can perform convolution processing, thereby obtaining a facial organ feature map. Based on the facial organ feature map, it can be effectively spliced ​​with the global feature map to generate a target texture image and a target shape image with continuous edges.

[0095] In one embodiment, the input image is a facial image; the target local feature map includes a left eye feature map, a right eye feature map, a nose feature map and a mouth feature map; the global feature map and the target local feature map are spliced ​​based on texture and shape respectively to obtain a target texture image and a target shape image, including: filling the outer areas of the left eye feature map, the right eye feature map, the nose feature map and the mouth feature map with feature values ​​to obtain a target left eye feature map, a target right eye feature map, a target nose feature map and a target mouth feature map of the same size as the global feature map; merging the target left eye feature map, the target right eye feature map, the target nose feature map and the target mouth feature map to obtain a facial organ feature map; splicing the global feature map and the facial organ feature map based on texture and shape respectively to obtain the target texture image and the target shape image.

[0096] In the above embodiment, feature maps corresponding to the left eye, right eye, nose and mouth in the facial image are obtained, these feature maps are merged to obtain a facial organ feature map, and the facial organ feature map is spliced ​​with the global feature map to obtain an accurate and reliable target texture image and target shape image.

[0097] In one embodiment, the facial organ feature map may be subjected to edge smoothing to obtain a target facial organ feature map, and the global feature map and the target facial organ feature map may be spliced ​​to obtain a target texture image and a target shape image. Fig. 9 , Fig. 9 FIG. 1 is a schematic diagram of a process of obtaining a target facial organ feature map in an embodiment. The implementation process of performing edge smoothing on the facial organ feature map to obtain the target facial organ feature map may be as follows: constructing an organ gradient smoothing feature map corresponding to the facial organ feature map [such as Fig. 9 (a)], obtain the facial organ feature map [as shown in Fig. 9 (b)], the characteristic values ​​of the corresponding pixels of the organ gradient smoothing feature map and the facial organ feature map are multiplied to obtain Fig. 9 (c) shows the target facial organ feature map.

[0098] In the above embodiment, by performing edge smoothing on the facial organ feature map, a target facial organ feature map with edge gradient can be obtained, which effectively weakens the sense of separation between the edges of the target texture image and the target shape image, so that the edges of the target three-dimensional model finally obtained are continuous, effectively reducing the probability of three-dimensional model distortion.

[0099] In one embodiment, the global feature map includes a global texture feature map and a global shape feature map, and the target local feature map includes a local texture feature map and a local shape feature map; and the global feature map and the target local feature map are spliced ​​based on texture and shape respectively to obtain a target texture image and a target shape image, including: splicing the global feature map and the target local feature map based on texture to obtain a target texture image; and splicing the global feature map and the target local feature map based on shape to obtain a target shape image.

[0100] In one embodiment, the global feature map and the target local feature map are spliced ​​based on texture to obtain a target texture image, including: splicing the global texture feature map and the local texture feature map, and convolving the spliced ​​feature map to integrate global texture features and local texture features to obtain the target texture image.

[0101] The global feature map and the target local feature map are spliced ​​based on the shape to obtain a target shape image, including: splicing the global shape feature map and the local shape feature map, and convolving the spliced ​​feature map to integrate the global shape features and the local shape features to obtain the target shape image.

[0102] In the above embodiment, the global feature map and the local feature map are spliced ​​based on texture and shape respectively, and the spliced ​​feature map is convolved, so as to obtain a target image that fuses the global features and the local features. The target three-dimensional model is reconstructed according to the target image. The target three-dimensional model integrates various information, can represent the image information more comprehensively, correspond to the input image as much as possible, and realize reliable reconstruction of the three-dimensional model.

[0103] In one embodiment, the global feature map and the local feature map may have more than one layer, but may be composed of multiple layers of feature maps. In this case, the global feature map and the local feature map need to be spliced ​​and then a convolution module is used to integrate the global information and the local information. In one embodiment, the global feature map and the target local feature map each correspond to at least one feature channel; the global feature map and the target local feature map are spliced ​​based on texture and shape respectively to obtain a target texture image and a target shape image, including: splicing the global feature map and the target local feature map in each of the feature channels based on texture and shape respectively, convolving the feature maps spliced ​​from each of the feature channels to integrate the global features and local features to obtain a target texture image and a target shape image.

[0104] The feature map processing flow of multiple feature channels (both texture-based and shape-based processing flows can be implemented through the processing flow of this map, that is, the processing flow of texture and shape can be the same) is as follows Fig.10 Specifically, the global feature maps and initial local feature maps (the initial local feature maps corresponding to the left eye, the right eye, the nose and the mouth) on the three feature channels are obtained respectively, and the initial local feature maps on these feature channels are edge-smoothed to obtain the target local feature maps on the three feature channels, and the global feature maps and the target local feature maps on each feature channel are spliced ​​to obtain the spliced ​​feature maps 1001 on the three feature channels, and these spliced ​​feature maps 1001 are stacked together in order and then input into the convolution module for convolution to obtain the target image.

[0105] The above-mentioned embodiment splices and performs convolution processing on the global feature map and the local feature map based on the feature channel, which can fully fuse the global features and local features on multiple feature channels, so that the obtained target image more comprehensively reflects the characteristics of the input image, and finally obtains a more accurate target three-dimensional model.

[0106] In one embodiment, the global feature map and the local feature map may be concatenated and convolved based on texture and shape, respectively, to obtain a corresponding target texture image and a target shape image.

[0107] In one embodiment, for texture, the global texture feature map and the local texture feature map are spliced, and the spliced ​​feature map is convolved to integrate the global texture features and the local texture features to obtain the target texture image, including: splicing the global texture feature map and the local texture feature map in each of the feature channels, and convolving the feature map spliced ​​from each of the feature channels to integrate the global texture features and the local texture features to obtain the target texture image. In the above embodiment, the global texture feature map and the local texture feature map are spliced ​​according to the channel dimension, and the spliced ​​feature map is convolved, which fully integrates the global texture features and local texture features on multiple feature channels, and can obtain a comprehensive and accurate target texture image.

[0108] In one embodiment, for the shape, the global feature map and the target local feature map each correspond to at least one feature channel, and the global shape feature map and the local shape feature map are spliced, and the spliced ​​feature map is convolved to integrate the global shape features and the local shape features to obtain the target shape image, including: splicing the global shape feature map and the local shape feature map in each of the feature channels, and convolving the feature map spliced ​​from each of the feature channels to integrate the global shape features and the local shape features to obtain the target shape image. In the above embodiment, the global shape feature map and the local shape feature map are spliced ​​according to the channel dimension, and the spliced ​​feature map is convolved, which fully integrates the global shape features and the local shape features on multiple feature channels, and can obtain a comprehensive and accurate target shape image.

[0109] In one embodiment, the image feature coefficients can be obtained by an autoencoder. An autoencoder is a neural network designed to copy input to output. Specifically, the autoencoder can be a convolutional autoencoder. A convolutional autoencoder uses a convolutional layer instead of a fully connected layer to downsample the input features to provide a potential representation of a smaller dimension, and forces the autoencoder to learn a compressed version of the input features, so as to obtain coefficients that characterize the image features.

[0110] In one embodiment, obtaining the image feature coefficients of the input image includes: performing layer-by-layer convolution processing on the input image through a convolutional autoencoder; and obtaining the texture feature coefficients and shape feature coefficients of the input image as the image feature coefficients based on the results of the layer-by-layer convolution processing.

[0111] Among them, the structure of the convolutional autoencoder can be as follows Fig.11 As shown in FIG. 1 , the convolutional autoencoder is composed of multiple convolutional layers, which perform convolution processing on the input image layer by layer to downsample the features of the input image and analyze them layer by layer, and then obtain the texture feature coefficient f according to the results of the layer-by-layer convolution processing. a and shape characteristic coefficient f s , as the image feature coefficient.

[0112] Specifically, in one embodiment, the convolutional autoencoder includes a decoder; the convolutional autoencoder performs layer-by-layer convolution processing on the input image, and obtains the image feature coefficient according to the result of the layer-by-layer convolution processing, including: performing layer-by-layer convolution processing on the input image by the convolutional autoencoder; the decoder obtains the texture feature coefficient and shape feature coefficient of the input image according to the result of the layer-by-layer convolution processing as the image feature coefficient.

[0113] The convolutional autoencoder outputs each convolutional layer through the decoder, such as Fig.11 The output size on the right is the size of the decoder output. The 53rd convolution layer can obtain a two-dimensional output result, which is 7×7×(f s +f a +64) output. Then perform average pooling (AvgPool) to get f s and f a The value of , that is, the texture feature coefficient and shape feature coefficient are obtained.

[0114] The above embodiment uses an autoencoder to obtain image feature coefficients, which can fully exploit the image features of the input image through layer-by-layer convolution, and then obtain accurate image feature coefficients, so as to obtain accurate global feature maps and local feature maps.

[0115] In one embodiment, the input image can be feature analyzed and decoded by a local detail enhancement module, and the local detail enhancement module can include a global decoder and a local decoder, through which a global feature map and an initial local feature map can be obtained. In one embodiment, the global feature map and the initial local feature map based on texture and shape of the input image are obtained according to the image feature coefficients, including: the deconvolution layer in the global decoder performs feature decoding on the input image according to the image feature coefficients to obtain the global feature map; the deconvolution layer in the local decoder performs feature decoding on the input image according to the image feature coefficients to obtain the initial local feature map.

[0116] The global decoder and the local decoder may each be composed of at least one deconvolution layer, and the convolution kernel sizes of the deconvolution layers may be the same or different. In addition, the sizes of the global feature maps of the feature channels may be the same, and the initial local feature maps of different parts may be the same or different.

[0117] In the above embodiment, the global decoder decodes the input image to obtain a global feature map, and the local decoder decodes the input image to obtain an initial local feature map, that is, the global decoder and the local decoder are used to obtain the overall features and local features of the input image respectively, and then the target image is obtained based on the integration of the overall features and the local features. This enables the target image to restore the information of the input image as much as possible, so that a reliable image reconstruction effect can be achieved based on the target image later.

[0118] In one embodiment, the local decoder includes a facial key part decoder; the deconvolution layer in the local decoder performs feature decoding on the input image according to the image feature coefficient to obtain the initial local feature map, including: the deconvolution layer in the facial key part decoder performs feature decoding on the input image according to the image feature coefficient, and determines the decoded key part feature map as the initial local feature map.

[0119] There may be more than one facial key part decoder, and each facial key part may correspond to at least one decoder, for example, including a left eye decoder, a right eye decoder, a nose decoder, a mouth decoder, etc. These facial key part decoders respectively perform feature decoding on the input image and obtain the corresponding initial local feature map.

[0120] In some embodiments, these facial key part decoders can be pre-trained using corresponding pictures of eyes, nose, and mouth.

[0121] In the above embodiment, the facial key part decoder is used to perform feature decoding in a targeted manner to obtain an initial local feature map with clear local features.

[0122] In one embodiment, the facial key part decoder includes a left eye decoder, a right eye decoder, a nose decoder and a mouth decoder; the deconvolution layer in the facial key part decoder performs feature decoding on the input image according to the image feature coefficient, and determines the decoded key part feature map as the initial local feature map, including: the deconvolution layer in the left eye decoder performs feature decoding on the input image according to the image feature coefficient to obtain a left eye feature map; the deconvolution layer in the right eye decoder performs feature decoding on the input image according to the image feature coefficient to obtain a right eye feature map; the deconvolution layer in the nose decoder performs feature decoding on the input image according to the image feature coefficient to obtain a nose feature map; the deconvolution layer in the mouth decoder performs feature decoding on the input image according to the image feature coefficient to obtain a mouth feature map; and the left eye feature map, the right eye feature map, the nose feature map and the mouth feature map are determined as the initial local feature map.

[0123] In one embodiment, according to the image feature coefficients, a global feature map and an initial local feature map of the input image based on texture and shape are respectively obtained, including: a deconvolution layer in a global decoder performs feature decoding on the input image according to texture feature coefficients and shape feature coefficients to obtain the global texture feature map and the global shape feature map; a deconvolution layer in a local decoder performs feature decoding on the input image according to texture feature coefficients and shape feature coefficients to obtain an initial texture local feature map and an initial shape local feature map.

[0124] In one embodiment, the initial texture local feature map and the initial shape local feature map can be edge smoothed to obtain a local texture feature map and a local shape feature map, and the obtained local texture feature map and local shape feature map are spliced ​​with the corresponding global feature map to obtain the corresponding target texture image and target shape image.

[0125] In one embodiment, the global decoder D g It consists of 13 deconvolution layers, each of which has a convolution kernel size of 3*3. Its output can be a global feature map G of c'*h'*w', where c' is the number of feature channels, h' and w' are the height and width of the global feature map, respectively, h'*w' can be 192*224, and the texture coefficient f a and shape factor f s As the input of the global decoder, the global texture feature map T is obtained G and the global shape feature map S G .

[0126] Local Decoder D l It consists of 4 local decoding modules: To decode the nose, mouth, left eye and right eye regions, each local decoding module consists of 10 deconvolution layers. The corresponding outputs are L nose , L mouth , L lefteye , L righteye , their corresponding output sizes are c′*h nose *w nose , c′*h mouth *w mouth , c′*h lefteye *w lefteye , c′*h righteyere *w righteye Among them, h nose 、h mouth 、h lefteye and h righteyere Respectively represent the height of the nose, mouth, left eye and right eye feature map, w nose 、wmouth 、w lefteye and w righteyere Represents the width of the nose, mouth, left eye and right eye feature maps respectively.

[0127] The outputs of the global decoder and local decoder are as follows:

[0128]

[0129] In the above embodiment, a global feature map is obtained by decoding with a global decoder, and a feature map of key facial parts is obtained by decoding with a feature map of key facial parts, and then the feature maps are spliced ​​and convolved to obtain a target image. Not only a global feature map reflecting the overall facial features of the input image can be obtained, but also a feature map of key facial parts reflecting local information can be obtained in a targeted manner, so that the obtained target image is sufficiently comprehensive and accurate.

[0130] In one embodiment, the target three-dimensional model generated by the embodiment of the present invention can be used as paired training data for face fusion (face-changing application) research. The fusion image (user face) and the template image are swapped to obtain the result image, and the 2D feature points of the face in the result image are the so-called paired training data. Each frame and the user face in the template image can be modeled separately, and then the posture and expression of each frame in the template image can be transferred to the user face, and the three-dimensional model corresponding to each frame after the face swap can be obtained, thereby obtaining paired training data from the 2D image corresponding to the three-dimensional model, so as to train the face swap model later.

[0131] Among them, the face-changing model can be a network neural model based on deep learning, which can replace some features of a face with models of other facial features. For example, two facial images A and B are input into the face-changing model, and the face-changing model obtains global features from A and local features from B, and then reconstructs a three-dimensional model based on these features to obtain a face model C containing the global features of A and the local features of B. Because local features contain more detailed information about facial organs and can more clearly represent facial features, it can be understood that face B is replaced with face A at this time.

[0132] Specifically, in one embodiment, the input image is a facial image; after the three-dimensional model reconstruction processing is performed according to the target texture image and the target shape image to obtain the target three-dimensional model, it also includes: obtaining global feature points of the two-dimensional image corresponding to the target three-dimensional model to obtain target feature points; obtaining a template three-dimensional model; obtaining local feature points of the two-dimensional image corresponding to the template three-dimensional model to obtain template feature points; inputting the target feature points and the template feature points as paired data into a face-changing model, so that the face-changing model outputs a face-changing three-dimensional model; the face-changing three-dimensional model contains the global features in the target three-dimensional model and the local features in the template three-dimensional model.

[0133] The template three-dimensional model can be obtained based on the template facial image. Specifically, the template facial image is input into the three-dimensional reconstruction model, and the three-dimensional model output by the three-dimensional reconstruction model is the template three-dimensional model. Since the template three-dimensional model is generated by the three-dimensional reconstruction model, in this way, the three-dimensional reconstruction model can directly and quickly output the local feature points of the template three-dimensional model. In some embodiments, a pre-configured template three-dimensional model can also be obtained, and the local feature points of the template three-dimensional model can be obtained by extracting feature points from the template three-dimensional model.

[0134] In the above embodiment, local feature points are obtained from the template three-dimensional model, global feature points are obtained from the target three-dimensional model, and these two feature points are input into the face-changing model in pairs, and the face-changing three-dimensional model is obtained from the face-changing model to accurately achieve face-changing.

[0135] In one embodiment, the face-changed 3D model may be subjected to image rendering processing to obtain a face-changed image. Fig.12 FIG. 1 is a schematic diagram of a process of obtaining a face-changed image in one embodiment. Fig.12 As shown, after integrating and rendering the input image and the template facial image, the replaced face image on the right is obtained. The replaced face image has the posture and outline of the input image, as well as the facial features and expressions of the template facial image, achieving the effect of "face changing".

[0136] In one embodiment, the method of obtaining a template three-dimensional model includes: obtaining a preset template facial image; obtaining a template global feature map and an initial template local feature map based on texture and shape of the template facial image; performing edge smoothing on the initial template local feature map to obtain a target template local feature map; splicing the template global feature map and the target template local feature map based on texture and shape respectively to obtain a template facial texture image and a template facial shape image; performing three-dimensional model reconstruction processing based on the template facial texture image and the template facial shape image to obtain the template three-dimensional model.

[0137] In the above embodiment, the template facial image is processed through the three-dimensional reconstruction model, and the edge smoothing is performed on the initial template local feature map, so that a template facial texture image and a template facial shape image with smooth and continuous edges can be obtained. This can effectively reduce the distortion of the reconstructed template three-dimensional model, ensure the normal operation of the face-changing application, and obtain a reliable three-dimensional model of the changed face.

[0138] The 3D model reconstruction method provided in this application can be applied to various 3D reconstruction processing scenarios, for example, it can be applied to image processing software, model reconstruction software, PS (Photoshop) software, 3D animation processing software (for example: anime face-pinching software), etc.

[0139] The present application also provides an application scenario, which applies the above-mentioned three-dimensional model reconstruction method. Specifically, Fig.13 FIG. 1 is a flow chart of a method for reconstructing a three-dimensional model in an embodiment, referring to FIG. Fig.13 ,The application of the 3D model reconstruction method in this application scenario is as follows:

[0140] Input a 224*224 face image to be processed into the 3D reconstruction software of the terminal (the 3D reconstruction software is equipped with a 3D reconstruction model based on deep learning) to trigger the 3D reconstruction software to process the input face image as follows to reconstruct the target 3D face model:

[0141] 1. Generate the texture coefficient f corresponding to the face image through a convolutional autoencoder a and shape factor f s .

[0142] 2. a and f s The first local detail enhancement module is used to output a 2D shape map, and the second local detail enhancement module is used to output a 2D texture map. The specific processing flow of the two local detail enhancement modules is shown in steps 3 and 4.

[0143] 3. In the local detail enhancement module, a decoder D is constructed, which consists of a global decoder D g and a local decoder D l constitute.

[0144] The following is an explanation using the first local detail enhancement module as an example (the implementation process of the second local detail enhancement module is the same and will not be repeated here):

[0145] Afterwards, the global decoder D g It consists of 13 deconvolution layers and outputs the global shape feature map S G .

[0146] Local Decoder D l It consists of 4 local decoding modules: To decode the nose, mouth, left eye and right eye regions, each deconvolution module contains 10 deconvolution layers. The corresponding initial local feature map L i .

[0147] Set the gradient smoothing feature map f i , f i The size of the initial local feature map L i The feature values ​​of each pixel in the gradient smoothing feature map are set as follows:

[0148]

[0149] After the gradient smoothing feature map is generated, it is multiplied with the pixel feature value of the corresponding initial local feature map to obtain the target local feature map of edge gradient corresponding to the four parts. These target local feature maps are merged to obtain the facial organ shape feature map S L .

[0150] The second local detail enhancement module obtains the global texture feature map T in the same way. G and facial organ texture feature map T L .

[0151] 4. Facial organ texture feature map T L and the global texture feature map T G After channel dimension splicing, the first local detail enhancement module outputs a 2D texture map T through a convolutional layer. 2D Similarly, the facial organ shape feature map S L With the global shape feature map S G After channel-dimensional concatenation, the second local detail enhancement module outputs a 2D shape map S through a convolutional layer. 2D .

[0152] 5. The 2D texture map T obtained above 2D and 2D shape map S 2D Perform three-dimensional model reconstruction to obtain the target three-dimensional face model.

[0153] like Fig.13 As shown, after inputting a face image, the 3D reconstruction software on the terminal reconstructs the 3D face model, and finally obtains the target 3D face model. Analysis of the target 3D face model shows that the 3D face model output by the above embodiment is complete and continuous, and there is no image distortion problem.

[0154] Specifically, for the processing effect on image texture. Fig.14 A comparison diagram of the 2D texture map obtained by the conventional technology and the embodiment of the present invention is shown, wherein Fig.14 (a) shows three 2D texture images obtained by traditional technology. Fig.14 In (a), each face texture has a certain degree of distortion. Fig.14 (b) shows three 2D texture images obtained by the embodiment of the present invention (wherein, in the two rows of images a / b, the two corresponding texture images above and below are obtained through the same input image), Fig.14 The facial texture in (b) is clear and there is no distortion problem. Next, we will compare the edge processing effect of the texture image. Fig.15 A comparison diagram of the edge effects of a 2D texture image obtained by a conventional technique and an embodiment of the present invention is shown, wherein Fig.15 (a) represents the 2D texture map obtained by traditional technology. Fig.15 (a) There is an obvious split in the eye edge area 1501. Fig.15 (b) represents a 2D texture image obtained in an embodiment of the present invention, Fig.15 The edge of the eye edge region 1502 in (b) is too smooth. Fig.15 The position of the middle box (including the eye edge regions 1501 and 1502) is the contrast between the edge abruptness and the edge smoothness. Fig.14 and Fig.15 It can be seen from the comparison that compared with the texture image generated by the traditional technology, the edge of the 2D texture image generated by the embodiment of the present invention is smoother, the discontinuity caused by the convolution is greatly reduced, and it is closer to the original skin color.

[0155] The processing effect on the image shape. Fig.16 A comparison diagram of the 2D shape diagram obtained by the conventional technology and the embodiment of the present invention is shown, wherein Fig.16 (a) shows three 2D shape images obtained by traditional technology. Fig.16 In (a), the three mouth edge regions all have some degree of missing, i.e., the edges are discontinuous. Fig.16 (b) shows three 2D shape images obtained by the embodiment of the present invention (wherein, in the two rows of images a / b, the two corresponding shape images above and below are obtained through the same input image), Fig.16 (b) All facial regions are continuous and the transition is relatively smooth.

[0156] Through the analysis and comparison results of the above images, it can be seen that the 3D reconstruction software on the terminal solves the problem of 2D texture and 2D shape distortion well through the 3D model reconstruction method provided by the embodiment of the present invention, and can output a good 3D reconstructed face model.

[0157] In one embodiment, a training method for a three-dimensional reconstruction model is also provided. In this embodiment, the method is applied to Figure 1 The terminal in the example is used for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server.

[0158] Specifically, Fig.17 FIG. 1 is a flow chart of a training method for a three-dimensional reconstruction model in an embodiment. Fig.17 As shown, the method comprises the following steps:

[0159] S1701, obtaining image feature coefficients and rendering coefficients of a training image.

[0160] The training image may be an image containing various types of objects. For specific implementation methods, reference may be made to the input image in the aforementioned embodiment.

[0161] The rendering coefficient may refer to a coefficient that can affect the image rendering process, and may be an illumination coefficient, a torsion coefficient, etc. Taking the face as an example, the illumination coefficient may be a coefficient corresponding to the illumination intensity, illumination angle, etc., and the torsion coefficient may be a coefficient corresponding to the pitch angle, profile angle, etc. of the head.

[0162] S1702, input the image feature coefficients into a three-dimensional reconstruction model based on deep learning, so that the three-dimensional reconstruction model: obtains the global feature map and the initial local feature map of the training image based on the texture and shape according to the image feature coefficients, performs edge smoothing on the initial local feature map to obtain a target local feature map; splices the global feature map and the target local feature map based on texture and shape, respectively, to obtain a target texture image and a target shape image; performs three-dimensional model reconstruction processing according to the target texture image and the target shape image to obtain a predicted three-dimensional model.

[0163] The 3D reconstruction model can be a neural network model based on deep learning.

[0164] It should be noted that the specific implementation process of obtaining the predicted three-dimensional model from the three-dimensional reconstructed model can be found in the embodiments of the three-dimensional model reconstruction method mentioned above, which will not be repeated here.

[0165] S1703: Perform image rendering processing on the predicted three-dimensional model according to the rendering coefficient to obtain a predicted two-dimensional image.

[0166] Image rendering is the process of adjusting the image's light, color, angle and other parameters. In some cases, rendering can also refer to the process of adjusting the image's light, color, angle and other parameters and the subsequent two-dimensional conversion, and a two-dimensional image is directly obtained after rendering.

[0167] In one embodiment, the implementation process of S1703 may be: adjusting the illumination direction, pitch angle, etc. of the predicted 3D image, performing a 2D conversion on the predicted 3D image after the adjustment, and using the obtained 2D image as the predicted 2D image. Specifically, the rendering may be implemented by a nonlinear rendering method, etc.

[0168] S1704, training the three-dimensional reconstruction model according to the error between the training image and the predicted two-dimensional image until a convergence condition is met, thereby obtaining a trained three-dimensional reconstruction model.

[0169] The predicted 2D image is obtained by performing image rendering processing on the predicted 3D model, and has rendering information such as lighting, color, and angle of the objects in the training image (people, animals, buildings, etc. in the training image). Therefore, the error between the predicted 2D image and the training image carries the rendering information of the object. Based on this, the trained 3D reconstruction model can reliably reconstruct the input image to obtain the target 3D model carrying the rendering information.

[0170] In the above embodiment, the predicted 3D model without distortion problem can be obtained as much as possible through the 3D reconstruction model, and the predicted 3D model is rendered to obtain a predicted 2D image, which is reconstructed based on the training image and can basically restore the graphic features of the training image. Based on this, the 3D reconstruction model is trained based on the error between the predicted 2D image and the training image, and an accurate and reliable 3D reconstruction model can be obtained through training.

[0171] In one embodiment, the training of the three-dimensional reconstruction model based on the error between the training image and the predicted two-dimensional image includes: constructing a loss function of the three-dimensional reconstruction model based on the error; performing gradient descent processing on the loss function; and adjusting model parameters of the three-dimensional reconstruction model based on the result of the gradient descent processing.

[0172] Specifically, there can be multiple training images and predicted two-dimensional images. The loss function of the three-dimensional reconstruction model can be constructed based on the errors between these training images and the predicted two-dimensional images. The loss function is then minimized through the gradient descent method to determine the model parameters corresponding to the minimum value of the loss function. The three-dimensional reconstruction model corresponding to the model parameters is the three-dimensional reconstruction model after adjustment.

[0173] The above embodiment processes the loss function of the 3D reconstruction model by using the gradient descent method, and can quickly and accurately obtain the minimum value of the loss function, and then adjust the model parameters of the 3D reconstruction model to train the 3D reconstruction model. When the minimum value of the loss function is small enough, the 3D reconstruction model can be considered to be good enough, and at this time, it can be considered that the convergence condition is met, and the corresponding 3D reconstruction model is the trained 3D reconstruction model.

[0174] In one embodiment, the acquisition of image feature coefficients and rendering coefficients of a training image includes: performing layer-by-layer convolution processing on the training image through a convolutional autoencoder; the convolutional autoencoder includes a decoder and an encoder; the decoder obtains texture feature coefficients and shape feature coefficients of the training image as the image feature coefficients according to the result of the layer-by-layer convolution processing; the encoder obtains torsion coefficients and illumination coefficients of the training image as the rendering coefficients according to the result of the layer-by-layer convolution processing.

[0175] The rendering coefficient includes a torsion coefficient m and a lighting coefficient S.

[0176] In one embodiment, the convolutional autoencoder includes an encoder; the image feature coefficients and the rendering coefficients are obtained according to the results of layer-by-layer convolution processing, including: the encoder obtains the torsion coefficients and illumination coefficients of the training image according to the results of layer-by-layer convolution processing as the rendering coefficients.

[0177] The structure of the convolutional autoencoder can be as follows Fig.11 As shown. The convolutional autoencoder can obtain the output information of the previous convolutional layer through the encoder and perform convolution processing. Fig.11 The filter / step number in the middle shows the structure of the encoder. After the convolution result is averaged and pooled, the encoder can output the values ​​of m and S, that is, the torsion coefficient and illumination coefficient.

[0178] In some embodiments, the convolutional autoencoder may also be an internal component of the 3D reconstruction model, that is, the image feature coefficients and the rendering coefficients are obtained by the convolutional autoencoder in the 3D reconstruction model.

[0179] The above embodiment uses an autoencoder to obtain image feature coefficients and rendering coefficients, can fully mine the image features of the training image through layer-by-layer convolution, and obtain accurate image feature coefficients and rendering coefficients based on a deep learning method, which can ensure the reliable operation of subsequent programs and further obtain an accurate target three-dimensional model.

[0180] In one embodiment, a training method for a three-dimensional reconstruction model is provided. In this embodiment, the method is applied to Figure 1 The implementation process is as follows: Fig.18 As shown, Fig.18 The following is a flow chart of a training method for a 3D reconstruction model in an embodiment. The specific implementation process is as follows:

[0181] First, the terminal obtains the training face image and generates the texture feature coefficient f of the training face image through the convolutional autoencoder. s , shape characteristic coefficient f a, torsion coefficient m and illumination coefficient S.

[0182] Second, f a and f s The input 3D reconstruction model includes the same first local detail enhancement module and second local detail enhancement module. The 2D shape map and the 2D texture map are obtained by the first local detail enhancement module and the second local detail enhancement module respectively. The 3D reconstruction model generates a predicted 3D face model according to the 2D shape map and the 2D texture map.

[0183] Third, the terminal triggers the rendering module to render the predicted three-dimensional face model according to the torsion coefficient m and the illumination coefficient S, and obtains the predicted two-dimensional face image.

[0184] Fourth, the terminal adjusts the 3D reconstruction model based on the error between the training face image and the predicted 2D face image. When the convergence condition is met, a trained 3D reconstruction model is obtained, which can reconstruct a 3D model based on the input 2D image.

[0185] In the above embodiment, a predicted 3D model is obtained through a 3D reconstruction model, and an image rendering is performed on the predicted 3D model to obtain a predicted 2D image, which is reconstructed based on a training image and can basically restore the graphic features of the training image. Based on this, the predicted 2D image corresponding to the predicted 3D model is compared with the input training image, and the comparison result can play a feedback role on the reconstruction effect of the 3D reconstruction model. The 3D reconstruction model is trained based on the comparison result, and an accurate and reliable 3D reconstruction model can be obtained through training.

[0186] The present application also provides an application scenario, which applies the above-mentioned 3D reconstruction model training method and 3D model reconstruction method. Specifically, the application of these methods in this application scenario is as follows:

[0187] The terminal receives multiple training face images and inputs these training face images into the model training software. The model training software obtains the texture feature coefficient f of the training face images. sX , shape characteristic coefficient f aX , torsion coefficient m X And the illumination coefficient S X The model training software converts the texture feature coefficient f sX , shape characteristic coefficient f aX Input into the 3D reconstruction model. The 3D reconstruction model is based on the texture feature coefficient f sX , shape characteristic coefficient f aX , respectively obtain the global texture feature map T of the training face image GX , global shape feature map S GX , local texture feature map TLXO and the local shape feature map S LXO , for the local texture feature map T LXO and the local shape feature map S LXO Perform edge smoothing to obtain the target local texture feature map T LX And the target local shape feature map S lX ; For the global texture feature map T GX and the target local texture feature map T LX Stitching is performed to obtain the target texture image T X , for the global shape feature map S GX And the target local shape feature map S LX Splice and get the target shape image S X ; According to the target texture image T X and the target shape image S X Perform 3D model reconstruction to obtain the predicted 3D face model. The model training software is based on the torsion coefficient m X And the illumination coefficient S X The predicted three-dimensional face model is subjected to image rendering processing to obtain a predicted two-dimensional face image; a loss function is constructed according to the error between the training face image and the predicted two-dimensional face image, and a gradient descent algorithm is run on the loss function. When the result of the gradient descent algorithm meets the convergence condition, a trained three-dimensional reconstruction model is obtained.

[0188] Afterwards, the model training software can output the trained 3D reconstruction model to the 3D reconstruction software. When the 3D reconstruction software receives the input face image, it can use the trained 3D reconstruction model to implement the following steps: sY and shape characteristic coefficient f aY Get the global texture feature map T of the input face image respectively GY , global shape feature map S GY , local texture feature map T LYO and the local shape feature map S LYO , for the local texture feature map T LYO and the local shape feature map S LYO Perform edge smoothing to obtain the target local texture feature map T LY And the target local shape feature map S LY ; For the global texture feature map T GY and the target local texture feature map T LY Stitching is performed to obtain the target texture image T Y , for the global shape feature map S GY And the target local shape feature map S LY Splice and get the target shape image S Y; According to the target texture image T Y and the target shape image S Y The 3D model reconstruction process is performed to obtain a target 3D face model. The 3D reconstruction software converts the target 3D face model into an image and displays it on a display screen.

[0189] The above method provided by the embodiment of the present invention can realize the training and reconstruction of the three-dimensional model in the terminal, and the three-dimensional face reconstructed by the three-dimensional reconstruction model can effectively suppress the occurrence of image distortion and achieve a reliable face model reconstruction effect.

[0190] It should be understood that, although the various steps in the above flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above flowchart may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0191] Based on the same idea as the three-dimensional model reconstruction method and the three-dimensional reconstruction model training method in the above-mentioned embodiment, the present invention also provides a three-dimensional model reconstruction device and a three-dimensional reconstruction model training device, which can be used to execute the above-mentioned three-dimensional model reconstruction method and the three-dimensional reconstruction model training method, respectively. For ease of explanation, the structural schematic diagram of the three-dimensional model reconstruction device and the three-dimensional reconstruction model training device embodiment only shows the parts related to the embodiment of the present invention. Those skilled in the art can understand that the illustrated structure does not constitute a limitation on the device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0192] In one embodiment, Fig.19 As shown, a three-dimensional model reconstruction device 1900 is provided. The device can adopt a software module or a hardware module, or a combination of the two to become a part of a computer device. The device specifically includes: a first coefficient acquisition module 1901, a feature map acquisition module 1902, a smoothing processing module 1903, a feature map splicing module 1904 and a first model reconstruction module 1905, wherein:

[0193] The first coefficient acquisition module 1901 is used to acquire the image feature coefficients of the input image.

[0194] The feature map acquisition module 1902 is used to respectively acquire a global feature map and an initial local feature map of the input image based on texture and shape according to the image feature coefficients.

[0195] The smoothing processing module 1903 is used to perform edge smoothing processing on the initial local feature map to obtain a target local feature map.

[0196] The feature map stitching module 1904 is used to stitch the global feature map and the target local feature map based on texture and shape, respectively, to obtain a target texture image and a target shape image.

[0197] The first model reconstruction module 1905 is used to perform a three-dimensional model reconstruction process according to the target texture image and the target shape image to obtain a target three-dimensional model.

[0198] In the above-mentioned three-dimensional model reconstruction device, the local feature map is subjected to edge smoothing processing, which is not easy to produce image distortion and can obtain a target three-dimensional model with smooth edges.

[0199] In one embodiment, the smoothing processing module includes: a boundary acquisition submodule, used to obtain the boundary of the initial local feature map; a distance acquisition submodule, used to obtain the distance between each pixel point in the initial local feature map and the boundary; a first edge smoothing submodule, used to perform edge smoothing on the initial local feature map according to the distance to obtain the target local feature map.

[0200] In one embodiment, the first edge smoothing submodule includes: an edge area acquisition unit, which is used to acquire the edge area of ​​the initial local feature map according to the distance; a weight value determination unit, which is used to determine the feature weight value corresponding to each pixel point of the edge area according to the distance, so that the feature weight value corresponding to the distant pixel point is greater than the feature weight value corresponding to the close pixel point; a feature map construction unit, which is used to generate a gradual smoothing feature map according to the feature weight value; the feature value of each pixel point in the gradual smoothing feature map is obtained according to the feature weight value; and a feature value multiplication unit, which is used to multiply the feature value of each pixel point in the gradual smoothing feature map with the feature value of the corresponding pixel point in the initial local feature map, and obtain the target local feature map according to the multiplication result.

[0201] In one embodiment, the input image is a facial image; the target local feature map includes key part feature maps corresponding to key parts of the face; the feature map splicing module includes: a filling submodule, used to fill the external area of ​​each key part feature map with a feature value respectively, so as to obtain a filled key part feature map with the same size as the global feature map; a merging submodule, used to merge each of the filled key part feature maps to obtain a facial organ feature map; a splicing submodule, used to splice the global feature map and the facial organ feature map based on texture and shape respectively, to obtain the target texture image and the target shape image.

[0202] In one embodiment, the key facial parts include at least one of a left eye, a right eye, a nose, and a mouth.

[0203] In one embodiment, the global feature map includes a global texture feature map and a global shape feature map, and the target local feature map includes a local texture feature map and a local shape feature map; the feature map splicing module includes: a texture convolution submodule, used to splice the global texture feature map and the local texture feature map, and convolve the spliced ​​feature map to integrate the global texture features and the local texture features to obtain the target texture image; a shape convolution submodule, used to splice the global shape feature map and the local shape feature map, and convolve the spliced ​​feature map to integrate the global shape features and the local shape features to obtain the target shape image.

[0204] In one embodiment, the global feature map and the target local feature map each correspond to at least one feature channel; the texture convolution submodule is further used to splice the global texture feature map and the local texture feature map in each of the feature channels, and to convolve the feature maps spliced ​​from each of the feature channels to integrate the global texture features and the local texture features to obtain the target texture image; the shape convolution submodule is further used to splice the global shape feature map and the local shape feature map in each of the feature channels, and to convolve the feature maps spliced ​​from each of the feature channels to integrate the global shape features and the local shape features to obtain the target shape image.

[0205] In one embodiment, the first coefficient acquisition module includes: a convolution submodule, used to perform layer-by-layer convolution processing on the input image through a convolution autoencoder; a feature coefficient acquisition submodule, used to obtain the texture feature coefficient and shape feature coefficient of the input image according to the result of the layer-by-layer convolution processing as the image feature coefficient.

[0206] In one embodiment, the feature map acquisition module includes: a global decoding submodule, which is used for the deconvolution layer in the global decoder to perform feature decoding on the input image according to the image feature coefficient to obtain the global feature map; and a local decoding submodule, which is used for the deconvolution layer in the local decoder to perform feature decoding on the input image according to the image feature coefficient to obtain the initial local feature map.

[0207] In one embodiment, the local decoder includes a facial key part decoder; the local decoding submodule is further used to perform feature decoding on the input image according to the image feature coefficient by the deconvolution layer in the facial key part decoder, and determine the decoded key part feature map as the initial local feature map.

[0208] In one embodiment, the input image is a facial image; the device further includes: a target feature point acquisition module, used to acquire global feature points of the two-dimensional image corresponding to the target three-dimensional model to obtain target feature points; a template model acquisition module, used to acquire the template three-dimensional model; a template feature point acquisition module, used to acquire local feature points of the two-dimensional image corresponding to the template three-dimensional model to obtain template feature points; a face-changing module, used to input the target feature points and the template feature points as paired data into the face-changing model, so that the face-changing model outputs a face-changed three-dimensional model; the face-changed three-dimensional model contains the global features in the target three-dimensional model and the local features in the template three-dimensional model.

[0209] In one embodiment, the template model acquisition module includes: a template image acquisition submodule, which is used to acquire a preset template facial image; a template feature map acquisition submodule, which is used to acquire a template global feature map and an initial template local feature map based on texture and shape of the template facial image; a second edge smoothing submodule, which is used to perform edge smoothing processing on the initial template local feature map to obtain a target template local feature map; a feature map splicing submodule, which is used to splice the template global feature map and the target template local feature map based on texture and shape respectively to obtain a template facial texture image and a template facial shape image; a template three-dimensional model reconstruction submodule, which is used to perform three-dimensional model reconstruction processing based on the template facial texture image and the template facial shape image to obtain the template three-dimensional model.

[0210] In one embodiment, Fig. 20 As shown, a training device 2000 for a three-dimensional reconstruction model is provided. The device can adopt a software module or a hardware module, or a combination of the two to become a part of a computer device. The device specifically includes: a second coefficient acquisition module 2001, a second model reconstruction module 2002, an image rendering module 2003 and a reconstruction model training module 2004, wherein:

[0211] The second coefficient acquisition module 2001 is used to acquire image feature coefficients and rendering coefficients of a training image.

[0212] The second model reconstruction module 2002 is used to input the image feature coefficients into a three-dimensional reconstruction model based on deep learning, so that the three-dimensional reconstruction model: obtains the global feature map and the initial local feature map of the training image based on the texture and shape according to the image feature coefficients, performs edge smoothing on the initial local feature map to obtain a target local feature map; splices the global feature map and the target local feature map based on texture and shape, respectively, to obtain a target texture image and a target shape image; performs three-dimensional model reconstruction processing according to the target texture image and the target shape image to obtain a predicted three-dimensional model.

[0213] The image rendering module 2003 is used to perform image rendering processing on the predicted three-dimensional model according to the rendering coefficient to obtain a predicted two-dimensional image.

[0214] The reconstruction model training module 2004 is used to train the three-dimensional reconstruction model according to the error between the training image and the predicted two-dimensional image until a convergence condition is met to obtain a trained three-dimensional reconstruction model.

[0215] In the above-mentioned embodiment, a predicted three-dimensional model without distortion problems can be obtained as much as possible through the three-dimensional reconstruction model, a predicted two-dimensional image corresponding to the predicted three-dimensional model can be determined, and the three-dimensional reconstruction model can be trained according to the error between the predicted two-dimensional image and the training image, so that an accurate and reliable three-dimensional reconstruction model can be obtained through training.

[0216] In one embodiment, the second coefficient acquisition module includes: a layer-by-layer convolution submodule, used to perform layer-by-layer convolution processing on the training image through a convolution autoencoder; the convolution autoencoder includes a decoder and an encoder; an image feature coefficient acquisition submodule, used to obtain the texture feature coefficient and shape feature coefficient of the training image as the image feature coefficient according to the result of the layer-by-layer convolution processing by the decoder; a rendering coefficient acquisition submodule, used to obtain the torsion coefficient and illumination coefficient of the training image as the rendering coefficient according to the result of the layer-by-layer convolution processing by the encoder.

[0217] For the specific definition of the three-dimensional model reconstruction device, please refer to the definition of the three-dimensional model reconstruction method above, which will not be repeated here. Each module in the above-mentioned three-dimensional model reconstruction device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0218] In one embodiment, a computer device is also provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps in the above-mentioned three-dimensional model reconstruction method embodiments are implemented.

[0219] In one embodiment, a computer device is also provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps in the above-mentioned training method embodiments of the three-dimensional reconstruction model are implemented.

[0220] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which, when executed by a processor, implements the steps in the above-mentioned three-dimensional model reconstruction method embodiments.

[0221] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which, when executed by a processor, implements the steps in the above-mentioned training method embodiments of the three-dimensional reconstruction model.

[0222] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned method embodiments.

[0223] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0224] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0225] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A three-dimensional model reconstruction method, characterized in that: The method comprises: The input image is convolved layer by layer through the convolutional autoencoder; According to the result of layer-by-layer convolution processing, texture feature coefficients and shape feature coefficients of the input image are obtained to obtain image feature coefficients of the input image; The deconvolution layer in the global decoder performs feature decoding on the input image according to the image feature coefficient to obtain a global feature map; The deconvolution layer in the local decoder performs feature decoding on the input image according to the image feature coefficient to obtain an initial local feature map; Performing edge smoothing on the initial local feature map to obtain a target local feature map; Based on texture and shape, the global feature map and the target local feature map are spliced ​​to obtain a target texture image and a target shape image; A three-dimensional model reconstruction process is performed according to the target texture image and the target shape image to obtain a target three-dimensional model.

2. The method according to claim 1, characterized in that: The step of performing edge smoothing on the initial local feature map to obtain a target local feature map includes: Obtaining a boundary of the initial local feature map; Obtaining the distance between each pixel point in the initial local feature map and the boundary; The initial local feature map is subjected to edge smoothing processing according to the distance to obtain the target local feature map.

3. The method according to claim 2, characterized in that The step of performing edge smoothing on the initial local feature map according to the distance to obtain the target local feature map includes: Acquire the edge area of ​​the initial local feature map according to the distance; Determine the feature weight value corresponding to each pixel point in the edge area according to the distance, so that the feature weight value corresponding to the distant pixel point is greater than the feature weight value corresponding to the close pixel point; Generate a gradual smoothing feature map according to the feature weight value; obtain the feature value of each pixel in the gradual smoothing feature map according to the feature weight value; The characteristic value of each pixel in the gradual smoothing feature map is multiplied with the characteristic value of the corresponding pixel in the initial local feature map, and the target local feature map is obtained according to the multiplication result.

4. The method according to any one of claims 1 to 3, characterized in that: The input image is a facial image; the target local feature map includes a key part feature map corresponding to the key parts of the face; The step of splicing the global feature map and the target local feature map based on texture and shape respectively to obtain a target texture image and a target shape image comprises: Filling the outer regions of each key part feature map with characteristic values ​​respectively, so as to obtain a filled key part feature map having the same size as the global feature map; Merging the feature maps of each of the key filled parts to obtain a facial organ feature map; Based on texture and shape respectively, the global feature map and the facial organ feature map are spliced ​​to obtain the target texture image and the target shape image.

5. The method according to claim 4, characterized in that The key facial parts include at least one of a left eye, a right eye, a nose, and a mouth.

6. The method according to any one of claims 1 to 3, characterized in that: The global feature map includes a global texture feature map and a global shape feature map, and the target local feature map includes a local texture feature map and a local shape feature map; The step of splicing the global feature map and the target local feature map based on texture and shape respectively to obtain a target texture image and a target shape image comprises: Splicing the global texture feature map and the local texture feature map, and performing convolution on the spliced ​​feature map to integrate the global texture features and the local texture features to obtain the target texture image; The global shape feature map and the local shape feature map are spliced, and the spliced ​​feature map is convolved to integrate the global shape features and the local shape features to obtain the target shape image.

7. The method according to claim 6, characterized in that The global feature map and the target local feature map each correspond to at least one feature channel; The step of splicing the global texture feature map and the local texture feature map, and convolving the spliced ​​feature map to integrate the global texture features and the local texture features to obtain the target texture image includes: The global texture feature map and the local texture feature map are spliced ​​in each of the feature channels, and the feature map obtained by splicing each of the feature channels is convolved to integrate the global texture features and the local texture features to obtain the target texture image; The step of splicing the global shape feature map and the local shape feature map, and convolving the spliced ​​feature map to integrate the global shape features and the local shape features to obtain the target shape image includes: The global shape feature map and the local shape feature map are spliced ​​in each of the feature channels, and the feature map obtained by splicing each of the feature channels is convolved to integrate the global shape features and the local shape features to obtain the target shape image.

8. The method according to claim 1, characterized in that The local decoder includes a facial key part decoder; The deconvolution layer in the local decoder performs feature decoding on the input image according to the image feature coefficient to obtain the initial local feature map, including: The deconvolution layer in the facial key part decoder performs feature decoding on the input image according to the image feature coefficients, and determines the decoded key part feature map as the initial local feature map.

9. The method according to any one of claims 1 to 3, characterized in that: The input image is a face image; after the three-dimensional model reconstruction processing is performed according to the target texture image and the target shape image to obtain the target three-dimensional model, the method further includes: Acquire global feature points of the two-dimensional image corresponding to the target three-dimensional model to obtain target feature points; Obtaining a template three-dimensional model; Acquire local feature points of the two-dimensional image corresponding to the template three-dimensional model to obtain template feature points; The target feature points and the template feature points are input as paired data into a face-changing model so that the face-changing model outputs a face-changing three-dimensional model; the face-changing three-dimensional model includes global features in the target three-dimensional model and local features in the template three-dimensional model.

10. The method according to claim 9, characterized in that The step of obtaining the template three-dimensional model comprises: Get the preset template face image; Acquire a template global feature map and an initial template local feature map based on texture and shape of the template face image; Performing edge smoothing on the initial template local feature map to obtain a target template local feature map; Based on texture and shape respectively, the template global feature map and the target template local feature map are spliced ​​to obtain a template face texture image and a template face shape image; A three-dimensional model reconstruction process is performed according to the template facial texture image and the template facial shape image to obtain the template three-dimensional model.

11. A three-dimensional model reconstruction device, characterized in that: The device comprises: A first coefficient acquisition module is used to perform layer-by-layer convolution processing on the input image through a convolution autoencoder; obtain the texture feature coefficient and shape feature coefficient of the input image according to the result of the layer-by-layer convolution processing, and obtain the image feature coefficient of the input image; A feature map acquisition module, configured to perform feature decoding on the input image according to the image feature coefficient by a deconvolution layer in a global decoder to obtain a global feature map; and perform feature decoding on the input image according to the image feature coefficient by a deconvolution layer in a local decoder to obtain an initial local feature map; A smoothing processing module, used for performing edge smoothing processing on the initial local feature map to obtain a target local feature map; A feature map splicing module, used to splice the global feature map and the target local feature map based on texture and shape, respectively, to obtain a target texture image and a target shape image; The first model reconstruction module is used to perform three-dimensional model reconstruction processing according to the target texture image and the target shape image to obtain a target three-dimensional model.

12. The device according to claim 11, characterized in that The smoothing processing module is also used to obtain the boundary of the initial local feature map; obtain the distance between each pixel point in the initial local feature map and the boundary; and perform edge smoothing processing on the initial local feature map according to the distance to obtain the target local feature map.

13. The device according to claim 12, characterized in that The smoothing processing module is also used to obtain the edge area of ​​the initial local feature map according to the distance; determine the feature weight value corresponding to each pixel point in the edge area according to the distance, so that the feature weight value corresponding to the distant pixel point is greater than the feature weight value corresponding to the close pixel point; generate a gradual smooth feature map according to the feature weight value; the feature value of each pixel point in the gradual smooth feature map is obtained according to the feature weight value; the feature value of each pixel point in the gradual smooth feature map is multiplied by the feature value of the corresponding pixel point in the initial local feature map, and the target local feature map is obtained according to the multiplication result.

14. The device according to any one of claims 11 to 13, characterized in that The input image is a facial image; the target local feature map includes a key part feature map corresponding to the key parts of the face; The feature map splicing module is also used to fill the external area of ​​each key part feature map with feature values ​​respectively to obtain a filled key part feature map with the same size as the global feature map; merge each of the filled key part feature maps to obtain a facial organ feature map; Based on texture and shape respectively, the global feature map and the facial organ feature map are spliced ​​to obtain the target texture image and the target shape image.

15. The device according to claim 14, characterized in that The key facial parts include at least one of a left eye, a right eye, a nose, and a mouth.

16. The device according to any one of claims 11 to 13, characterized in that The global feature map includes a global texture feature map and a global shape feature map, and the target local feature map includes a local texture feature map and a local shape feature map; The feature map splicing module is also used to splice the global texture feature map and the local texture feature map, and convolve the spliced ​​feature map to integrate the global texture features and the local texture features to obtain the target texture image; splice the global shape feature map and the local shape feature map, and convolve the spliced ​​feature map to integrate the global shape features and the local shape features to obtain the target shape image.

17. The device according to claim 16, characterized in that The global feature map and the target local feature map each correspond to at least one feature channel; The feature map stitching module is also used to stitch the global texture feature map and the local texture feature map in each of the feature channels, and to convolve the feature maps stitched together in each of the feature channels to integrate the global texture features and the local texture features to obtain the target texture image; and to stitch the global shape feature map and the local shape feature map in each of the feature channels, and to convolve the feature maps stitched together in each of the feature channels to integrate the global shape features and the local shape features to obtain the target shape image.

18. The device according to claim 11, characterized in that The local decoder includes a facial key part decoder; The feature map acquisition module is also used to perform feature decoding on the input image according to the image feature coefficients by the deconvolution layer in the facial key part decoder, and determine the decoded key part feature map as the initial local feature map.

19. The device according to any one of claims 11 to 13, characterized in that The input image is a facial image; the device further comprises: A target feature point acquisition module is used to acquire global feature points of the two-dimensional image corresponding to the target three-dimensional model to obtain target feature points; A template model acquisition module is used to acquire a template three-dimensional model; A template feature point acquisition module is used to acquire local feature points of the two-dimensional image corresponding to the template three-dimensional model to obtain template feature points; A face-changing module is used to input the target feature points and the template feature points as paired data into a face-changing model so that the face-changing model outputs a face-changed three-dimensional model; the face-changed three-dimensional model contains the global features in the target three-dimensional model and the local features in the template three-dimensional model.

20. The device according to claim 19, characterized in that The template model acquisition module is also used to acquire a preset template facial image; acquire a template global feature map and an initial template local feature map based on texture and shape of the template facial image; perform edge smoothing on the initial template local feature map to obtain a target template local feature map; splice the template global feature map and the target template local feature map based on texture and shape respectively to obtain a template facial texture image and a template facial shape image; perform three-dimensional model reconstruction processing based on the template facial texture image and the template facial shape image to obtain the template three-dimensional model.

21. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.

22. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.

23. A computer program product comprising computer instructions, which when executed by a processor implement the steps of the method according to any one of claims 1 to 10.

Citation Information

Cited By

  • Three-dimensional model reconstruction method and apparatus, and three-dimensional reconstruction model training method and apparatus

    WO2022057526A1