Image generation method and apparatus, storage medium, and electronic device
By acquiring the initial information of the virtual character and determining the set of color channel values, an algorithm is used to generate the virtual character image, solving the problems of long production cycles and low efficiency caused by artists drawing by hand, and achieving the effects of rapid generation and reduced costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2023-02-03
- Publication Date
- 2026-07-24
AI Technical Summary
The current technology, which relies on artists to manually draw virtual character avatars, suffers from long production cycles, low efficiency, and high labor costs.
By obtaining the initial information of the virtual character, determining the set of color channel values, and generating a virtual character image based on this set, the algorithm is used for classification and iterative mapping to generate a virtual character image that conforms to the drawing style.
It enables the rapid generation of virtual character images, reduces labor costs, and improves the efficiency of virtual character image processing.
Smart Images

Figure CN116188644B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and more specifically, to an image generation method, apparatus, storage medium, and electronic device. Background Technology
[0002] Game applications typically include a large number of virtual characters. Since the backgrounds and personalities of different virtual characters may vary, it is necessary to use virtual character avatars to reflect the character's temperament, thereby better representing the character's image and making it easier to distinguish from other virtual characters.
[0003] Currently, due to the high level of complexity in creating virtual character avatars, they are typically drawn entirely by hand by artists. During the drawing process, artists refer to the facial features, expressions, makeup, and lighting of virtual characters with similar characteristics to the virtual character being created. Based on these references, they then draw and render a virtual character avatar that captures the essence of the intended virtual character.
[0004] The aforementioned process of manually drawing virtual character avatars by artists is complex, resulting in a long production cycle, low efficiency, and high labor costs.
[0005] There is currently no effective solution to the above problems. Summary of the Invention
[0006] At least some embodiments of this application provide an image generation method, apparatus, storage medium, and electronic device to at least solve the technical problems in the related art, such as the long production cycle, low production efficiency, and high labor cost of virtual character avatars due to artists drawing virtual character avatars purely by hand.
[0007] According to one embodiment of this application, an image generation method is provided, the image generation method comprising: obtaining initial information of a virtual character, wherein the initial information is used to represent the drawing style of the virtual character, and the drawing style is determined by pre-input content; determining a color channel value set according to the initial information, wherein the color channel value set includes the color channel value of each pixel of the virtual character image; and generating a virtual character image based on the color channel value set.
[0008] Optionally, after obtaining the initial information of the virtual character, the image generation method further includes: classifying the initial information according to a first algorithm to obtain target information, wherein the first algorithm is used to classify according to the category label of the drawing style.
[0009] Optionally, before classifying the initial information according to the first algorithm to obtain the target information, the image generation method further includes: projecting multiple preset images into a multi-dimensional coordinate system to obtain a point cloud data set, wherein the preset images are preset virtual character images with predetermined initial information, and each dimension of the multi-dimensional coordinate system corresponds to different categories of drawing styles; determining a classification line for each drawing style according to the point cloud data set, wherein the classification line is used to divide each drawing style, and each drawing style includes at least one sub-drawing style; determining a classification expression according to the classification line, wherein the classification expression is used to divide any two drawing styles; and determining the first algorithm based on the classification expression.
[0010] Optionally, determining the color channel value set based on the initial information includes: using a second algorithm to iteratively map the color channel values of each pixel generated corresponding to the target information to obtain the color channel value set, wherein the second algorithm is used to determine the color channel value corresponding to each pixel in the virtual character image.
[0011] Optionally, before using the second algorithm to iteratively map the color channel values of each pixel corresponding to the target information to obtain a set of color channel values, the image generation method further includes: iteratively mapping the overall pixel regions of multiple preset images to obtain a first result, wherein the first result is used to represent a first target parameter corresponding to each drawing style of the multiple preset images; iteratively mapping the preset pixel regions of the multiple preset images based on the first result to obtain a second result, wherein the second result is used to represent a second target parameter corresponding to the preset pixel regions; iteratively mapping each pixel of the multiple preset images based on the second result to obtain a third result, wherein the third result is used to represent the color channel value of each pixel of the multiple preset images; and determining the second algorithm based on the first result, the second result, and the third result.
[0012] Optionally, iteratively mapping the overall pixel region of multiple preset images to obtain a first result includes: iteratively mapping a first parameter corresponding to each drawing style of each preset image, wherein the first parameter is the sum of the total lumen value and the total color channel value; and determining the first parameter whose variance meets the first preset condition as the first result.
[0013] Optionally, the second result is obtained by iteratively mapping the preset pixel regions of multiple preset images based on the first result, including: iteratively mapping the second parameter corresponding to each preset pixel region of each preset image based on the first result, wherein the second parameter is the sum of the total lumen value and the total color channel value; and determining the second parameter whose variance meets the second preset condition as the second result.
[0014] Optionally, the third result is obtained by iteratively mapping each pixel of multiple preset images based on the second result, including: iteratively mapping the third parameter corresponding to each pixel of each preset image based on the second result, wherein the third parameter is a color channel value; and determining the third parameter whose variance meets the third preset condition as the third calculation result.
[0015] According to one embodiment of this application, an image generation apparatus is also provided, comprising: an acquisition module for acquiring initial information of a virtual character, wherein the initial information represents the drawing style of the virtual character, and the drawing style is determined by pre-input content; a determination module for determining a set of color channel values based on the initial information, wherein the set of color channel values includes the color channel values of each pixel of the virtual character image; and a generation module for generating a virtual character image based on the set of color channel values.
[0016] Optionally, the image generation apparatus further includes a classification module, which is used to classify the initial information according to a first algorithm to obtain target information, wherein the first algorithm is used to classify according to the category label of the drawing style.
[0017] Optionally, the image generation device further includes: a first training module, which projects multiple preset images into a multi-dimensional coordinate system to obtain a point cloud data set, wherein the preset images are preset virtual character images with predetermined initial information, and each dimension of the multi-dimensional coordinate system corresponds to different categories of drawing styles; determines a classification line for each drawing style based on the point cloud data set, wherein the classification line is used to divide each drawing style, and each drawing style includes at least one sub-drawing style; determines a classification expression based on the classification line, wherein the classification expression is used to divide any two drawing styles; and determines a first algorithm based on the classification expression.
[0018] Optionally, the determining module is further configured to use a second algorithm to iteratively map the color channel values of each pixel generated corresponding to the target information to obtain a set of color channel values, wherein the second algorithm is used to determine the color channel values corresponding to each pixel in the virtual character image.
[0019] Optionally, the image generation device further includes: a second training module, which is used to iteratively map the overall pixel regions of multiple preset images to obtain a first result, wherein the first result is used to represent a first target parameter corresponding to each drawing style of the multiple preset images; iteratively map the preset pixel regions of the multiple preset images based on the first result to obtain a second result, wherein the second result is used to represent a second target parameter corresponding to the preset pixel regions; iteratively map each pixel of the multiple preset images based on the second result to obtain a third result, wherein the third result is used to represent the color channel value of each pixel of the multiple preset images; and determine a second algorithm based on the first result, the second result, and the third result.
[0020] Optionally, the second training module is also used to iteratively map the first parameter corresponding to each rendering style of each preset image, wherein the first parameter is the sum of the total lumen value and the total color channel value; and to determine the first parameter whose variance meets the first preset condition as the first result.
[0021] Optionally, the second training module is further configured to iteratively map the second parameter corresponding to each preset pixel region of each preset image based on the first result, wherein the second parameter is the sum of the total lumen value and the total color channel value; and determine the second parameter whose variance meets the second preset condition as the second result.
[0022] Optionally, the second training module is further used to iteratively map the third parameter corresponding to each pixel of each preset image based on the second result, wherein the third parameter is a color channel value; and to determine the third parameter whose variance meets the third preset condition as the third calculation result.
[0023] According to one embodiment of this application, a computer-readable storage medium is also provided, which stores a computer program, wherein the computer program is configured to execute the image generation method described above when run by a processor.
[0024] According to one embodiment of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the image generation method described in any of the preceding claims.
[0025] In at least some embodiments of this application, the method involves obtaining initial information of a virtual character, wherein the initial information represents the drawing style of the virtual character, and the drawing style is determined by pre-input content; determining a set of color channel values based on the initial information, wherein the set of color channel values includes the color channel values of each pixel of the virtual character image; and generating a virtual character image based on the set of color channel values. This method achieves the goal of generating a virtual character image corresponding to the drawing style described by the input natural language text, thereby realizing the technical effects of quickly generating virtual character images, reducing labor costs, and improving the processing efficiency of virtual character images. It also solves the technical problems in related technologies where virtual character avatars are drawn purely by artists by hand, resulting in long production cycles, low production efficiency, and high labor costs. Attached Figure Description
[0026] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0027] Figure 1 This is a hardware structure block diagram of a mobile terminal for an image generation method according to an embodiment of this application;
[0028] Figure 2 This is a flowchart of an image generation method according to one embodiment of this application;
[0029] Figure 3 This is a schematic diagram of a virtual character image generated according to one embodiment of this application;
[0030] Figure 4 This is a schematic diagram of the structure of an image generation apparatus according to one optional embodiment of the present application;
[0031] Figure 5 This is a hardware structure block diagram of an electronic device for an image generation method according to an embodiment of the present invention. Detailed Implementation
[0032] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0033] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application 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 this application 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 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.
[0034] In one possible implementation, the creation of virtual character avatars in the field of image processing technology is typically achieved by having artists manually draw the avatars. After practical experience and careful research, the applicant found that this method still suffers from technical problems such as long production cycles, low efficiency, and high labor costs. Therefore, this application proposes an image generation method. This method is applied in the process of creating virtual character avatars, such as in games. It involves obtaining initial information about the virtual character, where the initial information represents the character's drawing style, which is determined by pre-input content. A color channel value set is then determined based on the initial information, including the color channel values of each pixel in the virtual character image. This method generates a virtual character image based on the color channel value set, achieving the goal of generating a virtual character image corresponding to the drawing style described by the input content. This solves the technical problems of long production cycles, low efficiency, and high labor costs associated with manually drawing virtual character avatars by artists in related technologies. Ultimately, it achieves the technical effects of rapidly generating virtual character images, reducing labor costs, and improving the efficiency of virtual character image processing.
[0035] The methods described in this application can be executed on a mobile terminal, computer terminal, or similar computing device. For example, when running on a mobile terminal, the mobile terminal can be a smartphone, tablet computer, PDA, mobile internet device, PAD, game console, or other terminal device. Figure 1 This is a hardware structure block diagram of a mobile terminal for an image generation method according to an embodiment of this application. For example... Figure 1 As shown, a mobile terminal may include one or more ( Figure 1Only one is shown in the image. Processor 102 (processor 102 may include, but is not limited to, a central processing unit (CPU), graphics processing unit (GPU), digital signal processing (DSP) chip, microprocessor (MCU), programmable logic device (FPGA), neural network processor (NPU), tensor processor (TPU), artificial intelligence (AI) type processor, etc.) and memory 104 for storing data. In one embodiment of this application, it may also include: transmission device 106, input / output device 108 and display device 110.
[0036] In some optional embodiments primarily focused on gaming scenarios, the aforementioned device may also provide a human-computer interaction interface with a touch-sensitive surface. This interface can sense finger contact and / or gestures to interact with a graphical user interface (GUI). The human-computer interaction functions may include the following: creating web pages, drawing, word processing, creating electronic documents, playing games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music, and / or web browsing, etc. Executable instructions for performing the aforementioned human-computer interaction functions are configured / stored in one or more processor-executable computer program products or readable storage media.
[0037] Those skilled in the art will understand that Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0038] According to one embodiment of this application, an embodiment of an image generation method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0039] In one possible implementation, embodiments of this application provide an image generation method. Figure 2 This is a flowchart of an image generation method according to one embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:
[0040] Step S20: Obtain the initial information of the virtual character.
[0041] The initial information is used to represent the drawing style of the virtual character, and the drawing style is determined by the pre-input content.
[0042] The drawing style of virtual characters includes, but is not limited to, the character's art style, historical setting, artistic style, lighting, color tone, age, and character style. Specifically, art style includes impasto and cel animation; historical setting includes science fiction, modern, classical Chinese, and Baroque; artistic style includes fantasy and realism; lighting includes frontal and side lighting; color tone includes red and blue tones; age includes youth and old age; and character style includes cunning and righteousness.
[0043] By classifying the drawing styles of virtual characters, we can more accurately describe their appearance based on various drawing styles, thereby better reflecting their character traits.
[0044] It is understood that drawing styles can be added or reduced according to actual circumstances. The embodiments in this application are merely examples and do not limit the drawing styles. In the embodiments of this application, the drawing styles include the above seven types (drawing style, background era, art style, light source, color tone, age, and character style) as examples.
[0045] The pre-input content can be in the form of natural language text, such as everyday languages like Chinese, English, or French. Using natural language text to describe the drawing style allows artists to more intuitively express the temperament of the virtual character they want to create. For example, if an artist wants to draw a righteous young virtual character, and wants the character to be illuminated from the front, with a reddish hue, a cel-shaded art style, a modern setting, and a fantasy art style, then only seven sets of information need to be input using natural language text: cel-shaded, modern, fantasy, frontal light source, reddish hue, young, and righteous. Furthermore, the pre-input content can also be in the form of code, such as using ASCII, Unicode, or ISO8859-1 encoding. Input codes corresponding to each drawing style can be predefined, allowing artists to intuitively express the temperament of the virtual character they want to create by inputting the corresponding codes. Alternatively, the pre-input content can also be in other predefined character forms; this embodiment of the application does not limit this.
[0046] The initial information of a virtual character is the drawing style that the artist wants to create by inputting pre-entered content. Since the drawing style of a virtual character can reflect its temperament, by dividing it into multiple drawing styles and inputting the corresponding initial information according to the type of drawing style, a virtual character image can be generated. This can generate a virtual character image that better matches the temperament of the virtual character as expected by the artist, and thus better represent the image of the virtual character.
[0047] Step S22: Determine the set of color channel values based on the initial information.
[0048] The color channel value set includes the color channel values of each pixel in the virtual character image.
[0049] The color channel value set is the set of color channel values (RGB) of each pixel in the virtual character image to be generated.
[0050] The RGB values of each pixel in the virtual character image to be generated are determined based on the initial input information. Since this RGB value is determined based on the initial input information, which is input by the artist according to the virtual character they want to generate, the RGB values of each pixel determined based on the initial information can better match the color values expected by the artist. Therefore, the virtual character image generated based on this RGB set can be closer to the virtual character image that the artist wants to generate and better match the artist's expectations.
[0051] Step S24: Generate a virtual character image based on the set of color channel values.
[0052] As mentioned earlier, virtual character images generated based on the RGB set determined by the initial information pre-input by the artist are closer to the virtual character images that the artist wants to generate and better meet the artist's expectations. In other words, the generated virtual character images can accurately reflect the temperament of the virtual character that the artist wants to generate.
[0053] Figure 3 This is a schematic diagram of a virtual character image generated according to one embodiment of this application. For example, the virtual character image finally generated in step S24 is as follows: Figure 3 As shown, the virtual character image is not only realistic, but also best reflects the temperament of the virtual character that the artist intends to generate. Therefore, the artist only needs to make slight modifications to the final generated virtual character image to draw the final image that is expected, which effectively reduces labor costs and improves the production efficiency of virtual character images.
[0054] Through the above steps, the method involves obtaining initial information about the virtual character, where the initial information represents the drawing style of the virtual character and the drawing style is determined by pre-input content; determining a set of color channel values based on the initial information, where the set of color channel values includes the color channel values of each pixel in the virtual character image; and generating a virtual character image based on the set of color channel values. This achieves the goal of generating a virtual character image corresponding to the drawing style described by the input content, thereby realizing the technical effects of quickly generating virtual character images, reducing labor costs, and improving the efficiency of virtual character image processing. Furthermore, it solves the technical problems in related technologies where virtual character avatars are drawn purely by artists by hand, resulting in long production cycles, low production efficiency, and high labor costs.
[0055] In one possible implementation, after obtaining the initial information of the virtual character in step S20, the method further includes the following execution steps:
[0056] Step S21: Classify the initial information according to the first algorithm to obtain the target information.
[0057] The first algorithm is used to classify drawing styles based on category labels.
[0058] The first algorithm can be understood as an algorithm used to classify initial information according to the category labels of drawing styles. By classifying the initial information according to the first algorithm, target information can be obtained that categorizes the initial information according to the various drawing styles. For example, if the initial information includes thick painting, Chinese classical, fantasy, side lighting, blue tone, old age, and justice, then classifying the initial information according to the first algorithm can yield target information with the drawing style being thick painting, the background era being Chinese classical, the art style being fantasy, the light source being side lighting, the tone being blue, the age being old, and the character style being justice.
[0059] The target information can be formatted as a machine-readable string. Each sub-drawing style within a drawing style has a corresponding category label, which can consist of symbols or numbers. The target information is thus a string composed of symbols or numbers from multiple sub-drawing styles. For example, initial information pre-input using natural language text is converted into target information in string format, making it easier for the machine to determine the color channel value set and generate a virtual character image based on the color channel value set by reading the target information in string format.
[0060] Step S21 can be understood as classifying the pre-input initial information according to various drawing styles and converting it into target information that the machine can read. For example, if the drawing styles are divided into seven categories: painting style, background era, art style, light source, color tone, age, and character style, then the target information obtained by classifying the initial information through the first algorithm is a seven-tuple of information classified according to the above seven drawing styles.
[0061] Furthermore, it can be seen that the first algorithm described above can not only classify the initial information, but also perform format conversion, such as converting the input natural language text format into the target information string format. The first algorithm can be, for example, a decision tree algorithm, which is not limited in the embodiments of this application. Taking the first algorithm as a decision tree algorithm as an example, before classifying the initial information according to the first algorithm to obtain the target information, it is necessary to train the first algorithm to determine the first algorithm, that is, to train the decision tree.
[0062] In one possible implementation, before classifying the initial information according to the first algorithm to obtain the target information in step S21, the method further includes the following execution steps:
[0063] Step S201: Project multiple preset images onto a multi-dimensional coordinate system to obtain a point cloud data set.
[0064] Among them, the preset image is a preset virtual character image with predetermined initial information, and each dimension of the multi-dimensional coordinate system corresponds to different types of labels for drawing styles.
[0065] The preset image can be understood as an existing virtual character image. The artist categorizes this existing virtual character image according to various drawing styles, pre-determining each sub-drawing style corresponding to the preset image, that is, pre-determining the initial information of the preset image. This preset image with pre-determined initial information is used to subsequently train the first algorithm to improve the accuracy of the first algorithm.
[0066] A multidimensional coordinate system is established based on various drawing styles. Each dimension of the multidimensional coordinate system corresponds to a drawing style, that is, each dimension of the multidimensional coordinate system corresponds to a category label of a drawing style. For example, if drawing styles are divided into seven categories: art style, background era, art style, light source, color tone, age, and character style, then the multidimensional coordinate system established based on drawing styles is a seven-dimensional coordinate system. Each dimension of the seven-dimensional coordinate system represents art style, background era, art style, light source, color tone, age, and character style, respectively.
[0067] Multiple preset images used to train the first algorithm are projected into a multi-dimensional coordinate system. Since the initial information of each preset image is known, the point cloud data of each preset image can be determined in the multi-dimensional coordinate system, thus obtaining a set of point cloud data of multiple preset images. For example, taking the seven-dimensional coordinate system mentioned above as a multi-dimensional coordinate system, if a preset image A is classified according to its style, background era, art style, light source, hue, age, and character style, and the initial information of the preset image A is determined to be cel-shaded, modern, fantasy, positive light source, red tone, youth, and justice, and in the dimension representing the style, the parameter corresponding to cel-shaded is 0.5, in the dimension representing the background era, the parameter corresponding to modern is 1, in the dimension representing the art style, the parameter corresponding to fantasy is 2, in the dimension representing the light source, the parameter corresponding to positive light source is 2, in the dimension representing the hue, the parameter corresponding to red tone is 1, in the dimension representing the age, the parameter corresponding to youth is 1, and in the dimension representing the character style, the parameter corresponding to justice is 2, then the coordinates of the preset image A in the seven-dimensional coordinate system can be determined as (0.5, 1, 2, 2, 1, 1, 2), which is the point cloud data of the preset image A.
[0068] Optionally, the projection method for projecting multiple preset images into a multidimensional coordinate system can be orthogonal projection.
[0069] Step S202: Determine the classification line for each drawing style based on the point cloud data set.
[0070] The classification line is used to divide each drawing style into at least one sub-drawing style.
[0071] Each drawing style includes at least one sub-drawing style. For example, the drawing styles include thick paint and cel animation, which are sub-drawing styles of the drawing style.
[0072] Since each drawing style includes at least one sub-drawing style, in order to distinguish the different sub-drawing styles, it is necessary to classify each drawing style, that is, to determine the classification line for each drawing style. By determining the classification line for each drawing style, the sub-drawing style corresponding to the input information (e.g., the aforementioned initial information) can be accurately determined.
[0073] Specifically, classification lines for each drawing style are determined based on point cloud datasets. Since different preset images correspond to different point cloud data in a multi-dimensional coordinate system, containing different classification scenarios, determining the classification lines for each drawing style using point cloud datasets corresponding to multiple preset images can improve the accuracy of the determined classification lines.
[0074] Step S203: Determine the classification expression based on the classification line.
[0075] The classification expression is used to divide any two drawing styles.
[0076] There exists a classification expression between any two drawing styles to distinguish them. By determining the classification expression between any two drawing styles from a variety of drawing styles, the drawing style corresponding to the input information (e.g., the aforementioned initial information) can be accurately determined. For example, taking the drawing styles as including the seven categories mentioned above, determining the classification expression between any two drawing styles yields a total of... The system employs 21 classification expressions to accurately distinguish each drawing style and determine the drawing style corresponding to the input information (e.g., the aforementioned initial information).
[0077] Specifically, the classification expression is determined based on the classification line. Since the sub-drawing styles in each drawing style can be accurately determined based on the classification line, the classification expression can distinguish between different drawing styles and different sub-drawing styles, thereby achieving accurate classification of input information (such as the aforementioned initial information).
[0078] Step S204: Determine the first algorithm based on the classification expression.
[0079] The first algorithm, determined by the classification expression, can accurately classify the input information (e.g., the aforementioned initial information) according to the category label of the drawing style, and convert the input information (e.g., the aforementioned initial information) into target information in string format.
[0080] For example, taking the drawing style as an example including the above seven categories, the first algorithm can be expressed as y = w T x, where x is the input, i.e., the initial information determined based on pre-input content, w T Let y be the transpose of matrix w, which is the matrix used to accurately classify the initial information, and let y be the output 7-tuple information, which is the target information.
[0081] Optionally, when determining the classification line for each drawing style in step S202, the classification line with the smallest variance among the same drawing styles and the largest variance among different drawing styles is selected as the final classification line for that drawing style. For example, taking the drawing styles as including the above seven categories, the variance among the same drawing styles is the variance of the same element and the same term in each seven-tuple, and the variance among different drawing styles is the variance of the same element and the different term in each seven-tuple.
[0082] The classification line selected above, which minimizes the variance among elements of the same drawing style and maximizes the variance among elements of different drawing styles, can more accurately distinguish input information (such as the aforementioned initial information).
[0083] In one possible implementation, determining the color channel value set based on the initial information in step S22 may include the following steps:
[0084] Step S221: The second algorithm is used to iteratively map the color channel values of each pixel generated corresponding to the target information to obtain a set of color channel values.
[0085] The second algorithm is used to determine the color channel value corresponding to each pixel in the virtual character image.
[0086] The second algorithm can be understood as an algorithm used to determine the RGB corresponding to each pixel in the virtual character image to be generated. Specifically, the second algorithm iteratively maps the RGB of each pixel in the virtual character image to determine the RGB corresponding to each pixel that best meets the artist's expectations. For example, for a certain pixel, iterative mapping is performed through the first RGB, second RGB, third RGB, ..., Nth RGB to determine that the RGB corresponding to that pixel that best meets the artist's expectations is the Nth RGB.
[0087] The second algorithm iteratively maps the RGB values of each pixel generated corresponding to the target information to obtain the RGB set of each pixel in the virtual character image, which includes the RGB values of multiple pixels. This improves the similarity between the generated RGB set and the RGB set expected by the artist, thus improving the accuracy of the generated RGB set. Based on the generated RGB set, a virtual character avatar that matches the artist's expectations can be generated.
[0088] Understandably, before determining the set of color channel values using the second algorithm, it is necessary to train the second algorithm to determine its effectiveness.
[0089] In one possible implementation, before step S221, where the second algorithm iteratively maps the color channel values of each pixel corresponding to the target information to obtain the color channel value set, the method further includes the following execution steps:
[0090] Step S211: Iteratively map the entire pixel region of multiple preset images to obtain the first result.
[0091] The first result is used to represent the first target parameter corresponding to each drawing style of the multiple preset images.
[0092] The preset image is the preset image in step S201 above, which is a virtual character image with pre-determined initial information. The seven-tuple information of the preset image is known and can be used to train the second algorithm to improve the accuracy of the second algorithm.
[0093] The first target parameter can be understood as the sum of the target total lumens and total color channel values for each drawing style determined during iterative mapping. This target sum of total lumens and total color channel values is the sum of total lumens and total color channel values with the minimum variance. Since the sum of total lumens and total color channel values for the entire pixel region of the iterative mapping best matches the sum of total lumens and total color channel values expected by the artist when the variance is minimized, the first result that best matches the artist's expectations can be obtained by determining the sum of total lumens and total color channel values for the entire pixel region corresponding to the minimum variance.
[0094] Iterative mapping of the entire pixel region of a preset image can be understood as having an initial image, i.e., a blank image, and iteratively mapping the sum of the total lumen value and the total color channel value of the entire pixel region of the initial image. At each iteration, the sum of the total lumen value and the total color channel value of the entire pixel region of the initial image is compared with the sum of the total lumen value and the total color channel value of the entire pixel region of the preset image. The sum of the total lumen value and the total color channel value of the entire pixel region of the preset image being compared can be understood as the sum of the total lumen value and the total color channel value that best matches the artist's expectations. Thus, the sum of the total lumen value and the total color channel value of the entire pixel region of the initial image is determined from an overall perspective, and the first result is obtained.
[0095] Specifically, when determining the total lumen value and total color channel value of the initial image from an overall perspective, further distinctions are made based on the total lumen value and total color channel value corresponding to each drawing style, thus determining the total lumen value and total color channel value of the overall pixel area corresponding to each drawing style. For example, if the initial information of the preset image's seven-tuple information is the seven-tuple information corresponding to cel, modern, fantasy, positive light source, red tone, youth, and justice, then by iteratively mapping the overall pixel area of the preset image, the first result obtained is the total lumen value and total color channel value of the overall pixel area corresponding to cel, modern, fantasy, positive light source, red tone, youth, and justice, respectively. This allows the determination of the total lumen value and total color channel value of the overall pixel area corresponding to each drawing style from an overall (overall pixel area) perspective, providing a data foundation for more accurately determining the RGB corresponding to each pixel in the subsequent process.
[0096] Step S212: Based on the first result, iteratively map the preset pixel regions of multiple preset images to obtain the second result.
[0097] The second result is used to represent the second target parameter corresponding to the preset pixel region.
[0098] The second target parameter can be understood as the sum of the target total lumens and total color channel values corresponding to the preset pixel region determined during iterative mapping. This target sum of total lumens and total color channel values is the sum of total lumens and total color channel values with the minimum variance. Since the sum of total lumens and total color channel values of the preset pixel region obtained through iterative mapping best matches the sum of total lumens and total color channel values expected by the artist when the variance is minimized, the second result that best matches the artist's expectations can be obtained by determining the sum of total lumens and total color channel values of the preset pixel region corresponding to the minimum variance.
[0099] The preset pixel region can be any N×N pixel region in the preset image. Step S211 performs iterative mapping from a holistic (overall pixel region) perspective to obtain a first result. Step S212 can be understood as performing a finer-grained division of the preset image, iteratively mapping each N×N pixel region in the preset image based on the first result, so that the sum of the total lumen value and the total color channel value of each N×N pixel region better matches the artist's expected sum of total lumen value and total color channel value, thus obtaining a second result that best matches the artist's expectations.
[0100] The process of iteratively mapping a preset pixel region of a preset image can be referenced from the process of iteratively mapping the entire pixel region of the preset image described above. It can also be understood as having an initial image, i.e., a blank image, and iteratively mapping the sum of the total lumen value and the total color channel value of the preset pixel region of the initial image. Compare the sum of the total lumen value and the total color channel value of the preset pixel region of the initial image with the sum of the total lumen value and the total color channel value of the preset pixel region of the preset image (i.e., the sum of the total lumen value and the total color channel value that best matches the artist's expectation) at each iteration mapping. Thus, the total lumen value and the total color channel value of the preset pixel region of the initial image are determined from the local (preset pixel region) perspective, and a second result is obtained, which provides a data basis for more accurately determining the RGB corresponding to each pixel in the future.
[0101] Step S213: Based on the second result, iteratively map each pixel of the multiple preset images to obtain the third result.
[0102] The third result is used to represent the color channel value of each pixel in multiple preset images.
[0103] The third result can be understood as the RGB corresponding to each pixel determined during iterative mapping, which is the RGB of each pixel in the preset image.
[0104] In step S212, iterative mapping is performed from the perspective of local (preset pixel area) to obtain the second result. Step S213 can be understood as dividing the preset image into finer-grained parts, and iteratively mapping each pixel in the preset image based on the second result, so that the color channel value of each pixel is more in line with the color channel value expected by the artist, thereby obtaining the third result that best matches the artist's expectations.
[0105] The process of iteratively mapping each pixel of the preset image can be referenced from the process of iteratively mapping the preset pixel region of the preset image described above. It can also be understood as having an initial image, i.e. a blank image, and iteratively mapping the RGB of each pixel of the initial image. Compare the RGB of each pixel of the initial image with the RGB of each pixel of the preset image (i.e., the RGB that best matches the artist's expectation) at each iteration mapping. In this way, the RGB of each pixel of the initial image is determined from the perspective of each pixel, and a third result is obtained, which provides a data basis for the subsequent generation of virtual character images.
[0106] Step S214: Determine the second algorithm based on the first result, the second result, and the third result.
[0107] Based on the first, second, and third results obtained through iterative mapping, a second algorithm is determined to generate RGB values that best match the artist's expectations, thereby effectively improving the accuracy of the RGB values generated by the second algorithm.
[0108] Optionally, the second algorithm can be a multivariate iterative equation system, the input of which is a seven-tuple information and the output is a triple information, which can be understood as the output being the RGB of each pixel in the virtual character image to be generated.
[0109] In one possible implementation, step S211, iteratively mapping the entire pixel region of multiple preset images to obtain a first result may include the following execution steps:
[0110] Step S2111: Iteratively map the first parameter corresponding to each drawing style of each preset image;
[0111] Step S2112: Determine the first parameter whose variance meets the first preset condition as the first result.
[0112] The first parameter is the sum of the total lumen value and the total color channel value.
[0113] For example, the first preset condition can be the minimum variance, and the first parameter that meets the first preset condition is the sum of the total lumen value and the total color channel value when the variance is minimum.
[0114] Since the sum of the total lumens and total color channel values of the overall pixel region for each drawing style in the iterative mapping best matches the sum of the total lumens and total color channel values expected by the artist when the variance is minimized, the first result that best matches the artist's expectations can be obtained by determining the sum of the total lumens and total color channel values of the overall pixel region for each drawing style corresponding to the minimum variance.
[0115] The specific processes of steps S2111 and S2112 can be found in the above description of step S211, and will not be elaborated further here.
[0116] In one possible implementation, step S212, iteratively mapping preset pixel regions of multiple preset images based on the first result to obtain a second result may include the following steps:
[0117] Step S2121: Iteratively map the second parameter corresponding to each preset pixel region of each preset image based on the first result;
[0118] Step S2122: Determine the second parameter whose variance meets the second preset condition as the second result.
[0119] The second parameter is the sum of the total lumen value and the total color channel value.
[0120] For example, the second preset condition can be the minimum variance, and the second parameter that meets the second preset condition is the sum of the total lumen value and the total color channel value when the variance is minimum.
[0121] Since the sum of the total lumens and total color channel values of the preset pixel area of the iterative mapping best matches the sum of the total lumens and total color channel values expected by the artist when the variance is minimized, the second result that best matches the artist's expectations can be obtained by determining the sum of the total lumens and total color channel values of the preset pixel area corresponding to the minimum variance.
[0122] The specific processes of steps S2121 and S2122 can be found in the above description of step S212, and will not be elaborated further here.
[0123] In one possible implementation, step S213, iteratively mapping each pixel of multiple preset images based on the second result to obtain a third result, may include the following execution steps:
[0124] Step S2131: Iteratively map the third parameter corresponding to each pixel of each preset image based on the second result;
[0125] Step S2132: Determine the third parameter whose variance meets the third preset condition as the third calculation result.
[0126] The third parameter is the color channel value.
[0127] For example, the third preset condition can be the minimum variance, and the third parameter that meets the third preset condition is the color channel value corresponding to the minimum variance.
[0128] Since the color channel value of each pixel in the iterative mapping best matches the color channel value expected by the artist when the variance is minimized, a third result that best matches the artist's expectation can be obtained by determining the color channel value of each pixel corresponding to the minimum variance.
[0129] The specific processes of steps S2131 and S2132 can be found in the above description of step S213, and will not be elaborated further here.
[0130] It is understood that the image generation method proposed in this application embodiment can be executed in a neural network model. That is, the first algorithm and the second algorithm mentioned above can both be algorithms in a neural network model. Training the first algorithm and the second algorithm is equivalent to training the neural network model. The trained neural network model can generate corresponding virtual character images based on the input natural language text.
[0131] Therefore, this application embodiment employs artificial intelligence text-to-pixel technology to classify the drawing styles of virtual characters, enabling artists to select the corresponding drawing style for input and obtain realistic virtual character images that correspond to the input drawing style. This significantly reduces the time artists spend creating virtual character images, improves the efficiency of virtual character image creation, and reduces labor costs.
[0132] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0133] This embodiment also provides an image generation apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0134] Figure 4 This is a structural block diagram of an image generation apparatus according to one embodiment of the present application, such as... Figure 4As shown, the device includes: an acquisition module 401, which is used to acquire initial information of a virtual character, wherein the initial information is used to represent the drawing style of the virtual character, and the drawing style is determined by pre-input content; a determination module 402, which is used to determine a color channel value set based on the initial information, wherein the color channel value set includes the color channel value of each pixel of the virtual character image; and a generation module 403, which is used to generate a virtual character image based on the color channel value set.
[0135] Optionally, the image generation apparatus further includes a classification module 404, which is used to classify the initial information according to a first algorithm to obtain target information, wherein the first algorithm is used to classify according to the category label of the drawing style.
[0136] Optionally, the image generation device further includes: a first training module 405, which is used to project multiple preset images into a multi-dimensional coordinate system to obtain a point cloud data set, wherein the preset images are preset virtual character images with predetermined initial information, and each dimension of the multi-dimensional coordinate system corresponds to different categories of drawing styles; determine a classification line for each drawing style based on the point cloud data set, wherein the classification line is used to divide each drawing style, and each drawing style includes at least one sub-drawing style; determine a classification expression based on the classification line, wherein the classification expression is used to divide any two drawing styles; and determine a first algorithm based on the classification expression.
[0137] Optionally, the determining module 402 is further configured to use a second algorithm to iteratively map the color channel values of each pixel generated corresponding to the target information to obtain a set of color channel values, wherein the second algorithm is used to determine the color channel values corresponding to each pixel in the virtual character image.
[0138] Optionally, the image generation apparatus further includes: a second training module 406, which is used to iteratively map the overall pixel regions of multiple preset images to obtain a first result, wherein the first result is used to represent a first target parameter corresponding to each drawing style of the multiple preset images; iteratively map the preset pixel regions of the multiple preset images based on the first result to obtain a second result, wherein the second result is used to represent a second target parameter corresponding to the preset pixel regions; iteratively map each pixel of the multiple preset images based on the second result to obtain a third result, wherein the third result is used to represent the color channel value of each pixel of the multiple preset images; and determine a second algorithm based on the first result, the second result, and the third result.
[0139] Optionally, the second training module 406 is further used to iteratively map the first parameter corresponding to each drawing style of each preset image, wherein the first parameter is the sum of the total lumen value and the total color channel value; and to determine the first parameter whose variance meets the first preset condition as the first result.
[0140] Optionally, the second training module 406 is further configured to iteratively map the second parameter corresponding to each preset pixel region of each preset image based on the first result, wherein the second parameter is the sum of the total lumen value and the total color channel value; and determine the second parameter whose variance meets the second preset condition as the second result.
[0141] Optionally, the second training module 406 is further used to iteratively map the third parameter corresponding to each pixel of each preset image based on the second result, wherein the third parameter is a color channel value; and to determine the third parameter whose variance meets the third preset condition as the third calculation result.
[0142] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0143] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.
[0144] Optionally, in this embodiment, the computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0145] Optionally, in this embodiment, the computer-readable storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0146] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0147] Step S20: Obtain the initial information of the virtual character;
[0148] Step S22: Determine the set of color channel values based on the initial information;
[0149] Step S24: Generate a virtual character image based on the set of color channel values.
[0150] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: Step S21, classifying the initial information according to the first algorithm to obtain the target information.
[0151] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: step S201, projecting multiple preset images into a multi-dimensional coordinate system to obtain a point cloud data set; step S202, determining a classification line for each drawing style based on the point cloud data set; step S203, determining a classification expression based on the classification line; step S204, determining a first algorithm based on the classification expression.
[0152] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: Step S221, using a second algorithm to iteratively map the color channel values of each pixel generated corresponding to the target information to obtain a set of color channel values.
[0153] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: step S211, iteratively mapping the overall pixel regions of multiple preset images to obtain a first result; step S212, iteratively mapping the preset pixel regions of multiple preset images based on the first result to obtain a second result; step S213, iteratively mapping each pixel of multiple preset images based on the second result to obtain a third result; step S214, determining a second algorithm based on the first result, the second result, and the third result.
[0154] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: step S2111, iteratively mapping the first parameter corresponding to each drawing style of each preset image; step S2112, determining the first parameter whose variance meets the first preset condition as the first result.
[0155] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: step S2121, iteratively mapping the second parameter corresponding to each preset pixel region of each preset image based on the first result; step S2122, determining the second parameter whose variance meets the second preset condition as the second result.
[0156] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: step S2131, iteratively mapping the third parameter corresponding to each pixel of each preset image based on the second result; step S2132, determining the third parameter whose variance meets the third preset condition as the third calculation result.
[0157] This embodiment provides a technical solution for image generation in a computer-readable storage medium. The method involves acquiring initial information about a virtual character, where the initial information represents the drawing style of the virtual character, and the drawing style is determined by pre-input content; determining a set of color channel values based on the initial information, where the set of color channel values includes the color channel values of each pixel in the virtual character image; and generating a virtual character image based on the set of color channel values. This achieves the goal of generating a virtual character image corresponding to the drawing style described by the input content, thereby realizing the technical effects of rapidly generating virtual character images, reducing labor costs, and improving the efficiency of virtual character image processing. Furthermore, it solves the technical problems in related technologies where virtual character avatars are drawn purely by artists, resulting in long production cycles, low production efficiency, and high labor costs.
[0158] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this application.
[0159] In exemplary embodiments of this application, a computer-readable storage medium stores a program product capable of implementing the methods described above in this embodiment. In some possible implementations, various aspects of the embodiments of this application may also be implemented as a program product including program code, which, when the program product is run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this embodiment according to various exemplary embodiments of this application.
[0160] The program product for implementing the above-described method according to embodiments of this application may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the embodiments of this application is not limited thereto. In the embodiments of this application, the computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0161] The aforementioned program product may take the form of any combination of one or more computer-readable media. Such computer-readable storage media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples (not exhaustive) of computer-readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0162] It should be noted that the program code contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0163] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0164] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0165] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0166] Step S20: Obtain the initial information of the virtual character;
[0167] Step S22: Determine the set of color channel values based on the initial information;
[0168] Step S24: Generate a virtual character image based on the set of color channel values.
[0169] Optionally, the processor may also be configured to perform the following steps via a computer program: Step S21, classify the initial information according to the first algorithm to obtain the target information.
[0170] Optionally, the processor may also be configured to perform the following steps via a computer program: Step S201, projecting multiple preset images into a multi-dimensional coordinate system to obtain a point cloud data set; Step S202, determining a classification line for each drawing style based on the point cloud data set; Step S203, determining a classification expression based on the classification line; Step S204, determining a first algorithm based on the classification expression.
[0171] Optionally, the processor may also be configured to perform the following steps via a computer program: Step S221, using the second algorithm to iteratively map the color channel values of each pixel generated corresponding to the target information to obtain a set of color channel values.
[0172] Optionally, the processor may also be configured to perform the following steps via a computer program: Step S211, iteratively map the overall pixel region of multiple preset images to obtain a first result; Step S212, iteratively map the preset pixel region of multiple preset images based on the first result to obtain a second result; Step S213, iteratively map each pixel of multiple preset images based on the second result to obtain a third result; Step S214, determine a second algorithm based on the first result, the second result, and the third result.
[0173] Optionally, the processor may also be configured to perform the following steps via a computer program: step S2111, iteratively mapping the first parameter corresponding to each drawing style of each preset image; step S2112, determining the first parameter whose variance meets the first preset condition as the first result.
[0174] Optionally, the processor may also be configured to perform the following steps via a computer program: step S2121, iteratively mapping the second parameter corresponding to each preset pixel region of each preset image based on the first result; step S2122, determining the second parameter whose variance meets the second preset condition as the second result.
[0175] Optionally, the processor may also be configured to perform the following steps via a computer program: step S2131, iteratively mapping the third parameter corresponding to each pixel of each preset image based on the second result; step S2132, determining the third parameter whose variance meets the third preset condition as the third calculation result.
[0176] In the electronic device of this embodiment, a technical solution for image generation is provided. The method involves acquiring initial information about a virtual character, wherein the initial information represents the drawing style of the virtual character, and the drawing style is determined by pre-input content; determining a set of color channel values based on the initial information, wherein the set of color channel values includes the color channel values of each pixel of the virtual character image; and generating a virtual character image based on the set of color channel values. This achieves the goal of generating a virtual character image corresponding to the drawing style described in the input natural language text, thereby realizing the technical effects of rapidly generating virtual character images, reducing labor costs, and improving the efficiency of virtual character image processing. Furthermore, it solves the technical problems in related technologies where virtual character avatars are drawn purely by artists, resulting in long production cycles, low production efficiency, and high labor costs.
[0177] Figure 5 This is a schematic diagram of an electronic device according to an embodiment of this application. Figure 5 As shown, the electronic device 500 is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0178] like Figure 5 As shown, the electronic device 500 is presented in the form of a general-purpose computing device. The components of the electronic device 500 may include, but are not limited to: at least one processor 510, at least one memory 520, a bus 530 connecting different system components (including memory 520 and processor 510), and a display 540.
[0179] The memory 520 stores program code that can be executed by the processor 510, causing the processor 510 to perform the steps described in the method section of the embodiments of this application according to various exemplary implementations of this application.
[0180] The memory 520 may include a readable medium in the form of volatile memory cells, such as random access memory (RAM) 5201 and / or cache memory 5202, and may further include read-only memory (ROM) 5203, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
[0181] In some instances, memory 520 may also include programs / utilities 5204 having a set (at least one) of program modules 5205, including but not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Memory 520 may further include memory remotely located relative to processor 510, which can be connected to electronic device 500 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0182] Bus 530 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, peripheral bus, graphics acceleration port, processor 510, or a local bus using any of the various bus structures.
[0183] The display 540 may be, for example, a touchscreen liquid crystal display (LCD) that allows a user to interact with the user interface of the electronic device 500.
[0184] Optionally, the electronic device 500 can also communicate with one or more external devices 600 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 500, and / or any device that enables the electronic device 500 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via the input / output (I / O) interface 550. Furthermore, the electronic device 500 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via a network adapter 560. Figure 5 As shown, network adapter 560 communicates with other modules of electronic device 500 via bus 530. It should be understood that, although... Figure 5 As not shown, other hardware and / or software modules may be used in conjunction with electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0185] The aforementioned electronic device 500 may also include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply, and / or a camera.
[0186] Those skilled in the art will understand that Figure 5 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, the electronic device 500 may also include components that are more... Figure 5 The more or fewer components shown, or having the same Figure 1 Different configurations are shown. The memory 520 can be used to store computer programs and corresponding data, such as the computer program and corresponding data corresponding to the image generation method in this embodiment. The processor 510 executes various functional applications and data processing by running the computer program stored in the memory 520, thereby implementing the aforementioned image generation method.
[0187] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0188] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0189] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0190] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0191] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0192] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0193] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. An image generation method, characterized in that, The image generation method includes: Obtain initial information of a virtual character, wherein the initial information is used to represent the drawing style of the virtual character, and the drawing style is determined by pre-input content; classify the initial information according to a first algorithm to obtain target information, wherein the first algorithm is used to classify according to the category label of the drawing style; The second algorithm is used to iteratively map the color channel values of each pixel generated corresponding to the target information to obtain a set of color channel values. The second algorithm is used to determine the color channel values corresponding to each pixel in the virtual character image. The set of color channel values includes the color channel values of each pixel in the virtual character image. The virtual character image is generated based on the set of color channel values; Before classifying the initial information according to the first algorithm to obtain target information, the image generation method further includes: projecting multiple preset images into a multi-dimensional coordinate system to obtain a point cloud data set, wherein the preset images are preset virtual character images with predetermined initial information, and each dimension of the multi-dimensional coordinate system corresponds to different category labels of the drawing style; determining a classification line for each drawing style according to the point cloud data set, wherein the classification line is used to divide each drawing style, and each drawing style includes at least one sub-drawing style; determining a classification expression according to the classification line, wherein the classification expression is used to divide any two drawing styles; and determining the first algorithm based on the classification expression.
2. The method according to claim 1, characterized in that, Before iteratively mapping the color channel values of each pixel corresponding to the target information using the second algorithm to obtain the set of color channel values, the image generation method further includes: Iterative mapping is performed on the overall pixel region of multiple preset images to obtain a first result, wherein the first result is used to represent the first target parameter corresponding to each drawing style of the multiple preset images; Based on the first result, the preset pixel regions of the plurality of preset images are iteratively mapped to obtain a second result, wherein the second result is used to represent the second target parameter corresponding to the preset pixel region; Based on the second result, each pixel of the plurality of preset images is iteratively mapped to obtain a third result, wherein the third result is used to represent the color channel value of each pixel of the plurality of preset images; The second algorithm is determined based on the first result, the second result, and the third result.
3. The method according to claim 2, characterized in that, The iterative mapping of the entire pixel region of the plurality of preset images to obtain the first result includes: Iteratively map the first parameter corresponding to each rendering style of each preset image, where the first parameter is the sum of the total lumen value and the total color channel value; The first parameter whose variance meets the first preset condition is determined as the first result.
4. The method according to claim 2, characterized in that, The step of iteratively mapping the preset pixel regions of the plurality of preset images based on the first result to obtain the second result includes: The second parameter corresponding to each preset pixel region of each preset image is iteratively mapped based on the first result, wherein the second parameter is the sum of the total lumen value and the total color channel value; The second parameter whose variance meets the second preset condition is determined as the second result.
5. The method according to claim 2, characterized in that, The step of iteratively mapping each pixel of the plurality of preset images based on the second result to obtain the third result includes: The third parameter corresponding to each pixel of each preset image is iteratively mapped based on the second result, wherein the third parameter is a color channel value; The third parameter that determines the variance to meet the third preset condition is the third calculation result.
6. An image generation apparatus, characterized in that, The image generation device includes: The acquisition module is used to acquire the initial information of the virtual character, wherein the initial information is used to represent the drawing style of the virtual character, and the drawing style is determined by pre-input content text; A classification module is used to classify the initial information according to a first algorithm to obtain target information, wherein the first algorithm is used to classify according to the category label of the drawing style; The determining module is used to iteratively map the color channel values of each pixel generated corresponding to the target information using a second algorithm to obtain a set of color channel values. The second algorithm is used to determine the color channel values corresponding to each pixel in the virtual character image. The set of color channel values includes the color channel values of each pixel in the virtual character image. A generation module is used to generate the virtual character image based on the set of color channel values; The image generation device further includes: a first training module, configured to project multiple preset images onto a multi-dimensional coordinate system to obtain a point cloud data set, wherein the preset images are preset virtual character images with predetermined initial information, and each dimension of the multi-dimensional coordinate system corresponds to different category labels of the drawing style; determine a classification line for each drawing style based on the point cloud data set, wherein the classification line is used to divide each drawing style, and each drawing style includes at least one sub-drawing style; determine a classification expression based on the classification line, wherein the classification expression is used to divide any two drawing styles; and determine the first algorithm based on the classification expression.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the image generation method according to any one of claims 1 to 5 when run by a processor.
8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the image generation method according to any one of claims 1 to 5.