Material and three-dimensional model reconstruction method and device

Through material classification and iterative optimization technology, the problem of low material reconstruction efficiency in 3D modeling is solved, high-quality material map generation is achieved, and it is suitable for large-scale commodity material reconstruction.

CN118247412BActive Publication Date: 2024-10-01TAOBAO CHINA SOFTWARE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410675780.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2024-10-01
Estimated Expiration
2044-05-28

AI Technical Summary

Technical Problem

In existing 3D modeling technology, material reconstruction methods are inefficient, require expensive equipment and complex operations, and are difficult to apply to large-scale commodity material reconstruction tasks.

Method used

By obtaining images of the target object from multiple different viewing angles, material classification and iterative optimization are performed, and a pre-trained material classification model and ambient light map are used to construct a loss function to optimize the initial material map and generate a high-quality target material map.

Benefits of technology

It improves the quality and efficiency of material mapping, and is suitable for large-scale commodity material reconstruction scenes, ensuring the consistency and smoothness of the same material areas on the object surface, and avoiding problems such as shadow slits.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118247412B_ABST
    Figure CN118247412B_ABST
Patent Text Reader

Abstract

This specification provides a material and three-dimensional model reconstruction method and device. The material reconstruction method includes obtaining the to-be-processed images of the target object at multiple different viewing angles, classifying the materials of the to-be-processed images to determine the material classification results of different material areas, and iteratively optimizing the initial material map based on the material classification results and the difference between the rendered image of the target object and the to-be-processed image until the convergence condition is met to obtain the target material map. By classifying the materials of the target object and iteratively optimizing the material map based on the material classification results and the image differences, the consistency and smoothness of the same material areas on the surface of the object are improved, the quality of the material map and the accuracy and generalization ability of the reconstruction of various material surfaces are improved, and the material reconstruction method is simple in process and highly efficient, and is suitable for large-scale commodity material reconstruction scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the technical field of three-dimensional modeling, and in particular, to a material and three-dimensional model reconstruction method and device. Background Art

[0002] Three-dimensional reconstruction (3D reconstruction) is a technology that restores real-world objects in computers. It is currently widely used in movies, game scenes, product displays, and digital human scenes. Currently, 3D modeling mainly uses a texture-based modeling method, in which material mapping is the key factor for the model to appear realistic and exquisite, so the reconstruction effect of material mapping is crucial.

[0003] In the related art, material reconstruction methods usually require expensive equipment and complex technicians to operate, and are inefficient when dealing with large-scale commodity material reconstruction tasks. Summary of the invention

[0004] To improve the efficiency and quality of three-dimensional material reconstruction, one or more embodiments of the present specification provide a material reconstruction method and device, a three-dimensional model reconstruction method and device, an electronic device, a storage medium, and a computer program product.

[0005] In a first aspect, one or more embodiments of this specification provide a material reconstruction method, including:

[0006] Acquire images to be processed of the target object taken at multiple different viewing angles;

[0007] Performing material classification on the image to be processed to determine material classification results of different material areas in the target object;

[0008] Based on the material classification result and the difference between the rendered image of the target object and the image to be processed, the initial material map is iteratively optimized to obtain a target material map, wherein the rendered image of the target object is obtained by rendering a rough geometric model of the target object using the initial material map.

[0009] In one or more embodiments, the performing material classification on the image to be processed and determining the material classification results of different material areas in the target object includes:

[0010] The image to be processed is input into a pre-trained material classification model, and the material classification model is used to perform image segmentation on different material areas of the target object to obtain the material classification result output by the material classification model.

[0011] In one or more embodiments, the model training process of the material classification model includes:

[0012] Acquire a training data set and a pre-trained image segmentation model, wherein the sample data in the training data set includes a sample image and label information, and the label information represents a material classification result of an object in the sample image;

[0013] Inputting the sample data into the image segmentation model to obtain an output result of the image segmentation model;

[0014] Based on the difference between the output result and the label information, the model parameters of the large image segmentation model are adjusted until the model convergence condition is met to obtain the material classification model.

[0015] In one or more embodiments, the process of generating a rendered image of the target object includes:

[0016] Performing ambient light extraction on the image to be processed to obtain an ambient light map corresponding to the image to be processed, wherein the ambient light represents the lighting condition of the target object on the image to be processed;

[0017] Based on the initial material map and the ambient light map, a pre-generated rough geometric model of the target object is rendered to obtain the rendered image.

[0018] In one or more embodiments, the iterative optimization of the initial material map based on the material classification result and the difference between the rendered image of the target object and the image to be processed includes:

[0019] Determining a first loss term based on the material classification result, where the first loss term is used to constrain the brightness values ​​of pixels in the same material area to be the same;

[0020] determining a second loss term based on a difference between the rendered image and the image to be processed;

[0021] A loss function is constructed based on the first loss term and the second loss term, and the initial material map is iteratively optimized based on the loss function.

[0022] In one or more embodiments, the iterative optimization of the initial material map based on the material classification result and the difference between the rendered image of the target object and the image to be processed includes:

[0023] Performing ambient light extraction on the image to be processed to obtain an ambient light map corresponding to the image to be processed, wherein the ambient light represents the lighting condition of the target object on the image to be processed;

[0024] Rendering the coarse geometric model based on the ambient light map to obtain a highlight component map;

[0025] The initial material map is iteratively optimized based on the highlight component map, the material classification result, and the difference between the rendered image and the image to be processed.

[0026] In one or more embodiments, the iterative optimization of the initial material map based on the highlight component map, the material classification result, and the difference between the rendered image and the image to be processed includes:

[0027] Determining a first loss term based on the material classification result, where the first loss term is used to constrain the brightness values ​​of pixels in the same material area to be the same;

[0028] determining a second loss term based on a difference between the rendered image and the image to be processed;

[0029] Extract shadow features of the rendered image based on the highlight component map to obtain a first shadow map, extract shadow features of the image to be processed based on the highlight component map to obtain a second shadow map, and determine a third loss term based on a difference between the first shadow map and the second shadow map;

[0030] A loss function is constructed based on the first loss term, the second loss term, and the third loss term, and the initial material map is iteratively optimized based on the loss function.

[0031] In one or more embodiments, extracting shadow features from the rendered image based on the highlight component map to obtain a first shadow map includes:

[0032] For each pixel on the highlight component map, in response to a brightness value being greater than a preset threshold, the brightness value is configured as a first weight value, and in response to a brightness value being less than or equal to the preset threshold, the brightness value is configured as a second weight value, and each pixel on the highlight component map is traversed to obtain a shadow weight map;

[0033] The shadow weight map and the rendered image are fused to obtain the first shadow map.

[0034] In one or more embodiments, the step of obtaining images to be processed of the target object taken at multiple different viewing angles includes:

[0035] Using an image acquisition device to acquire images of the target object at multiple different viewing angles;

[0036] Perform image segmentation on the captured image to obtain the image to be processed including the target object.

[0037] In a second aspect, one or more embodiments of this specification propose a three-dimensional model reconstruction method, including:

[0038] A pre-generated rough geometric model of a target object is rendered using a target material map to obtain a three-dimensional model of the target object, wherein the target material map is obtained by the method described in any embodiment of the first aspect.

[0039] In a third aspect, one or more embodiments of this specification provide a material reconstruction device, including:

[0040] An image acquisition module is configured to acquire images to be processed of a target object taken at multiple different viewing angles;

[0041] A material classification module is configured to perform material classification on the image to be processed and determine material classification results of different material areas in the target object;

[0042] The texture optimization module is configured to iteratively optimize the initial material texture based on the material classification result and the difference between the rendered image of the target object and the image to be processed to obtain a target material texture, wherein the rendered image of the target object is obtained by rendering a rough geometric model of the target object using the initial material texture.

[0043] In one or more embodiments, the material classification module is configured to:

[0044] The image to be processed is input into a pre-trained material classification model, and the material classification model is used to perform image segmentation on different material areas of the target object to obtain the material classification result output by the material classification model.

[0045] In one or more embodiments, the material classification module is configured to:

[0046] Acquire a training data set and a pre-trained image segmentation model, wherein the sample data in the training data set includes a sample image and label information, and the label information represents a material classification result of an object in the sample image;

[0047] Inputting the sample data into the image segmentation model to obtain an output result of the image segmentation model;

[0048] Based on the difference between the output result and the label information, the model parameters of the large image segmentation model are adjusted until the model convergence condition is met to obtain the material classification model.

[0049] In one or more embodiments, a model rendering module is further included, wherein the model rendering module is configured to:

[0050] Performing ambient light extraction on the image to be processed to obtain an ambient light map corresponding to the image to be processed, wherein the ambient light represents the lighting condition of the target object on the image to be processed;

[0051] Based on the initial material map and the ambient light map, a pre-generated rough geometric model of the target object is rendered to obtain the rendered image.

[0052] In one or more embodiments, the texture optimization module is configured to:

[0053] Determining a first loss term based on the material classification result, where the first loss term is used to constrain the brightness values ​​of pixels in the same material area to be the same;

[0054] determining a second loss term based on a difference between the rendered image and the image to be processed;

[0055] A loss function is constructed based on the first loss term and the second loss term, and the initial material map is iteratively optimized based on the loss function.

[0056] In one or more embodiments, the texture optimization module is configured to:

[0057] Performing ambient light extraction on the image to be processed to obtain an ambient light map corresponding to the image to be processed, wherein the ambient light represents the lighting condition of the target object on the image to be processed;

[0058] Rendering the coarse geometric model based on the ambient light map to obtain a highlight component map;

[0059] The initial material map is iteratively optimized based on the highlight component map, the material classification result, and the difference between the rendered image and the image to be processed.

[0060] In one or more embodiments, the texture optimization module is configured to:

[0061] Determining a first loss term based on the material classification result, where the first loss term is used to constrain the brightness values ​​of pixels in the same material area to be the same;

[0062] determining a second loss term based on a difference between the rendered image and the image to be processed;

[0063] Extract shadow features of the rendered image based on the highlight component map to obtain a first shadow map, extract shadow features of the image to be processed based on the highlight component map to obtain a second shadow map, and determine a third loss term based on a difference between the first shadow map and the second shadow map;

[0064] A loss function is constructed based on the first loss term, the second loss term, and the third loss term, and the initial material map is iteratively optimized based on the loss function.

[0065] In one or more embodiments, the texture optimization module is configured to:

[0066] For each pixel on the highlight component map, in response to a brightness value being greater than a preset threshold, the brightness value is configured as a first weight value, and in response to a brightness value being less than or equal to the preset threshold, the brightness value is configured as a second weight value, and each pixel on the highlight component map is traversed to obtain a shadow weight map;

[0067] The shadow weight map and the rendered image are fused to obtain the first shadow map.

[0068] In one or more embodiments, the image acquisition module is configured to:

[0069] Using an image acquisition device to acquire images of the target object at multiple different viewing angles;

[0070] Perform image segmentation on the captured image to obtain the image to be processed including the target object.

[0071] In a fourth aspect, one or more embodiments of this specification propose a three-dimensional model reconstruction device, including:

[0072] The three-dimensional rendering module is configured to render a pre-generated rough geometric model of a target object using a target material map to obtain a three-dimensional model of the target object, wherein the target material map is obtained by the method described in any embodiment of the first aspect.

[0073] In a fifth aspect, one or more embodiments of this specification provide an electronic device, including:

[0074] Processor; and

[0075] A memory stores computer instructions, wherein the computer instructions are used to enable a processor to execute the method described in any of the above embodiments.

[0076] In a sixth aspect, one or more embodiments of this specification propose a storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the method described in any of the aforementioned embodiments.

[0077] In a seventh aspect, one or more embodiments of this specification propose a computer program product, which implements the method described in any of the aforementioned embodiments when running.

[0078] The material reconstruction method of one or more embodiments of the present specification includes obtaining the to-be-processed images of the target object at multiple different viewing angles, classifying the materials of the to-be-processed images to determine the material classification results of different material regions, and iteratively optimizing the initial material map based on the material classification results and the difference between the rendered image of the target object and the to-be-processed image until the convergence condition is met to obtain the target material map. By classifying the materials of the target object and iteratively optimizing the material map based on the material classification results and the image differences, the consistency and smoothness of the same material regions on the surface of the object are improved, and the problems such as shadow cracks are avoided, and the quality of the material map and the accuracy and generalization ability of the reconstruction of various material surfaces are improved. In addition, the material reconstruction method is simple in process and highly efficient, and is suitable for large-scale commodity material reconstruction scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] Figure 1 is a flowchart of a material reconstruction method according to some implementation methods of the present specification.

[0080] Figure 2 It is a schematic diagram of a material reconstruction method according to some implementation methods of this specification.

[0081] Figure 3 It is a schematic diagram of a material reconstruction method according to some implementation methods of this specification.

[0082] Figure 4 It is a schematic diagram of a material reconstruction method according to some implementation methods of this specification.

[0083] Figure 5 is a flowchart of a material reconstruction method according to some implementation methods of the present specification.

[0084] Figure 6 is a flowchart of a material reconstruction method according to some implementation methods of the present specification.

[0085] Figure 7 is a flowchart of a material reconstruction method according to some implementation methods of the present specification.

[0086] Figure 8 is a flowchart of a material reconstruction method according to some implementation methods of the present specification.

[0087] Fig. 9 is a flowchart of a material reconstruction method according to some implementation methods of the present specification.

[0088] Fig.10 It is a schematic diagram of a material reconstruction method according to some implementation methods of this specification.

[0089] Fig.11 is a flowchart of a material reconstruction method according to some implementation methods of the present specification.

[0090] Fig.12 It is a schematic diagram of a material reconstruction method according to some implementation methods of this specification.

[0091] Fig.13 It is a structural block diagram of a material reconstruction device in some implementation modes of this specification.

