A material map generation method and related equipment

By randomly modifying image content to generate multiple material description files, it solves the texture duplication and discontinuity problems caused by material ball tiling in three-dimensional scenes, and improves the authenticity and effect of objects and scenes.

CN117456077BActive Publication Date: 2024-10-01DIVINE VISION (SHENZHEN) CULTURE TECH CO LTD
View PDF 15 Cites 0 Cited by

Patent Information

Application Number
CN202311435223.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-30
Publication Date
2024-10-01
Estimated Expiration
2043-10-30

AI Technical Summary

Technical Problem

In a three-dimensional scene, the tiling of a single material ball leads to duplication of textures, and the tiling of multiple material balls leads to discontinuous textures and inconsistent styles, causing the object to lose authenticity and reducing the overall effect.

Method used

By obtaining a picture containing a pattern texture, a mask area is randomly generated, the picture content is deleted and regenerated, and multiple second pictures are generated. Based on these pictures, multiple material description files are generated to describe different material properties of the object surface.

Benefits of technology

It improves the authenticity of objects and the overall effect of the three-dimensional scene, ensuring the continuity of texture and the unity of style.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117456077B_ABST
    Figure CN117456077B_ABST
Patent Text Reader

Abstract

The present specification provides a material map generation method and related equipment. The method includes: obtaining a first picture containing a pattern texture; randomly generating a mask area in the first picture, deleting the picture content corresponding to the mask area in the first picture, and regenerating the picture content corresponding to the mask area through an image generation model to obtain a second picture, repeating the above process until a preset number of second pictures are obtained; generating corresponding multiple material description files based on the multiple second pictures; wherein each of the multiple material description files includes multiple material maps for describing different material properties of the surface material of an object.
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 field of image processing technology, and in particular, to a material map generation method and related equipment. Background Art

[0002] In the process of building a 3D scene, in order to reduce resource consumption and ensure the effect and accuracy, a common method is to use four continuous material balls as textures to lay flat on flat objects such as the ground and walls. Among them, the material ball defines the basic properties of the object surface, including color, reflectivity, refractive index, roughness, transparency, etc. By adjusting the parameters of the material ball, you can simulate a variety of different materials, such as metal, plastic, glass, cloth, etc., so that the object has a realistic appearance during the rendering process.

[0003] However, if only a single material ball is used for tiling, the problem of texture duplication will easily occur, making the rendered object lose its authenticity, poor viewing experience, and reducing the overall effect of the 3D scene. If multiple different material balls are used for tiling, problems such as discontinuous textures and inconsistent styles will occur, which will also make the rendered object lose its authenticity. Summary of the invention

[0004] In view of this, one or more embodiments of the present specification provide a material map generation method and related devices.

[0005] In a first aspect, this specification provides a method for generating a material map, the method comprising:

[0006] Get a first image containing a pattern texture;

[0007] Randomly generate a mask area in the first image, delete the image content corresponding to the mask area in the first image, and regenerate the image content corresponding to the mask area through the image generation model to obtain a second image, and repeat the above process until a preset number of second images are obtained;

[0008] Generate a corresponding plurality of material description files based on the plurality of second images; wherein each of the plurality of material description files includes a plurality of material maps for describing different material properties of the surface material of the object.

[0009] In an illustrated embodiment, the first picture and the plurality of second pictures are all four-square continuous pictures.

[0010] In an illustrated embodiment, the randomly generating a mask area in the first picture and deleting picture content corresponding to the mask area in the first picture includes:

[0011] Randomly generate a mask area in the first picture, and determine whether a proportion of the mask area in the first picture is greater than a preset threshold;

[0012] If so, delete the picture content corresponding to the mask area in the first picture; otherwise, randomly generate the mask area in the first picture again.

[0013] In an illustrated embodiment, the mask region does not cover four side edge regions in the first image.

[0014] In an illustrated embodiment, the generating corresponding multiple material description files based on the multiple second images includes:

[0015] The multiple second images are respectively input into a pre-trained material map generation model to generate multiple material description files corresponding to the multiple second images; wherein the material map generation model is a deep learning model.

[0016] In one illustrated embodiment, the image generation model includes a diffusion model; or a pre-trained model for generating an image based on an input image.

[0017] In an illustrated embodiment, the plurality of texture maps include a combination of any plurality of texture maps shown below:

[0018] A map used to describe the pattern texture of an object's surface;

[0019] A map used to describe the normal texture of an object's surface;

[0020] A map used to describe the bump texture of an object's surface;

[0021] A map used to describe the light and shadow texture of an object's surface;

[0022] A map used to describe the roughness texture of an object's surface.

