A game character skin modeling method and system

By setting grayscale thresholds and iterations in the modeling of the game character skin, combined with the multi-layer style fusion of the VGG19 neural network, the style transfer process of the game character skin modeling is optimized, solving the problem of excessive blur of maps or outline feature display, and achieving better content adaptation and visual effects.

CN120259555BActive Publication Date: 2025-09-02北京让时间多点意思网络科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510688319.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-26
Publication Date
2025-09-02
Estimated Expiration
2045-05-26

AI Technical Summary

Technical Problem

In the prior art, game character skin modeling methods with fixed style transfers can easily lead to excessive blurring of the texture or excessive display of character outline features, resulting in low content style adaptation and affecting modeling effect.

Method used

Iterative edge detection is performed by setting the starting grayscale threshold and grayscale step, combining the Sobel edge detection algorithm, analyzing the distribution of edge lines in the clothing map, determining the optimal grayscale threshold and the optimal number of iterations, using the VGG19 neural network to fuse the Gram matrix under multiple style layers, combining the content texture expression and the outstanding situation of the element values ​​of the style layer, determining the optimal number of style migrations, and obtaining the new style clothing map.

Benefits of technology

It improves the content texture expression and style adaptability of the game character skin modeling, ensures the diversity and coordination of the character skin modeling effects, and improves the visual effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120259555B_ABST
    Figure CN120259555B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of clothing texture processing, and in particular to a method and system for modeling the skin of a game character. First, a plurality of style images and clothing textures of a game character are obtained. Iterative edge detection is performed on the clothing textures, the contour distribution is analyzed, and the content texture expression is calculated to quantify the degree of retention of the original details; at the same time, a neural network is used to fuse the Gram matrix of multiple style images to construct a composite style representation; in the iterative migration process, the matrix feature prominence, the number of iterations, and the content texture expression are combined to dynamically track the balance point between the degree of stylization and the retention of the original features, and calculate the style content adaptation; finally, by analyzing the differences in the style content adaptation of all clothing textures, the optimal number of migrations is accurately located, effectively avoiding the loss of details caused by excessive stylization, achieving diversified style fusion while ensuring the expressiveness of the clothing textures, and improving the game modeling effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of clothing texture processing, and in particular to a game character skin modeling method and system. Background Art

[0002] In game development, character skin modeling is a critical step in enhancing a game's visual appeal and player immersion. With the rapid development of the gaming industry and the rise of players' aesthetic tastes, the demand for stylized and diverse character skins is growing. The character skin modeling process generally includes concept art design, 3D modeling, UV unwrapping, texturing, rigging and animation, and engine adaptation. When developing new character skins, new texture UV mapping is typically performed based on existing style series (such as the Spring Festival series, the Pool series, and the Ink Painting series).

[0003] Existing technologies typically perform style transfer (merging the content of one image with the style of another image to generate an image with a new style) by inputting a style image and a UV map into the VGG19 neural network. A fixed number of style transfers is specified to obtain the final map and perform subsequent processing. However, the map obtained with a fixed number of style transfers may overly blur or over-expose the original outline model features (such as head shape and body shape) of the game character, resulting in a low degree of content-style adaptability and unsatisfactory game character skin modeling. Summary of the Invention

[0004] In order to solve the technical problem that the textures obtained by a fixed number of style transfers may be overly blurred or over-display the original outline model features of the game character (such as head shape, body shape, etc.), resulting in low content style adaptation and unsatisfactory game character skin modeling, the purpose of the present invention is to provide a game character skin modeling method and system. The technical solutions adopted are as follows:

[0005] A game character skin modeling method, comprising:

[0006] Get the clothing texture from the initial skin image of each game character and obtain multiple style images;

[0007] Set the starting grayscale threshold and grayscale step size, perform iterative edge detection on each clothing texture, and determine the optimal grayscale threshold and optimal number of iterations based on the distribution of edge lines in the clothing texture at each iteration to calculate the content texture expression of each clothing texture;

[0008] After preselecting multiple style layers in the VGG19 neural network and setting weights to process each style image, the Gram matrices of all style images at all style layers at the same depth are fused to obtain a composite matrix.

[0009] The composite matrix and VGG19 neural network are used to iteratively transfer the style of each clothing map. Under each style transfer, the prominence of the element values ​​​​in the Gram matrix of the style layer and the number of iterations are analyzed, and combined with the content texture expressiveness to obtain the style content adaptation; the differences between the style content adaptations of all clothing maps are compared to determine the optimal number of style transfers, so as to obtain a new style clothing map for game character skin modeling.

[0010] Furthermore, the setting of the starting grayscale threshold and grayscale step size, performing iterative edge detection on each clothing map, and determining the optimal grayscale threshold and optimal number of iterations based on the distribution of edge lines in the clothing map at each iteration include:

[0011] At each iteration, an updated grayscale threshold is determined based on the starting grayscale threshold, the number of iterations, and the grayscale step size;

[0012] Perform edge detection on each clothing map based on the Sobel edge detection algorithm and the updated grayscale threshold to obtain all edge lines;