[0092] Fig.14 It is a structural block diagram of an electronic device in some implementation modes of this specification. DETAILED DESCRIPTION

[0093] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0094] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0095] Three-dimensional reconstruction (3D reconstruction) is a technology that restores real-world objects in computers. 3D reconstruction is an important technology for realizing 3D games, virtual reality (VR), and augmented reality (AR). It is currently widely used in movies, game scenes, product displays, and digital human scenes.

[0096] At present, 3D modeling mainly adopts the modeling method based on texture, that is, the geometric model is separated from the material texture, and the geometric model and the material texture are reconstructed separately, and then the geometric model is rendered according to the material texture to obtain the 3D model. Among them, the material texture is the key factor for the 3D model to show realism and exquisiteness, so the reconstruction effect of the material texture is crucial.

[0097] In the early days, the material reconstruction methods for 3D model surfaces mainly included: 1) acquisition through professional material acquisition equipment. This method requires expensive professional equipment and is only suitable for laboratory scenarios such as scientific research. It is not applicable enough and is difficult to promote; 2) manual production. This method requires professionals with rich experience, has a long production cycle and low efficiency.

[0098] With the development of machine learning technology, the use of deep learning-based generative models for material reconstruction has become a major research direction. The captured images can be used as model input to reconstruct the surface material. This method is efficient and low-cost, and is very suitable for large-scale commodity material reconstruction tasks. However, due to the aforementioned difficulties in material reconstruction, it is difficult to obtain large-scale material data sets, so the trained generative model is not effective, and the quality of the reconstructed material map is very low, making it difficult to implement.

[0099] Based on the above, the embodiments of this specification provide a material reconstruction method and device, a three-dimensional model reconstruction method and device, an electronic device, a storage medium, and a computer program product, which aim to iteratively optimize the material map based on the material classification information on the surface of the object, ensure the consistency and smoothness of the same material area of ​​the object, and effectively improve the quality of the material map.

[0100] In some embodiments, this specification provides a material reconstruction method, which is mainly used to generate a surface material map of a 3D model. The initial material map is optimized and iterated in combination with the material classification information of the object surface through optimization iteration, thereby generating a high-quality material map of the target object while ensuring efficiency.

[0101] Generally speaking, material mapping needs to meet the requirements of 3D model rendering in most common scenarios. Material mapping mainly includes three material layers, namely diffuse map, roughness map and specular map. Among them, the diffuse map represents the color and basic texture of the object itself; the roughness map represents the glossiness of the object, such as the smoothness or roughness of the surface of the object; the metalness map represents the intensity of the light reflected by the object under light, which can reflect the highlight effect of the object.

[0102] In the following implementations of this specification, unless otherwise specified, material maps may include the aforementioned diffuse map, roughness map, and metalness map.

[0103] like Figure 1 As shown, in some embodiments, the material reconstruction method exemplified in this specification includes:

[0104] S110, obtaining images to be processed of the target object captured at multiple different viewing angles.

[0105] In the implementation manner of this specification, the reconstruction of the material map relies on multi-perspective captured images, that is, by photographing the target object at multiple perspectives, multiple captured images at different perspectives can be obtained, and these captured images are the images to be processed described in this specification.

[0106] For example, in one example, a camera can be used to collect RGB images of a target object at different viewing angles, and these RGB images are used as the images to be processed in this specification. Of course, those skilled in the art can understand that the images to be processed can also be other image types, such as HSV images, HSL images, grayscale images, etc. The image type is related to the corresponding color space, and this specification does not limit this.

[0107] In some embodiments, considering that the captured image captured by the camera includes not only the target object in the foreground but also the background, in order to reduce the interference of background noise, after the captured image is acquired, the captured image may be segmented, so that only the foreground image including the target object is retained as the image to be processed, and the interference of background noise is removed.

[0108] S120 , classifying the materials of the image to be processed, and determining the material classification results of different material areas in the target object.

[0109] It can be understood that the surface of the target object in the image to be processed may include one or more materials. Different materials have different roughness and light reflection effects. Therefore, under natural lighting conditions, different surface materials present different visual effects.

[0110] Therefore, in the implementation manner of this specification, the surface material of the target object in the processed image can be classified. The purpose of material classification is to segment different material areas on the surface of the object, so as to obtain the material classification result corresponding to the target object.

[0111] For example, in an example, suppose the target object surface includes three different material areas, namely leather, metal, and cloth. By classifying the materials of the image to be processed, the image areas corresponding to leather, metal, and cloth can be segmented out respectively, that is, the obtained material classification result includes the image areas corresponding to the three materials.

[0112] In some implementations, a pre-trained material classification model may be used to perform material classification on the image to be processed, that is, the image to be processed is input into the pre-trained material classification model, and the material classification model predicts and outputs a corresponding material classification result.

[0113] It is worth noting that in the scheme of using the material classification model to classify the material of the processed image, considering that large-scale material data sets are difficult to obtain, a large image segmentation model that has been pre-trained can be used as a base model, and a small amount of material data sets can be used to fine-tune the large image segmentation model to achieve a highly reliable material classification model. This will be explained below in this manual and will not be described in detail here.

[0114] As can be seen from the foregoing, the material classification result obtained by performing material classification on the image to be processed can reflect the image areas of different materials on the surface of the target object.

[0115] For example Figure 2 In this example, the target object in the image to be processed is a metal can. The image to be processed containing the metal can is input into the pre-trained material classification model, so that the material classification result output by the material classification model can be obtained. In this example, the material classification result is the image range represented by blocks of different colors, where the image range corresponding to blocks of the same color is the same material area.

[0116] S130 , based on the material classification result and the difference between the rendered image of the target object and the image to be processed, iteratively optimize the initial material map to obtain a target material map.

[0117] It should be noted that in the implementation manner of this specification, the reconstruction problem of the material map is regarded as a material optimization problem. The initial value of the optimization problem is the given initial material map. The optimization goal is to iteratively tune the initial material map so that the initial material map gradually converges to a surface similar to or consistent with the real object, thereby obtaining the target material map.

[0118] In some implementations, the initial material map may be a solid color map. For example, in one example, the initial material map may be a pure black or pure white map.

[0119] In other embodiments, considering that the algorithm convergence efficiency is not high enough when starting material optimization from a solid color map, the initial material map can be configured based on the image to be processed. For example, in one example, the initial roughness map and the initial metalness map included in the initial material map can be solid color maps, and the initial diffuse map can be obtained by extracting features from the image to be processed, so that compared with the solid color diffuse map, it can have a color and basic texture closer to the image to be processed, thereby accelerating the convergence speed of the diffuse map and improving the efficiency of the algorithm.

[0120] In the implementation manner of this specification, after the initial material map is determined, the rough geometric model of the target object can be rendered using the initial material map to obtain a rendered image.

[0121] A coarse geometric model refers to a mesh model obtained by three-dimensional modeling of a target object. In the field of computer graphics, a mesh model is usually used to represent the geometry of a three-dimensional object. The mesh model is composed of a large number of discrete vertices, edges connecting two vertices, and mesh patches composed of multiple edges.

