Map processing method and device, electronic equipment and storage medium
By using an automated color processing model, the problem of inefficient color changes in 3D model textures has been solved, achieving efficient and accurate color adjustments, improving the visual effect of 3D models, and meeting the needs of high-quality digital content creation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-18
- Publication Date
- 2026-03-31
AI Technical Summary
In existing technologies, changing the color of textures on 3D models is inefficient. Manual operation is greatly affected by subjective factors, making it difficult to guarantee the accuracy and consistency of color changes, resulting in poor visual effects.
By determining the texture map of the target 3D model and the color information of the target area, a pre-trained color processing model is used to automatically determine and adjust the texture color, achieving efficient and accurate color change.
It achieves efficient and automated processing of 3D model texture color changes, improves color processing quality and speed, meets the needs of high-quality digital content creation, and ensures the accuracy and consistency of color changes.
Smart Images

Figure CN121767607A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a texture processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] In today's world, where 3D models are widely used in numerous digital fields such as film and animation, and game development, their visual presentation is of paramount importance. Among these, texture mapping, as a key element in giving 3D models surface details and colors, directly affects the model's realism and aesthetics. Especially in scenarios involving color difference processing, such as adjusting the colors of 3D models to meet design requirements to achieve color harmony and unity with the overall scene or other models, accurate texture color processing becomes crucial.
[0003] In related technologies, changing the color of 3D model textures often relies on manual operation. Designers must use their experience to locate the areas to be modified within complex texture maps, and then repeatedly adjust color parameters to achieve the color change. This process is not only extremely inefficient, consuming a lot of time and manpower, but manual operation is also greatly affected by subjective factors, making it difficult to guarantee the accuracy and consistency of color changes. Color deviations often occur, resulting in unsatisfactory visual effects of the final 3D model, which cannot meet the growing demand for high-quality digital content creation. Summary of the Invention
[0004] This invention provides a texture processing method, apparatus, electronic device, and storage medium to achieve efficient and automated processing of texture color changes in 3D models, thereby improving the quality and speed of 3D model color processing and meeting the technical requirements for high-quality digital content creation.
[0005] According to one aspect of the present invention, a texture processing method is provided, the method comprising:
[0006] Determine the first texture map of the target 3D model and the target color information of the target part on the target 3D model;
[0007] Determine the initial texture color information of the target region corresponding to the target part in the first texture map, and determine the target texture color information corresponding to the initial texture color information based on the pre-trained color processing model;
[0008] Based on the target texture color information and the first texture map, a second texture map corresponding to the target color information is obtained.
[0009] According to another aspect of the present invention, a texture processing apparatus is provided, the apparatus comprising:
[0010] The first module is used to determine the first texture map of the target 3D model and the target color information of the target part on the target 3D model;
[0011] The second module is used to determine the initial texture color information of the target region corresponding to the target part in the first texture map, and to determine the target texture color information corresponding to the initial texture color information based on a pre-trained color processing model.
[0012] The third module is used to obtain a second texture map corresponding to the target color information based on the target texture color information and the first texture map.
[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0014] One or more processors;
[0015] Storage device for storing one or more programs.
[0016] When one or more programs are executed by one or more processors, the one or more processors implement a texture processing method as described in any of the embodiments of this disclosure.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer instructions for causing a processor to execute any of the texturing processing methods of the present invention.
[0018] According to another aspect of the present disclosure, a computer program product is provided, which, when executed by a processor, implements a texture processing method as described in any of the embodiments of the present disclosure.
[0019] The technical solution of this disclosure, by determining the first texture map of the target 3D model and the target color information of the target part on the target 3D model, can clearly identify the processing object and the final color target to be achieved, effectively avoiding blind processing and helping to improve overall processing efficiency. Determining the initial texture color information of the target area corresponding to the target part in the first texture map can accurately locate the specific area whose color needs to be changed and its corresponding color information. The target texture color information corresponding to the initial texture color information is determined based on a pre-trained color processing model. Utilizing the model avoids the drawbacks of manual operation being affected by subjective factors, ensuring the accuracy and consistency of color changes and effectively avoiding color deviation. Based on the target texture color information and the first texture map, a second texture map corresponding to the target color information is obtained, enabling rapid and accurate color changes in the 3D model texture, meeting the needs of high-quality digital content creation, and improving the visual effect of the 3D model. The technical solution of this disclosure solves the problems of low efficiency, inaccuracy and consistency in manually changing the color of 3D model textures in the prior art. It realizes efficient and automated processing of 3D model texture color changes, thereby improving the quality and speed of 3D model color processing and meeting the technical requirements of high-quality digital content creation.
[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 A schematic flowchart illustrating a texture processing method provided in an embodiment of this disclosure;
[0023] Figure 2 A schematic flowchart illustrating a texture processing method provided in an embodiment of this disclosure;
[0024] Figure 3 Example diagram of a target color set for a texture processing method, provided in embodiments of this disclosure;
[0025] Figure 4 This is an example diagram of the current rendering of the 3D model provided in the embodiments of this disclosure;
[0026] Figure 5 Example diagrams showing the expected effect of the three-dimensional model provided in the embodiments of this disclosure;
[0027] Figure 6 Example diagram of the initial texture mapping of a 3D model provided in the embodiments of this disclosure;
[0028] Figure 7 An example image of the sampling result for sampling the current rendering of a 3D model provided in this embodiment of the disclosure;
[0029] Figure 8 Example image of a mask image for a three-dimensional model provided in an embodiment of this disclosure;
[0030] Figure 9 A rendering of the three-dimensional model provided in the embodiments of this disclosure;
[0031] Figure 10 This is a schematic diagram of the structure of a texture processing device provided in an embodiment of the present disclosure;
[0032] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation
[0033] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0034] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0035] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0036] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0037] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0038] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0039] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0040] Figure 1 This is a schematic flowchart illustrating a texture processing method provided in an embodiment of this disclosure. This embodiment is applicable to situations involving texture processing. The method can be executed by a texture processing device, which can be implemented in hardware and / or software and can be configured in electronic devices such as computers or servers. Figure 1 As shown, the method in this embodiment includes:
[0041] S110. Determine the first texture map of the target 3D model and the target color information of the target part on the target 3D model.
[0042] Taking a game scene as an example, the target 3D model can be understood as a 3D digital model of a game character or clothing that needs to be dyed. In this embodiment, the target 3D model can be a 3D mesh model or a 3D point cloud model. The first texture map can be understood as the texture map used by the target 3D model at the current moment. The method of obtaining the first texture map of the target 3D model can include: determining the texture map used by the target 3D model at the current moment and using it as the first texture map of the target 3D model. The target part can be understood as a local area on the target 3D model that needs to be changed in a specific color or style. The number of target parts can be one, two, or more. For example, for the armor of a warrior character, the target part can be a single part such as the shoulder, chest, or leg of the armor. Or, for a warrior character, the target part can be a single part such as the warrior's hair, eyes, or eyebrows. The target color information can be understood as the color information that the target part is expected to ultimately present. The target color information can include the hue and saturation of one of the following colors. In this embodiment, the target color information can be set according to actual needs, and it is not specifically limited here.
[0043] As an optional implementation in this disclosure, determining the target color information of the target part on the target 3D model may include: obtaining a reference effect image corresponding to the target 3D model, and determining the target color information of the target part on the target 3D model based on the reference image.
[0044] The reference effect image can be understood as a visual effect image of the desired target 3D model designed according to actual needs. The color characteristics of the target 3D model in the reference effect image are different from the color characteristics of the target 3D model under the first texture map. In the embodiments of this disclosure, there are various ways to obtain the reference effect image corresponding to the target 3D model, and no specific limitation is made here. For example, it can be drawn by relevant technicians using image processing software. Alternatively, it can be an image obtained by modifying the color of the rendering effect image of the target 3D model under the first texture map based on a text-generated image model or an image-generated image intelligent model. Or, it can be a screenshot of the color matching of a character's clothing in a similar style in another game; this screenshot is the reference effect image used to guide the setting of the color of the target part.
[0045] Specifically, a reference effect image corresponding to the target 3D model is acquired. This reference effect image is then analyzed to determine the image region within it that corresponds to the target part on the target 3D model. This image region can then be sampled using a preset image editing model (e.g., an AI image generation and editing model) to obtain sampled color information, i.e., the target color information of the target part on the target 3D model. When there are multiple target parts, for each target part, the image region corresponding to that target part in the reference effect image is determined. Then, for each image region corresponding to a target part, color sampling is performed on that image region to obtain color sampling information, i.e., the target color information of the target part corresponding to that image region.
[0046] As another optional implementation in this disclosure, determining the target color information of the target part on the target 3D model may include: determining the target color information of the target part on the target 3D model based on the color description text input for the target part on the target 3D model.
[0047] The color description text can be understood as text used to describe the specific color attribute that a particular target part in the desired 3D model should present. That is, it's a textual description of the desired color of the target part. Examples include "dye the character's hair red," "dye the character's pants black," and so on. Optionally, the color description text includes at least one part of the target 3D model and the desired color information for that part.
[0048] Specifically, the process involves acquiring color description text input for a target region on the target 3D model. This color description text can then be analyzed. Based on the text analysis results, the target color information for the target region on the target 3D model can be determined.
[0049] S120. Determine the initial texture color information of the target region corresponding to the target part in the first texture map, and determine the target texture color information corresponding to the initial texture color information based on the pre-trained color processing model.
[0050] The target region can be understood as the image region corresponding to the target part in the first texture map. Since the texture map is applied to the surface of the 3D model through a mapping relationship, each part of the 3D model has a corresponding region in the texture map. For example, the shoulder of a warrior character's armor is a part with a specific shape and location in the 3D model, and there is a corresponding image region in the first texture map; this region is the target region. The initial texture color information can be understood as the original color characteristics of the target region in the first texture map, that is, the color information of the region before any processing. For example, the target region corresponding to the shoulder of a warrior character's armor was originally gray in the first texture map; this gray color is the initial texture color information.
[0051] In this embodiment, the target texture color information can be understood as the color characteristics that the target area should possess after processing by the color processing model. The target texture color information is the result obtained by adjusting the initial texture color information to achieve the target color information. For example, after processing by the color processing model, the color of the target area corresponding to the shoulder of the warrior character's armor changes from gray to red; this red is the target texture color information. In this embodiment, the initial texture color information and the target texture color information are different. The color processing model can be understood as a model used to output the corresponding target texture color information based on the input initial texture color information. Optionally, the color processing model can be a trained channel mixer. In this embodiment, the color processing model learns the conversion rules and style characteristics between different colors and can adjust the initial color to the desired target color according to the user's needs. For example, through training, the model can change the color of the warrior's armor from gray to red.
[0052] Specifically, the initial texture color information of the target region corresponding to the target part in the first texture map is determined. When there are multiple target parts, for each target part, the initial texture color information of the target region corresponding to the target part in the first texture map is input into a pre-trained color processing model to obtain the color information of the target region corresponding to the target part in the first texture map, that is, to determine the target texture color information corresponding to the initial texture color information.
[0053] In this embodiment of the disclosure, determining the initial texture color information of the target region corresponding to the target part in the first texture map may include: dividing the target 3D model into regions based on the first texture map to obtain a mask image corresponding to the first texture map; wherein, the mask image may include a first region corresponding to the target part; determining a second region in the first texture map corresponding to the first region, and using the second region as the target region in the first texture map corresponding to the target part; and determining the initial texture information of the target region based on the color information within the second region.
[0054] The mask image can be understood as a mask image obtained by dividing the target 3D model into regions based on the first texture map. In this embodiment, the number of mask images can be one, two, or more. The mask images correspond to the target parts, that is, one mask image corresponds to one target part. It is understood that the mask image can be a binary image, that is, the mask image consists of two colors, usually black and white, to represent specific areas in the image. The white portion can be used to represent areas that need color processing. The black portion can be used to represent unaffected areas. In this embodiment, this simple black-and-white representation allows the binary mask image to have high simplicity and clarity, clearly dividing different regions in the image. In this embodiment, the mask image can include a first region corresponding to the target part. The first region is the area in the first texture map that needs color processing (coloring processing) corresponding to a certain part. The first region can be the image region in the mask image corresponding to the target part. In a single mask image, the number of first regions corresponding to an independent target part can be one, two, or more. In this embodiment, each mask region can be bound to an independent channel mixer matrix model, i.e., a color processing model, to achieve regionalized coloring. Furthermore, different mixer parameters can be applied to different regions defined by the mask, thereby achieving differentiated coloring for different materials or parts. The second region can be understood as the image region corresponding to the first region in the first texture map.
[0055] Specifically, based on the texture information of the first texture map, the target 3D model is divided into regions to obtain a mask image corresponding to the first texture map. The mask image includes a first region corresponding to the target part. Then, a second region in the first texture map corresponding to the first region can be determined. This second region can then be used as the target region in the first texture map corresponding to the target part. Therefore, based on the color information within the second region, the initial texture information of the target region can be determined.
[0056] In this embodiment of the disclosure, the step of dividing the target 3D model into mesh regions based on the first texture map to obtain a mask image corresponding to the first texture map includes: dividing the target 3D model into regions according to the first texture map to obtain an initial stained region corresponding to the first texture map, and displaying the initial stained region; in response to a region adjustment operation on the initial stained region, obtaining a target stained region corresponding to the initial stained region; and obtaining a mask image corresponding to the first texture map based on the target stained region.
[0057] The initial stained area can be understood as the stained area in the first texture map determined after dividing the target 3D model into regions based on the first texture map. The region adjustment operation can be understood as an operation used to adjust the initial stained area. Optionally, the region adjustment operation may include one of the following: adding a stained area, deleting a stained area, adjusting the edge of a region, and blending regions of different materials. In this embodiment, the automatically generated mask can be visually adjusted through the region adjustment operation to improve the accuracy and naturalness of the stained area. The target stained area can be understood as the stained area obtained after performing the region adjustment operation on the initial stained area.
[0058] Specifically, the target 3D model is divided into regions based on the first texture map, identifying different materials and parts (such as skin, clothing, metal, etc.) to obtain region division results. The region division results include at least one model surface region. For each model surface region, a corresponding stained region is generated, resulting in an initial stained region corresponding to the first texture map. The initial stained region can then be displayed. In response to a region adjustment operation on the initial stained region, a target stained region corresponding to the initial stained region can be obtained based on the region adjustment operation. Furthermore, a mask image corresponding to the first texture map can be obtained based on the target stained region; specifically, the texture map including the target stained region is used as the mask image corresponding to the first texture map.
[0059] S130. Based on the target texture color information and the first texture map, a second texture map corresponding to the target color information is obtained.
[0060] The second texture map can be understood as a new texture map obtained by replacing the color of the target area with the color information of the target texture map based on the first texture map. The second texture map allows the target part of the target 3D model to present the target color information desired by the user. For example, the new texture map obtained by replacing the color of the shoulder area in the first texture map of the warrior character's armor with red is the second texture map. After applying this second texture map, the shoulder of the warrior character's armor will appear red.
[0061] In this embodiment, the texture format of the obtained second texture map can be set according to actual needs, and is not specifically limited herein. Optionally, the texture format of the second texture map and the texture format of the first texture map can be the same or different. Furthermore, the second texture map obtained in this embodiment can be directly imported into a game engine for rendering and use. This embodiment also provides a real-time preview and scheme saving function for the coloring effect, facilitating user confirmation and adjustment of the coloring effect, and making it easy to call up and compare different coloring schemes at any time.
[0062] Specifically, the initial texture color information in the first texture map corresponding to the target texture color information is replaced with the target texture color information to obtain a replaced texture map, which is the second texture map corresponding to the target color information.
[0063] In this embodiment of the disclosure, after obtaining the second texture map, the process may further include global optimization and detail enhancement of the texture in the second texture map to achieve secondary coloring. Specifically, a preset artificial intelligence processing algorithm can be used for multi-view stylized redrawing, and combined with LoRA (Low-Rank Adaptation) fine-tuning technology, global style optimization and detail enhancement can be performed on the texture for secondary coloring.
[0064] The technical solution of this disclosure, by determining the first texture map of the target 3D model and the target color information of the target part on the target 3D model, can clearly identify the processing object and the final color target to be achieved, effectively avoiding blind processing and helping to improve overall processing efficiency. Determining the initial texture color information of the target area corresponding to the target part in the first texture map can accurately locate the specific area whose color needs to be changed and its corresponding color information. The target texture color information corresponding to the initial texture color information is determined based on a pre-trained color processing model. Utilizing the model avoids the drawbacks of manual operation being affected by subjective factors, ensuring the accuracy and consistency of color changes and effectively avoiding color deviation. Based on the target texture color information and the first texture map, a second texture map corresponding to the target color information is obtained, enabling rapid and accurate color changes in the 3D model texture, meeting the needs of high-quality digital content creation, and improving the visual effect of the 3D model. The technical solution of this disclosure solves the problems of low efficiency, inaccuracy and consistency in manually changing the color of 3D model textures in the prior art. It realizes efficient and automated processing of 3D model texture color changes, thereby improving the quality and speed of 3D model color processing and meeting the technical requirements of high-quality digital content creation.
[0065] Figure 2 This is a schematic flowchart illustrating another texture processing method provided in this embodiment. The technical solution of this embodiment can be combined with other embodiments; for the same or related parts, they can be described in conjunction with the descriptions of other embodiments, and will not be repeated here. Figure 2 As shown, the method in this embodiment may specifically include:
[0066] S210. Obtain training sample data; wherein, the training sample data includes the expected color information of a preset part on the sample 3D model and the first color information of the texture area corresponding to the preset part in the sample texture map of the sample 3D model.
[0067] In this context, the sample 3D model can be understood as a 3D model used to train the color processing model. In this embodiment, there are various ways to obtain the sample 3D model, which are not specifically limited here. For example, it can be obtained from a dataset used to store 3D models. Alternatively, it can be manually created by a technician using 3D model-making software. Alternatively, a 3D laser scan of the target object can be performed to quickly and accurately obtain the appearance and structural data of the target object, generating a 3D model. Alternatively, 3D modeling can be based on images; and so on. The preset part can be understood as a part on the sample 3D model. The number of preset parts can be one, two, or more. The expected color information can be understood as the color information expected to be presented on the preset part of the sample 3D model. The sample texture map can be understood as the texture map used by the sample 3D model at the current moment. The map region can be understood as the image region in the sample texture map of the sample 3D model corresponding to the preset part. The first color information can be understood as the color information within the map region. In this embodiment, the first color information can be obtained by color sampling of the map region in the sample texture map corresponding to the preset part to obtain the sampled color information, i.e., the first color information.
[0068] As an optional implementation in this disclosure, the acquisition of training sample data may include: rendering the sample 3D model under a preset viewpoint to generate a first sampling image corresponding to the sample 3D model; performing color processing on the first sampling image based on a preset color processing method to obtain a second sampling image corresponding to the first sampling image; performing color sampling on the second sampling image to obtain expected color information of a preset part on the sample 3D model; and performing color sampling on the first sampling image to obtain first color information of the texture area corresponding to the preset part in the sample texture map of the sample 3D model.
[0069] The preset viewing angle can be set according to actual needs and is not specifically limited here. For example, a frontal view. The first sampled image can be understood as an image generated by rendering the sample 3D model under the preset viewing angle. The second sampled image can be understood as an image obtained by color processing the first sampled image based on a preset color processing method. Optionally, the preset color processing method includes a style redrawing method and / or a color fill method.
[0070] Specifically, the sample 3D model is rendered from a preset perspective to obtain a rendered image, which is a first sampled image corresponding to the sample 3D model. Then, the first sampled image is processed using a preset color processing method to obtain a second sampled image corresponding to the first sampled image. The second sampled image can then be color sampled, thereby obtaining the expected color information of a preset location on the sample 3D model based on the sampling results. Furthermore, the first sampled image can be color sampled, thereby obtaining the first color information of the texture area corresponding to the preset location in the sample texture map of the sample 3D model based on the sampling results.
[0071] As another optional implementation in this disclosure, the step of acquiring training sample data may include: acquiring a sample texture map of the sample 3D model; converting the sample texture map to a preset color space; and adjusting the color of the sample texture map in the preset color space to obtain an adjusted image; determining the target color parameters for processing the sample texture map into the adjusted image based on a perceptual color difference algorithm; obtaining the desired effect image corresponding to the sample texture map based on the target color parameters and the sample texture map; and performing color sampling on the desired effect map and the sample texture map respectively to obtain the expected color information of a preset part on the sample 3D model and the first color information of the map area corresponding to the preset part in the sample texture map.
[0072] The preset color space can be set according to actual needs and is not specifically limited here; for example, it can be the RGB color space or the HSV color space. The target color parameters can be understood as the color parameters used to process the sample texture map into the adjusted image, determined based on a perceptual color difference algorithm. The desired effect image can be understood as the image obtained based on the target color parameters and the sample texture map.
[0073] Specifically, a sample texture map of the sample 3D model is obtained. Then, the sample texture map is converted to a preset color space, and its color is adjusted within that preset color space to obtain an adjusted image. A perceptual color difference algorithm can then be used to determine the target color parameters (e.g., HSV parameters) for processing the sample texture map into the adjusted image. These target color parameters are then applied to the sample texture map to obtain the desired effect image corresponding to the sample texture map. Color sampling can be performed on both the desired effect map and the sample texture map to obtain the expected color information for a preset part of the sample 3D model and the first color information of the texture area corresponding to the preset part in the sample texture map.
[0074] S220. Input the first color information into a pre-built channel mixer model to obtain the second color information corresponding to the first color information.
[0075] In this embodiment of the disclosure, the pre-built channel mixer model can be a channel mixer matrix model of a preset size. For example, the pre-built channel mixer model can be a 3×3 channel mixer matrix model.
[0076] Specifically, a channel mixer model is pre-built to obtain the pre-built channel mixer model. Then, the first color information can be input into the pre-built channel mixer model to obtain the output result of the channel mixer model, which is the second color information corresponding to the first color information.
[0077] For example, to construct a 3×3 channel mixer matrix model Used to transfer the first color information Mapped to expected color information .
[0078] The second color information corresponding to the first color information can be obtained by inputting the first color information into a pre-built channel mixer model using the following formula:
[0079] ;
[0080] Here, r can represent the red channel, g can represent the green channel, and b can represent the blue channel.
[0081] S230. Based on the second color information and the expected color information, determine the loss value of the preset loss function, and adjust the channel mixer parameters of the channel mixer model based on the loss value to obtain the color processing model.
[0082] In this embodiment of the disclosure, the preset loss function can be set according to actual needs, and is not specifically limited here, such as the mean squared error (MSE) loss function.
[0083] Alternatively, the loss value of the preset loss function, determined based on the second color information and the expected color information, can be expressed by the following formula:
[0084] ;
[0085] Where i can be represented as the i-th sampling point. N can be represented as the total number of sampling points. It can be represented as the first color information corresponding to the i-th sampling point. It can be represented as the expected color information corresponding to the i-th sampling point.
[0086] In this embodiment, the channel blending parameters can be updated iteratively using a gradient descent algorithm to gradually approximate the expected color information output by the model. Specifically, this can be expressed by the following formula:
[0087] ;
[0088] in, It can be represented as the channel mixing parameter matrix at the t-th iteration. It can be represented as the learning rate, which is used to control the magnitude of parameter updates. It can be represented as the gradient of the loss function L with respect to the parameter M.
[0089] S240. Determine the first texture map of the target 3D model and the target color information of the target part on the target 3D model.
[0090] S250. Determine the initial texture color information of the target region corresponding to the target part in the first texture map, and determine the target texture color information corresponding to the initial texture color information based on the pre-trained color processing model.
[0091] S260. Based on the target texture color information and the first texture map, a second texture map corresponding to the target color information is obtained.
[0092] The technical solution of this disclosure embodiment obtains training sample data; wherein, the training sample data includes expected color information of a preset part on a sample 3D model and first color information of the texture area corresponding to the preset part in the sample texture map of the sample 3D model; the first color information is input into a pre-constructed channel mixer model to obtain second color information corresponding to the first color information; based on the second color information and the expected color information, a loss value of a preset loss function is determined, and the channel mixer parameters of the channel mixer model are adjusted based on the loss value to obtain a color processing model, thereby achieving X and achieving the technical effect of X.
[0093] This disclosure provides an optional embodiment of a texture processing method, the specific implementation of which can be found in the following embodiments. Technical features that are the same as or similar to those in the above embodiments will not be repeated here. The method of this embodiment specifically includes the following steps:
[0094] Step 1: For the target 3D model, input the target color of the part that needs to be modified, that is, the target color information of the target part on the target 3D model.
[0095] Specifically, the target color can be determined using the expected rendering of the target 3D model, or by manually specifying it. For example, target color information may include the following colors, see [link to relevant documentation]. Figure 3 In this embodiment of the disclosure, the method for obtaining the expected rendering of the target 3D model is as follows: Specifically, AI redrawing technology can be used to redraw the current rendering of the target 3D model (see...). Figure 4 The image is redrawn to obtain the redrawn image, which is the expected effect of the target 3D model (see [link]). Figure 5 ).
[0096] Step 2: Determine the initial texture map of the target 3D model (see...) Figure 6 In addition, determine the initial texture color information for the parts of the target 3D model that need to be modified.
[0097] In one embodiment. See also Figure 7 AI redrawing technology is used to sample the current effect image of the target 3D model to obtain the initial texture color information of the parts of the target 3D model that need to be modified in the first texture map.
[0098] In another possible embodiment, a mask image is obtained based on the initial texture map, comprising an image region corresponding to each of the said modified parts. For example... Figure 8 As shown, different colors are used for the areas to be colored in the initial texture map, and then based on the mask image corresponding to each part that needs to be colored, the texture area in the first texture map corresponding to this image area is determined based on the image area in the mask image that corresponds to the part that needs to be modified. Color sampling is performed on this texture area to obtain the initial texture color information of the part that needs to be modified on the target 3D model.
[0099] Step 3: Input the initial texture color into the pre-trained color processing model and the pre-trained channel mixer matrix model to obtain the target texture color information corresponding to the initial texture color information.
[0100] Step four: Apply the target texture color information to the position in the first texture map corresponding to the target texture color information to obtain a second texture map corresponding to the target color.
[0101] In this embodiment of the disclosure, in response to a second texture map generation event, the texture map used by the target 3D model can be replaced by the second texture map instead of the first texture map. For specific variations, please refer to [link to relevant documentation]. Figure 9 The rendered image.
[0102] The technical solution of this disclosure solves the problems of low efficiency, inaccuracy and consistency in manually changing the color of 3D model textures in the prior art. It realizes efficient and automated processing of 3D model texture color changes, thereby improving the quality and speed of 3D model color processing and meeting the technical requirements of high-quality digital content creation.
[0103] Figure 10 This is a schematic diagram of a texture processing apparatus provided in an embodiment of the present disclosure. Figure 10 As shown, the texture processing device includes a first module 310, a second module 320, and a third module 330. The first module 310 is used to determine a first texture map of the target 3D model and target color information of a target region on the target 3D model. The second module 320 is used to determine the initial texture color information of the target region corresponding to the target region in the first texture map, and to determine the target texture color information corresponding to the initial texture color information based on a pre-trained color processing model. The third module 330 is used to obtain a second texture map corresponding to the target color information based on the target texture color information and the first texture map.
[0104] The technical solution of this disclosure, by determining the first texture map of the target 3D model and the target color information of the target part on the target 3D model, can clearly identify the processing object and the final color target to be achieved, effectively avoiding blind processing and helping to improve overall processing efficiency. Determining the initial texture color information of the target area corresponding to the target part in the first texture map can accurately locate the specific area whose color needs to be changed and its corresponding color information. The target texture color information corresponding to the initial texture color information is determined based on a pre-trained color processing model. Utilizing the model avoids the drawbacks of manual operation being affected by subjective factors, ensuring the accuracy and consistency of color changes and effectively avoiding color deviation. Based on the target texture color information and the first texture map, a second texture map corresponding to the target color information is obtained, enabling rapid and accurate color changes in the 3D model texture, meeting the needs of high-quality digital content creation, and improving the visual effect of the 3D model. The technical solution of this disclosure solves the problems of low efficiency, inaccuracy and consistency in manually changing the color of 3D model textures in the prior art. It realizes efficient and automated processing of 3D model texture color changes, thereby improving the quality and speed of 3D model color processing and meeting the technical requirements of high-quality digital content creation.
[0105] In some embodiments of this disclosure, optionally, the texture processing apparatus further includes a model training module. The model training module is used to acquire training sample data; wherein the training sample data includes expected color information of a preset location on a sample 3D model and first color information of a texture region corresponding to the preset location in a sample texture map of the sample 3D model; inputting the first color information into a pre-constructed channel mixer model to obtain second color information corresponding to the first color information; determining a loss value of a preset loss function based on the second color information and the expected color information; and adjusting the channel mixer parameters of the channel mixer model based on the loss value to obtain a color processing model.
[0106] In some embodiments of this disclosure, optionally, the model training module includes a first sample acquisition unit, wherein the first sample acquisition unit is used to render the sample 3D model under a preset viewpoint to generate a first sampling image corresponding to the sample 3D model; perform color processing on the first sampling image based on a preset color processing method to obtain a second sampling image corresponding to the first sampling image; wherein the preset color processing method includes a style redrawing method and / or a color filling method; perform color sampling on the second sampling image to obtain expected color information of a preset part on the sample 3D model, and perform color sampling on the first sampling image to obtain first color information of the texture area corresponding to the preset part in the sample texture map of the sample 3D model.
[0107] In some embodiments of this disclosure, optionally, the model training module includes a second sample acquisition unit, which is used to acquire a sample texture map of the sample 3D model, convert the sample texture map to a preset color space, and perform color adjustment on the sample texture map in the preset color space to obtain an adjusted image; determine the target color parameters for processing the sample texture map into the adjusted image based on a perceptual color difference algorithm, obtain the desired effect image corresponding to the sample texture map based on the target color parameters and the sample texture map; and perform color sampling on the desired effect map and the sample texture map respectively to obtain the expected color information of a preset part on the sample 3D model and the first color information of the map area corresponding to the preset part in the sample texture map.
[0108] In some embodiments of this disclosure, optionally, the second module 320 is configured to divide the target 3D model into regions based on the first texture map to obtain a mask image corresponding to the first texture map; wherein, the mask image includes a first region corresponding to the target part; determine a second region in the first texture map corresponding to the first region, and use the second region as the target region in the first texture map corresponding to the target part; determine the initial texture information of the target region based on the color information in the second region.
[0109] In some embodiments of this disclosure, optionally, the second module 320 is configured to divide the target 3D model into regions based on the first texture map to obtain an initial stained region corresponding to the first texture map, and display the initial stained region; in response to a region adjustment operation on the initial stained region, obtain a target stained region corresponding to the initial stained region; and obtain a mask image corresponding to the first texture map based on the target stained region.
[0110] In some embodiments of this disclosure, optionally, the first module 310 is used to acquire a reference effect image corresponding to the target three-dimensional model, and determine the target color information of the target part on the target three-dimensional model based on the reference image; or, determine the target color information of the target part on the target three-dimensional model based on the color description text input for the target part on the target three-dimensional model.
[0111] The texture processing apparatus provided in this embodiment can execute the texture processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.
[0112] It is worth noting that the various units and modules included in the above-mentioned texture processing device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.
[0113] Figure 11This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0114] like Figure 11 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0115] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0116] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as texture processing methods.
[0117] In some embodiments, the texture processing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via read-only memory (ROM) 12 and / or communication unit 19. When the computer program is loaded into random access memory (RAM) 13 and executed by processor 11, one or more steps of the texture processing method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the texture processing method by any other suitable means (e.g., by means of firmware).
[0118] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0119] Computer programs used to implement the texture processing methods of this disclosure can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0120] This disclosure provides a computer-readable storage medium storing computer instructions for causing a processor to execute a texture processing method, comprising: determining a first texture map of a target 3D model and target color information of a target region on the target 3D model; determining initial texture color information of a target region corresponding to the target region in the first texture map; determining target texture color information corresponding to the initial texture color information based on a pre-trained color processing model; and obtaining a second texture map corresponding to the target color information based on the target texture color information and the first texture map.
[0121] In the context of this disclosure, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0122] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0123] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0124] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0125] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication unit 19, or installed from storage unit 18, or installed from ROM 12. When the computer program is executed by processor 11, it performs the functions defined in the methods of embodiments of this disclosure.
[0126] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements a texture processing method according to any embodiment of this disclosure.
[0127] In implementing a computer program product, computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0128] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this disclosure can be achieved, and this is not limited herein.
[0129] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A texture processing method, characterized in that, The method includes: Determine the first texture map of the target 3D model and the target color information of the target part on the target 3D model; Determine the initial texture color information of the target region corresponding to the target part in the first texture map, and determine the target texture color information corresponding to the initial texture color information based on the pre-trained color processing model; Based on the target texture color information and the first texture map, a second texture map corresponding to the target color information is obtained.
2. The method according to claim 1, characterized in that, The method further includes: Acquire training sample data; wherein, the training sample data includes the expected color information of a preset part on the sample 3D model and the first color information of the texture area corresponding to the preset part in the sample texture map of the sample 3D model; The first color information is input into a pre-built channel mixer model to obtain the second color information corresponding to the first color information; Based on the second color information and the expected color information, the loss value of the preset loss function is determined, and the channel mixer parameters of the channel mixer model are adjusted based on the loss value to obtain the color processing model.
3. The method according to claim 2, characterized in that, The acquisition of training sample data includes: The sample 3D model is rendered under a preset viewpoint to generate a first sampled image corresponding to the sample 3D model; The first sampled image is processed based on a preset color processing method to obtain a second sampled image corresponding to the first sampled image; wherein, the preset color processing method includes a style redrawing method and / or a color filling method; Color sampling is performed on the second sampled image to obtain the expected color information of a preset part on the sample 3D model, and color sampling is performed on the first sampled image to obtain the first color information of the texture area corresponding to the preset part in the sample texture map of the sample 3D model.
4. The method according to claim 2, characterized in that, The acquisition of training sample data includes: Obtain the sample texture map of the sample 3D model, convert the sample texture map to a preset color space, and adjust the color of the sample texture map in the preset color space to obtain the adjusted image; Based on the perceptual color difference algorithm, the target color parameters of the sample texture map are determined to be processed into the adjusted image. Based on the target color parameters and the sample texture map, the desired effect image corresponding to the sample texture map is obtained. Color sampling is performed on the desired effect texture map and the sample texture map respectively to obtain the expected color information of the preset part on the sample 3D model and the first color information of the texture area corresponding to the preset part in the sample texture map.
5. The method according to claim 1, characterized in that, Determining the initial texture color information of the target region corresponding to the target part in the first texture map includes: The target 3D model is divided into regions based on the first texture map to obtain a mask image corresponding to the first texture map; wherein, the mask image includes a first region corresponding to the target part; Determine a second region in the first texture map that corresponds to the first region, and use the second region as the target region in the first texture map that corresponds to the target part; The initial texture information of the target area is determined based on the color information within the second area.
6. The method according to claim 5, characterized in that, The step of dividing the target 3D model into mesh regions based on the first texture map to obtain a mask image corresponding to the first texture map includes: The target 3D model is divided into regions based on the first texture map to obtain an initial stained region corresponding to the first texture map, and the initial stained region is displayed. In response to a region adjustment operation on the initial stained region, a target stained region corresponding to the initial stained region is obtained; A mask image corresponding to the first texture map is obtained based on the target stained area.
7. The method according to claim 1, characterized in that, Determining the target color information of the target region on the target 3D model includes: Obtain a reference effect image corresponding to the target 3D model, and determine the target color information of the target part on the target 3D model based on the reference image; or... Based on the color description text input for the target part on the target 3D model, the target color information of the target part on the target 3D model is determined.
8. A texture processing apparatus, characterized in that, The device includes: The first module is used to determine the first texture map of the target 3D model and the target color information of the target part on the target 3D model; The second module is used to determine the initial texture color information of the target region corresponding to the target part in the first texture map, and to determine the target texture color information corresponding to the initial texture color information based on a pre-trained color processing model. The third module is used to obtain a second texture map corresponding to the target color information based on the target texture color information and the first texture map.
9. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the texture processing method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the texture processing method according to any one of claims 1-7.