[0013] The number of pixels of the closed edge line is used as a first scalar factor, the number of pixels of the remaining edge line is used as a second scalar factor, and the ratio of the second scalar factor to the first scalar factor is normalized to obtain the value as the contour blurriness in each iteration. If the first scalar factor does not exist, the contour blurriness is a preset value.

[0014] When the update threshold is non-positive, the iterative edge detection process stops, and among all the iterations, the iteration number with the minimum contour fuzziness is taken as the optimal iteration number, and the updated grayscale threshold corresponding to the minimum contour fuzziness is taken as the optimal grayscale threshold.

[0015] Furthermore, the method for obtaining the updated grayscale threshold includes:

[0016] In each iteration, the number of iterations is multiplied by the grayscale step size to adjust the grayscale value;

[0017] The difference between the initial grayscale threshold and the adjusted grayscale value is used as the updated grayscale threshold in each iteration.

[0018] Furthermore, the method for obtaining the content texture expressiveness includes:

[0019] The ratio of the optimal grayscale threshold corresponding to each clothing map to the initial grayscale threshold is used as the first expression factor;

[0020] The value after negative correlation mapping of the ratio of the optimal number of iterations corresponding to each clothing map to the total number of iterations is used as the second expressiveness factor;

[0021] A value obtained by normalizing the product of the first expressiveness factor and the second expressiveness factor is used as the content texture expressiveness of each clothing map.

[0022] Furthermore, the method for obtaining the composite matrix includes:

[0023] At each depth, multiply the weight corresponding to each style layer by each element value in the Gram matrix under each style layer to obtain the weighted element value;

[0024] The mean of the weighted element values ​​at the same position in the Gram matrices of all style layers at each depth is used as the element value at the same position in the composite matrix, thereby obtaining the composite matrix at each depth.

[0025] Furthermore, the method for obtaining the style content adaptability includes:

[0026] In each style transfer, the prominence of the element values ​​in the Gram matrix of each style layer at the same depth compared to other style layers is analyzed, and combined with the number of iterations, the style influence value of each depth is determined;

[0027] The value after negative correlation mapping between the content texture expression of each clothing map and the style influence effectiveness value of each depth is used as the style content adaptation factor;

[0028] In each style transfer, the normalized value of the mean value of the style content adaptation factor of each clothing map at all depths is used as the style content adaptation degree of each clothing map in each style transfer.

[0029] Furthermore, the method for obtaining the style influence effectiveness value includes:

[0030] At the same depth, any style layer is selected as the target layer. At the same position in the Gram matrix, the weighted element value of the target layer is used as the numerator, the average of the weighted element values ​​corresponding to the two style layers closest to the target layer is used as the denominator, and the resulting ratio is used as the eigenvalue of the target layer at that position.

[0031] The mean of the eigenvalues ​​of the target layer at all positions in the Gram matrix is ​​used as the style influence factor of the target layer;

[0032] At the same depth, the product of the mean of the style impact factors of all style layers and the number of style transfers is normalized and used as the style impact value of the depth.

[0033] Furthermore, the method for obtaining the optimal number of style transfers includes:

[0034] During the iterative style transfer process, in each style transfer, the difference between the maximum and minimum values ​​of the style content adaptation of all clothing maps is used as the distribution range;

[0035] Among all clothing maps, calculate the absolute value of the difference between the style content adaptation of any two clothing maps as the difference factor;

[0036] The sum of all difference factors and the product of the distribution extremes are negatively correlated and normalized to obtain the value, which serves as the style content coordination factor for each style transfer.

[0037] During the iterative style transfer process, when the style content coordination factor under a certain style transfer is greater than the preset coordination threshold, the iteration is stopped and the current number of style transfers is taken as the optimal number of style transfers.

[0038] Furthermore, the acquisition of new style clothing textures for use in game character skin modeling includes:

[0039] Based on the best number of style transfers, the VGG19 neural network is used to transfer the style of each clothing map to obtain the corresponding new style clothing map;

[0040] Bind the 3D model of the game character to the skeleton to generate animations that deform naturally when the joints move;

[0041] Import all new style clothing textures, remaining textures in the initial skin image of the game character, 3D model of the game character, and animation into the game engine to generate a new skin model of the game character and perform game character skin modeling.

[0042] A game character skin modeling system includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and when the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor, the steps of a game character skin modeling method are implemented.

[0043] The present invention has the following beneficial effects:

[0044] Game character skin modeling typically involves processing the character's clothing. Therefore, clothing textures from each character's initial skin image are first obtained, along with multiple style images. These style images are used to transfer the style of the clothing textures. During the style transfer process, overly blurred or overexposed features may occur, resulting in suboptimal modeling. The original contours of the clothing textures are crucial factors influencing the performance. Therefore, a starting grayscale threshold and step size are set. Iterative edge detection is performed on each clothing texture, and the distribution of edge lines (contour features) is analyzed. The content texture expressiveness of each clothing texture is calculated, reflecting the ease with which the original clothing details within the texture can be observed. Style transfer involves blending the content of one image with the style of another. However, multiple images may express the same theme. To maximize the diversity of game character skins, the Gram matrices of all style images at all style levels at each depth of the VGG19 neural network are fused to produce a composite matrix that incorporates the various detailed styles. The composite matrix and the VGG19 neural network are then used to iteratively transfer the style of each clothing texture. The content texture expressiveness constraint supervises the theme outline of the clothing texture itself, ensuring the expressiveness of the skin content. However, as the number of style transfers increases, the content texture characteristics of the generated texture will gradually weaken, the style factors will gradually increase, and the overall visual effect will show a trend of first increasing and then decreasing. To find the optimal number of style transfers, the present invention analyzes the prominence of element values ​​in the Gram matrix under each style transfer and calculates the style content adaptability based on the number of iterations and the content texture expressiveness. The style content adaptability of all clothing textures is compared to determine the optimal number of style transfers for obtaining new style clothing textures for game character skin modeling. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0046] Figure 1 A flowchart of a method for modeling game character skin provided by one embodiment of the present invention;