[0122] For example, in some embodiments, the mesh patch may be a triangular patch, that is, a triangular face composed of three vertices is a mesh patch, so that the mesh model is composed of a continuous surface composed of a large number of triangular face patches. For example, in other embodiments, the mesh patch may be a quadrilateral, that is, a quadrilateral face composed of four vertices is a mesh patch, so that the mesh model is composed of a continuous surface composed of a large number of quadrilateral face patches.

[0123] In some implementations of this specification, a coarse geometric model can be generated based on a multi-view image to be processed. For example, in one example, a camera pose calculation can be performed based on the multi-view image to be processed to obtain the camera position of the multi-view image to be processed. Then, a dense reconstruction is performed based on the camera pose calculation result and the multi-view image to be processed to generate a dense point cloud of the target object. The point cloud meshing technology is used to generate a mesh model for the generated dense point cloud to obtain a meshed coarse geometric model. Those skilled in the art can undoubtedly understand and fully implement this process by referring to the relevant technology, and this specification will not elaborate on it.

[0124] For example, the target object of the image to be processed is still Figure 2 Taking the metal can shown in the figure as an example, the corresponding rough geometric model can be generated through the above method process. Figure 3 As shown, through Figure 3 As you can see, the coarse geometry model has exactly the same geometry as the target object, but without the surface material map.

[0125] In the implementation manner of this specification, after obtaining the initial texture map and the coarse geometric model, the coarse geometric model can be rendered based on the initial texture map, thereby obtaining a rendered image of the 3D model whose surface is the initial texture map.

[0126] In combination with the foregoing, it can be seen that in the implementation mode of this specification, the material reconstruction problem is an optimization problem of the initial material map. It can be understood that before the iterative optimization begins, since the initial material map is very different from the surface of the real object, the difference between the rendered image and the target object on the image to be processed is also very large. The goal of optimizing the initial material map is to find the optimal material map so that the rendered image and the image to be processed are as close or consistent as possible. The optimal material map is the target material map described in this specification.

[0127] Therefore, the difference between the rendered image obtained above and the image to be processed can be used as the loss (Loss), and the initial material map can be reversely iterated and optimized by minimizing the loss function until the convergence condition is met and the iterative optimization process is stopped. At this time, the material map obtained is the target material map.

[0128] It is worth noting that in the implementation of this specification, on the basis of optimizing the initial texture map based on the difference between the rendered image and the image to be processed, the material classification result is further introduced as a loss term to optimize the initial texture map.

[0129] From the above, we can see that the material classification result reflects the image segmentation result of different material areas on the surface of the target object, that is, the internal material represented by the image range in the same material area should be completely consistent. Therefore, when optimizing the material map in this area, the brightness values ​​of the pixels in this area should be kept as similar as possible.

[0130] Therefore, in the implementation mode of this specification, the initial material map is iteratively optimized by introducing the material classification results, and the optimization goal is to make the pixel brightness values ​​in the same material area on the material map as close as possible. The specific implementation can be, for example, constraining the variance of the pixel brightness values ​​in the same material area on the metalness map and the roughness map to be equal to 1.

[0131] In some implementations, a first loss term may be constructed based on the material classification result, a second loss term may be constructed based on the difference between the rendered image and the image to be processed, and a loss function may be constructed based on the first loss term and the second loss term, and the initial material map may be iteratively optimized by minimizing the loss function. This specification will be described in the following implementations and will not be described in detail here.

[0132] In the implementation mode of this specification, as the initial material map is continuously optimized, the initial material map gradually converges to be close to or consistent with the surface material of the target object on the image to be processed. When the convergence condition is met, the optimization process can be stopped, and the material map obtained at this time is the target material map. The convergence condition can be set according to the specific scene requirements. For example, in one example, the convergence condition includes that the value of the loss function is less than a preset threshold; for example, in another example, the convergence condition includes that the number of iterations exceeds a preset number, and this specification does not limit this.

[0133] It can be seen that in the implementation of this specification, given the captured image of the target object, the surface material map of the target object can be generated, and one-click material reconstruction can be achieved, which is suitable for large-scale commodity material reconstruction scenarios. For example, taking an e-commerce platform as an example, merchants can upload captured images of any target object, and then the platform can achieve surface material reconstruction of the target object based on the material reconstruction method of this specification, and obtain the material map of the target object, which is very efficient.

[0134] More importantly, in the implementation of this specification, by introducing the material classification results of the target object, the significant material feature gradient can be better propagated to the same material area, so that the properties in the same material area remain consistent, improving the consistency and smoothness of the same material area on the surface of the object, avoiding problems such as shadow cracks, and improving the quality of the material map. In addition, based on the material classification results, the accuracy and generalization ability of the algorithm for various material surfaces can be improved, and the reconstruction of most common materials such as smooth, rough, metal, ceramic, leather, etc. can be achieved.

[0135] From the above, it can be seen that in the implementation mode of this specification, by classifying the materials of the target object and iteratively optimizing the material map based on the material classification results and image differences, the consistency and smoothness of the same material area on the object surface are improved, the problems such as shadow cracks are avoided, the quality of the material map and the accuracy and generalization ability of reconstructing various material surfaces are improved, and the material reconstruction method is simple and efficient, which is suitable for large-scale commodity material reconstruction scenarios.

[0136] For example, in one example, the target object in the image to be processed is still Figure 2 Take the metal can shown as an example. Figure 4 (a) shows the material mapping effect without combining material classification information in the related art. Figure 4 (b) shows the material mapping effect obtained by combining the material classification information in this manual. By comparison, we can see that Figure 4 The object in (a) lacks metallic luster and the visual effect is not realistic enough. Figure 4 The object presented in (b) has rich metallic luster and texture, and the visual effect is more realistic.

[0137] like Figure 5 As shown, in some embodiments, the material reconstruction method exemplified in this specification, the process of obtaining the image to be processed includes:

[0138] S111. Using an image acquisition device to acquire images of a target object at multiple different viewing angles.

[0139] S112: performing image segmentation on the captured image to obtain an image to be processed including the target object.

[0140] In the implementation manner of this specification, the image acquisition device can be, for example, a camera, which can be used to capture images of the target object at multiple different viewing angles. The captured images can be, for example, RGB images, HSV images, HSL images, grayscale images, etc., and this specification does not impose any restrictions on this.

[0141] It can be understood that the captured image of the target object captured by the camera not only includes the foreground target object, but often also includes the background area, so the captured image can be segmented and only the foreground image including the target object is retained. The foreground image of the target object is the image to be processed in this specification.

[0142] For example, in some implementations, an image segmentation model may be used to segment the captured image to obtain an image to be processed. The image segmentation model may be, for example, a SAM (Segment Anything Model) or other image segmentation model, which is not limited in this specification.

[0143] By performing image segmentation on images captured from multiple perspectives, images to be processed of the target object from multiple perspectives can be obtained.