[0023] In a second aspect, this specification provides a material map generation device, the device comprising:

[0024] An acquisition unit, configured to acquire a first image including a pattern texture;

[0025] A picture generating unit, configured to randomly generate a mask area in the first picture, delete the picture content corresponding to the mask area in the first picture, and regenerate the picture content corresponding to the mask area through an image generating model to obtain a second picture, and repeatedly perform the above process until a preset number of second pictures are obtained;

[0026] A material map generation unit is used to generate a corresponding plurality of material description files based on the plurality of second images; wherein each of the plurality of material description files includes a plurality of material maps for describing different material properties of the surface material of the object.

[0027] Accordingly, the present specification also provides a computer device, comprising: a memory and a processor; the memory stores a computer program that can be executed by the processor; when the processor runs the computer program, it executes the material map generation method described in the above embodiments.

[0028] Accordingly, the present specification also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the material map generation method described in the above embodiments is executed.

[0029] In summary, the present application can first obtain a first picture containing a pattern texture. Then, a mask area is randomly generated in the first picture, and the picture content corresponding to the mask area in the first picture is deleted. Further, the present application can regenerate the picture content corresponding to the above-mentioned mask area through the image generation model to obtain a second picture, and repeat the above process until a preset number of second pictures are obtained. Finally, the present application can generate corresponding multiple material description files based on the multiple second pictures. Among them, each material description file in the multiple material description files may include multiple material maps for describing different material properties of the surface material of the object. In this way, the present application can be based on an existing picture containing a pattern texture, and by randomly modifying part of the picture content therein for multiple times, obtain multiple different pictures, and then generate corresponding multiple material description files based on these multiple different pictures to render the surface of the object, which greatly improves the authenticity of the object and ensures the overall effect of the three-dimensional scene. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 is a schematic diagram of a system architecture provided by an exemplary embodiment;

[0031] Figure 2 It is a flowchart of a material map generation method provided by an exemplary embodiment;

[0032] Figure 3 is a schematic diagram of a picture processing flow provided by an exemplary embodiment;

[0033] Figure 4 It is a schematic diagram of the splicing effect of a four-square continuous graph provided by an exemplary embodiment;

[0034] Figure 5 It is a structural schematic diagram of a material map generating device provided by an exemplary embodiment;

[0035] Figure 6 It is a structural diagram of a computer device provided by an exemplary embodiment. DETAILED DESCRIPTION

[0036] 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 implementations described in the following exemplary embodiments do not represent all implementations 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.

[0037] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0038] It should be noted that the “plurality” mentioned in this application refers to two or more than two.

[0039] 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 application 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.

[0040] First, some terms in this specification are explained to facilitate understanding by those skilled in the art.

[0041] (1) Material ball is one of the important elements used to simulate the material and lighting effects of the object surface. The material ball defines the basic material properties of the object surface, including color, reflectivity, refractive index, roughness, transparency, etc. By adjusting the parameters of the material ball, you can simulate a variety of different materials, such as metal, plastic, glass, cloth, etc., so that the object has a realistic appearance during the rendering process. In addition, the material ball also interacts with the light and determines the reflection and refraction behavior of the object surface when it is illuminated by light. Different material balls can present different reflection characteristics to light, such as diffuse reflection, specular reflection, ambient light reflection, etc. By adjusting the parameters of the material ball, you can control the lighting effect of the object, so that it can produce details such as shadows and highlights in the rendering results, enhancing the sense of reality.

[0042] A material ball file can contain multiple physically-based rendering (PBR) material maps used to describe the surface material of an object, such as color maps, normal maps, displacement maps, ambient occlusion (AO) maps, roughness maps, etc.

[0043] Among them, color mapping, also known as diffuse mapping, is a common texture mapping technology used to add color and pattern to the surface of 3D models. A color map is a 2D image that is usually used to simulate the color, pattern, and other details of the surface of an object. For example, in a game, you can use a color map to create the surface texture of a brick wall, a piece of grass, or a piece of clothing.

[0044] Among them, the normal map is used to simulate tiny geometric shapes on the surface of a 3D model. The normal map is actually a 2D image that can adjust the direction of the surface normal vector by modifying the RGB value of each pixel. This allows the 3D model to reflect light more realistically when rendered, thereby enhancing the detail effect. For example, in a game, a normal map can be used to add uneven details to the surface of materials such as stone walls, wood, or metal.

[0045] Among them, the ambient occlusion (AO) map is used to simulate the shadows between objects and increase the sense of volume when there is no lighting.

[0046] Among them, displacement mapping is a mapping technology used to change the geometric shape of a model. It stores height information on the geometric surface and applies this information to the model surface to modify and distort the topological structure of the model mesh, thereby creating a more realistic surface detail effect.