[0047] Figure 2 A schematic diagram of a clothing map provided by one embodiment of the present invention;

[0048] Figure 3A flow chart of a method for obtaining an optimal grayscale threshold and an optimal number of iterations provided by one embodiment of the present invention;

[0049] Figure 4 A schematic diagram of the distribution of edge lines in each iteration of iterative edge detection provided by one embodiment of the present invention;

[0050] Figure 5 A schematic diagram showing the relationship between a visual effect and the number of style transfers provided by one embodiment of the present invention;

[0051] Figure 6 A flow chart of a method for obtaining style content adaptation provided by one embodiment of the present invention;

[0052] Figure 7 A system block diagram of a game character skin modeling system provided by one embodiment of the present invention;

[0053] Figure 8 A schematic diagram of the system structure of a game character skin modeling system provided by one embodiment of the present invention. DETAILED DESCRIPTION

[0054] To further illustrate the technical means and effects employed by the present invention to achieve the intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail a method and system for modeling game character skins according to the present invention, including its specific implementation, structure, features, and effects. In the following description, references to different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.

[0055] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0056] The following describes in detail a method and system for modeling game character skins provided by the present invention with reference to the accompanying drawings.

[0057] See also Figure 1 , which shows a method flow chart of a game character skin modeling method provided by one embodiment of the present invention, the method comprising the following steps:

[0058] Step S1: Obtain a clothing texture from the initial skin image of each game character and obtain multiple style images.

[0059] Game character skins primarily refer to a form of visual customization used to change the appearance of game characters, primarily achieved through the creation of specific texture UV maps. In order for game character skins to function properly in games, they need to be modeled. The general process is as follows: original design: drawing the character's settings; 3D modeling: performing 3D modeling based on the character's settings (including the front, side, and back) to obtain a 3D model; UV unfolding: unfolding the 3D model into a 2D plane UV map; texture rendering: rendering the 2D plane map to obtain a specific texture UV map; bone binding and animation: binding the 3D model to the skeleton to generate an animation that naturally deforms the model when the joints move; engine adaptation: importing the 3D model, specific texture UV maps, and animation into the game engine to complete the entire process of game character modeling.

