Method, apparatus, electronic device, and storage medium for processing a texture map
Through automated map splitting and splicing methods, the problem of inefficient map processing is solved, and efficient map processing and quality assurance is achieved.
Patent Information
- Application Number
- CN202111633826.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2041-12-28
AI Technical Summary
In the prior art, the splitting and splicing processing of maps is inefficient, and multiple channels cannot be simultaneous processing, and it cannot be displayed in real time, resulting in low texture quality.
By obtaining the target map set, determine the selection parameters of the original map, and select the original map based on these parameters to obtain the selection map. Then, these selection maps are spliced to generate a new target map. This process includes grayscale parameter processing of masked areas and calculation of selection parameters to achieve automated map splitting and stitching.
The batch processing of maps is realized, the efficiency of map splitting and splicing is improved, the rendering effect can be previewed in real time, and the quality of maps is ensured through brightness detection and correction.
Smart Images

Figure CN114332306B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular, to a method for processing a texture map, a device for processing a texture map, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the establishment of the art asset library and the acquisition of external resources, some changes have occurred in the 3D scene production process of games. In the related art, one model corresponds to a set of texture maps (customized models). This approach can ensure the quality of the model, but it has a high cost and is also difficult to batch later, resulting in a very low cost performance. In another approach, texture maps are reused, especially Tiling texture maps. These texture maps can be obtained from many sources, but a set of texture maps includes multiple texture maps. Users need to split them in an image processing software and then merge them. However, for the splitting and splicing of images, on the one hand, multi-channel simultaneous processing cannot be achieved, resulting in very low image processing efficiency. On the other hand, real-time display cannot be performed, resulting in the inability to intuitively display the effects of post-production and also the inability to detect and correct the texture maps, resulting in low-quality texture maps. Summary of the Invention
[0003] Embodiments of the present invention provide a method, a device, an electronic device, and a computer-readable storage medium for processing a texture map to solve or partially solve the problem of low efficiency in splitting and splicing processing of texture maps in the related art.
[0004] Embodiments of the present invention disclose a method for processing a texture map, including:
[0005] Obtaining at least one target texture map set, where the target texture map set includes a plurality of original texture maps;
[0006] Determining selection area parameters for the original texture map, and performing area selection on the original texture map according to the selection area parameters to obtain a plurality of selected area texture maps corresponding to the original texture map;
[0007] Splicing the plurality of selected area texture maps corresponding to the original texture map to obtain a first target texture map corresponding to each original texture map.
[0008] Optionally, the determining the selection area parameters for the original texture map includes:
[0009] Obtaining first selection area parameters for the original texture map and selection area adjustment parameters for the first selection area parameters;
[0010] Calculating second selection area parameters by using the first selection area parameters and the selection area adjustment parameters.
[0011] Optionally, performing area selection on the original texture map according to the selection area parameters to obtain a plurality of selected area texture maps corresponding to the original texture map, including:
[0012] Obtaining a mask area for the original texture map and grayscale parameters of the mask area;
[0013] Taking the area in the mask area where the grayscale parameter is greater than the selection area parameter as the selected area, and the area where the grayscale parameter is less than the selection area parameter as the mask area;
[0014] Masking the mask area on the original texture map, masking the original texture map with the mask area, and taking the texture map area within the selected area as the selected area texture map corresponding to the original texture map.
[0015] Optionally, the selection area parameters include a first selection area parameter corresponding to a first grayscale gradient direction and a second selection area parameter corresponding to a second grayscale gradient direction, the first grayscale gradient direction is opposite to the second grayscale gradient direction, and taking the area in the mask area where the grayscale parameter is greater than the selection area parameter as the selected area, and the area where the grayscale parameter is less than the selection area parameter as the mask area includes:
[0016] According to the first grayscale gradient direction, taking the area in the mask area where the grayscale parameter is greater than the first selection area parameter as the first selected area, and the area where the grayscale parameter is less than the first selection area parameter as the first mask area;
[0017] According to the second grayscale gradient direction, taking the area in the mask area where the grayscale parameter is greater than the second selection area parameter as the second selected area, and the area where the grayscale parameter is less than the second selection area parameter as the second mask area.
[0018] Optionally, the first grayscale gradient direction is a grayscale gradient direction from top to bottom; the second grayscale gradient direction is a grayscale gradient direction from bottom to top.
[0019] Optionally, masking the mask area on the original texture map, masking the original texture map with the mask area, and taking the texture map area within the selected area as the selected area texture map corresponding to the original texture map includes:
[0020] Masking the mask area on the original texture map, masking the original texture map with the first mask area and the second mask area, and taking the texture map area that is simultaneously within the first selected area and the second selected area as the plurality of selected area texture maps corresponding to the original texture map.
[0021] Optionally, splicing a plurality of selected area textures corresponding to the original texture to obtain a first target texture corresponding to each original texture, including:
[0022] Obtaining the selected area order corresponding to each selected area texture and the position information in the mask area, where the position information includes the upper mask parameter and the lower mask parameter of the selected area texture;
[0023] Using the upper mask parameter and / or the lower mask parameter corresponding to each selected area texture to calculate the splicing displacement corresponding to each selected area texture;
[0024] Splicing a plurality of selected area textures corresponding to the original texture according to the selected area order and the splicing displacement to generate a first target texture corresponding to each original texture.
[0025] Optionally, the using the upper mask parameter and / or the lower mask parameter corresponding to each selected area texture to calculate the splicing displacement corresponding to each selected area texture includes:
[0026] Using the upper mask parameter corresponding to each selected area texture to calculate the splicing displacement corresponding to each selected area texture;
[0027] And / or, using the lower mask parameter corresponding to each selected area texture to calculate the splicing displacement corresponding to each selected area texture.
[0028] Optionally, the using the upper mask parameter and / or the lower mask parameter corresponding to each selected area texture to calculate the splicing displacement corresponding to each selected area texture includes:
[0029] Using the upper mask parameter corresponding to each selected area texture and the first selected area adjustment parameter corresponding to the upper mask parameter to calculate the splicing displacement corresponding to each selected area texture;
[0030] And / or, using the lower mask parameter corresponding to each selected area texture and the second selected area adjustment parameter corresponding to the lower mask parameter to calculate the splicing displacement corresponding to each selected area texture.
[0031] Optionally, the original texture includes at least a solid color texture, a mixed texture, and a normal map.
[0032] Optionally, it further includes:
[0033] Performing grayscale processing on the first target texture to obtain a corresponding grayscale texture;
[0034] Performing coloring processing on the grayscale texture according to a preset grayscale threshold to display the brightness detection image of the first target texture;
[0035] Obtain the grayscale information for the luminance detection image, and correct the luminance detection image of the first target map according to the grayscale information to generate a second target map.
[0036] Optionally, the step of performing coloring processing on the grayscale map according to a preset grayscale threshold and displaying the luminance detection image of the first target map includes:
[0037] Obtain the map grayscale value of each pixel point in the grayscale map and the lightness detection threshold for the first target map;
[0038] Perform luminance detection on the first target map according to the map grayscale value of each pixel point and the lightness detection threshold, and display the luminance detection image of the first target map.
[0039] Optionally, the lightness detection threshold includes a first metal lightness threshold, a second metal lightness threshold, a first non-metal lightness threshold, and a second non-metal lightness threshold. The second metal lightness threshold is greater than the first metal lightness threshold, and the second non-metal lightness threshold is greater than the first non-metal lightness threshold. The step of performing luminance detection on the first target map according to the grayscale value of each pixel point and the lightness detection threshold and displaying the luminance detection image of the first target map includes:
[0040] Color the pixel points in the first target map whose map grayscale value is less than the first metal lightness threshold with a first color, and color the pixel points whose map grayscale value is greater than the second metal lightness threshold with a second color to obtain the metal detection image of the first target map;
[0041] Color the pixel points in the first target map whose map grayscale value is less than the first non-metal lightness threshold with a first color, and color the pixel points whose map grayscale value is greater than the second metal lightness threshold with a second color to obtain the non-metal detection image of the first target map;
[0042] Obtain the metal channel image corresponding to the first target map;
[0043] Perform image mixing using the metal detection image, the non-metal detection image, and the metal channel image, and display the luminance detection image of the first target map.
[0044] Optionally, the step of performing image mixing using the metal detection image, the non-metal detection image, and the metal channel image and displaying the luminance detection image of the first target map includes:
[0045] Perform grayscale processing on the metal detection image to obtain a metal grayscale image;
[0046] Perform grayscale processing on the non-metal detection image to obtain a non-metal grayscale image;
[0047] Stitch the metal grayscale image and the non-metal grayscale image to obtain a detection area image corresponding to the first target map;
[0048] Perform image mixing using the metal detection image, the non-metal detection image, the metal channel image, and the detection area image to display a brightness detection image of the first target map.
[0049] Optionally, the grayscale information includes the metal grayscale values of each pixel point in the metal grayscale image and the non-metal grayscale values of each pixel point in the non-metal grayscale image. The step of correcting the brightness detection image of the first target map according to the grayscale information to generate a second target map includes:
[0050] Perform brightness area division on the metal grayscale image using the metal grayscale value, the first metal brightness threshold, and the second metal brightness threshold to obtain a metal brightness abnormal area corresponding to the metal grayscale image;
[0051] Perform brightness area division on the non-metal grayscale image using the non-metal grayscale value, the first non-metal brightness threshold, and the second non-metal brightness threshold to obtain a non-metal brightness abnormal area corresponding to the non-metal grayscale image;
[0052] In response to the brightness mixing operation, perform brightness mixing on the first target map and the metal brightness abnormal area, and perform mixing on the first target map and the non-metal brightness abnormal area to perform brightness correction on the first target map to generate a second target map.
[0053] Optionally, the step of performing brightness area division on the metal grayscale image using the metal grayscale value, the first metal brightness threshold, and the second metal brightness threshold to obtain a metal brightness abnormal area corresponding to the metal grayscale image includes:
[0054] Use the pixel points in the metal grayscale image with metal grayscale values less than the first metal brightness threshold to construct a first over-dark area corresponding to the metal grayscale image;
[0055] Use the pixel points in the metal grayscale image with metal grayscale values greater than the second metal brightness threshold to construct a first over-bright area corresponding to the metal grayscale image.
[0056] Optionally, the step of dividing the non-metal grayscale image into brightness regions by using the non-metal grayscale value, the first non-metal brightness threshold, and the second non-metal brightness threshold to obtain a non-metal brightness abnormal region corresponding to the non-metal grayscale image includes:
[0057] Using pixel points in the non-metal grayscale image whose non-metal grayscale values are less than the first non-metal brightness threshold to construct a second over-dark region corresponding to the non-metal grayscale image;
[0058] Using pixel points in the non-metal grayscale image whose non-metal grayscale values are greater than the second non-metal brightness threshold to construct a second over-bright region corresponding to the non-metal grayscale image.
[0059] Optionally, the step of performing brightness correction on the first target map by performing brightness mixing on the first target map and the metal brightness abnormal region, and performing mixing on the first target map and the non-metal brightness abnormal region to generate a second target map includes:
[0060] In response to a brightness mixing subtraction operation, determining a subtraction amplitude corresponding to the brightness mixing subtraction operation, and performing image superposition of the first target map and the first over-bright region according to the subtraction amplitude to perform brightness correction on the first over-bright region, and performing image superposition of the first target map and the second over-bright region to perform brightness correction on the second over-bright region;
[0061] In response to a brightness mixing addition operation, determining an addition amplitude corresponding to the brightness mixing addition operation, and performing image superposition of the first target map and the first over-dark region according to the addition amplitude to perform brightness correction on the first over-dark region, and performing image superposition of the first target map and the second over-dark region to perform brightness correction on the second over-dark region, thereby generating a second target map corresponding to the first target map.
[0062] An embodiment of the present invention also discloses a processing device for a map, including:
[0063] A map set acquisition module, configured to acquire at least one target map set, where the target map set includes a plurality of original maps;
[0064] A selected area map determination module, configured to determine selection area parameters for the original map, and perform area selection on the original map according to the selection area parameters to obtain a plurality of selected area maps corresponding to the original map;
[0065] A target map generation module, configured to splice the plurality of selected area maps corresponding to the original map to obtain a first target map corresponding to each original map.
[0066] Optionally, the selected area texture determination module includes:
[0067] A parameter acquisition sub-module, configured to acquire a first selected area parameter for the original texture, and a selected area adjustment parameter for the first selected area parameter;
[0068] A selected area parameter calculation sub-module, configured to calculate a second selected area parameter by using the first selected area parameter and the selected area adjustment parameter.
[0069] Optionally, the selected area texture determination module includes:
[0070] A grayscale parameter acquisition sub-module, configured to acquire a mask area for the original texture, and a grayscale parameter of the mask area;
[0071] An area determination sub-module, configured to use an area in the mask area where the grayscale parameter is greater than the selected area parameter as a selected area, and an area where the grayscale parameter is less than the selected area parameter as a mask area;
[0072] A selected area texture generation sub-module, configured to mask the mask area on the original texture, mask the original texture by using the mask area, and use a texture area within the selected area as the selected area texture corresponding to the original texture.
[0073] Optionally, the selected area parameter includes a first selected area parameter corresponding to a first grayscale gradient direction and a second selected area parameter corresponding to a second grayscale gradient direction, the first grayscale gradient direction is opposite to the second grayscale gradient direction, and the area determination sub-module is specifically configured to:
[0074] According to the first grayscale gradient direction, use an area in the mask area where the grayscale parameter is greater than the first selected area parameter as a first selected area, and an area where the grayscale parameter is less than the first selected area parameter as a first mask area;
[0075] According to the second grayscale gradient direction, use an area in the mask area where the grayscale parameter is greater than the second selected area parameter as a second selected area, and an area where the grayscale parameter is less than the second selected area parameter as a second mask area.
[0076] Optionally, the first grayscale gradient direction is a grayscale gradient direction from top to bottom; the second grayscale gradient direction is a grayscale gradient direction from bottom to top.
[0077] Optionally, the selected area texture generation sub-module is specifically configured to:
[0078] Mask the masked area in the original texture map, mask the original texture map using the first masked area and the second masked area, and use the texture map area that is simultaneously within the first selection area and the second selection area as several selection texture maps corresponding to the original texture map.
[0079] Optionally, the target texture map generation module includes:
[0080] An information acquisition sub-module, configured to acquire the selection order corresponding to each selection texture map, and the position information within the masked area, where the position information includes the upper-layer mask parameter and the lower-layer mask parameter of the selection texture map;
[0081] A splicing displacement calculation sub-module, configured to calculate the splicing displacement corresponding to each selection texture map by using the upper-layer mask parameter and / or the lower-layer mask parameter corresponding to each selection texture map;
[0082] A target texture map generation sub-module, configured to splice several selection texture maps corresponding to the original texture map according to the selection order and the splicing displacement, and generate a first target texture map corresponding to each original texture map.
[0083] Optionally, the splicing displacement calculation sub-module is specifically configured to:
[0084] Calculate the splicing displacement corresponding to each selection texture map by using the upper-layer mask parameter corresponding to each selection texture map;
[0085] And / or, calculate the splicing displacement corresponding to each selection texture map by using the lower-layer mask parameter corresponding to each selection texture map.
[0086] Optionally, the splicing displacement calculation sub-module is specifically configured to:
[0087] Calculate the splicing displacement corresponding to each selection texture map by using the upper-layer mask parameter corresponding to each selection texture map and the first selection adjustment parameter corresponding to the upper-layer mask parameter;
[0088] And / or, calculate the splicing displacement corresponding to each selection texture map by using the lower-layer mask parameter corresponding to each selection texture map and the second selection adjustment parameter corresponding to the lower-layer mask parameter.
[0089] Optionally, the original texture map at least includes a base color texture map, a blend texture map, and a normal texture map.
[0090] Optionally, it further includes:
[0091] A grayscale conversion module, configured to perform grayscale processing on the first target texture map to obtain a corresponding grayscale texture map;
[0092] A brightness detection image display module, which is used to perform coloring processing on the grayscale map according to a preset grayscale threshold and display the brightness detection image of the first target map;
[0093] A brightness correction module, which is used to obtain the grayscale information of the brightness detection image and correct the brightness detection image of the first target map according to the grayscale information to generate a second target map.
[0094] Optionally, the brightness detection image display module includes:
[0095] A parameter acquisition sub-module, which is used to acquire the map grayscale value of each pixel point in the grayscale map and the brightness detection threshold for the first target map;
[0096] A detection image generation sub-module, which is used to perform brightness detection on the first target map according to the map grayscale value of each pixel point and the brightness detection threshold and display the brightness detection image of the first target map.
[0097] Optionally, the brightness detection threshold includes a first metal brightness threshold, a second metal brightness threshold, a first non-metal brightness threshold, and a second non-metal brightness threshold. The second metal brightness threshold is greater than the first metal brightness threshold, and the second non-metal brightness threshold is greater than the first non-metal brightness threshold. The detection image generation sub-module is specifically used for:
[0098] Coloring the pixel points in the first target map with a map grayscale value less than the first metal brightness threshold into a first color, and coloring the pixel points with a map grayscale value greater than the second metal brightness threshold into a second color to obtain the metal detection image of the first target map;
[0099] Coloring the pixel points in the first target map with a map grayscale value less than the first non-metal brightness threshold into a first color, and coloring the pixel points with a map grayscale value greater than the second metal brightness threshold into a second color to obtain the non-metal detection image of the first target map;
[0100] Obtain the metal channel image corresponding to the first target map;
[0101] Perform image mixing on the metal detection image, the non-metal detection image, and the metal channel image and display the brightness detection image of the first target map.
[0102] Optionally, the detection image generation sub-module is specifically used for:
[0103] Perform grayscale processing on the metal detection image to obtain a metal grayscale image;
[0104] Perform grayscale processing on the non-metal detection image to obtain a non-metal grayscale image;
[0105] Stitch the metal grayscale image and the non-metal grayscale image to obtain a detection area image corresponding to the first target map;
[0106] Perform image mixing using the metal detection image, the non-metal detection image, the metal channel image, and the detection area image to display a brightness detection image of the first target map.
[0107] Optionally, the grayscale information includes the metal grayscale values of each pixel point in the metal grayscale image and the non-metal grayscale values of each pixel point in the non-metal grayscale image. The brightness correction module includes:
[0108] A first abnormal area determination sub-module, configured to perform brightness area division on the metal grayscale image using the metal grayscale value, the first metal brightness threshold, and the second metal brightness threshold to obtain a metal brightness abnormal area corresponding to the metal grayscale image;
[0109] A second abnormal area determination sub-module, configured to perform brightness area division on the non-metal grayscale image using the non-metal grayscale value, the first non-metal brightness threshold, and the second non-metal brightness threshold to obtain a non-metal brightness abnormal area corresponding to the non-metal grayscale image;
[0110] A brightness correction sub-module, configured to perform brightness correction on the first target map by performing brightness mixing on the first target map and the metal brightness abnormal area, and mixing the first target map and the non-metal brightness abnormal area in response to a brightness mixing operation, and generating a second target map.
[0111] Optionally, the first abnormal area determination sub-module is specifically configured to:
[0112] Use the pixel points in the metal grayscale image whose metal grayscale values are less than the first metal brightness threshold to construct a first over-dark area corresponding to the metal grayscale image;
[0113] Use the pixel points in the metal grayscale image whose metal grayscale values are greater than the second metal brightness threshold to construct a first over-bright area corresponding to the metal grayscale image.
[0114] Optionally, the second abnormal area determination sub-module is specifically configured to:
[0115] Use the pixel points in the non-metal grayscale image whose non-metal grayscale values are less than the first non-metal brightness threshold to construct a second over-dark area corresponding to the non-metal grayscale image;
[0116] Construct a second over-bright region corresponding to the non-metal grayscale image by using the pixel points in the non-metal grayscale image whose non-metal grayscale values are greater than the second non-metal brightness threshold.
[0117] Optionally, the brightness correction sub-module is specifically configured to:
[0118] In response to the brightness mixing subtraction operation, determine the subtraction amplitude corresponding to the brightness mixing subtraction operation, and perform image superposition of the first target map and the first over-bright region according to the subtraction amplitude to correct the brightness of the first over-bright region, and perform image superposition of the first target map and the second over-bright region to correct the brightness of the second over-bright region;
[0119] In response to the brightness mixing addition operation, determine the addition amplitude corresponding to the brightness mixing addition operation, and perform image superposition of the first target map and the first over-dark region according to the addition amplitude to correct the brightness of the first over-dark region, and perform image superposition of the first target map and the second over-dark region to correct the brightness of the second over-dark region, and generate a second target map corresponding to the first target map.
[0120] An embodiment of the present invention also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus;
[0121] The memory is used to store a computer program;
[0122] When the processor is used to execute the program stored on the memory, it implements the method described in the embodiment of the present invention.
[0123] An embodiment of the present invention also discloses a computer-readable storage medium, on which instructions are stored. When executed by one or more processors, the processors execute the method described in the embodiment of the present invention.
[0124] The embodiments of the present invention have the following advantages:
[0125] In an embodiment of the present invention, when it is necessary to splice a sticker set, at least one target sticker set can be obtained, the selection area parameters for each original sticker in the target sticker set can be determined, and the original stickers can be regionally selected according to the selection area parameters to obtain several selected area stickers for each original sticker. For the same original sticker, the several selected area stickers corresponding to it can be spliced to obtain the first target sticker corresponding to the original sticker, realizing automatic selection of areas for each original sticker in the target sticker set and splicing according to the selected areas to generate new stickers. In this process, by simultaneously selecting areas and splicing multiple stickers in the same sticker set, batch processing of stickers is realized, effectively improving the efficiency of sticker splitting and splicing. Description of the Drawings
[0126] Figure 1 is a flowchart of the steps of a method for processing stickers provided in an embodiment of the present invention;
[0127] Figure 2 is a schematic diagram of gray-scale gradient provided in an embodiment of the present invention;
[0128] Figure 3 is a schematic diagram of unidirectional area selection provided in an embodiment of the present invention;
[0129] Figure 4 is a schematic diagram of unidirectional area selection provided in an embodiment of the present invention;
[0130] Figure 5 is a schematic diagram of bidirectional area selection provided in an embodiment of the present invention;
[0131] Figure 6 is a schematic diagram of the movement of the selected area sticker provided in an embodiment of the present invention;
[0132] Figure 7 is a calculation node for the splicing displacement provided in an embodiment of the present invention;
[0133] Figure 8 is a calculation node for the splicing displacement provided in an embodiment of the present invention;
[0134] Figure 9 is a calculation node for the splicing displacement provided in an embodiment of the present invention;
[0135] Figure 10 is a schematic flowchart of the detection and correction provided in an embodiment of the present invention;
[0136] Figure 11 is a block diagram of the structure of a sticker processing device provided in an embodiment of the present invention;
[0137] Figure 12 is a block diagram of an electronic device provided in an embodiment of the present invention;
[0138] Figure 13 It is a schematic diagram of a computer-readable storage medium provided in an embodiment of the present invention. Detailed implementation manners
[0139] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation manners.
[0140] As an example, for the reuse of texture maps, especially the reuse of Tiling texture maps, such texture maps can be obtained from many channels, effectively reducing the acquisition of texture map resources and lowering the cost of texture map resource management. For Tiling texture maps, only a part of a texture map may be used in an actual art project, so that the user needs to split the texture map in an image processing software during use, and then splice the required areas to obtain the corresponding texture map. However, there is often more than one texture map in a set of texture maps, and at least 3 texture maps (such as base color texture map, blend texture map, and normal texture map, etc.) can be included. Moreover, the user needs to split multiple sets of texture maps to obtain the corresponding target texture map during use. For example, assume that it is necessary to split from 5 sets of texture maps, with 3 maps in each set, then a total of 15 maps need to be split, and different areas need to be selected for each map, thus bringing a huge workload to the user and greatly reducing the efficiency of texture map splitting and splicing. In addition, during the splitting and splicing process, the rendering effect cannot be previewed in real time, which exacerbates the inconvenience of texture map selection, and the quality of texture maps is uneven, easily resulting in a low quality of the spliced texture map.
[0141] In this regard, one of the core inventive points of the embodiments of the present invention lies in realizing batch processing of texture maps by constructing an automated process for texture map splitting and splicing, improving the efficiency of texture map splitting and splicing. At the same time, quality inspection is carried out on the spliced texture maps, and the texture maps with abnormal images in the inspection results are corrected to ensure the image quality of the spliced texture maps. Specifically, at least one target texture map set can be obtained, the selection area parameters for each original texture map in the target texture map set are determined, and the original texture maps are regionally selected according to the selection area parameters to obtain several selected area texture maps for each original texture map. For the same original texture map, the several selected area texture maps corresponding to it can be spliced to obtain the first target texture map corresponding to the original texture map, realizing automatic selection of areas for each original texture map in the target texture map set and splicing according to the selected areas to generate new texture maps. In this process, by simultaneously selecting areas and splicing multiple texture maps in the same texture map set, batch processing of texture maps is realized, effectively improving the efficiency of texture map splitting and splicing. For the quality inspection of images, the target texture maps to be spliced can be grayscale processed to obtain corresponding grayscale texture maps, and then the grayscale texture maps are colored according to a preset grayscale threshold to display the brightness detection image of the spliced target texture maps. Then, the grayscale information for the brightness detection image is obtained, and the brightness detection image of the first target texture map is corrected according to the grayscale information to generate a new texture map. Thus, for the texture maps that need to be quality inspected, by converting the texture maps to grayscale and staining according to the grayscale threshold to display the brightness detection image of the texture maps, real-time rendering and display of the images are realized, enabling the user to intuitively and quickly understand the areas with abnormal brightness in the spliced texture maps. At the same time, after the brightness detection image is determined, correction can be carried out according to the grayscale information, effectively ensuring the quality of the texture maps.
[0142] To enable those skilled in the art to better understand the technical solutions of the embodiments of the present invention, some technical terms involved in the embodiments of the present invention are explained and described below.
[0143] Diffuse texture map. The diffuse color can be the color of an object itself under white light. For example, for green leaves, its diffuse color is green, so the diffuse texture map can be the texture map of the object under white light.
[0144] Normal map, which can be used to store the image of the light and shadow structure of a model. For example, for a flat model texture map, the normal map can contain information about the light and shadow structure in this flat model.
[0145] Mix texture (Mix map), which can contain image information of different channels. For example, the picture color consists of an R channel, a G channel, and a B channel, and each channel is an independent grayscale channel. These three channels can store different information. In the embodiments of the present invention, for the three channels of the mix texture, the R channel can store roughness, the G channel can store metallicity, and the B channel can store ambient occlusion (AO), etc.
[0146] The target texture set, which can include base color texture, normal map, mix texture, etc. Then, for the texture splitting, splicing, etc. involved in the embodiments of the present invention, it can be to synchronously split and automatically splice the base color texture, normal map, and mix texture in a set of target texture sets to generate new textures.
[0147] Specifically, referring to Figure 1 , a step flowchart of a method for processing textures provided in the embodiments of the present invention is shown, which can specifically include the following steps:
[0148] Step 101, obtain at least one target texture set, where the target texture set includes several original textures;
[0149] In a specific implementation, it is possible to first determine the texture set that needs to be spliced and split, and then input each original texture in the selected target texture set for automatic splitting and splicing of the textures.
[0150] Optionally, for the automatic splitting and splicing of textures, it can be modularized to build a corresponding plug-in. The plug-in can include a switch node. Through the switch node, the texture set to be split and spliced this time can be selected, and then the base color texture, normal map, and mix texture in the selected target texture set are split and automatically spliced to generate new textures.
[0151] Step 102, determine the selection area parameters for the original texture, and perform area selection on the original texture according to the selection area parameters to obtain several selected area textures corresponding to the original texture;
[0152] When the target texture set is determined, it is possible to first synchronously perform selection on each original texture in the target texture set to achieve texture splitting. It can be understood that the selection process for each texture is basically the same. In the following embodiments, the selection process of a certain texture is taken as an example for illustrative purposes. It can be understood that the processing process is performed synchronously for all original textures.
[0153] In the embodiments of the present invention, for the original texture map, it is possible to perform a selection area on it through a Mask node. Through the Mask node, a corresponding mask area can be generated on the original texture map, and the mask area can be used to select the required area from the original texture map as the selected area texture map. For an original texture map, multiple selection area processes can be performed on it respectively to obtain several selected area texture maps. Optionally, the selection area process for the same original texture map is also carried out synchronously. For example, assuming that 8 selection areas need to be selected from the original texture map, 8 corresponding selection area parameters can be set, and the area of the original texture map can be selected simultaneously according to these 8 selection area parameters to obtain 8 corresponding selected area texture maps, etc. The present invention does not limit this.
[0154] For the mask area, it can be a selection of black-and-white relationship areas. The black areas are transparent and the white areas are opaque, that is, the places where the texture map is covered by the black areas are not displayed, and the original content of the texture map is displayed in the white areas. Thus, by adjusting the positions of the black areas and the white areas, the area selection of the original texture map can be achieved, and the corresponding selected area texture map can be obtained. Specifically, for a conventional Mask node, when expanding the selection area (white area), it will spread to both sides simultaneously, making it difficult to accurately select the target area. And when moving the position of the selection area, the upper and lower breakpoints will move simultaneously, resulting in the need to re-determine the range.
[0155] In this regard, during the process of performing the selection area process, a function node can be written through a pixel processor (Pixel Processor) so as to control the position of the selection area through the exposed parameters of the function node. In a specific implementation, through the way of exposing parameters, the selection area parameters for the original texture map can be determined, and the area of the original texture map can be selected according to the selection area parameters to obtain several selected area texture maps corresponding to the original texture map. Among them, in the Mask node, the selection area parameters can be the parameters for determining the selection area of the mask area. The number of selection area parameters indicates how many times the original texture map needs to be selected, so that several corresponding selected area texture maps can be obtained.
[0156] In an alternative embodiment, for the selection area process of the original texture map, first, the mask area for the original texture map and the gray scale parameters of the mask area can be obtained. Then, the area in the mask area where the gray scale parameters are greater than the selection area parameters is used as the selection area, and the area where the gray scale parameters are less than the selection area parameters is used as the mask area. Then, the mask area is masked on the original texture map, and the texture map area located in the selection area is used as the selected area texture map corresponding to the original texture map.
[0157] Among them, the grayscale parameter of the mask area can characterize the grayscale gradient of the texture map, that is, the grayscale gradient process from 0 to 1. 0 represents black and 1 represents white. For the grayscale gradient of the mask area, it can be from 0 to 1 from top to bottom, that is, the grayscale gradient process from black to white. The values between 0 and 1 can be the transition process, corresponding to the corresponding decimals. During the selection process, the grayscale parameter of the mask area can be represented by Y, and the value range is from 0 to 1. Refer to Figure 2 , which shows the schematic diagram of the grayscale gradient provided in the embodiment of the present invention. From left to right, it corresponds to the pixel processor, the selection area parameter setting, and the grayscale change of the mask area. Corresponding function nodes can be written in the pixel processor to expose and control the parameters; in the selection area parameter setting, Figure 2 shows the case where the selection area parameter X is 1, that is, the entire texture map is selected; in the grayscale change of the mask area, it can be a grayscale gradient from top to bottom, that is, the gradient process from black to white. It can be understood that when it is from 0 to 1 from bottom to top, the grayscale gradient can be a grayscale gradient from bottom to top, etc. The present invention does not limit this.
[0158] For the selection area parameter, it can be a position definition relationship, and the value range can be from 0 to 1, which can be represented by X. During the selection process, by comparing the selection area parameter with the grayscale parameter and controlling the black and white areas corresponding to the mask area (that is, the mask area and the selection area) according to the comparison result. After determining the mask area, the position masked by the mask area in the original texture map is not displayed, and the content of the original texture map is displayed in the selection area, and the texture map area within the selection area is used as the selection texture map corresponding to the corresponding selection area parameter. Thus, when there are N selection area parameters, selection can be performed simultaneously, and N selection texture maps corresponding to the original texture map can be obtained.
[0159] In one example, through numerical magnitude comparison, the comparison result is input into the If node for determination. In the mask area, the area where X>Y outputs 0, that is, the area where the selection area parameter is greater than the grayscale parameter is used as the mask area; the area where X<Y outputs 1, that is, the area where the selection area parameter is less than the grayscale parameter is used as the selection area. Thus, for a certain selection area parameter of the original texture map, by comparing it with the grayscale parameter of the mask area corresponding to the Mask node, the selection area corresponding to the selection area parameter can be determined, and the texture map area displayed in the selection area is used as the selection texture map corresponding to the selection area parameter. For example, assuming the selection area parameter is 0.5, then half of the mask area is the mask area and half is the selection area. Correspondingly, the texture map area corresponding to the selection area in the original texture map can be used as the selection texture map; assuming the selection area parameter is 0.25, then one-fourth of the mask area is the mask area and three-fourths is the selection area, etc. The present invention does not limit this.
[0160] In another alternative embodiment, when making a selection area for the original texture map, on the one hand, rough selection can be performed through selection area parameters, and the selection area parameters can also be finely adjusted by adjusting the parameters to achieve refined selection. Specifically, the first selection area parameter for the original texture map and the selection area adjustment parameter for the first selection area parameter can be obtained, and then the second selection area parameter can be calculated using the first selection area parameter and the selection area adjustment parameter. During the selection area process, the mask area for the original texture map and the grayscale parameter of the mask area can be obtained first. Then, the area in the mask area where the grayscale parameter is greater than the second selection area parameter is used as the selection area, and the area where the grayscale parameter is less than the second selection area parameter is used as the mask area. Then, the mask area is masked on the original texture map, and the texture map area within the selection area is used as the selected texture map corresponding to the original texture map.
[0161] In a specific implementation, while making a selection area for the original texture map by setting the corresponding selection area parameters through the Mask node, in order to improve the accuracy of the selection area, corresponding adjustment parameters can also be set for the selection area parameters, and the selection area range corresponding to the selection area parameters can be finely adjusted through these adjustment parameters to achieve a higher-precision selection area. Specifically, an adjustment variable can be added using the Add node, and the corresponding adjustment amplitude is multiplied on this adjustment variable to obtain the adjustment parameter. Then, based on the selection area parameter, the adjustment parameter is added to obtain the target selection area parameter. Then, the target selection area parameter is compared with the grayscale parameter corresponding to the mask area to determine the selected texture map. Optionally, for the determination of the selected texture map, the above process can be referred to and will not be elaborated here.
[0162] In one example, the adjustment variable can include 0 and positive integers. Assuming the selection area parameter is 0.314 and the adjustment amplitude is 0.02, the adjustment amplitude can be controlled by controlling the adjustment variable. For example, if the adjustment variable is set to 1, the selection area parameter can be finely adjusted from 0.314 to (0.314 + 1 * 0.02), achieving fine adjustment of the selection area. Thus, by finely adjusting the selection area parameter, the accuracy of the texture map area selection is improved, and further the accuracy of the texture map selection area is ensured.
[0163] In another alternative embodiment, when making a selection area for the original texture map, the selection can be made from one direction or simultaneously from two opposite directions to achieve two-way selection. Among them, for the selection area parameters, they can include a first selection area parameter corresponding to the first grayscale gradient direction and a second selection area parameter corresponding to the second grayscale gradient direction. Since the first grayscale gradient direction is opposite to the second grayscale gradient direction, then in accordance with the first grayscale gradient direction, the area in the mask area where the grayscale parameter is greater than the first selection area parameter can be used as the first selection area, and the area where the grayscale parameter is less than the first selection area parameter can be used as the first mask area. At the same time, in accordance with the second grayscale gradient direction, the area in the mask area where the grayscale parameter is greater than the second selection area parameter can be used as the second selection area, and the area where the grayscale parameter is less than the second selection area parameter can be used as the second mask area. Then, the mask area can be masked on the original texture map, and the first mask area and the second mask area are used to mask the original texture map, and the texture map area that is simultaneously located in the first selection area and the second selection area is used as several selection texture maps corresponding to the original texture map.
[0164] Optionally, the first grayscale gradient direction is the grayscale gradient direction from top to bottom in the mask area; the second grayscale gradient direction is the grayscale gradient direction from bottom to top in the mask area. For example, for the first grayscale gradient direction, the grayscale gradient from top to bottom in the mask area can be from 0 to 1; correspondingly, for the second grayscale gradient direction, the grayscale gradient from bottom to top in the mask area can be from 0 to 1. Thus, by determining different grayscale gradient directions and corresponding selection area parameters, two-way selection of the original texture map can be achieved, improving the efficiency of texture map selection.
[0165] In specific implementation, the selection direction identifier can be configured at the corresponding selection area node, including inputting "upper half" in the selection area node, which represents that the grayscale gradient direction corresponding to this selection area node is the grayscale gradient from top to bottom, and the selection area parameters associated with this selection area node represent the parameters for selection from top to bottom; inputting "lower half" in the selection area node, which represents that the grayscale gradient direction corresponding to this selection area node is the grayscale gradient from bottom to top, and the selection area parameters associated with this selection area node represent the parameters for selection from bottom to top. Thus, when the Mask node makes a selection for the original texture map, it can control the selection area from the upper and lower edges respectively. At the same time, if the selection area parameters correspond to adjustment parameters, fine-tuning can be further performed according to the adjustment parameters. The relevant process can refer to the above description and will not be elaborated here.
[0166] During the process of two-way selection, for the same direction, the process of one-way selection can be referred to for the selection of the mapped area. After determining the first mask area and the first selection area corresponding to the first selection parameters, and the second mask area and the second selection area corresponding to the second selection parameters, there may be an overlap between the first mask area and the second selection area. Then, the overlapping part can be used as the mask area. Similarly, the overlapping part between the second mask area and the first selection area can be used as the mask area, and the overlapping part of the first selection area and the second selection area can be used as the target selection area. Then, the mapped area displayed within the target selection area is used as the mapped area corresponding to the original map.
[0167] In one example, referring to Figure 3 , a schematic diagram of one-way selection provided in an embodiment of the present invention is shown. It can perform selection from top to bottom. Specifically, Y represents a vertical black and white gradient, that is, 0 at the top and 1 at the bottom. Then, there is a constant $pos (the value range of the constant is 0 - 1, which is the selection parameter X) compared with Y. The node "> greater than" is used and then input into the IF node. The IF node makes a judgment. When the constant is greater than Y, the output is 0; otherwise, the output is 1. When the constant is 0.314, the black area is as Figure 3 shown. Referring to Figure 4 , a schematic diagram of one-way selection provided in an embodiment of the present invention is shown. It can also perform selection from top to bottom. The difference from Figure 3 is that it adds fine-tuning parameters. By adding an add node to the node corresponding to the selection parameter, fine-tuning parameters are added, and the fine-tuning value and the number of fine-tuning are set. For example, the fine-tuning value is 0.02, and the number of fine-tuning times is 0, 1, 2, etc. Referring to Figure 5 , a schematic diagram of two-way selection provided in an embodiment of the present invention is shown. Based on one-way selection, corresponding selection directions (corresponding nodes), such as "upper half", "lower half", etc., are added to the processing nodes corresponding to the selection parameters to achieve two-way selection from top to bottom and from bottom to top.
[0168] Through the above process, for each original map in the target map set, the original map can be selected according to several corresponding selection parameters to obtain several mapped areas corresponding to the original map. Thus, for the original map, through batch splitting, on the one hand, the efficiency of map splitting is effectively improved, and on the other hand, the map can be selected as needed, which can meet the actual needs of users.
[0169] Step 103: Stitch the several mapped areas corresponding to the original map to obtain the first target map corresponding to each original map.
[0170] For each original texture, after selecting it, several selected textures can be obtained. Then, all the selected textures corresponding to an original texture can be spliced together to obtain the first target texture corresponding to the original texture. Optionally, for the selection of the Mask node, it is done by displaying the required area and hiding the unnecessary area. In other words, for the original texture itself, assuming it is 1024*1024, its size is still 1024*1024 after the selection. If splicing is performed directly, multiple selected textures will overlap. Therefore, each selected texture needs to be moved first, and then spliced together to obtain a new texture.
[0171] In a specific implementation, for the splicing of selection maps, you can first obtain the selection order corresponding to each selection map, and the position information in the corresponding mask area, the position information includes the upper mask parameters and the lower mask parameters of the selection map, then use the upper mask parameters and / or lower mask parameters corresponding to each selection map to calculate the splicing displacement corresponding to each selection map, and then splice several selection maps corresponding to the original map according to the selection order and the splicing displacement to generate a first target map corresponding to each original map.
[0172] Among them, the selection order can be the order corresponding to the selection nodes when the original map is selected as mentioned above; for the upper mask parameters and the lower mask parameters, if the selection process is through two-way selection, then for the selection map, it can correspond to the upper mask area and the lower mask area, if the selection process is from top to bottom, then for the selection map, it can correspond to the upper mask area, if the selection process is from bottom to top, then for the selection map, it can correspond to the lower mask area, in this regard, the position of the selection map can be controlled and exposed through the function node to obtain the upper mask parameters and / or lower mask parameters corresponding to the selection map, wherein the mask parameters can be used to characterize the distance that the selection map moves, for example, refer to Figure 6 , shows a schematic diagram of the movement of the selection map provided in an embodiment of the present invention, from left to right are respectively the original position of the selection, the position without parameter adjustment, the moved position of the selection, and the parameter adjustment. Specifically, the position information to be moved can be input in the parameter adjustment node to control the movement of the selection map. For example, if the upper mask parameter is "0.428", the selection map needs to be moved up by 0.428. Similarly, the lower mask parameter is how much, the selection map needs to be moved down by how much, so that the display position can be adjusted by moving the selection map, which is convenient for splicing the selection maps.
[0173] In a specific implementation, after determining the upper mask parameters and / or lower mask parameters corresponding to the selected area texture maps, the upper mask parameters corresponding to each selected area texture map can be used to calculate the splicing displacement for each selected area texture map; and / or, the lower mask parameters corresponding to each selected area texture map can be used to calculate the splicing displacement for each selected area texture map. If there are adjustment parameters during the selection process, the upper mask parameters corresponding to each selected area texture map and the first selection area adjustment parameters corresponding to the upper mask parameters can be used to calculate the splicing displacement for each selected area texture map; and / or, the lower mask parameters corresponding to each selected area texture map and the second selection area adjustment parameters corresponding to the lower mask parameters can be used to calculate the splicing displacement for each selected area texture map. Thus, by calculating the splicing displacements corresponding to each selected area texture map and moving the selected area texture maps according to the splicing displacements, each selected area texture map can be moved to the corresponding splicing position and automatically perform texture map splicing to generate a first target texture map corresponding to each original texture map.
[0174] For example, the selection order of each selected area texture map can be determined first so that subsequent splicing can be performed according to the selection order. Then, the function node can be used to expose the position information of the selected area texture maps to obtain the upper mask parameters and / or lower mask parameters corresponding to each selected area texture map. The value of the mask parameter indicates how much the selected area texture map needs to be moved up or down. Thus, through the above logical relationship, no matter how many selected area texture maps need to be spliced, the selected area texture maps can be automatically moved to the splicing position by inputting the moved positions of the upper and lower boundaries into the corresponding nodes. Optionally, if the number of selected area texture maps is larger, the calculation amount is greater. Suppose there are 8 selected area texture maps. The calculation logic for the 8th selected area texture map is as follows: the sum of the upper half movement ranges of the 1st - 7th selected area texture maps (if there are fine-tuning values, they also need to be added), the difference with the upper half value of the 1st - 8th selected area texture maps, and the output value also needs to be added with the sum of the lower half movement ranges of the 1st - 7th selected area texture maps (if there are fine-tuning values, they also need to be added) minus 1. The specific formula can be: {1 - upper half of 8 - upper half of (1 + 2 + 3 + 4 + 5 + 6 + 7)} + {lower half of (1 + 2 + 3 + 4 + 5 + 6 + 7) - 1}. When there are adjustment parameters, the corresponding adjustment parameters need to be added. Thus, automatic selection of each original texture map in the target texture map set and splicing according to the selected area are realized, generating a new texture map. In this process, by simultaneously performing selection and splicing on multiple texture maps in the same texture map set, batch processing of texture maps is realized, effectively improving the efficiency of texture map splitting and splicing. Refer to Figure 7, which shows the calculation nodes for the splicing displacement provided in the embodiments of the present invention. When there are 8 selected areas and the movement is for the upper mask parameters, the values of the upward movement corresponding to each selected area can be processed to obtain the splicing displacement of the upper half of the 8 selected areas. In this process, the corresponding movement direction nodes can be used to mark the direction in which the selected area moves, such as "upper half", "lower half" nodes, etc. For example, Figure 7 shows the calculation of the splicing displacement of the selected areas in the upper half, Figure 8 shows the calculation of the splicing displacement of the selected areas in the lower half, Figure 9 shows the calculation of the splicing displacement of the selected areas in both the upper half and the lower half. In addition, when fine-tuning parameters are involved, nodes corresponding to the fine-tuning parameters can be added, which will not be elaborated here.
[0175] It can be understood that in the above example, taking the splitting and splicing of one of the original texture maps as an example for illustrative purposes, for other original texture maps, the corresponding processing nodes can be copied. The number of copies is the same as the number of original texture maps, and the corresponding original texture map is specified as the input, so as to realize the splitting and splicing of each original texture map in the target texture map set. For example, the base color texture map, normal map, and blend map can be used as inputs for the splitting and splicing of the texture maps, and then the corresponding target texture maps are output respectively, thus realizing the batch processing of texture maps and effectively improving the efficiency of texture map splitting and splicing.
[0176] In other alternative embodiments, the present invention also discloses an image processing method, which can perform brightness detection on the first target texture map (for example, it can be the spliced first target texture map or the first target texture map that needs to be subjected to image specification detection, etc.) to determine whether the spliced texture map meets the corresponding picture specifications, so as to ensure the picture quality of the automatically spliced texture map through detection. Specifically, the first target texture map can be first grayscale processed to obtain the corresponding grayscale texture map, and then the grayscale texture map is colored according to a preset grayscale threshold to display the brightness detection image of the first target texture map. Then, the grayscale information for the brightness detection image can be obtained, and the brightness detection image of the first target texture map is corrected according to the grayscale information to generate the second target texture map. Thus, for the spliced texture map, the texture map can be grayscale converted, and the brightness detection image of the texture map is displayed by staining according to the grayscale threshold, realizing the real-time rendering display of the image, enabling the user to intuitively and quickly understand the areas with abnormal brightness in the spliced texture map. At the same time, after the brightness detection image is determined, it can be corrected according to the grayscale information, effectively ensuring the quality of the texture map.
[0177] It should be noted that, for the detection and automatic correction process of the texture map, the processing process of one of the first target texture maps is still used for exemplary description. It can be understood that the stitched texture maps corresponding to the same target texture set can also be detected and corrected simultaneously. The present invention does not limit this.
[0178] In a specific implementation, after converting the first target texture map into a grayscale texture map, the texture grayscale values of each pixel point in the grayscale texture map can be obtained, as well as the brightness detection threshold for the first target texture map. Then, the brightness of the first target texture map is detected according to the texture grayscale values of each pixel point and the brightness detection threshold, and the brightness detection image of the first target texture map is displayed. Optionally, for the brightness detection threshold, it can be a threshold for detecting whether the brightness of each pixel point in the first target texture map is abnormal. For abnormal brightness, it can include that the pixel point is too bright and the pixel point is too dark, etc. Thus, after converting the first target texture map into a grayscale texture map, the grayscale value corresponding to each pixel point can be obtained, so as to determine the brightness of the texture map through the grayscale value, and the brightness detection of the first target texture map is realized through the comparison relationship between the brightness detection threshold and the grayscale values of each pixel point.
[0179] For the brightness detection threshold, it can include a first metal brightness threshold, a second metal brightness threshold, a first non-metal brightness threshold, and a second non-metal brightness threshold. The second metal brightness threshold is greater than the first metal brightness threshold, and the second non-metal brightness threshold is greater than the first non-metal brightness threshold. Among them, the metal brightness threshold can be the brightness threshold related to metal in the texture map, and the non-metal brightness threshold can be the brightness threshold related to non-metal in the texture map. It can be understood that for the texture map, its grayscale change is between 0 and 1. Then, if it is less than the first metal brightness threshold or less than the first non-metal brightness threshold, it can be determined that the pixel point is too dark. If it is greater than the second metal brightness threshold or less than the second non-metal brightness threshold, it can be determined that the pixel point is too bright. Thus, by comparing the grayscale values of each pixel point in the grayscale texture map with the corresponding brightness detection threshold, the normal brightness area, the too bright area, and the too dark area, etc. in the first target texture map can be detected, and the brightness detection of the stitched texture map is realized for brightness correction.
[0180] It should be noted that for the metal brightness threshold and the non-metal brightness threshold, both can be configured according to actual needs and detected independently, and can be different values. The present invention does not limit this.
[0181] Specifically, for the brightness detection of the first target texture map, it is possible to color the pixel points in the first target texture map with a texture gray value less than the first metal brightness threshold as the first color, and color the pixel points with a texture gray value greater than the second metal brightness threshold as the second color to obtain the metal detection image of the first target texture map, and color the pixel points in the first target texture map with a texture gray value less than the first non-metal brightness threshold as the first color, and color the pixel points with a texture gray value greater than the second metal brightness threshold as the second color to obtain the non-metal detection image of the first target texture map. Then, obtain the metal channel image corresponding to the first target texture map, and then perform image blending using the metal detection image, the non-metal detection image, and the metal channel image to display the brightness detection image of the first target texture map.
[0182] For the metal detection image and the non-metal detection image, the brightness detection can be independently performed through two identical processing nodes, and the first color and the second color can be different colors. Among them, the pixel points of the first color can be pixel points with too dark brightness, and the pixel points of the second color can be pixel points with too bright brightness. Thus, by coloring the areas with abnormal brightness in the texture map with different colors and rendering and displaying them, users can intuitively and quickly understand the areas with abnormal brightness in the texture map, which is convenient for users to perform brightness correction manually or automatically.
[0183] In one example, for the metal brightness threshold, the first metal brightness threshold can be set to 0.45, and the second metal brightness threshold can be set to 0.8. The processing node can be a Gradient Map node. Then, the Gradient Map can be used to perform gray conversion on the first target texture map to obtain the corresponding gray texture map. Then, obtain the gray value corresponding to each pixel point in the gray texture map, and display the pixel points with a gray value less than 0.45 as blue, and display the pixel points with a gray value greater than 0.8 as red. Thus, the areas with too dark brightness in the texture map are displayed in blue, and the areas with too bright brightness in the texture map are displayed in red to obtain the metal detection image corresponding to the first target texture map.
[0184] Similarly, for the non-metal brightness threshold, the first non-metal brightness threshold can be set to 0.40, and the second non-metal brightness threshold can be set to 0.75. The processing node can also be a Gradient Map node. Then, the Gradient Map node can be used to perform gray conversion on the first target texture map to obtain the corresponding gray texture map. Then, obtain the gray value corresponding to each pixel point in the gray texture map, and display the pixel points with a gray value less than 0.45 as blue, and display the pixel points with a gray value greater than 0.8 as red. Thus, the areas with too dark brightness in the texture map are displayed in blue, and the areas with too bright brightness in the texture map are displayed in red to obtain the non-metal detection image corresponding to the first target texture map.
[0185] It should be noted that the brightness detection threshold is not a fixed value and can be set according to actual needs. The embodiments of the present invention include but are not limited to the above-mentioned values.
[0186] Optionally, both the metal detection image and the non-metal detection image only represent the brightness detection result of the texture in the metal or non-metal condition, and image synthesis is required to obtain the final image detection result of the texture. Among them, the metal channel image can be the image of the metal channel of the texture. In a specific implementation, two groups of GradientMap nodes can be used to control the metal and non-metal brightness thresholds respectively to perform brightness detection on the map to obtain a corresponding detection image. After the detection is completed, the metal detection image is grayscale processed to obtain a metal grayscale image, and the non-metal detection image is grayscale processed to obtain a non-metal grayscale image. The metal grayscale image is then spliced with the non-metal grayscale image to obtain a detection area image corresponding to the first target map. The metal detection image, the non-metal detection image, the metal channel image and the detection area image are then mixed to obtain a brightness detection image for the first target map. The brightness detection area may include an overly dark area marked with a first color and an overly bright area marked with a second color. Thus, the map is grayscale converted and the brightness detection image of the map is displayed by dyeing according to the grayscale threshold, thereby realizing real-time rendering and display of the image, so that the user can intuitively and quickly understand the area where the spliced map has brightness abnormalities.
[0187] After the brightness abnormality area in the first target map is determined by brightness detection, the brightness can be automatically corrected. The brightness detection image of the first target map is corrected according to the grayscale information of the brightness detection image to generate the second target map. Among them, the grayscale information includes the metal grayscale value of each pixel in the metal grayscale image and the non-metal grayscale value of each pixel in the non-metal grayscale image. The metal grayscale value, the first metal brightness threshold and the second metal brightness threshold can be used to divide the brightness area of the metal grayscale image to obtain the metal brightness abnormal area corresponding to the metal grayscale image, and the non-metal grayscale value, the first non-metal brightness threshold and the second non-metal brightness threshold can be used to divide the brightness area of the non-metal grayscale image to obtain the non-metal brightness abnormal area corresponding to the non-metal grayscale image. The brightness abnormal area corresponding to the first target map can be obtained through the grayscale information and the brightness detection threshold. Then, in response to the brightness mixing operation, the first target map and the metal brightness abnormal area can be brightness mixed, and the first target map can be brightness corrected by mixing the first target map with the non-metal brightness abnormal area to generate the second target map. After the brightness detection image is determined, the brightness correction can be performed according to the grayscale information, which effectively ensures the quality of the map.
[0188] Among them, for the metal grayscale image, pixel points with metal grayscale values less than the first metal brightness threshold in the metal grayscale image can be used to construct a first over - dark area corresponding to the metal grayscale image, and pixel points with metal grayscale values greater than the second metal brightness threshold in the metal grayscale image can be used to construct a first over - bright area corresponding to the metal grayscale image. For the non - metal grayscale image, pixel points with non - metal grayscale values less than the first non - metal brightness threshold in the non - metal grayscale image can be used to construct a second over - dark area corresponding to the non - metal grayscale image, and pixel points with non - metal grayscale values greater than the second non - metal brightness threshold in the non - metal grayscale image can be used to construct a second over - bright area corresponding to the non - metal grayscale image. Optionally, the Gradient Map node can also be used, and the corresponding brightness detection threshold (consistent with the automatically detected brightness detection threshold in the previous process) can be set to obtain 4 brightness abnormal areas corresponding to the first target texture map, including the first over - bright area and the first over - dark area of the metal, and the second over - bright area and the second over - dark area of the non - metal.
[0189] After determining the brightness abnormal areas, the Blend node (mixing node) can be used in cooperation with the brightness image (i.e., the grayscale images corresponding to the first over - bright area, the first over - dark area, the second over - bright area, and the second over - dark area, etc.) to automatically correct the brightness of the first target texture map. Specifically, the Blend node can include a subtraction mode and an addition mode. Then, in response to the brightness mixing subtraction operation, the subtraction amplitude corresponding to the brightness mixing subtraction operation can be determined, and the first target texture map and the first over - bright area can be image - superimposed according to the subtraction amplitude to correct the brightness of the first over - bright area, the first target texture map and the second over - bright area can be image - superimposed to correct the brightness of the second over - bright area. And in response to the brightness mixing addition operation, the addition amplitude corresponding to the brightness mixing addition operation can be determined, and the first target texture map and the first over - dark area can be image - superimposed according to the addition amplitude to correct the brightness of the first over - dark area, the first target texture map and the second over - dark area can be image - superimposed to correct the brightness of the second over - dark area, generating a second target texture map corresponding to the first target texture map.
[0190] For example, the brightness levels can be blended by using a Blend node in combination with a brightness mask (grayscale image of the detected image generated by a Gradient Map). Specifically, for overly bright areas, the Subtract mode can be used for overlaying by subtracting the grayscale image corresponding to the overly bright area generated by the Gradient Map from the first target texture map; for overly dark areas, the Add mode can be used for overlaying by adding the grayscale image corresponding to the overly dark area generated by the Gradient Map to the first target texture map. Meanwhile, the correction intensity can be controlled by adjusting the Opacity. Thus, by performing brightness detection on the texture maps generated through automatic splitting and stitching, on the one hand, different shadings can be used to display the areas with abnormal brightness, enabling users to intuitively and quickly identify the areas with abnormal brightness in the texture maps. On the other hand, the areas with abnormal brightness can be automatically corrected, effectively ensuring the quality of the texture maps.
[0191] Optionally, for the detection and correction of texture maps, refer to Figure 10 , which shows a schematic flowchart of the detection and correction provided in an embodiment of the present invention. The input can be a texture map that has been split and stitched, or a texture map that needs to be detected. For the correction area and the detection area, it can be parallel + serial, that is, the detection area and the correction area can work simultaneously, but are affected by the correction control area. At the beginning, the correction is not displayed, and only when the correction control area is enabled can the serial operation between the correction area and the detection area be achieved. That is, after the correction control area and the Debug control area are enabled, the detection area can perform anomaly detection on the texture map, and the correction area can correct the areas with anomalies in the texture map.
[0192] It should be noted that the embodiments of the present invention include but are not limited to the above examples. It can be understood that those skilled in the art can also make settings according to actual needs under the guidance of the ideas of the embodiments of the present invention. The present invention places no restrictions on this.
[0193] In an embodiment of the present invention, when it is necessary to perform stitching processing on a texture map set, at least one target texture map set can be obtained, the selection area parameters for each original texture map in the target texture map set can be determined, and the area selection can be performed on the original texture map according to the selection area parameters to obtain several selected area texture maps for each original texture map. Moreover, for the same original texture map, the several selected area texture maps corresponding to it can be stitched together to obtain the first target texture map corresponding to the original texture map, realizing automatic area selection for each original texture map in the target texture map set and stitching according to the selected areas to generate new texture maps. In this process, by simultaneously performing area selection and stitching on multiple texture maps in the same texture map set, batch processing of texture maps is achieved, effectively improving the efficiency of texture map splitting and stitching.
[0194] It should be noted that, for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the embodiments of the present invention are not limited by the described action sequences, because according to the embodiments of the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0195] Referring to Figure 11 , a structural block diagram of a processing device for a texture map provided in an embodiment of the present invention is shown, which may specifically include the following modules:
[0196] The texture map set acquisition module 1101 is configured to acquire at least one target texture map set, where the target texture map set includes a plurality of original texture maps;
[0197] The selected area texture map determination module 1102 is configured to determine the selection area parameters for the original texture map, and perform area selection on the original texture map according to the selection area parameters to obtain a plurality of selected area texture maps corresponding to the original texture map;
[0198] The target texture map generation module 1103 is configured to splice a plurality of selected area texture maps corresponding to the original texture map to obtain a first target texture map corresponding to each original texture map.
[0199] In an optional embodiment, the selected area texture map determination module 1102 includes:
[0200] The parameter acquisition sub-module is configured to acquire the first selection area parameters for the original texture map and the selection area adjustment parameters for the first selection area parameters;
[0201] The selection area parameter calculation sub-module is configured to calculate the second selection area parameters by using the first selection area parameters and the selection area adjustment parameters.
[0202] In an optional embodiment, the selected area texture map determination module 1102 includes:
[0203] The grayscale parameter acquisition sub-module is configured to acquire the mask area for the original texture map and the grayscale parameters of the mask area;
[0204] The area determination sub-module is configured to use the area in the mask area where the grayscale parameter is greater than the selection area parameter as the selection area, and the area where the grayscale parameter is less than the selection area parameter as the mask area;
[0205] A selected area texture generation sub-module, configured to mask the masked area in the original texture, mask the original texture with the masked area, and use the texture area within the selected area as the selected area texture corresponding to the original texture.
[0206] In an alternative embodiment, the selected area parameters include a first selected area parameter corresponding to a first grayscale gradient direction and a second selected area parameter corresponding to a second grayscale gradient direction, the first grayscale gradient direction being opposite to the second grayscale gradient direction. The area determination sub-module is specifically configured to:
[0207] According to the first grayscale gradient direction, use the area in the masked area with a grayscale parameter greater than the first selected area parameter as the first selected area, and use the area with a grayscale parameter less than the first selected area parameter as the first masked area;
[0208] According to the second grayscale gradient direction, use the area in the masked area with a grayscale parameter greater than the second selected area parameter as the second selected area, and use the area with a grayscale parameter less than the second selected area parameter as the second masked area.
[0209] In an alternative embodiment, the first grayscale gradient direction is a grayscale gradient direction from top to bottom; the second grayscale gradient direction is a grayscale gradient direction from bottom to top.
[0210] In an alternative embodiment, the selected area texture generation sub-module is specifically configured to:
[0211] Mask the masked area in the original texture, mask the original texture with the first masked area and the second masked area, and use the texture area that is simultaneously within the first selected area and the second selected area as several selected area textures corresponding to the original texture.
[0212] In an alternative embodiment, the target texture generation module 1103 includes:
[0213] An information acquisition sub-module, configured to acquire the selected area order corresponding to each selected area texture and the position information in the masked area, where the position information includes the upper-layer masking parameter and the lower-layer masking parameter of the selected area texture;
[0214] A splicing displacement calculation sub-module, configured to calculate the splicing displacement corresponding to each selected area texture by using the upper-layer masking parameter and / or the lower-layer masking parameter corresponding to each selected area texture;
[0215] A target texture generation sub-module, configured to splice several selected area textures corresponding to the original texture according to the selected area order and the splicing displacement to generate a first target texture corresponding to each original texture.
[0216] In an alternative embodiment, the splicing displacement calculation sub-module is specifically configured to:
[0217] Calculate the splicing displacement for each of the selected area texture maps by using the upper mask parameters corresponding to each of the selected area texture maps;
[0218] And / or, calculate the splicing displacement for each of the selected area texture maps by using the lower mask parameters corresponding to each of the selected area texture maps.
[0219] In an alternative embodiment, the splicing displacement calculation sub-module is specifically configured to:
[0220] Calculate the splicing displacement for each of the selected area texture maps by using the upper mask parameters corresponding to each of the selected area texture maps and the first selected area adjustment parameters corresponding to the upper mask parameters;
[0221] And / or, calculate the splicing displacement for each of the selected area texture maps by using the lower mask parameters corresponding to each of the selected area texture maps and the second selected area adjustment parameters corresponding to the lower mask parameters.
[0222] In an alternative embodiment, the original texture map at least includes a base color texture map, a blend texture map, and a normal texture map.
[0223] In an alternative embodiment, it further includes:
[0224] A grayscale conversion module, configured to perform grayscale processing on the first target texture map to obtain a corresponding grayscale texture map;
[0225] A brightness detection image display module, configured to perform coloring processing on the grayscale texture map according to a preset grayscale threshold and display a brightness detection image of the first target texture map;
[0226] A brightness correction module, configured to obtain grayscale information for the brightness detection image and correct the brightness detection image of the first target texture map according to the grayscale information to generate a second target texture map.
[0227] In an alternative embodiment, the brightness detection image display module includes:
[0228] A parameter acquisition sub-module, configured to acquire the texture map grayscale values of each pixel point in the grayscale texture map and the brightness detection threshold for the first target texture map;
[0229] A detection image generation sub-module, configured to perform brightness detection on the first target texture map according to the texture map grayscale values of each of the pixel points and the brightness detection threshold and display a brightness detection image of the first target texture map.
[0230] In an alternative embodiment, the brightness detection threshold includes a first metal brightness threshold, a second metal brightness threshold, a first non-metal brightness threshold, and a second non-metal brightness threshold. The second metal brightness threshold is greater than the first metal brightness threshold, and the second non-metal brightness threshold is greater than the first non-metal brightness threshold. The detection image generation sub-module is specifically configured to:
[0231] Color the pixel points in the first target texture map with texture gray values less than the first metal brightness threshold as a first color, and color the pixel points with texture gray values greater than the second metal brightness threshold as a second color to obtain a metal detection image of the first target texture map;
[0232] Color the pixel points in the first target texture map with texture gray values less than the first non-metal brightness threshold as a first color, and color the pixel points with texture gray values greater than the second metal brightness threshold as a second color to obtain a non-metal detection image of the first target texture map;
[0233] Obtain a metal channel image corresponding to the first target texture map;
[0234] Perform image mixing using the metal detection image, the non-metal detection image, and the metal channel image, and display the brightness detection image of the first target texture map.
[0235] In an alternative embodiment, the detection image generation sub-module is specifically configured to:
[0236] Perform gray-scale processing on the metal detection image to obtain a metal gray-scale image;
[0237] Perform gray-scale processing on the non-metal detection image to obtain a non-metal gray-scale image;
[0238] Stitch the metal gray-scale image and the non-metal gray-scale image together to obtain a detection area image corresponding to the first target texture map;
[0239] Perform image mixing using the metal detection image, the non-metal detection image, the metal channel image, and the detection area image, and display the brightness detection image of the first target texture map.
[0240] In an alternative embodiment, the gray-scale information includes the metal gray-scale values of the pixel points in the metal gray-scale image and the non-metal gray-scale values of the pixel points in the non-metal gray-scale image. The brightness correction module includes:
[0241] The first abnormal area determination sub-module is configured to perform brightness area division on the metal grayscale image by using the metal grayscale value, the first metal lightness threshold, and the second metal lightness threshold, so as to obtain the metal lightness abnormal area corresponding to the metal grayscale image;
[0242] The second abnormal area determination sub-module is configured to perform brightness area division on the non-metal grayscale image by using the non-metal grayscale value, the first non-metal lightness threshold, and the second non-metal lightness threshold, so as to obtain the non-metal lightness abnormal area corresponding to the non-metal grayscale image;
[0243] The brightness correction sub-module is configured to, in response to the lightness mixing operation, perform lightness mixing on the first target texture map and the metal lightness abnormal area, and perform mixing on the first target texture map and the non-metal lightness abnormal area to perform brightness correction on the first target texture map, and generate a second target texture map.
[0244] In an optional embodiment, the first abnormal area determination sub-module is specifically configured to:
[0245] Use the pixel points in the metal grayscale image whose metal grayscale value is less than the first metal lightness threshold to construct the first over-dark area corresponding to the metal grayscale image;
[0246] Use the pixel points in the metal grayscale image whose metal grayscale value is greater than the second metal lightness threshold to construct the first over-bright area corresponding to the metal grayscale image.
[0247] In an optional embodiment, the second abnormal area determination sub-module is specifically configured to:
[0248] Use the pixel points in the non-metal grayscale image whose non-metal grayscale value is less than the first non-metal lightness threshold to construct the second over-dark area corresponding to the non-metal grayscale image;
[0249] Use the pixel points in the non-metal grayscale image whose non-metal grayscale value is greater than the second non-metal lightness threshold to construct the second over-bright area corresponding to the non-metal grayscale image.
[0250] In an optional embodiment, the brightness correction sub-module is specifically configured to:
[0251] In response to the lightness mixing subtraction operation, determine the subtraction amplitude corresponding to the lightness mixing subtraction operation, and perform image superposition on the first target texture map and the first over-bright area according to the subtraction amplitude to perform brightness correction on the first over-bright area, and perform image superposition on the first target texture map and the second over-bright area to perform brightness correction on the second over-bright area;
[0252] In response to the brightness blending addition operation, determine the addition amplitude corresponding to the brightness blending addition operation, and perform image superposition of the first target map and the first over-dark area according to the addition amplitude to correct the brightness of the first over-dark area, and perform image superposition of the first target map and the second over-dark area to correct the brightness of the second over-dark area, and generate a second target map corresponding to the first target map.
[0253] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant parts, refer to the partial description of the method embodiment.
[0254] In addition, the embodiment of the present invention also provides an electronic device, such as Figure 12 shown, including a processor 1201, a communication interface 1202, a memory 1203, and a communication bus 1204. Among them, the processor 1201, the communication interface 1202, and the memory 1203 complete mutual communication through the communication bus 1204.
[0255] The memory 1203 is used to store a computer program.
[0256] When the processor 1201 is used to execute the program stored in the memory 1203, the following steps are implemented:
[0257] Obtain at least one target map set, where the target map set includes several original maps.
[0258] Determine the selection area parameters for the original map, and perform area selection on the original map according to the selection area parameters to obtain several selected area maps corresponding to the original map.
[0259] Stitch the several selected area maps corresponding to the original map to obtain a first target map corresponding to each original map.
[0260] In an optional embodiment, the determining the selection area parameters for the original map includes:
[0261] Obtain the first selection area parameters for the original map and the selection area adjustment parameters for the first selection area parameters.
[0262] Use the first selection area parameters and the selection area adjustment parameters to calculate the second selection area parameters.
[0263] In an optional embodiment, the performing area selection on the original map according to the selection area parameters to obtain several selected area maps corresponding to the original map includes:
[0264] Obtain the mask area for the original map and the grayscale parameters of the mask area.
[0265] Take the area in the mask area where the grayscale parameter is greater than the selection area parameter as the selection area, and the area where the grayscale parameter is less than the selection area parameter as the mask area;
[0266] Mask the mask area on the original texture map, use the mask area to mask the original texture map, and take the texture map area within the selection area as the selection texture map corresponding to the original texture map.
[0267] In an optional embodiment, the selection area parameters include a first selection area parameter corresponding to a first grayscale gradient direction and a second selection area parameter corresponding to a second grayscale gradient direction, the first grayscale gradient direction is opposite to the second grayscale gradient direction, and the step of taking the area in the mask area where the grayscale parameter is greater than the selection area parameter as the selection area, and the area where the grayscale parameter is less than the selection area parameter as the mask area includes:
[0268] In accordance with the first grayscale gradient direction, take the area in the mask area where the grayscale parameter is greater than the first selection area parameter as the first selection area, and the area where the grayscale parameter is less than the first selection area parameter as the first mask area;
[0269] In accordance with the second grayscale gradient direction, take the area in the mask area where the grayscale parameter is greater than the second selection area parameter as the second selection area, and the area where the grayscale parameter is less than the second selection area parameter as the second mask area.
[0270] In an optional embodiment, the first grayscale gradient direction is the grayscale gradient direction from top to bottom; the second grayscale gradient direction is the grayscale gradient direction from bottom to top.
[0271] In an optional embodiment, the step of masking the mask area on the original texture map, using the mask area to mask the original texture map, and taking the texture map area within the selection area as the selection texture map corresponding to the original texture map includes:
[0272] Mask the mask area on the original texture map, use the first mask area and the second mask area to mask the original texture map, and take the texture map areas that are simultaneously within the first selection area and the second selection area as several selection texture maps corresponding to the original texture map.
[0273] In an optional embodiment, the step of splicing several selection texture maps corresponding to the original texture map to obtain a first target texture map corresponding to each original texture map includes:
[0274] Obtain the selection order corresponding to each of the selected area textures and the position information in the belonging mask area, where the position information includes the upper mask parameter and the lower mask parameter of the selected area texture;
[0275] Use the upper mask parameter and / or the lower mask parameter corresponding to each of the selected area textures to calculate the splicing displacement corresponding to each of the selected area textures;
[0276] Splice a plurality of selected area textures corresponding to the original texture according to the selection order and the splicing displacement to generate a first target texture corresponding to each of the original textures.
[0277] In an alternative embodiment, the using the upper mask parameter and / or the lower mask parameter corresponding to each of the selected area textures to calculate the splicing displacement corresponding to each of the selected area textures includes:
[0278] Use the upper mask parameter corresponding to each of the selected area textures to calculate the splicing displacement corresponding to each of the selected area textures;
[0279] And / or, use the lower mask parameter corresponding to each of the selected area textures to calculate the splicing displacement corresponding to each of the selected area textures.
[0280] In an alternative embodiment, the using the upper mask parameter and / or the lower mask parameter corresponding to each of the selected area textures to calculate the splicing displacement corresponding to each of the selected area textures includes:
[0281] Use the upper mask parameter corresponding to each of the selected area textures and the first selection area adjustment parameter corresponding to the upper mask parameter to calculate the splicing displacement corresponding to each of the selected area textures;
[0282] And / or, use the lower mask parameter corresponding to each of the selected area textures and the second selection area adjustment parameter corresponding to the lower mask parameter to calculate the splicing displacement corresponding to each of the selected area textures.
[0283] In an alternative embodiment, the original texture includes at least a base color texture, a blend texture, and a normal map.
[0284] In an alternative embodiment, it further includes:
[0285] Perform grayscale processing on the first target texture to obtain a corresponding grayscale texture;
[0286] Perform coloring processing on the grayscale texture according to a preset grayscale threshold to display the brightness detection image of the first target texture;
[0287] Obtain the grayscale information for the brightness detection image of the first target map, and correct the brightness detection image of the first target map according to the grayscale information to generate a second target map.
[0288] In an alternative embodiment, the step of performing coloring processing on the grayscale map according to a preset grayscale threshold and displaying the brightness detection image of the first target map includes:
[0289] Obtain the map grayscale values of each pixel point in the grayscale map and the brightness detection threshold for the first target map;
[0290] Perform brightness detection on the first target map according to the map grayscale values of each pixel point and the brightness detection threshold, and display the brightness detection image of the first target map.
[0291] In an alternative embodiment, the brightness detection threshold includes a first metal brightness threshold, a second metal brightness threshold, a first non-metal brightness threshold, and a second non-metal brightness threshold. The second metal brightness threshold is greater than the first metal brightness threshold, and the second non-metal brightness threshold is greater than the first non-metal brightness threshold. The step of performing brightness detection on the first target map according to the grayscale values of each pixel point and the brightness detection threshold and displaying the brightness detection image of the first target map includes:
[0292] Color the pixel points in the first target map whose map grayscale values are less than the first metal brightness threshold with a first color, and color the pixel points whose map grayscale values are greater than the second metal brightness threshold with a second color to obtain the metal detection image of the first target map;
[0293] Color the pixel points in the first target map whose map grayscale values are less than the first non-metal brightness threshold with a first color, and color the pixel points whose map grayscale values are greater than the second metal brightness threshold with a second color to obtain the non-metal detection image of the first target map;
[0294] Obtain the metal channel image corresponding to the first target map;
[0295] Perform image mixing using the metal detection image, the non-metal detection image, and the metal channel image, and display the brightness detection image of the first target map.
[0296] In an alternative embodiment, the step of performing image mixing using the metal detection image, the non-metal detection image, and the metal channel image and displaying the brightness detection image of the first target map includes:
[0297] Perform grayscale processing on the metal detection image to obtain a metal grayscale image;
[0298] Perform grayscale processing on the non-metal detection image to obtain a non-metal grayscale image;
[0299] Stitch the metal grayscale image and the non-metal grayscale image to obtain a detection area image corresponding to the first target map;
[0300] Perform image mixing using the metal detection image, the non-metal detection image, the metal channel image, and the detection area image to display a brightness detection image of the first target map.
[0301] In an alternative embodiment, the grayscale information includes the metal grayscale values of each pixel point in the metal grayscale image and the non-metal grayscale values of each pixel point in the non-metal grayscale image. The correcting the brightness detection image of the first target map according to the grayscale information to generate a second target map includes:
[0302] Perform brightness region division on the metal grayscale image using the metal grayscale value, the first metal brightness threshold, and the second metal brightness threshold to obtain a metal brightness abnormal region corresponding to the metal grayscale image;
[0303] Perform brightness region division on the non-metal grayscale image using the non-metal grayscale value, the first non-metal brightness threshold, and the second non-metal brightness threshold to obtain a non-metal brightness abnormal region corresponding to the non-metal grayscale image;
[0304] In response to a brightness mixing operation, perform brightness mixing on the first target map and the metal brightness abnormal region, and perform mixing on the first target map and the non-metal brightness abnormal region to perform brightness correction on the first target map to generate a second target map.
[0305] In an alternative embodiment, the performing brightness region division on the metal grayscale image using the metal grayscale value, the first metal brightness threshold, and the second metal brightness threshold to obtain a metal brightness abnormal region corresponding to the metal grayscale image includes:
[0306] Use the pixel points in the metal grayscale image with metal grayscale values less than the first metal brightness threshold to construct a first over-dark region corresponding to the metal grayscale image;
[0307] Use the pixel points in the metal grayscale image with metal grayscale values greater than the second metal brightness threshold to construct a first over-bright region corresponding to the metal grayscale image.
[0308] In an alternative embodiment, the step of dividing the non-metal grayscale image into brightness regions by using the non-metal grayscale value, the first non-metal brightness threshold, and the second non-metal brightness threshold to obtain the non-metal brightness abnormal region corresponding to the non-metal grayscale image includes:
[0309] Constructing a second over-dark region corresponding to the non-metal grayscale image by using the pixel points in the non-metal grayscale image whose non-metal grayscale values are less than the first non-metal brightness threshold;
[0310] Constructing a second over-bright region corresponding to the non-metal grayscale image by using the pixel points in the non-metal grayscale image whose non-metal grayscale values are greater than the second non-metal brightness threshold.
[0311] In an alternative embodiment, the step of performing brightness correction on the first target map by performing brightness mixing on the first target map and the metal brightness abnormal region, and mixing the first target map and the non-metal brightness abnormal region to generate a second target map includes:
[0312] In response to a brightness mixing subtraction operation, determining a subtraction amplitude corresponding to the brightness mixing subtraction operation, and performing image superposition of the first target map and the first over-bright region according to the subtraction amplitude to perform brightness correction on the first over-bright region, and performing image superposition of the first target map and the second over-bright region to perform brightness correction on the second over-bright region;
[0313] In response to a brightness mixing addition operation, determining an addition amplitude corresponding to the brightness mixing addition operation, and performing image superposition of the first target map and the first over-dark region according to the addition amplitude to perform brightness correction on the first over-dark region, and performing image superposition of the first target map and the second over-dark region to perform brightness correction on the second over-dark region, thereby generating a second target map corresponding to the first target map.
[0314] The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity, only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
[0315] The communication interface is used for communication between the above terminal and other devices.
[0316] The memory may include a Random Access Memory (RAM), or may also include a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0317] The aforementioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0318] As Figure 13 shown, in another embodiment provided by the present invention, a computer-readable storage medium 1301 is further provided. Instructions are stored in the computer-readable storage medium. When it runs on a computer, it causes the computer to execute the processing method of the texture mapping described in the above embodiment.
[0319] In another embodiment provided by the present invention, a computer program product containing instructions is further provided. When it runs on a computer, it causes the computer to execute the processing method of the texture mapping described in the above embodiment.
[0320] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).
[0321] It should be noted that, in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements but also other elements that are not explicitly listed, or also includes elements that are inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article, or device that includes the element.
[0322] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and reference can be made to the corresponding parts of the method embodiments for the relevant content.
[0323] The above are only the preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are all included in the protection scope of the present invention.
Claims
1. A method for processing a texture map, characterized in that Including: Obtain at least one target atlas of texture maps, where the target atlas of texture maps includes several original texture maps; Determine selection area parameters for the original texture maps, and perform area selection on the original texture maps according to the selection area parameters to obtain several selected area texture maps corresponding to the original texture maps; Stitch the several selected area texture maps corresponding to the original texture maps to obtain a first target texture map corresponding to each original texture map; The determination of the selection area parameters for the original texture maps, where the selection area parameters include a first selection area parameter corresponding to a first gray-scale gradient direction and a second selection area parameter corresponding to a second gray-scale gradient direction, includes: Obtain a first selection area parameter for the original texture map and a selection area adjustment parameter for the first selection area parameter; Calculate a second selection area parameter by using the first selection area parameter and the selection area adjustment parameter.
2. The method according to claim 1, characterized in that, The performing area selection on the original texture maps according to the selection area parameters to obtain several selected area texture maps corresponding to the original texture maps includes: Obtain a mask area for the original texture map and gray-scale parameters of the mask area; Take the area in the mask area where the gray-scale parameter is greater than the selection area parameter as the selected area, and the area where the gray-scale parameter is less than the selection area parameter as the mask area; Mask the mask area on the original texture map, mask the original texture map by using the mask area, and take the texture map area located in the selected area as the selected area texture map corresponding to the original texture map.
3. The method according to claim 2, characterized in that The first gray-scale gradient direction is opposite to the second gray-scale gradient direction. The taking the area in the mask area where the gray-scale parameter is greater than the selection area parameter as the selected area, and the area where the gray-scale parameter is less than the selection area parameter as the mask area includes: According to the first gray-scale gradient direction, take the area in the mask area where the gray-scale parameter is greater than the first selection area parameter as the first selected area, and the area where the gray-scale parameter is less than the first selection area parameter as the first mask area; According to the second gray-scale gradient direction, take the area in the mask area where the gray-scale parameter is greater than the second selection area parameter as the second selected area, and the area where the gray-scale parameter is less than the second selection area parameter as the second mask area.
4. The method according to claim 3, characterized in that, The first gray-scale gradient direction is the gray-scale gradient direction from top to bottom; the second gray-scale gradient direction is the gray-scale gradient direction from bottom to top.
5. The method according to claim 3, wherein The masking the mask area on the original texture map, masking the original texture map by using the mask area, and taking the texture map area located in the selected area as the selected area texture map corresponding to the original texture map includes: Mask the mask area on the original texture map, mask the original texture map by using the first mask area and the second mask area, and take the texture map area that is simultaneously located in the first selected area and the second selected area as the several selected area texture maps corresponding to the original texture map.
6. The method according to claim 1, characterized in that The stitching the several selected area texture maps corresponding to the original texture maps to obtain a first target texture map corresponding to each original texture map includes: Obtain the selection order corresponding to each of the selection area textures and the position information in the belonging mask area, where the position information includes the upper mask parameter and the lower mask parameter of the selection area texture; Calculate the splicing displacement corresponding to each of the selection area textures by using the upper mask parameter and / or the lower mask parameter corresponding to each of the selection area textures; Splice a plurality of selection area textures corresponding to the original texture according to the selection order and the splicing displacement to generate a first target texture corresponding to each of the original textures.
7. The method according to claim 6, wherein The calculating the splicing displacement corresponding to each of the selection area textures by using the upper mask parameter and / or the lower mask parameter corresponding to each of the selection area textures includes: Calculate the splicing displacement corresponding to each of the selection area textures by using the upper mask parameter corresponding to each of the selection area textures; And / or, calculate the splicing displacement corresponding to each of the selection area textures by using the lower mask parameter corresponding to each of the selection area textures.
8. The method according to claim 6, characterized in that, The calculating the splicing displacement corresponding to each of the selection area textures by using the upper mask parameter and / or the lower mask parameter corresponding to each of the selection area textures includes: Calculate the splicing displacement corresponding to each of the selection area textures by using the upper mask parameter corresponding to each of the selection area textures and the first selection area adjustment parameter corresponding to the upper mask parameter; And / or, calculate the splicing displacement corresponding to each of the selection area textures by using the lower mask parameter corresponding to each of the selection area textures and the second selection area adjustment parameter corresponding to the lower mask parameter.
9. The method according to claim 1, characterized in that, The original texture includes at least a base color texture, a blend texture, and a normal map.
10. The method according to claim 1, characterized in that, It further includes: Perform grayscale processing on the first target texture to obtain a corresponding grayscale texture; Perform coloring processing on the grayscale texture according to a preset grayscale threshold to display the brightness detection image of the first target texture; Obtain the grayscale information for the brightness detection image and correct the brightness detection image of the first target texture according to the grayscale information to generate a second target texture.
11. The method according to claim 10, wherein The performing coloring processing on the grayscale texture according to a preset grayscale threshold to display the brightness detection image of the first target texture includes: Obtain the texture grayscale value of each pixel point in the grayscale texture and the brightness detection threshold for the first target texture; Perform brightness detection on the first target texture according to the texture grayscale value of each of the pixel points and the brightness detection threshold to display the brightness detection image of the first target texture.
12. The method according to claim 11, wherein The brightness detection threshold includes a first metal brightness threshold, a second metal brightness threshold, a first non-metal brightness threshold, and a second non-metal brightness threshold. The second metal brightness threshold is greater than the first metal brightness threshold, and the second non-metal brightness threshold is greater than the first non-metal brightness threshold. The performing brightness detection on the first target texture according to the grayscale value of each of the pixel points and the brightness detection threshold to display the brightness detection image of the first target texture includes: Color the pixel points in the first target texture map whose texture gray values are less than the first metal brightness threshold with a first color, and color the pixel points whose texture gray values are greater than the second metal brightness threshold with a second color to obtain the metal detection image of the first target texture map; Color the pixel points in the first target texture map whose texture gray values are less than the first non-metal brightness threshold with a first color, and color the pixel points whose texture gray values are greater than the second metal brightness threshold with a second color to obtain the non-metal detection image of the first target texture map; Obtain the metal channel image corresponding to the first target texture map; Perform image mixing using the metal detection image, the non-metal detection image, and the metal channel image, and display the brightness detection image of the first target texture map.
13. The method according to claim 12, wherein The performing image mixing using the metal detection image, the non-metal detection image, and the metal channel image, and displaying the brightness detection image of the first target texture map includes: Perform gray processing on the metal detection image to obtain a metal gray image; Perform gray processing on the non-metal detection image to obtain a non-metal gray image; Stitch the metal gray image and the non-metal gray image together to obtain the detection area image corresponding to the first target texture map; Perform image mixing using the metal detection image, the non-metal detection image, the metal channel image, and the detection area image, and display the brightness detection image of the first target texture map.
14. The method according to claim 13, wherein The gray-scale information includes the metal gray values of each pixel point in the metal gray image and the non-metal gray values of each pixel point in the non-metal gray image. The correcting the brightness detection image of the first target texture map according to the gray-scale information to generate a second target texture map includes: Use the metal gray values, the first metal brightness threshold, and the second metal brightness threshold to perform brightness region division on the metal gray image to obtain the metal brightness abnormal region corresponding to the metal gray image; Use the non-metal gray values, the first non-metal brightness threshold, and the second non-metal brightness threshold to perform brightness region division on the non-metal gray image to obtain the non-metal brightness abnormal region corresponding to the non-metal gray image; In response to the brightness mixing operation, perform brightness mixing on the first target texture map and the metal brightness abnormal region, and perform mixing on the first target texture map and the non-metal brightness abnormal region to perform brightness correction on the first target texture map to generate a second target texture map.
15. The method according to claim 14, wherein The using the metal gray values, the first metal brightness threshold, and the second metal brightness threshold to perform brightness region division on the metal gray image to obtain the metal brightness abnormal region corresponding to the metal gray image includes: Use the pixel points in the metal gray image whose metal gray values are less than the first metal brightness threshold to construct the first over-dark region corresponding to the metal gray image; Use the pixel points in the metal gray image whose metal gray values are greater than the second metal brightness threshold to construct the first over-bright region corresponding to the metal gray image.
16. The method according to claim 15, characterized in that Performing brightness region division on the non-metal grayscale image by using the non-metal grayscale value, the first non-metal brightness threshold, and the second non-metal brightness threshold to obtain a non-metal brightness abnormal region corresponding to the non-metal grayscale image includes: Using pixel points in the non-metal grayscale image with non-metal grayscale values less than the first non-metal brightness threshold to construct a second over-dark region corresponding to the non-metal grayscale image; Using pixel points in the non-metal grayscale image with non-metal grayscale values greater than the second non-metal brightness threshold to construct a second over-bright region corresponding to the non-metal grayscale image.
17. The method according to claim 16, characterized in that, Responding to the brightness mixing operation, performing brightness mixing on the first target texture map and the metal brightness abnormal region, and performing mixing on the first target texture map and the non-metal brightness abnormal region to perform brightness correction on the first target texture map, generating a second target texture map, including: Responding to the brightness mixing subtraction operation, determining a subtraction amplitude corresponding to the brightness mixing subtraction operation, and performing image superposition of the first target texture map and the first over-bright region according to the subtraction amplitude to perform brightness correction on the first over-bright region, and performing image superposition of the first target texture map and the second over-bright region to perform brightness correction on the second over-bright region; Responding to the brightness mixing addition operation, determining an addition amplitude corresponding to the brightness mixing addition operation, and performing image superposition of the first target texture map and the first over-dark region according to the addition amplitude to perform brightness correction on the first over-dark region, and performing image superposition of the first target texture map and the second over-dark region to perform brightness correction on the second over-dark region, generating a second target texture map corresponding to the first target texture map.
18. A processing device for a sticker, characterized in that, Including: A texture map set acquisition module, configured to acquire at least one target texture map set, where the target texture map set includes a plurality of original texture maps; A selected area texture map determination module, configured to determine selection area parameters for the original texture map, and perform area selection on the original texture map according to the selection area parameters to obtain a plurality of selected area texture maps corresponding to the original texture map; A target texture map generation module, configured to splice the plurality of selected area texture maps corresponding to the original texture map to obtain a first target texture map corresponding to each original texture map; The selection area parameters of the original texture map include a first selection area parameter corresponding to a first gray scale gradient direction and a second selection area parameter corresponding to a second gray scale gradient direction, and the selected area texture map determination module further includes: A parameter acquisition sub-module, configured to acquire a first selection area parameter for the original texture map and a selection area adjustment parameter for the first selection area parameter; A selection area parameter calculation sub-module, configured to calculate a second selection area parameter by using the first selection area parameter and the selection area adjustment parameter.
19. An electronic device, characterized in that, Including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus; The memory is used for storing a computer program; When the processor executes the program stored in the memory, it implements the method according to any one of claims 1-17.
20. A computer-readable storage medium having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1-17.
Citation Information
Patent Citations
Image display program, image display method, image display device, and recording medium
JP2006003603A