[0047] Among them, the roughness map is used to define the roughness information of the material, 0 (black-0sRGB) means smooth, 1 (white-255sRGB) means rough. Roughness refers to the surface irregularity that causes light diffusion, and the reflection direction changes freely according to the surface roughness.

[0048] (2) Four-way continuity means that an image is repeatedly tiled in four directions: up, down, left, and right, and the pattern textures at the joints between the images are continuous.

[0049] (3) A mask is a binary image in which the pixel values ​​can only take two possible values: 0 or 255. The area with a pixel value of 0 represents the background, and the area with a pixel value of 255 represents the foreground or the object of interest. Applying a mask to an image can easily extract the area of ​​interest in the image for further processing or analysis.

[0050] Three-dimensional scenes are widely used in virtual shooting, games and other fields. For example, in a virtual shooting scene, the background picture can be rendered on the screen based on the three-dimensional scene, and shot together with the foreground in front of the screen to obtain the desired shooting picture. As mentioned above, in the process of building a three-dimensional scene, in order to reduce resource consumption and ensure the effect and accuracy, a common method is to use four continuous material balls as textures to tile on flat objects such as the ground and walls. However, if only a single material ball is used for tiling, the problem of texture duplication will easily occur, causing the rendered object to lose details and authenticity, and the look and feel is poor, which seriously reduces the overall effect of the three-dimensional scene. If multiple different material balls are used for tiling, problems such as discontinuous textures and inconsistent styles will occur, which will also cause the rendered object to lose authenticity.

[0051] Based on this, this specification provides a material map generation solution. This solution is based on an existing picture containing pattern textures, and by randomly modifying part of the picture content multiple times, multiple different pictures are obtained, and then multiple corresponding material description files are generated based on these multiple different pictures to render the object surface, which greatly improves the authenticity of the object's appearance and ensures the overall effect of the three-dimensional scene.

[0052] During implementation, the present application may first obtain a first image containing a pattern texture. Then, a mask area is randomly generated in the first image, and the image content corresponding to the mask area in the first image is deleted. Furthermore, the present application may regenerate the image content corresponding to the mask area through an image generation model to obtain a second image, and repeat the above process until a preset number of second images are obtained. Finally, the present application may generate a corresponding plurality of material description files based on the plurality of second images. Each of the plurality of material description files may include a plurality of material maps for describing different material properties of the surface material of an object.

[0053] In the above technical scheme, this application is based on an existing picture containing a pattern texture, and obtains multiple different pictures by randomly modifying part of the picture content multiple times, and then generates corresponding multiple material description files based on these multiple different pictures to render the object surface, which greatly improves the authenticity of the object and ensures the overall effect of the three-dimensional scene.

[0054] See also Figure 1 , Figure 1 FIG. 1 is a schematic diagram of a system architecture provided by an exemplary embodiment. Figure 2 As shown, the system may include a computer device 10 and a computer device 20. The computer device 10 and the computer device 20 may transmit data via wireless communication such as Bluetooth, Wi-Fi or mobile network, or via wired communication such as data cable.

[0055] In an illustrated embodiment, a plurality of material description files (eg, material balls) that have been prepared may be stored in the computer device 20. Each material description file may include a plurality of material maps for describing different material properties of the surface material of an object.

[0056] Exemplarily, the multiple material maps may include a combination of any multiple material maps shown below: a map for describing the pattern texture of the object surface (e.g., a color map); a map for describing the normal texture of the object surface (e.g., a normal map); a map for describing the concave and convex texture of the object surface (e.g., a displacement map); a map for describing the light and shadow texture of the object surface (e.g., an AO map); a map for describing the roughness texture of the object surface (e.g., a roughness map), etc., and this specification does not make any specific limitations on this.

[0057] like Figure 1 As shown, the computer device 10 can obtain a material description file stored in the computer device 20, and further obtain a color map (eg, the first picture) contained in the material description file.

[0058] It should be noted that the present application does not specifically limit the specific implementation method of how to obtain the color map.

[0059] In an illustrated embodiment, the computer device 10 may send a request for obtaining a target material description file to the computer device 20 based on a current rendering task, and accordingly, the computer device 20 may respond to the request and send the stored target material description file to the computer device 10. Further, the computer device 10 may receive the target material description file sent by the computer device 20, and extract a color map from a plurality of material maps contained therein.

[0060] In one illustrated embodiment, the existing material description file may also be stored locally in the computer device 10. Accordingly, the computer device 10 may directly obtain the color map in the above-mentioned target material description file from the local storage space, etc. This specification does not make any specific limitations on this.