[0060] When developing a new game character skin, a new texture UV map is usually drawn according to an existing style series (such as the New Year series, swimming pool series, ink style series, etc.). Specifically, the style image and UV map can be input into the VGG19 neural network model for style transfer (combining the content of one image with the style of another image to generate an image with a new style). The general process of using the VGG19 neural network model for style transfer is as follows: (1) Input the content image and style image, and generate an image copy containing random white noise as the optimization starting point; (2) Use the VGG19 neural network model to layer the content image and style image separately: in the layering of the content image, select a deeper layer (such as conv4_2) as the content layer; in the layering of the style image, select multiple shallow and deep layers (such as conv1_1, conv2_1, conv3_1, conv4_1, conv5_1) as the style layer. (The VGG19 network model is divided into 5 blocks, with a total of 19 layers, including 16 convolutional layers and the last 3 fully connected layers. Since no corresponding prediction or classification is required in style transfer, the last fully connected layer is not used. Therefore, the convolution operation from shallow to deep in the 5 blocks of VGG19 is mainly used to obtain the feature map (the width and height gradually decrease, and the depth increases layer by layer); (3) Set the loss function (content loss, style loss); (4) After setting the above parameters, start iterating from the optimization starting point, and obtain the image after style transfer after the iteration is completed.

[0061] It should be noted that the VGG19 neural network model is a well-known technology, and the specific process and operation will not be described here.

[0062] Normally, the process of modeling a new skin for a game character is done based on an existing game character. Therefore, in an embodiment of the present invention, the UV map of the game character can be exported from the game directory, and the compressed package of the UV map can be decompressed to the local storage space to obtain multiple initial skin images for each game character. The maps of the game character's face, hands and other human surface types contained in the game character's initial skin image usually do not undergo major changes. The skin modeling of the game character is usually done by drawing and processing the maps of the game character's clothing, weapons and other object types: therefore, each game character's initial skin image can be manually screened, and the object type maps can be screened out, thus obtaining the clothing maps in each game character's initial skin image. Please refer to Figure 2 , which shows a schematic diagram of a clothing map.

[0063] At the same time, multiple style images of the same style series can be selected from the local style series database. In this embodiment of the present invention, the number of style images is set to 3. The specific number can be adjusted according to the implementation scenario and is not limited here.

[0064] Step S2: Set the starting grayscale threshold and grayscale step size, perform iterative edge detection on each clothing map, and determine the optimal grayscale threshold and optimal number of iterations based on the distribution of edge lines in the clothing map at each iteration to calculate the content texture expression of each clothing map.

[0065] In the subsequent style transfer process, as the number of style transfer iterations increases, the obtained texture may become overly blurred or over-display the character's contour features, resulting in unsatisfactory game character skin modeling effects. Of these two unsatisfactory effects, the original characteristic contours in the texture are the main influencing factors for the obvious performance effect. Therefore, the subsequent style transfer process can be adjusted by analyzing the contour features in the clothing texture.

[0066] For game character skins, each clothing map is outlined by a combination of multiple layers of textures. Affected by color factors such as color and contrast, these multiple layers of textures have different highlighting effects. During the style transfer process, the outer textures mainly ensure the main outline of the clothing. These main outlines guarantee the most basic content range. If these main outlines are destroyed, the content range after the style layer changes will not be greatly restricted, thereby losing the effective expression of the skin content. The outline can be mainly represented by the edge line. Therefore, in this embodiment of the present invention, the starting grayscale threshold and grayscale step size are set, and iterative edge detection is performed on each clothing map. Based on the distribution of edge lines in the clothing map at each iteration, the optimal grayscale threshold and the optimal number of iterations are determined to calculate the content texture expression of each clothing map.

[0067] Preferably, in one embodiment of the present invention, the method for obtaining the optimal grayscale threshold and the optimal number of iterations includes:

[0068] See also Figure 3 , which shows a flow chart of a method for obtaining an optimal grayscale threshold and an optimal number of iterations in one embodiment of the present invention, the method comprising the following steps:

[0069] Step S201: At each iteration, an updated grayscale threshold is determined based on the starting grayscale threshold, the number of iterations, and the grayscale step size.

[0070] In this embodiment of the present invention, the starting grayscale threshold is set to 255. During the iteration process, the outer contour in the clothing map, that is, the main body contour, appears first. As the grayscale threshold continues to decrease, the detectable main body contour will continue to connect and thicken its edges on the basis of the previous one. Therefore, in each iteration, the number of iterations is multiplied by the grayscale step size as the adjusted grayscale value, and then the difference between the starting grayscale threshold and the adjusted grayscale value is used as the updated grayscale threshold for each iteration.

[0071] It should be noted that, in this embodiment of the present invention, the grayscale step size is set to 30. The specific step size setting can be adjusted according to the implementation scenario and is not limited here.

[0072] Step S202: performing edge detection on each clothing image using an edge detection algorithm based on the updated grayscale threshold to obtain all edge lines.

[0073] Extract structured edges under the constraint of updating the grayscale threshold: In each iteration process, edge detection is performed on each clothing map based on the Sobel edge detection algorithm and the updated grayscale threshold to obtain all edge lines.

[0074] It should be noted that the Sobel edge detection algorithm is a well-known technology, and the specific process is not described here in detail.

[0075] Step S203: Analyze the distribution of edge lines in each clothing map to determine the contour fuzziness in each iteration.

[0076] Based on the analysis in step S201, it can be seen that as the number of iterations increases, the main body contour will be connected and thickened, that is, the proportion of pixels representing the main body contour will gradually increase, and the proportion of closed edge lines will become larger. Therefore, in each iteration, the number of pixels of the closed edge lines is used as the first quantity factor, and the number of pixels of the remaining edge lines is used as the second quantity factor. The smaller the first quantity factor, the fewer pixels representing the main body contour, and the greater the contour blur. Therefore, the value after normalization of the ratio of the second quantity factor to the first quantity factor is used as the contour blur at each iteration, where if the first quantity factor does not exist, the contour blur is a preset value. Normalization is a technical means well known to those skilled in the art, and the normalization function can be linear normalization or standard normalization, etc. The specific normalization method is not limited here.

[0077] In this embodiment of the present invention, when the first quantity factor does not exist, it is considered that the contour blur is the largest. Since the contour blur when the first quantity factor exists ranges from 0 to 1, the preset value here is set to 1.

[0078] Step S204: Compare the contour blurriness in all iterations to determine the optimal grayscale threshold and the optimal number of iterations.

[0079] During the iterative edge detection process, the iterative edge detection process stops when the update threshold is a non-positive number.

[0080] The optimal number of iterations should be the iteration number with the clearest contour. Therefore, among all the iteration numbers, the iteration number with the minimum contour blur is taken as the optimal number of iterations, and the updated grayscale threshold corresponding to the minimum contour blur is taken as the optimal grayscale threshold.

[0081] See also Figure 4 , which shows a schematic diagram of the distribution of edge lines in each iteration of iterative edge detection in this embodiment of the present invention.

[0082] It should be noted that in this embodiment of the present invention, when processing an image, if it is necessary to perform a grayscale operation on the image, methods such as average grayscale, maximum value method or weighted grayscale can be used, and they are all technical means well known to those skilled in the art and are not limited or elaborated here.

[0083] At this point, the optimal grayscale threshold and the optimal number of iterations can be determined during the iterative edge detection process for each clothing map. These two indicators represent the grayscale threshold and the number of iterations when the main outline of the clothing map is clearest. Based on these two indicators, the content texture expression of each clothing map can be calculated.

[0084] Preferably, in one embodiment of the present invention, the method for obtaining content texture expressiveness includes:

[0085] In the iterative edge detection process, the earlier the optimal number of edge displays appears, that is, the smaller the optimal number of iterations, the more obvious the original color contrast of the clothing map is, and the stronger the content expression of the clothing texture in the clothing map is.

[0086] Given that the grayscale threshold gradually decreases with the progression of iterative edge detection, the larger the optimal grayscale threshold, the stronger the content texture expression. Therefore, the ratio of the optimal grayscale threshold corresponding to each clothing map to the starting grayscale threshold is used as the first expression factor. The larger the first expression factor, the earlier the optimal number of iterations appears and the better the texture expression of the clothing map.

[0087] Since the smaller the optimal number of iterations, the better the content texture expression, the ratio of the optimal number of iterations corresponding to each clothing map to the total number of iterations is negatively correlated and mapped to achieve logical relationship correction, thereby obtaining the second expression factor. At this time, the larger the second expression factor, the earlier the optimal number of iterations appears, and the better the content texture expression of the clothing map. The negative correlation mapping and normalization processing here can be used as formula ,in, It represents the exponential function with the natural constant e as the base, and x represents the independent variable.

[0088] Finally, the product of the first and second expressiveness factors is normalized to obtain the value representing the content texture expressiveness of each clothing texture. Normalization is a well-known technique for those skilled in the art, and the normalization function can be linear normalization or standard normalization. The specific normalization method is not limited here.

[0089] Step S3: After preselecting multiple style layers in the VGG19 neural network and setting weights to process each style image, the Gram matrices of all style images at all style layers at the same depth are fused to obtain a composite matrix.

[0090] Style transfer refers to the process of combining the content of one image with the style of another image to generate an image with a new style. Conventionally, when using the VGG19 neural network to perform style transfer on a target image, only one image's style is manually selected as the style to be transferred by the neural network. A Gram matrix is ​​then extracted from this image as the style matrix for the subsequent style transfer process. However, style expression is a relatively vague concept. The same theme (e.g., Spring Festival) may actually include multiple image styles, each displaying the same theme in a relatively unique way. Furthermore, in real-world scenarios, players' requirements for game character skins vary due to individual and quantitative differences. Therefore, the actual design of game character skins is typically complex (e.g., a blend of Spring Festival styles with different detailed styles in the Spring Festival series) to meet the diverse needs of game character skins. Therefore, in this embodiment of the present invention, multiple style layers are preselected in the VGG19 neural network, and weights are assigned to each style image. The Gram matrices of all style images at all style layers at the same depth are then fused to produce a composite matrix. The composite matrix combines the Gram matrices of these style images at all style layers at the same depth to represent the fusion of multiple detailed styles.

[0091] Preferably, in one embodiment of the present invention, the method for obtaining the composite matrix includes:

[0092] First, each style image is layered based on the VGG19 neural network. In this embodiment of the present invention, conv1_1, conv2_1, conv3_1, conv4_1, and conv5_1 are used as style layers (the selected layers can be changed as needed), and the Gram matrix of each style image under each style layer is obtained. The weight of each style layer can be set according to the implementation scenario and ranges from 0 to 1.

[0093] The Gram matrices at the same depth have the same size and contain the same number of elements, so all Gram matrices at each depth are fused: at each depth, the weight corresponding to each style layer is multiplied by each element value in the Gram matrix at each style layer to obtain the weighted element value. At this time, the element values ​​in all Gram matrices at each depth are weighted element values.

[0094] Finally, at the same depth, the mean of the weighted element values ​​at the same position in the Gram matrices of all style layers is used as the element value at the same position in the composite matrix, thereby obtaining the composite matrix at each depth.

[0095] Step S4: Use the composite matrix and VGG19 neural network to iteratively transfer the style of each clothing map. Under each style transfer, analyze the prominence of the element values ​​in the Gram matrix of the style layer and the number of iterations, and combine it with the content texture expression to obtain the style content adaptation; compare the differences between the style content adaptations of all clothing maps, determine the optimal number of style transfers, and thus obtain a new style clothing map for game character skin modeling.

[0096] According to the composite matrix at each depth, the VGG19 neural network is used to iteratively transfer the style of each local clothing image. The initial value of the number of style transfers is set to 1, and the step size is 1, so as to obtain the new style clothing map after style transfer for game character skin modeling.

[0097] The content texture expressiveness constraint of each clothing map supervises the main outline of the skin content in the clothing map, ensuring the expressiveness of the skin content. However, during the iterative style transfer process, as the number of style transfers increases, the content texture features of the generated new style clothing map will continue to weaken, while its style factors will continue to increase. The two will be in an inverse distribution as a whole, and the corresponding visual effect will change with a trend of first increasing and then decreasing. Please refer to Figure 5 , which shows a schematic diagram of the relationship between visual effects and the number of style transfers in one embodiment of the present invention. Since the style factors are derived from a composite matrix, the composite matrix will directly affect the visual effects of the generated local style clothing map. The more complex the style weights contained in the composite matrix, the more mixed and comprehensive the style factors are. Therefore, under the composite matrix, as the number of style transfers increases, the various detailed style methods mixed in the style factors will gradually be amplified, thereby further amplifying the trend of the increasingly aggravated change of the style factors. Therefore, in order to determine the optimal number of style transfers, under each style transfer, the prominence of the element values ​​in the Gram matrix of the style layer and the number of iterations are analyzed, and combined with the content texture expression to obtain the style content adaptation. Finally, the differences between the style content adaptations of all clothing maps are compared to determine the optimal number of style transfers, thereby obtaining a new style clothing map for game character skin modeling.

[0098] Preferably, in one embodiment of the present invention, the method for obtaining style content adaptability includes:

[0099] See also Figure 6 , which shows a flow chart of a method for obtaining style content adaptation in one embodiment of the present invention, the method comprising the following steps:

[0100] Step S401: Under each style transfer, analyze the prominence of the element values ​​in the Gram matrix of each style layer at the same depth compared with the element values ​​in the Gram matrices of other style layers, and combine the number of iterations to determine the style influence effectiveness value of each depth.

[0101] At the same depth, any style layer is selected as the target layer. At the same position in the Gram matrix, the weighted element value of the target layer is used as the numerator, and the average of the weighted element values ​​corresponding to the two style layers closest to the target layer is used as the denominator. The resulting ratio is used as the eigenvalue of the target layer at this position. The larger the eigenvalue, the more prominent the weighted element value of the target layer. Then, the average of the eigenvalues ​​of the target layer at all positions in the Gram matrix is ​​used as the style influence effectiveness factor of the target layer. At this time, the larger the style influence effectiveness factor, the greater the influence proportion of the Gram matrix of the target layer.

[0102] As iterations progress, the weight of style influence increases, while the content texture features gradually weaken. Therefore, at the same depth, the style influence value for that depth is normalized by multiplying the mean of the style influence factors of all style layers by the number of style transfers. A larger value indicates a greater style influence. Normalization is a well-known technique for those skilled in the art, and the normalization function can be linear normalization or standard normalization. The specific normalization method is not limited here.

[0103] Step S402: Determine a style content adaptation factor by comprehensively considering the content texture expression of each clothing map and the style influence effectiveness value at each depth.

[0104] For each clothing map, the texture distribution at the best number of iterations in its iterative edge detection process is the clothing texture combination that best represents the skin of its game character; and the corresponding content texture expression reflects, to a certain extent, the contrast when creating a new style of skin based on the texture of the original content. The greater the content texture expression, the greater the restriction of the content texture on the modeling of the new style of skin when the clothing map is performing style transfer, and the skin change effect after style transfer is easier to observe. Therefore, based on the content texture expression of each clothing map and the style influence effectiveness value at each depth under each style transfer, the content style adaptability under the current style transfer can be calculated.

[0105] Calculate the ratio of the content texture expression of each clothing map to the style influence value of each depth. The larger the ratio, the greater the content texture restriction and the smaller the style influence. Therefore, the value after negative correlation mapping of the ratio is used as the style content adaptation factor. At this time, the larger the style content adaptation factor, the smaller the content texture restriction and the greater the influence of style factors. The negative correlation mapping here can be used , where x represents the independent variable.

[0106] Step S403: Under each style transfer, the style content adaptation factors of each clothing map at all depths are integrated to obtain the style content adaptation degree of each clothing map under each style transfer.

[0107] Based on the above steps, the style content adaptation factor of each clothing texture at each depth under each style transfer can be obtained. Here, the style content adaptation factors at all depths can be integrated: under each style transfer, the average value of the style content adaptation factor of each clothing texture at all depths is normalized and used as the style content adaptation degree of each clothing texture under each style transfer. Normalization is a technical means well known to those skilled in the art. The normalization function can be linear normalization or standard normalization, etc. The specific normalization method is not limited here.

[0108] After obtaining the style content adaptability of each clothing map under each style transfer, since in the actual process, different clothing maps each have a certain amount of clothing features, after style processing, the differences in clothing features between different clothing maps may increase, making the visual effect of skin combination modeling of clothing maps inconsistent. Therefore, under the same number of style transfer iterations, it is necessary to supervise the style coordination of different clothing maps. That is, under each style transfer, the differences between the style content adaptability of all clothing maps can be compared to determine the optimal number of style transfers.

[0109] Preferably, in one embodiment of the present invention, the method for obtaining the optimal number of style transfer times includes:

[0110] During the iterative style transfer process, the difference between the maximum and minimum values ​​of the style content adaptability of all clothing maps in each style transfer is used as the distribution range. The larger the distribution range, the greater the difference in the style content adaptability of all clothing maps in this style transfer, the worse the coordination, and therefore the lower the possibility that this style transfer will be the best style transfer.

[0111] Then, among all clothing maps, the absolute value of the difference between the style content adaptation of any two clothing maps is calculated as the difference factor. The larger the difference factor, the worse the coordination of the style content of the two clothing maps is, which also reflects that the possibility of this style transfer being the best style transfer is lower.

[0112] Then, the sum of all difference factors is multiplied by the distribution range. Based on the above analysis, the larger the product of the two, the worse the coordination between all clothing maps in a certain style transfer. Therefore, the product is negatively correlated and normalized to achieve logical relationship correction, thereby obtaining the style content coordination factor under each style transfer. The larger the style content coordination factor at this time, the better the style coordination of all clothing maps under this style transfer. The negative correlation mapping and normalization here can be used as formula ,in, It represents the exponential function with the natural constant e as the base, and x represents the independent variable.

[0113] Therefore, in the iterative style transfer process, when the style content coordination factor under a certain style transfer is greater than the preset coordination threshold, the iteration is stopped and the current number of style transfers is taken as the optimal number of style transfers.

[0114] It should be noted that, in this embodiment of the present invention, the preset coordination threshold is set to 0.8, and the specific value can be adjusted according to the implementation scenario and is not limited here.

[0115] At this point, the optimal number of style transfers can be obtained, and the clothing texture can be further processed based on the optimal number of style transfers to obtain a new style clothing texture for game character skin modeling.

[0116] Preferably, in one embodiment of the present invention, obtaining a new style clothing texture for use in game character skin modeling includes:

[0117] According to the optimal number of style transfers, the VGG19 neural network is used to perform style transfer on each clothing map to obtain the corresponding new style clothing map.

[0118] The 3D model of the game character is then bound to the skeleton to generate an animation in which the model deforms naturally when the joints move.

[0119] Finally, all new style clothing textures, the remaining textures in the game character's initial skin image, the game character's 3D model, and animation are imported into the game engine to generate a new skin model for the game character and perform game character skin modeling.

[0120] It should be noted that the operations of using the VGG19 neural network for style transfer, 3D modeling, and importing into game engines mentioned in this embodiment of the present invention are all well-known technologies, and the specific process will not be repeated here.

[0121] In summary, game character skin modeling typically involves processing the character's clothing. Therefore, the initial clothing textures for each character's skin image are first obtained, along with multiple style images. These style images are used to transfer the style of the clothing textures. During the style transfer process, overly blurred or overexposed features may occur, resulting in suboptimal modeling. The original contours of the clothing textures are crucial factors influencing the performance. Therefore, a starting grayscale threshold and step size are set. Iterative edge detection is performed on each clothing texture, and the distribution of edge lines (contour features) is analyzed. The content texture expressiveness of each clothing texture is calculated, reflecting the ease with which the original clothing details within the texture can be observed. Style transfer involves blending the content of one image with the style of another. However, multiple images may express the same theme. To maximize the diversity of game character skins, the Gram matrices of all style images at all style levels at each depth of the VGG19 neural network are fused to produce a composite matrix that incorporates the various detailed styles. This composite matrix and the VGG19 neural network are then used to iteratively transfer the style of each clothing texture. The content texture expressiveness constraint supervises the theme outline of the clothing texture itself, ensuring the expressiveness of the skin content. However, as the number of style transfers increases, the content texture characteristics of the generated texture will gradually weaken, the style factors will gradually increase, and the overall visual effect will show a trend of first increasing and then decreasing. To find the optimal number of style transfers, the embodiment of the present invention analyzes the prominence of element values ​​in the Gram matrix during each style transfer and calculates the style content adaptation based on the number of iterations and content texture expressiveness. The style content adaptation of all clothing textures is compared to determine the optimal number of style transfers for obtaining new style clothing textures for game character skin modeling.

[0122] The present invention also provides a game character skin modeling system, see Figure 7 , which shows a system block diagram, including: a data acquisition module 701, used to implement step S1 in the above method embodiment; a content texture analysis module 702, used to implement step S2 in the above method embodiment; a composite matrix fusion module 703, used to implement step S3 in the above method embodiment; a style transfer and modeling module 704, used to implement step S4 in the above method embodiment.

[0123] It should be noted that the system provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. In addition, the game character skin modeling system and the game character skin modeling method embodiment provided in the above embodiment are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0124] See also Figure 8 , which shows a system structure diagram of a game character skin modeling system provided by an embodiment of the present invention, including a processor 800, a memory 801, a bus 802 and a communication interface 803, wherein the processor 800, the communication interface 803 and the memory 801 are connected via the bus 802; wherein the memory 801 may include a high-speed random access memory, the bus 802 may be an ISA bus, a PCI bus or an EISA bus, etc., and the processor 800 may be an integrated circuit chip with signal processing capabilities; the memory 801 stores at least one instruction, at least one program, a code set or an instruction set, and when the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor, a step in a game character skin modeling method is implemented.