[0144] From the above, it can be seen that in the implementation of this specification, by performing image segmentation on the captured image to obtain the image to be processed of the target object, the interference of background noise can be reduced, and a data basis can be provided for subsequent high-quality material map reconstruction.

[0145] In some embodiments, in the material reconstruction method exemplified in this specification, the process of material classification of the image to be processed can be performed based on a material classification model, that is, a material classification model is pre-trained, and the input of the material classification model is the image to be processed containing the target object, and the output of the material classification model is the image segmentation result of different material areas on the target object, and the image segmentation result is the material classification result for the target object.

[0146] like Figure 6 As shown, in some embodiments, the material reconstruction method exemplified in this specification includes the following steps for training the material classification model:

[0147] S610: Obtain a training data set and a pre-trained image segmentation model.

[0148] S620: Input the sample data into the image segmentation model to obtain the output result of the image segmentation model.

[0149] S630: Based on the difference between the output result and the label information, adjust the model parameters of the large image segmentation model until the model convergence condition is met to obtain a material classification model.

[0150] In the implementation manner of this specification, a large image segmentation model is used as a base model, and a material classification model is obtained by fine-tuning and training the large image segmentation model.

[0151] It is understandable that a large model refers to a large-scale neural network model. The characteristics of a large model are reflected in two aspects: one is "large", that is, the number of parameters of the model is very large, usually reaching millions to billions of parameters; the other is "pre-trained", that is, the model has been pre-trained on a large-scale data set, and only needs to be fine-tuned with a small amount of data to support applications in various scenarios.

[0152] Therefore, in the implementation manner of this specification, a large image segmentation model is used as the base model. The large image segmentation model can be, for example, a SAM model. Since the large image segmentation model has been pre-trained on a large-scale data set, when it is applied to the material classification scenario of this specification, only a small amount of material sample data is needed to achieve fine-tuning training of the model to meet the application of material classification tasks.

[0153] Specifically, we first obtain a training data set containing a small amount of sample data. Each sample data in the training data set includes a sample image and label information. The sample image is an image containing a real object. The label information corresponding to the sample image is the information for classifying and labeling the object material area on the sample image through manual labeling and other methods.

[0154] When training the large image segmentation model, the sample image can be input into the large image segmentation model based on the training data set to obtain the output result of the large image segmentation model. It can be understood that for a certain sample image, the output result of the large image segmentation model represents: the classification result of the material area predicted by the large image segmentation model, that is, the predicted value; and the label information corresponding to the sample image represents: the classification result of the material area obtained by manual annotation, that is, the true value (Groundtruth). Therefore, the difference between the output result and the label information is the model loss value (Loss). Based on the loss value, the model parameters of the large image segmentation model are adjusted and optimized by back propagation. This cycle is iterated, and the model parameters are continuously optimized and adjusted until the model convergence conditions are met. The model training process can be stopped, and the model obtained at this time is the material classification model in this manual.

[0155] After the material classification model is trained through the above method process, when performing material classification on the image to be processed, it is only necessary to input the image to be processed into the material classification model to obtain the material classification result predicted by the material classification model. The material classification result represents the image segmentation result of different material areas on the surface of the target object on the image to be processed.

[0156] From the above, it can be seen that in the implementation mode of this specification, a material classification model is obtained based on the training of a large image segmentation model, so that a high-precision material classification model can be obtained without relying on a large-scale material data set. Through the practice of the material classification model of this specification, the material classification model can be almost unaffected by shadows and highlights, and image segmentation of different material areas can be accurately achieved, with higher material classification accuracy.

[0157] In some embodiments, in the process of rendering the rough geometric model using the initial material map, in order to fully integrate the lighting conditions of the target object and obtain a higher quality rendered image, the image to be processed can be subjected to ambient light extraction and rendered based on the ambient light map. Figure 7 Provide explanation.

[0158] like Figure 7 As shown, in some implementations, the material reconstruction method exemplified in this specification renders the rough geometric model to obtain a rendered image, including:

[0159] S131 , extracting ambient light from the image to be processed to obtain an ambient light map corresponding to the image to be processed.

[0160] S132: Based on the initial material map and the ambient light map, the pre-generated rough geometric model of the target object is rendered to obtain a rendered image.

[0161] It can be understood that ambient light refers to the lighting conditions of the environment in which the target object is located when the image to be processed of the target object is captured. Even if the material is the same, the visual effects presented will be different when the lighting conditions are different. Therefore, in the implementation of this specification, an ambient light map is used to reflect the lighting conditions of the environment in which the target object is located.

[0162] In some embodiments, the image to be processed may first be subjected to ambient light extraction to obtain an ambient light map representing the lighting conditions of the target object on the image to be processed, and then, when the rough geometric model is rendered using the initial material map, the model may be rendered in combination with the ambient light map, so that the lighting conditions of the target object in the rendered image may be substantially consistent with the lighting conditions on the image to be processed, thereby improving the authenticity and visual effects of the rendered image.

[0163] From the above, it can be seen that in the implementation of this specification, the rough geometric model is rendered using an ambient light map, which can maintain a high degree of authenticity for rendering under any lighting conditions, thereby improving the authenticity and visual effects of the rendered image.

[0164] like Figure 8 As shown, in some embodiments, the material reconstruction method exemplified in this specification, the process of iteratively optimizing the initial material map, includes:

[0165] S810. Determine a first loss item based on the material classification result.

[0166] S820: Determine a second loss term based on a difference between the rendered image and the image to be processed.

[0167] S830, constructing a loss function based on the first loss term and the second loss term, and iteratively optimizing the initial material map based on the loss function.

[0168] In some embodiments, during the optimization of the initial material map, a loss function may be constructed. The loss function may include two parts, namely, a first loss term and the second loss term Among them, the first loss term Represents material classification loss, the second loss term Represents the image loss between the rendered image and the image to be processed.

[0169] It is understandable that the first loss term It refers to the material classification loss determined based on the material classification result. The material classification result represents the image segmentation result of different material areas on the surface of the target object, so that for the same material area, the brightness values ​​of all pixels in the area can be constrained to be the same. The specific implementation can be, for example, constraining the variance of the pixel brightness values ​​in the same material area on the metalness map and the roughness map to be equal to 1.

[0170] Second loss item It refers to the difference between the rendered image and the image to be processed. It can be understood that the image to be processed is an image obtained by shooting the target object and represents the real material of the target object, while the rendered image refers to the image generated based on the material map. Therefore, the smaller the difference between the two, the closer the material map is to the material of the real surface of the object.

[0171] Therefore, in the implementation manner of the present specification, the initial material map can be back-propagated and optimized by minimizing the loss function. Taking one round of iterative process as an example, after the initial material map is optimized, the coarse geometric model can be rendered again based on the optimized material map based on the aforementioned method process to obtain a rendered image, and then the above process is repeated to determine the loss value. If the convergence condition is not met, the material map is iteratively optimized again until the convergence condition is met and the iterative process is stopped.

[0172] The convergence condition can be set according to the specific scenario requirements. For example, in one example, the convergence condition includes the value of the loss function being less than a preset threshold; for example, in another example, the convergence condition includes the number of iterations exceeding a preset number. This specification does not limit this.