[0061] Furthermore, the computer device 10 can randomly generate a mask area in the acquired first image, and delete the image content corresponding to the mask area in the first image. Furthermore, the present application can regenerate the image content corresponding to the above-mentioned mask area through the image generation model to obtain a second image (i.e., a new color map), and repeat the above process until a preset number of multiple second images are obtained.

[0062] It should be noted that the present application does not specifically limit the specific type of the above-mentioned image generation model. In an illustrated embodiment, the image generation model may be a diffusion model (e.g., Stable Diffusion). The diffusion model is actually a deep learning model. In an illustrated embodiment, the image generation model may also be a pre-trained model for generating images based on input images, i.e., a large model, etc., which is not specifically limited in this specification.

[0063] Further, the computer device 10 may generate a corresponding plurality of material description files (e.g., material balls) based on the plurality of second images. Each of the plurality of material description files may include a plurality of material maps for describing different material properties of the surface material of the object. Finally, the computer device 10 may use the plurality of material description files (which may also include a target material description file) to render the surface of the object.

[0064] In an illustrated embodiment, the first image and the second image may be four-sided continuous images, and correspondingly, each material description file in the multiple material description files generated by the multiple second images may also be a four-sided continuous material ball.

[0065] As described above, the present application can be based on an existing picture containing a pattern texture, and by randomly modifying part of the picture content multiple times, obtain multiple different pictures, and then generate corresponding multiple material description files based on these multiple different pictures to render the object surface, which greatly improves the authenticity of the object and ensures the overall effect of the three-dimensional scene.

[0066] In one illustrated embodiment, the computer device 10 may be a smart wearable device, a smart phone, a tablet computer, a laptop computer, a desktop computer, a server, etc. having the above functions, and this specification does not make any specific limitation on this.

[0067] In an embodiment shown, the computer device 20 may be a server having the above functions or a server cluster composed of multiple servers, etc., which is not specifically limited in this specification. For example, the computer device 20 may be a cloud storage device.

[0068] See also Figure 2 , Figure 2 is a flowchart of a material map generation method provided by an exemplary embodiment. The method can be applied to Figure 1 The system architecture shown can be applied to Figure 1 The computer device 10 shown. Figure 2 As shown, the method may specifically include the following steps S201 to S203.

[0069] Step S201, obtaining a first picture including a pattern texture.

[0070] In an illustrated implementation, a computer device may acquire a first image including a pattern texture.

[0071] In one illustrated embodiment, the first image may be a real image captured by a camera, or a virtual image rendered by software, or the first image may be a color map further produced from the real image or the virtual image, and so on. This specification does not specifically limit this.

[0072] In an illustrated embodiment, the first image may also be a color map included in an existing material description file that has been produced. Accordingly, the computer device may search for a suitable target material description file from multiple material description files that have been produced based on the current rendering task, and further obtain the color map included in the target material description file as the first image.

[0073] In an illustrated embodiment, the first picture may be a four-square continuous picture.

[0074] Step S202: randomly generate a mask area in the first picture, delete the picture content corresponding to the mask area in the first picture, and regenerate the picture content corresponding to the mask area through the image generation model to obtain a second picture, and repeat the above process until a preset number of second pictures are obtained.

[0075] In an illustrated implementation, after acquiring the first picture, the computer device may modify the first picture multiple times, thereby obtaining multiple new pictures.

[0076] It should be noted that the present application does not specifically limit the specific implementation method of modifying the first image.

[0077] In one illustrated embodiment, a computer device may first randomly generate a mask area in a first image, then delete the image content in the first image corresponding to the mask area, and regenerate the image content corresponding to the mask area to obtain a second image (i.e., a new image), and repeat the above process until a preset number of second images are obtained.

[0078] It should be noted that the present application does not specifically limit the specific value of the preset number. Exemplarily, the preset number can be 4 or 9, etc., which is not specifically limited in this specification and can be set according to actual needs and device performance. In an embodiment shown, the preset number can also be 1, that is, only one second picture is generated, which is not specifically limited in this specification.

[0079] In an illustrated embodiment, after randomly generating a mask area in the first image, the computer device may first determine whether the proportion of the mask area in the first image is greater than a preset threshold. Exemplarily, if the proportion of the mask area in the first image is greater than the preset threshold, the image content corresponding to the mask area in the first image may be deleted, and subsequent steps may be performed. Exemplarily, if the proportion of the mask area in the first image is less than or equal to the preset threshold, it is necessary to randomly generate a mask area in the first image again to ensure that the first image is effectively and fully modified.

[0080] In one illustrated embodiment, the computer device may also pre-set that the proportion of the randomly generated mask area in the first image must be greater than the preset threshold, and then randomly generate mask areas of different positions, sizes, and shapes on this basis, etc. This specification does not make specific limitations on this.