[0125] It should be noted that the order in which the embodiments of the present invention are described above is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0126] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.

Claims

1. A game character skin modeling method, characterized in that: The method comprises: Get the clothing texture from the initial skin image of each game character and obtain multiple style images; Set the starting grayscale threshold and grayscale step size, perform iterative edge detection on each clothing texture, and determine the optimal grayscale threshold and optimal number of iterations based on the distribution of edge lines in the clothing texture at each iteration to calculate the content texture expression of each clothing texture; After preselecting multiple style layers in the VGG19 neural network and setting weights to process each style image, the Gram matrices of all style images at all style layers at the same depth are fused to obtain a composite matrix. Using a composite matrix and the VGG19 neural network, we iteratively transfer the style of each clothing texture. During each style transfer, we analyze the prominence of the element values ​​in the style layer's Gram matrix and the number of iterations. This is then combined with the content texture expressiveness to determine the style-content fit. We then compare the style-content fits of all clothing textures to determine the optimal number of style transfers, thereby obtaining a new style clothing texture for character skin modeling. The method for obtaining the content texture expression includes: The ratio of the optimal grayscale threshold to the initial grayscale threshold corresponding to each clothing map is used as the first expression factor; The value after negative correlation mapping of the ratio of the optimal number of iterations corresponding to each clothing map to the total number of iterations is used as the second expressiveness factor; A value obtained by normalizing the product of the first expressiveness factor and the second expressiveness factor is used as the content texture expressiveness of each clothing map.