[0173] From the above, it can be seen that in the implementation mode of this specification, by classifying the materials of the target object and iteratively optimizing the material map based on the material classification results and image differences, the consistency and smoothness of the same material area on the object surface are improved, the problems such as shadow cracks are avoided, the quality of the material map and the accuracy and generalization ability of reconstructing various material surfaces are improved, and the material reconstruction method is simple and efficient, which is suitable for large-scale commodity material reconstruction scenarios.

[0174] In some implementations, considering that objects may have shadow problems in a lighting environment, and shadows are also an important source of information reflecting material properties, for example, the material properties can be better reflected through changes in light and dark lighting. Therefore, in some implementations of the present specification, shadows can be further introduced to optimize material mapping based on shadows. Fig. 9 The implementation method is described.

[0175] like Fig. 9 As shown, in some embodiments, the material reconstruction method exemplified in this specification includes:

[0176] S910 , extracting ambient light from the image to be processed to obtain an ambient light map corresponding to the image to be processed.

[0177] In the implementation manner of this specification, the process of extracting the ambient light map can refer to the aforementioned S131 and will not be repeated here.

[0178] S920, rendering the coarse geometric model based on the ambient light map to obtain a highlight component map.

[0179] In the implementation manner of this specification, the highlight component image refers to a rendering image that simulates the shadow situation when the surface of the target object is completely smooth through specular reflection, for example Fig.10 Shows Figure 2 In the highlight component map of the metal can, it can be seen that the highlight component map only retains the shadow information of the target object. In the implementation mode of this specification, the highlight component map obtained by rendering the coarse geometric model based on the ambient light map only retains the shadow of the target object under the ambient light.

[0180] S930, iteratively optimizing the initial material map based on the highlight component map, the material classification result, and the difference between the rendered image and the image to be processed.

[0181] In the implementation manner of this specification, on the basis of optimizing the initial texture map based on the material classification loss and image loss, the shadow perception loss is further introduced through the highlight component map to improve the optimization effect of the texture map. Fig.11 Provide explanation.

[0182] like Fig.11As shown, in some embodiments, the material reconstruction method exemplified in this specification, the process of iteratively optimizing the initial material map includes:

[0183] S931. Determine a first loss item based on the material classification result.

[0184] S932: Determine a second loss term based on the difference between the rendered image and the image to be processed.

[0185] In the implementation mode of this specification, the first loss item is determined and the second loss term See the above process for Figure 8 The implementation method is sufficient and will not be described in detail here.

[0186] S933. Extract shadow features of the rendered image based on the highlight component map to obtain a first shadow map, extract shadow features of the processed image based on the highlight component map to obtain a second shadow map, and determine a third loss item based on the difference between the first shadow map and the second shadow map.

[0187] It can be understood that according to the foregoing, the highlight component map reflects the shadow situation of the target object in the current environment, so based on the highlight component map, the shadow features of the rendered image and the image to be processed can be extracted respectively to obtain the first shadow map and the second shadow map.

[0188] In one example, taking the extraction of shadow features of a rendered image as an example, first, a preset threshold can be set for the pixel brightness value on the highlight component map, and the preset threshold represents the critical value of the pixel being a shadow. If the pixel brightness value of a pixel on the highlight component map is greater than the preset threshold, it means that the pixel is not a pixel in the shadow area, so the brightness value of the pixel can be configured as a first weight, which can be 0, for example. Conversely, if the pixel brightness value of a pixel on the highlight component map is less than or equal to the preset threshold, it means that the pixel is a pixel in the shadow area, so the brightness value of the pixel can be configured as a second weight, which can be 1, for example. By traversing all pixels on the highlight component map in this way, a shadow weight map composed of 0 and 1 can be obtained.

[0189] In some implementations, the preset threshold may be selected according to specific scenario requirements. In an exemplary implementation, the preset threshold may be 0.1-0.5.

[0190] In the implementation manner of this specification, after determining the shadow weight map, the rendered image can be fused using the shadow weight map, for example, by multiplying the weight value on the shadow weight map with the brightness value on the rendered image, thereby obtaining an image that only retains the shadow situation on the rendered image, that is, the first shadow map. Similarly, similar to the above, the shadow weight map can be obtained through the highlight component map, and then the shadow weight map is used to fuse the image to be processed to obtain the second shadow map, which will not be described in detail in this specification.

[0191] It can be understood that the first shadow map reflects the shadow situation on the rendered image, and the second shadow map reflects the real shadow situation of the target object on the image to be processed. The smaller the difference between the two, the closer the shadow situation on the rendered image is to the real shadow situation. Therefore, the third loss term can be constructed based on the difference between the first shadow map and the second shadow map. , the third loss term This represents the shadow perception loss between the rendered image and the image to be processed.

[0192] S934. Construct a loss function based on the first loss term, the second loss term, and the third loss term, and iteratively optimize the initial material map based on the loss function.

[0193] Combined with the above, we can see that the first loss term It refers to the material classification loss determined based on the material classification result. The material classification result represents the image segmentation result of different material areas on the surface of the target object, so that for the same material area, the brightness values ​​of all pixels in the area can be constrained to be the same. The specific implementation can be, for example, constraining the variance of the pixel brightness values ​​in the same material area on the metalness map and the roughness map to be equal to 1.

[0194] Second loss item It refers to the difference between the rendered image and the image to be processed. It can be understood that the image to be processed is an image obtained by shooting the target object and represents the real material of the target object, while the rendered image refers to the image generated based on the material map. Therefore, the smaller the difference between the two, the closer the material map is to the material of the real surface of the object.

[0195] The third loss term represents the difference in shadow conditions between the rendered image and the image to be processed. The smaller the difference is, the closer the shadow condition on the rendered image is to the real shadow condition.

[0196] Therefore, in the implementation mode of this specification, based on the first loss term , the second loss item and the third loss term Construct a loss function, and perform back propagation optimization on the initial material map by minimizing the loss function. The iterative optimization process can be referred to the aforementioned implementation method, and this manual will not elaborate on it.

[0197] From the above, it can be seen that in the implementation of this specification, the shadow changes of the material map are constrained by the highlight component map, so as to effectively reduce or eliminate the impact of the shadow, better reflect the material properties, and improve the quality of the material map.

[0198] In one example, the image to be processed is as follows Figure 2 The metal can image shown below is used as an example. Fig.12 Embodiment The material reconstruction method of this specification is described.

[0199] exist Fig.12 In the example, the image to be processed is a metal can shot from multiple different perspectives, and the figure only takes one perspective image as an example. The image to be processed is input into the pre-trained material classification model to obtain the material classification result predicted by the material classification model. The material classification result is the image range represented by blocks of different colors, where the image range corresponding to blocks of the same color is the same material area.