[0081] Exemplarily, the preset threshold corresponding to the proportion of the mask area may be 45%, 50%, 60%, etc. This specification does not specifically limit this, and it may be set according to actual needs and equipment performance.

[0082] In addition, taking the first image as a four-sided continuous image as an example, in order to ensure that the second image modified from the first image is also a four-sided continuous image, the above-mentioned mask area cannot cover the four side edge areas of the first image (i.e., the areas corresponding to the upper, lower, left, and right four sides). If the randomly generated mask area covers part or all of the four side edge areas of the first image, it is necessary to adjust the currently generated mask area (for example, move or reduce the mask area), or directly re-generate the mask area randomly, so that the mask area cannot cover the four side edge areas of the first image, thereby ensuring that the edge information (or the pattern texture of the edge) in the first image can be retained, and then ensuring that each subsequent second image is also a four-sided continuous image.

[0083] In one illustrated embodiment, the computer device may also pre-set that the randomly generated mask area cannot cover the four side edge areas of the first image, and then randomly generate mask areas of different positions, sizes, and shapes on this basis, and this specification does not make specific limitations on this.

[0084] In an illustrated embodiment, when randomly generating a mask area, it may specifically include: using noise to randomly generate a black and white mask on the first image. The white area of ​​the black and white mask represents the image deletion area (i.e., the mask area in this specification), and the pixel values ​​in the white area are all 0. The black area of ​​the black and white mask represents the image retention area (i.e., the other area except the mask area in this specification), and the pixel values ​​in the black area are all 255.

[0085] Correspondingly, if the proportion of the white area in the entire black and white mask is greater than a preset threshold (for example, greater than 50%), the black and white mask can be applied to the first image to delete the image content corresponding to the white area in the first image. Otherwise, the black and white mask needs to be randomly generated again.

[0086] Correspondingly, if the white area covers part or all of the four side edge areas of the first image, the white area can be appropriately adjusted, such as shrinking the white area, or moving the white area so that the black area can cover the four side edge areas of the first image, etc. This specification does not make any specific limitations on this.

[0087] In some possible embodiments, a white area may be used to represent an image retention area, and a black area may be used to represent an image deletion area. In this case, the pixel values ​​in the white area are all 255, the pixel values ​​in the black area are all 0, and so on. This specification does not make any specific limitations on this.

[0088] For example, see Figure 3 , Figure 3FIG. 1 is a schematic diagram of an image processing flow provided by an exemplary embodiment. The first image acquired by the computer device can be Figure 3 As shown, the first image may include a corresponding pattern texture, and the first image may be a four-way continuous image.

[0089] Furthermore, the computer device may randomly generate a mask area on the first image. Figure 3 As shown, the computer device may randomly generate a mask area A on the first image for the first time, a mask area B on the first image (the first image at this time may be a copy of the original first image) for the second time, a mask area C on the first image (the first image at this time may be a copy of the original first image) for the third time, and so on. The shape, size, position, etc. of the mask area randomly generated each time may be different. For example, Figure 3 As shown, the shape of the mask area A may be an irregular pattern, the shape of the mask area B may be a circle, the shape of the mask area C may be a rectangle, and so on, which is not specifically limited in this specification.

[0090] Furthermore, after randomly generating the mask area, the computer device may delete the image content corresponding to the mask area in the first image to obtain an incomplete first image. Figure 3 As shown, for the first time, the computer device can delete the image content corresponding to the mask area A in the first image to obtain an incomplete first image A; for the second time, the computer device can delete the image content corresponding to the mask area B in the first image to obtain an incomplete first image B; for the third time, the computer device can delete the image content corresponding to the mask area C in the first image to obtain an incomplete first image C, and so on.

[0091] Further, after deleting the image content corresponding to the mask area in the first image to obtain the incomplete first image, the computer device can regenerate the image content corresponding to the mask area to obtain the second image. Figure 3 As shown, for the first time, the computer device can regenerate the image content A corresponding to the mask area A in the incomplete first image A, thereby obtaining the second image A; for the second time, the computer device can regenerate the image content B corresponding to the mask area B in the incomplete first image B, thereby obtaining the second image B; for the third time, the computer device can regenerate the image content C corresponding to the mask area C in the incomplete first image C, thereby obtaining the second image C.

[0092] like Figure 3 As shown, the pattern textures in the image content A, image content B, and image content C that are regenerated each time may be different.