2. A game character skin modeling method according to claim 1, characterized in that: The method of setting a starting grayscale threshold and a grayscale step size, performing iterative edge detection on each clothing map, and determining an optimal grayscale threshold and an optimal number of iterations based on the distribution of edge lines in the clothing map at each iteration includes: At each iteration, an updated grayscale threshold is determined based on the starting grayscale threshold, the number of iterations, and the grayscale step size; Perform edge detection on each clothing map based on the Sobel edge detection algorithm and the updated grayscale threshold to obtain all edge lines; The number of pixels of the closed edge line is used as a first scalar factor, the number of pixels of the remaining edge line is used as a second scalar factor, and the ratio of the second scalar factor to the first scalar factor is normalized to obtain the value as the contour blurriness in each iteration. If the first scalar factor does not exist, the contour blurriness is a preset value. When the update threshold is non-positive, the iterative edge detection process stops, and among all the iterations, the iteration number with the minimum contour fuzziness is taken as the optimal iteration number, and the updated grayscale threshold corresponding to the minimum contour fuzziness is taken as the optimal grayscale threshold.

3. A game character skin modeling method according to claim 2, characterized in that: The method for obtaining the updated grayscale threshold includes: In each iteration, the number of iterations is multiplied by the grayscale step size to adjust the grayscale value; The difference between the initial grayscale threshold and the adjusted grayscale value is used as the updated grayscale threshold in each iteration.