[0200] In this example, the method process of the aforementioned implementation is used to extract ambient light from the image to be processed, and an ambient light map corresponding to the image to be processed can be obtained. The ambient light map can reflect the lighting conditions of the environment in which the target object is located. At the same time, the coarse geometric model and the initial material map of the target object can be obtained based on the aforementioned method process, which will not be described in detail in this specification. Then, the coarse geometric model is rendered using the initial material map to obtain a rendered image, and the coarse geometric model is rendered based on the ambient light map to obtain a highlight component map. Afterwards, the first loss item is determined based on the material classification result. , the first loss term represents the material classification loss; the second loss term is determined based on the difference between the rendered image and the image to be processed , the second loss term Represents the image loss between the rendered image and the image to be processed; Fig.11 In an implementation mode, a third loss term may be determined based on the highlight component map , the third loss term represents the shadow perception loss between the rendered image and the image to be processed. Finally, based on the first loss term , the second loss item and the third loss term Construct a loss function, and perform back propagation optimization on the initial material map by minimizing the loss function. The iterative optimization process can be referred to the aforementioned implementation method, and this manual will not elaborate on it.

[0201] From the above, it can be seen that in the implementation of this specification, by classifying the material of the target object, and iteratively optimizing the material map based on the material classification results and image differences, the consistency and smoothness of the same material area on the surface of the object are improved, and the problems such as shadow cracks are avoided, the quality of the material map and the accuracy and generalization ability of the reconstruction of various material surfaces are improved, and the material reconstruction method process is simple and efficient, which is suitable for large-scale commodity material reconstruction scenarios. The material classification model is obtained based on the training of the image segmentation large model, so that a high-precision material classification model can be obtained without relying on a large-scale material data set. Through the practice of the material classification model of this specification, it can be almost unaffected by shadows and highlights, and image segmentation of different material areas can be accurately achieved, and the material classification accuracy is higher. By constraining the shadow changes of the material map through the highlight component map, the influence of the shadow can be effectively reduced or eliminated, the material properties can be better reflected, and the quality of the material map can be improved.

[0202] In some embodiments, this specification provides a three-dimensional model reconstruction method, which can be used to generate a 3D model, and the method process includes:

[0203] The target material map is used to render the pre-generated rough geometric model of the target object to obtain a three-dimensional model of the target object.

[0204] In the implementation manner of this specification, the target material map and the coarse geometric model can be obtained by referring to the method process of any of the aforementioned implementation embodiments, and then, the target material map and the coarse geometric model are rendered to obtain a 3D model of the target object with the surface effect of the target material map.

[0205] For example, see the aforementioned Figure 4 Example, Figure 4 (a) shows the material mapping effect without combining material classification information in the related art. Figure 4 (b) shows the material mapping effect obtained by combining the material classification information in this manual. By comparison, we can see that Figure 4 The object in (a) lacks metallic luster and the visual effect is not realistic enough. Figure 4 The object presented in (b) has rich metallic luster and texture, and the visual effect is more realistic.

[0206] From the above, it can be seen that in the implementation mode of this specification, by classifying the materials of the target object and iteratively optimizing the material map based on the material classification results and image differences, the consistency and smoothness of the same material area on the object surface are improved, the problems such as shadow cracks are avoided, the quality of the material map and the accuracy and generalization ability of reconstructing various material surfaces are improved, and the material reconstruction method is simple and efficient, which is suitable for large-scale commodity material reconstruction scenarios.

[0207] In some embodiments, this specification provides a material reconstruction device, see Fig.13 As shown, the device comprises:

[0208] The image acquisition module 10 is configured to acquire images to be processed of the target object taken at multiple different viewing angles;

[0209] The material classification module 20 is configured to classify the material of the image to be processed and determine the material classification results of different material areas in the target object;

[0210] The texture optimization module 30 is configured to iteratively optimize the initial material texture based on the material classification result and the difference between the rendered image of the target object and the image to be processed to obtain a target material texture, wherein the rendered image of the target object is obtained by rendering a rough geometric model of the target object using the initial material texture.

[0211] In one or more embodiments, the material classification module 20 is configured to:

[0212] The image to be processed is input into a pre-trained material classification model, and the material classification model is used to perform image segmentation on different material areas of the target object to obtain the material classification result output by the material classification model.

[0213] In one or more embodiments, the material classification module 20 is configured to:

[0214] Acquire a training data set and a pre-trained image segmentation model, wherein the sample data in the training data set includes a sample image and label information, and the label information represents a material classification result of an object in the sample image;

[0215] Inputting the sample data into the image segmentation model to obtain an output result of the image segmentation model;

[0216] Based on the difference between the output result and the label information, the model parameters of the large image segmentation model are adjusted until the model convergence condition is met to obtain the material classification model.

[0217] In one or more embodiments, a model rendering module is further included, wherein the model rendering module is configured to:

[0218] Performing ambient light extraction on the image to be processed to obtain an ambient light map corresponding to the image to be processed, wherein the ambient light represents the lighting condition of the target object on the image to be processed;

[0219] Based on the initial material map and the ambient light map, a pre-generated rough geometric model of the target object is rendered to obtain the rendered image.

[0220] In one or more embodiments, the texture optimization module 30 is configured to:

[0221] Determining a first loss term based on the material classification result, where the first loss term is used to constrain the brightness values ​​of pixels in the same material area to be the same;

[0222] determining a second loss term based on a difference between the rendered image and the image to be processed;

[0223] A loss function is constructed based on the first loss term and the second loss term, and the initial material map is iteratively optimized based on the loss function.

[0224] In one or more embodiments, the texture optimization module 30 is configured to:

[0225] Performing ambient light extraction on the image to be processed to obtain an ambient light map corresponding to the image to be processed, wherein the ambient light represents the lighting condition of the target object on the image to be processed;

[0226] Rendering the coarse geometric model based on the ambient light map to obtain a highlight component map;

[0227] The initial material map is iteratively optimized based on the highlight component map, the material classification result, and the difference between the rendered image and the image to be processed.

[0228] In one or more embodiments, the texture optimization module 30 is configured to:

[0229] Determining a first loss term based on the material classification result, where the first loss term is used to constrain the brightness values ​​of pixels in the same material area to be the same;

[0230] determining a second loss term based on a difference between the rendered image and the image to be processed;

[0231] Extract shadow features of the rendered image based on the highlight component map to obtain a first shadow map, extract shadow features of the image to be processed based on the highlight component map to obtain a second shadow map, and determine a third loss term based on a difference between the first shadow map and the second shadow map;

[0232] A loss function is constructed based on the first loss term, the second loss term, and the third loss term, and the initial material map is iteratively optimized based on the loss function.

[0233] In one or more embodiments, the texture optimization module 30 is configured to:

[0234] For each pixel on the highlight component map, in response to a brightness value being greater than a preset threshold, the brightness value is configured as a first weight value, and in response to a brightness value being less than or equal to the preset threshold, the brightness value is configured as a second weight value, and each pixel on the highlight component map is traversed to obtain a shadow weight map;

[0235] The shadow weight map and the rendered image are fused to obtain the first shadow map.

[0236] In one or more embodiments, the image acquisition module 10 is configured to:

[0237] Using an image acquisition device to acquire images of the target object at multiple different viewing angles;

[0238] Perform image segmentation on the captured image to obtain the image to be processed including the target object.

[0239] In some embodiments, the present specification provides a three-dimensional model reconstruction device, the device comprising:

[0240] The three-dimensional rendering module is configured to render a pre-generated rough geometric model of a target object using a target material map to obtain a three-dimensional model of the target object, wherein the target material map is obtained by the method described in any embodiment of the first aspect.

[0241] In some implementations, this specification example provides an electronic device, including:

[0242] Processor; and

[0243] A memory stores computer instructions, wherein the computer instructions are used to enable a processor to execute the method described in any of the above embodiments.

[0244] In some embodiments, the present specification provides an example storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the method described in any of the above embodiments.

[0245] In some implementations, the examples in this specification provide a computer program product, which implements the method of any of the aforementioned implementations when running.

[0246] Fig.14 is a schematic structural diagram of a device provided by an exemplary embodiment. Fig.14 At the hardware level, the device includes a processor 702, an internal bus 704, a network interface 706, a memory 708, and a non-volatile memory 710, and may also include hardware required for other scenarios. One or more embodiments of this specification may be implemented based on software, such as the processor 702 reading the corresponding computer program from the non-volatile memory 710 into the memory 708 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0247] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.

[0248] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0249] Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0250] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0251] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0252] The above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0253] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "one", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0254] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0255] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of this specification shall be included in the scope of protection of one or more embodiments of this specification.

Claims

1. A material reconstruction method, It is characterized in that include: Acquire images to be processed of the target object taken at multiple different viewing angles; Performing material classification on the image to be processed to determine material classification results of different material areas in the target object; Based on the material classification result and the difference between the rendered image of the target object and the image to be processed, iteratively optimize the initial material map to obtain a target material map, wherein the rendered image of the target object is obtained by rendering a rough geometric model of the target object using the initial material map; The iterative optimization of the initial material map based on the material classification result and the difference between the rendered image of the target object and the image to be processed to obtain the target material map includes: Determining a first loss term based on the material classification result, where the first loss term is used to constrain the brightness values ​​of pixels in the same material area to be the same; determining a second loss term based on a difference between the rendered image and the image to be processed; A loss function is constructed based on the first loss term and the second loss term, and the initial material map is iteratively optimized based on the loss function.

2. The method according to claim 1, It is characterized in that The performing material classification on the image to be processed to determine the material classification results of different material areas in the target object includes: The image to be processed is input into a pre-trained material classification model, and the material classification model is used to perform image segmentation on different material areas of the target object to obtain the material classification result output by the material classification model.

3. The method according to claim 2, It is characterized in that The model training process of the material classification model includes: Acquire a training data set and a pre-trained image segmentation model, wherein the sample data in the training data set includes a sample image and label information, and the label information represents a material classification result of an object in the sample image; Inputting the sample data into the image segmentation model to obtain an output result of the image segmentation model; Based on the difference between the output result and the label information, the model parameters of the large image segmentation model are adjusted until the model convergence condition is met to obtain the material classification model.

4. The method according to claim 1, It is characterized in that The process of generating a rendered image of the target object includes: Performing ambient light extraction on the image to be processed to obtain an ambient light map corresponding to the image to be processed, wherein the ambient light represents the lighting condition of the target object on the image to be processed; Based on the initial material map and the ambient light map, a pre-generated rough geometric model of the target object is rendered to obtain the rendered image.

5. The method according to claim 1, It is characterized in that The iterative optimization of the initial material map based on the material classification result and the difference between the rendered image of the target object and the image to be processed includes: Performing ambient light extraction on the image to be processed to obtain an ambient light map corresponding to the image to be processed, wherein the ambient light represents the lighting condition of the target object on the image to be processed; Rendering the coarse geometric model based on the ambient light map to obtain a highlight component map; The initial material map is iteratively optimized based on the highlight component map, the material classification result, and the difference between the rendered image and the image to be processed.

6. The method according to claim 5, It is characterized in that The iterative optimization of the initial material map based on the highlight component map, the material classification result, and the difference between the rendered image and the image to be processed includes: Extract shadow features of the rendered image based on the highlight component map to obtain a first shadow map, extract shadow features of the image to be processed based on the highlight component map to obtain a second shadow map, and determine a third loss term based on a difference between the first shadow map and the second shadow map; A loss function is constructed based on the first loss term, the second loss term, and the third loss term, and the initial material map is iteratively optimized based on the loss function.

7. The method according to claim 6, It is characterized in that Extracting shadow features from the rendered image based on the highlight component map to obtain a first shadow map includes: For each pixel on the highlight component map, in response to a brightness value being greater than a preset threshold, the brightness value is configured as a first weight value, and in response to a brightness value being less than or equal to the preset threshold, the brightness value is configured as a second weight value, and each pixel on the highlight component map is traversed to obtain a shadow weight map; The shadow weight map and the rendered image are fused to obtain the first shadow map.

8. The method according to claim 1, It is characterized in that The step of obtaining images to be processed of the target object taken at multiple different viewing angles includes: Using an image acquisition device to acquire images of the target object at multiple different viewing angles; Perform image segmentation on the captured image to obtain the image to be processed including the target object.

9. A three-dimensional model reconstruction method, It is characterized in that include: A pre-generated rough geometric model of a target object is rendered using a target material map to obtain a three-dimensional model of the target object, wherein the target material map is obtained by the method described in any one of claims 1 to 8.

10. A material reconstruction device, It is characterized in that include: An image acquisition module is configured to acquire images to be processed of a target object taken at multiple different viewing angles; A material classification module is configured to perform material classification on the image to be processed and determine material classification results of different material areas in the target object; a texture optimization module, configured to iteratively optimize an initial material texture based on the material classification result and a difference between the rendered image of the target object and the image to be processed, so as to obtain a target material texture, wherein the rendered image of the target object is obtained by rendering a rough geometric model of the target object using the initial material texture; The texture optimization module is configured as follows: Determining a first loss term based on the material classification result, where the first loss term is used to constrain the brightness values ​​of pixels in the same material area to be the same; determining a second loss term based on a difference between the rendered image and the image to be processed; A loss function is constructed based on the first loss term and the second loss term, and the initial material map is iteratively optimized based on the loss function.

11. A three-dimensional model reconstruction device, It is characterized in that include: A three-dimensional rendering module is configured to render a pre-generated rough geometric model of a target object using a target material map to obtain a three-dimensional model of the target object, wherein the target material map is obtained by the method described in any one of claims 1 to 8.

12. An electronic device, It is characterized in that include: processor; and A memory storing computer instructions, wherein the computer instructions are used to enable a processor to execute the method according to any one of claims 1 to 9.

13. A storage medium, It is characterized in that Computer instructions are stored, and the computer instructions are used to make a computer execute the method according to any one of claims 1 to 9.

14. A computer program product, It is characterized in that The computer program product implements the method according to any one of claims 1 to 9 when running.