[0093] And, if Figure 3 As shown, the second picture A, the second picture B, and the second picture C obtained each time can all be four-sided continuous pictures. For example, please refer to Figure 4 , Figure 4 FIG. 1 is a schematic diagram of a splicing effect of a four-square continuous image provided by an exemplary embodiment. Figure 4 As shown, the pattern texture in the image obtained by repeatedly splicing the first image and multiple newly generated second images along the upper, lower, left and right directions is continuous.

[0094] It should be noted that the present application does not particularly limit the specific implementation method of regenerating the image content corresponding to the mask area to obtain the second image.

[0095] In an illustrated embodiment, the present application can manually draw the image content corresponding to each mask area through various image editing software (such as Photoshop) to repair the above-mentioned incomplete first images, thereby obtaining Figure 3 The second picture A, the second picture B, the second picture C, etc. are shown.

[0096] In an illustrated embodiment, the present application may also input the above-mentioned incomplete first images into a pre-trained image generation model, and regenerate the image content corresponding to the mask area through the image generation model, thereby obtaining Figure 3 The second picture A, the second picture B, the second picture C, etc. are shown.

[0097] In an illustrated embodiment, the image generation model may be a diffusion model (e.g., Stable Diffusion). The diffusion model is actually a deep learning model. In an illustrated embodiment, the image generation model may also be a pre-trained model for generating images based on input images, i.e., a large model, etc., which is not specifically limited in this specification.

[0098] Understandably, Figure 3 and Figure 4 The pattern textures in the pictures shown are for illustrative purposes only. In actual applications, the first picture, the second picture, etc. may include various pattern textures corresponding to rocks, gravel, wood boards, asphalt, pebbles or grass, and this manual does not make any specific limitations on this.

[0099] In addition, in an illustrated embodiment, before generating a mask area on the first image, the present application may also perform a shadow removal process on the first image to avoid obvious light and shadow effects in the image, thereby affecting the subsequent material map generation effect. Exemplarily, a pre-trained shadow removal model may be saved in the computer device. After obtaining the first image, the computer device may first input the first image into the shadow removal model for shadow removal. Further, the computer device may perform the above-mentioned shadow removal process on the first image after the shadow removal process. Figure 3 The picture processing flow shown, etc., is not specifically limited in this specification.

[0100] In one illustrated implementation, the shadow removal model may actually be a deep learning model, which is not specifically limited in this specification.

[0101] Step S203, generating a corresponding plurality of material description files based on the plurality of second images; wherein each of the plurality of material description files includes a plurality of material maps for describing different material properties of the surface material of the object.

[0102] In an illustrated embodiment, after obtaining a preset number of multiple second images based on multiple modifications to the first image, the computer device may generate corresponding multiple material description files based on the multiple second images.

[0103] Each of the multiple material description files may include multiple material maps for describing different material properties of the surface material of the object.

[0104] Exemplarily, the multiple material maps may include a combination of any multiple material maps shown below: a map for describing the pattern texture of the object surface (e.g., a color map); a map for describing the normal texture of the object surface (e.g., a normal map); a map for describing the concave and convex texture of the object surface (e.g., a displacement map); a map for describing the light and shadow texture of the object surface (e.g., an AO map); a map for describing the roughness texture of the object surface (e.g., a roughness map), etc., and this specification does not make any specific limitations on this.

[0105] Further, in an illustrated embodiment, the computer device can render the surface of an object (e.g., a wall, a ground, etc.) based on the newly generated multiple material description files, and finally realize the construction of the entire three-dimensional scene. Alternatively, in an illustrated embodiment, the computer device can also render the surface of an object based on the original target material description file and the newly generated multiple material description files. Exemplarily, the three-dimensional scene can be a forest, a park, a school, the interior of a house, etc., and this specification does not specifically limit this.

[0106] It should be noted that the present application does not specifically limit the specific implementation method of generating multiple material description files based on multiple second images.

[0107] In an illustrated embodiment, the computer device may input the plurality of second images into a pre-trained material map generation model, and generate a plurality of material description files corresponding to the plurality of second images through the material map generation model.

[0108] It should be noted that the present application does not specifically limit the specific type of the material map generation model. In an illustrated embodiment, the material map generation model may be a deep learning model.

[0109] In one illustrated embodiment, the training process of the material map generation model may include the following steps.

[0110] First, the present application may first obtain a training sample set, which may include multiple training images. Each of the multiple training images may be an image rendered based on a corresponding material description file and preset lighting parameters. Based on this, the present application may use each material description file as a label for the training image rendered by it.

[0111] In an illustrated embodiment, the above-mentioned lighting parameters may include lighting intensity and lighting direction, etc., which are not specifically limited in this specification.