4. A game character skin modeling method according to claim 1, characterized in that: The method for obtaining the composite matrix includes: At each depth, multiply the weight corresponding to each style layer by each element value in the Gram matrix under each style layer to obtain the weighted element value; The mean of the weighted element values ​​at the same position in the Gram matrices of all style layers at each depth is used as the element value at the same position in the composite matrix, thereby obtaining the composite matrix at each depth.

5. A game character skin modeling method according to claim 4, characterized in that: The method for obtaining the style content adaptability includes: In each style transfer, the prominence of the element values ​​in the Gram matrix of each style layer at the same depth compared to other style layers is analyzed, and combined with the number of iterations, the style influence value of each depth is determined; The value after negative correlation mapping between the content texture expression of each clothing map and the style influence effectiveness value of each depth is used as the style content adaptation factor; In each style transfer, the normalized value of the mean value of the style content adaptation factor of each clothing map at all depths is used as the style content adaptation degree of each clothing map in each style transfer.

6. A game character skin modeling method according to claim 5, characterized in that: The method for obtaining the style influence effectiveness value includes: At the same depth, any style layer is selected as the target layer. At the same position in the Gram matrix, the weighted element value of the target layer is used as the numerator, the average of the weighted element values ​​corresponding to the two style layers closest to the target layer is used as the denominator, and the resulting ratio is used as the eigenvalue of the target layer at that position. The mean of the eigenvalues ​​of the target layer at all positions in the Gram matrix is ​​used as the style influence factor of the target layer; At the same depth, the product of the mean of the style impact factors of all style layers and the number of style transfers is normalized and used as the style impact value of the depth.