[0112] Then, the present application can perform supervised training on the deep learning model based on each training image in the training sample set and its corresponding label, until the difference between the material description file output by the deep learning model for each input training image and its corresponding label reaches the expected value, and the training is completed to obtain the above-mentioned material map generation model.

[0113] In an illustrated embodiment, the first image and the second image may be images of orthogonal views that do not contain perspective information. Exemplarily, the perspective information may include, for example, concave-convex information of an object (such as a rock, a wooden board, a carpet, etc.). Accordingly, the material map generation model obtained through the training may be used to estimate perspective information in a plurality of second images. Accordingly, each training image in the training sample set may also be an orthogonal image that does not contain perspective information, and so on, which is not specifically limited in this specification.

[0114] In summary, the present application can first obtain a first picture containing a pattern texture. Then, a mask area is randomly generated in the first picture, and the picture content corresponding to the mask area in the first picture is deleted. Further, the present application can regenerate the picture content corresponding to the above-mentioned mask area through the image generation model to obtain a second picture, and repeat the above process until a preset number of second pictures are obtained. Finally, the present application can generate corresponding multiple material description files based on the multiple second pictures. Among them, each material description file in the multiple material description files may include multiple material maps for describing different material properties of the surface material of the object. In this way, the present application can be based on an existing picture containing a pattern texture, and by randomly modifying part of the picture content therein for multiple times, obtain multiple different pictures, and then generate corresponding multiple material description files based on these multiple different pictures to render the surface of the object, which greatly improves the authenticity of the object and ensures the overall effect of the three-dimensional scene.

[0115] Corresponding to the implementation of the above method flow, the embodiment of this specification also provides a material map generation device. Figure 5 , Figure 5 30 is a schematic diagram of a structure of a material map generation device provided by an exemplary embodiment. The device 30 can be applied to a server that provides data transmission services. Figure 5 As shown, the device 30 comprises:

[0116] An acquisition unit 301 is used to acquire a first image containing a pattern texture;

[0117] The picture generating unit 302 is used to randomly generate a mask area in the first picture, delete the picture content corresponding to the mask area in the first picture, and regenerate the picture content corresponding to the mask area through the image generation model to obtain a second picture, and repeat the above process until a preset number of second pictures are obtained;

[0118] The material map generation unit 303 is used to generate a corresponding plurality of material description files based on the plurality of second images; wherein each of the plurality of material description files includes a plurality of material maps for describing different material properties of the surface material of the object.

[0119] In an illustrated embodiment, the first picture and the plurality of second pictures are all four-square continuous pictures.

[0120] In an illustrated embodiment, the picture generating unit 302 is specifically configured to:

[0121] Randomly generate a mask area in the first picture, and determine whether a proportion of the mask area in the first picture is greater than a preset threshold;

[0122] If so, delete the picture content corresponding to the mask area in the first picture; otherwise, randomly generate the mask area in the first picture again.

[0123] In an illustrated embodiment, the mask region does not cover four side edge regions in the first image.

[0124] In an illustrated embodiment, the material map generation unit 303 is specifically used to:

[0125] The multiple second images are respectively input into a pre-trained material map generation model to generate multiple material description files corresponding to the multiple second images; wherein the material map generation model is a deep learning model.

[0126] In one illustrated embodiment, the image generation model includes a diffusion model; or a pre-trained model for generating an image based on an input image.

[0127] In an illustrated embodiment, the plurality of texture maps include a combination of any plurality of texture maps shown below:

[0128] A map used to describe the pattern texture of an object's surface;

[0129] A map used to describe the normal texture of an object's surface;

[0130] A map used to describe the bump texture of an object's surface;

[0131] A map used to describe the light and shadow texture of an object's surface;

[0132] A map used to describe the roughness texture of an object's surface.

[0133] The implementation process of the functions and effects of each unit in the above device 30 is detailed in the above Figure 1-Figure 4 The description of the corresponding embodiment will not be repeated here. It should be understood that the above-mentioned device 30 can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor (CPU) of the device where it is located reading the corresponding computer program instructions into the memory and running them. From the hardware level, in addition to the CPU and memory, the device where the above-mentioned device is located usually also includes other hardware such as chips for wireless signal transmission and reception, and / or other hardware such as boards and cards for realizing network communication functions.

[0134] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the units or modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. Those of ordinary skill in the art may understand and implement it without creative work.

[0135] The devices, units, and modules 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.