7. A game character skin modeling method according to claim 1, characterized in that: The method for obtaining the optimal number of style transfers includes: During the iterative style transfer process, in each style transfer, the difference between the maximum and minimum values ​​of the style content adaptation of all clothing maps is used as the distribution range; Among all clothing maps, calculate the absolute value of the difference between the style content adaptation of any two clothing maps as the difference factor; The sum of all difference factors and the product of the distribution extremes are negatively correlated and normalized to obtain the value, which serves as the style content coordination factor for each style transfer. During the iterative style transfer process, when the style content coordination factor under a certain style transfer is greater than the preset coordination threshold, the iteration is stopped and the current number of style transfers is taken as the optimal number of style transfers.

8. A game character skin modeling method according to claim 1, characterized in that: The method of obtaining a new style clothing texture for modeling the game character skin includes: Based on the best number of style transfers, the VGG19 neural network is used to transfer the style of each clothing map to obtain the corresponding new style clothing map; Bind the 3D model of the game character to the skeleton to generate animations that deform naturally when the joints move; Import all new style clothing textures, remaining textures in the initial skin image of the game character, 3D model of the game character, and animation into the game engine to generate a new skin model of the game character and perform game character skin modeling.

9. A game character skin modeling system, characterized in that: The method comprises a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and when the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor, the steps of a game character skin modeling method as described in any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Chuxiong textile clothing element migration method and system based on convolutional neural network

    CN116342578A

  • Game role skin modeling method and device, equipment and storage medium

    CN116402676A