[0136] Corresponding to the above method embodiment, the embodiment of this specification also provides a computer device. Figure 6 , Figure 6 FIG. 1 is a schematic diagram of a computer device provided by an exemplary embodiment. Figure 6 As shown, the computer device may include a processor 1001 and a memory 1002, and may further include an input device 1004 (such as a keyboard, etc.) and an output device 1005 (such as a display, etc.). The processor 1001, the memory 1002, the input device 1004, and the output device 1005 may be connected via a bus or other means. Figure 6 As shown, the memory 1002 includes a computer-readable storage medium 1003, which stores a computer program that can be run by the processor 1001. The processor 1001 can be a general-purpose processor, a microprocessor, or an integrated circuit for controlling the execution of the above method embodiment. When the processor 1001 runs the stored computer program, it can execute the various steps of the material map generation method in the embodiment of this specification, including: obtaining a first picture containing a pattern texture; randomly generating a mask area in the first picture, deleting the picture content corresponding to the mask area in the first picture, and regenerating the picture content corresponding to the mask area through the image generation model to obtain a second picture, repeating the above process until a preset number of second pictures are obtained; generating corresponding multiple material description files based on the multiple second pictures; wherein each of the multiple material description files includes multiple material maps for describing different material properties of the surface material of the object, and so on.

[0137] For a detailed description of each step of the above material map generation method, please refer to the previous content and will not be repeated here.

[0138] Corresponding to the above method embodiment, the embodiment of this specification also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by the processor, it executes each step of the material map generation method in the embodiment of this specification. Figure 1-Figure 4 The description of the corresponding embodiments will not be repeated here.

[0139] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.

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

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

[0142] Computer readable media include permanent and non-permanent, removable and non-removable media and can store information by any method or technology. The information can be computer readable instructions, data structures, program modules or other data.

[0143] 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 disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage 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 transitory media such as modulated data signals and carrier waves.

[0144] 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.

[0145] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, the embodiments of this specification may take the form of complete hardware embodiments, complete software embodiments or embodiments combining software and hardware. Moreover, the embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

Claims

1. A material map generation method, characterized in that: The method comprises: Get a first image containing a pattern texture; A mask area is randomly generated in the first image, the image content corresponding to the mask area is deleted in the first image, and the image content corresponding to the mask area is regenerated through an image generation model to obtain a second image, and the above process is repeatedly performed for the first image that has been obtained until a preset number of second images are obtained; Generate a corresponding plurality of material description files based on the plurality of second images; wherein each of the plurality of material description files includes a plurality of material maps for describing different material properties of the surface material of the object.

2. The method according to claim 1, characterized in that The first picture and the plurality of second pictures are all four-way continuous pictures.

3. The method according to claim 1, characterized in that The randomly generating a mask area in the first picture and deleting picture content corresponding to the mask area in the first picture includes: Randomly generate a mask area in the first picture, and determine whether a proportion of the mask area in the first picture is greater than a preset threshold; If so, delete the picture content corresponding to the mask area in the first picture; otherwise, randomly generate the mask area in the first picture again.

4. The method according to claim 1, characterized in that: The mask area does not cover the four side edge areas in the first picture.

5. The method according to claim 1, characterized in that The generating a plurality of corresponding material description files based on the plurality of second images comprises: The multiple second images are respectively input into a pre-trained material map generation model to generate multiple material description files corresponding to the multiple second images; wherein the material map generation model is a deep learning model.

6. The method according to claim 1, characterized in that The image generation model includes a diffusion model; or a pre-trained model for generating an image based on an input image.

7. The method according to any one of claims 1 to 6, characterized in that: The plurality of texture maps include any combination of the following plurality of texture maps: A map used to describe the pattern texture of an object's surface; A map used to describe the normal texture of an object's surface; A map used to describe the bump texture of an object's surface; A map used to describe the light and shadow texture of an object's surface; A map used to describe the roughness texture of an object's surface.

8. A material map generating device, characterized in that: The device comprises: An acquisition unit, used for acquiring a first picture including a pattern texture; An image generation unit, configured to randomly generate a mask area in the first image, delete the image content corresponding to the mask area in the first image, and regenerate the image content corresponding to the mask area through an image generation model to obtain a second image, and repeatedly perform the above process on the first image that has been obtained until a preset number of second images are obtained; A material map generation unit is used to generate a corresponding plurality of material description files based on the plurality of second images; wherein each of the plurality of material description files includes a plurality of material maps for describing different material properties of the surface material of the object.

9. A computer device, characterized in that: include: Memory and processor; The memory stores a computer program executable by the processor; When the processor runs the computer program, the processor performs the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Patch mask detection system and method based on convolutional neural network

    CN110992322A

  • Mapping method and device based on deep learning

    CN111260548A

  • Graph rendering method and device, storage medium and electronic equipment

    CN112927339A

  • Method for improving detection performance of instance segmentation model based on data enhancement

    CN113033573A

  • Graphic processing method and device in game

    CN113181639A