Virtual character image generation method, device, electronic device and storage medium
By obtaining the user's facial features and drawing trajectories and converting them into three-dimensional coordinates or using image recognition models to generate virtual characters' facial features and makeup, the problem of single styles in virtual image generation is solved, and personalized virtual character image generation is achieved.
Patent Information
- Application Number
- CN202111599059.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2041-12-24
AI Technical Summary
In the prior art, virtual image generation methods cannot meet the personalized needs of users, and the pre-configured virtual image style is single, lacking innovation and sense of participation.
By responding to the user's facial features drawing operation, the drawing trajectory is obtained, and the drawing trajectory is converted into three-dimensional coordinates or the image recognition model is used to generate the facial features of virtual characters, and the makeup drawing trajectory is combined to generate the virtual character image.
It realizes the generation of personalized virtual characters based on user drawing operations, increasing the user's sense of participation and innovation in image generation.
Smart Images

Figure CN114332365B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to the field of image processing and virtual reality technology. Background Art
[0002] Currently, avatar customization is mostly used in gaming or image processing scenarios for beautification cameras. Typically, users are provided with pre-configured avatars to choose from. However, these pre-configured avatars tend to be monotonous and fixed in appearance, failing to meet users' personalized needs. Summary of the Invention
[0003] The present disclosure provides a method, device, electronic device and storage medium for generating a virtual character image.
[0004] According to one aspect of the present disclosure, a method for generating a virtual character image is provided, comprising:
[0005] In response to a user's drawing operation on facial features of the avatar, obtaining a drawing trajectory on the face of the avatar;
[0006] Generate facial features of the virtual character based on the drawing trajectory;
[0007] Among them, the virtual character is the character image in the virtual reality scene.
[0008] According to another aspect of the present disclosure, there is provided a device for generating a virtual character image, comprising:
[0009] a trajectory acquisition module, configured to acquire a drawing trajectory on the face of the avatar in response to a user's drawing operation on the facial features of the avatar;
[0010] The facial features generation module is used to generate the facial features of the virtual character based on the drawing trajectory;
[0011] Among them, the virtual character is the character image in the virtual reality scene.
[0012] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0013] at least one processor; and
[0014] a memory communicatively connected to the at least one processor; wherein,
[0015] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method in any embodiment of the present disclosure.
[0016] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to cause a computer to execute the method in any embodiment of the present disclosure.
[0017] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements the method in any embodiment of the present disclosure when executed by a processor.
[0018] The present disclosure provides a method, device, electronic device, and storage medium for generating a virtual character image. For a character image in a virtual reality scene, a drawing trajectory can be obtained based on the user's drawing operation, and the facial features of the virtual character can be generated based on the drawing trajectory, thereby obtaining a virtual character image. This can meet the user's personalized needs, expand the image generation method in the virtual world, and increase the user's sense of participation.
[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.
[0021] Figure 1 This is a flowchart of a method for generating a virtual character image in one embodiment of the present disclosure;
[0022] Figure 2 This is a flowchart of a method for generating a virtual character image in one embodiment of the present disclosure;
[0023] Figure 3 Schematic diagram of a virtual character image generation device according to an embodiment of the present disclosure;
[0024] Figure 4 Schematic diagram of a makeup generation module in one embodiment of the present disclosure;
[0025] Figure 5 It is a block diagram of an electronic device used to implement the method for generating a virtual character image according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0027] The present disclosure provides a method for generating a virtual character image. Figure 1 This is a flowchart of a method for generating a virtual character image according to an embodiment of the present disclosure. The method can be applied to a device for generating a virtual character image. For example, when the device is deployed on a terminal or other processing device, it can generate a virtual character image, etc. The terminal can be a user equipment (UE), a mobile device, a computing device, a virtual reality (VR) integrated device, etc. In some possible implementations, the method can also be implemented by a processor calling computer-readable instructions stored in a memory. Figure 1 As shown, including:
[0028] Step S101, in response to a user's drawing operation on the facial features of the avatar, obtaining a drawing trajectory on the face of the avatar;
[0029] A virtual character is a human figure in a virtual reality scene. A pre-generated character model containing the limbs and head of the virtual character is displayed to the user. In response to the user's drawing operation on the virtual character's facial features (eyebrows, eyes, nose, mouth, and ears), the user receives the drawing trajectory generated by the user using a trajectory drawing device (such as an electronic pen, etc.) or directly sliding a finger on the virtual character's face.
[0030] Step S102: Generate facial features of the virtual character based on the drawing trajectory.
[0031] Since the characters in virtual reality application scenarios are three-dimensional characters with a strong sense of three-dimensionality, in order to integrate the facial features with the characters and achieve visual harmony and unity, the two-dimensional drawing trajectory is processed into a three-dimensional facial feature image to obtain the facial features of the virtual character.
[0032] In related technologies, customizing a virtual character image is achieved through the following methods:
[0033] 1. Image customization: The facial features are classified and configured in the system. The corresponding facial features are determined according to the user's selection. For example, the eyes, nose, mouth and other organs are determined in sequence according to the user's selection, and combined to form a face;
[0034] 2. Makeup customization: Configure a variety of makeup effects in the system, and add the corresponding makeup to the existing face according to the user's selection to generate an image under the makeup.
[0035] The above-mentioned method of customizing images and makeup has the following problems:
[0036] 1. The number of facial features or makeup built into the system is limited and cannot meet the user's needs for personalized customization;
[0037] 2. The creation methods are generally unified and lack a certain degree of innovation; for users, especially those who pursue individuality, there is a lack of personal participation and sense of surprise.
[0038] The virtual character image generation method provided by the embodiments of the present disclosure can obtain a drawing trajectory for a character image in a virtual reality scene based on the user's drawing operation, and generate the facial features of the virtual character based on the drawing trajectory, thereby obtaining a virtual character image. This can meet the user's personalized needs, expand the image generation method in the virtual world, and increase the user's sense of participation.
[0039] There are many ways to generate the facial features of a virtual character based on the drawing trajectory, as shown in the following embodiments:
[0040] In one possible implementation, generating facial features of a virtual character based on the drawing trajectory includes:
[0041] Convert the two-dimensional coordinates of each trajectory point in the drawing trajectory into three-dimensional coordinates;
[0042] Generate the facial features of the virtual character based on the three-dimensional coordinates of each trajectory point.
[0043] In practical applications, the three-dimensional coordinates of each facial point of the virtual character are predetermined, and the three-dimensional coordinates of each trajectory point of the drawing trajectory can be determined based on the three-dimensional coordinates of each facial point where the drawing trajectory overlaps with the face.
[0044] Optionally, the three-dimensional coordinates of each facial point that overlaps with the face can be used as the three-dimensional coordinates of each trajectory point for drawing the trajectory. For trajectory points that do not overlap with the face, the three-dimensional coordinates of the trajectory point can be calculated based on the three-dimensional coordinates of at least one facial point whose distance from the trajectory point meets a preset condition.
[0045] In one example, the coordinates of a trajectory point of the drawn trajectory are (x1, y1), and the trajectory point coincides with a point (x1, y1, z1) on the face in a two-dimensional plane, then the three-dimensional coordinates of the trajectory point are (x1, y1, z1); if the trajectory point (x2, y2) does not coincide with the point on the face, and the points on the face whose distances from the trajectory point meet the preset conditions are (x3, y3, z3), (x4, y4, z4) and (x5, y5, z5), then z2 can be calculated based on z3, z4 and z5, so that the three-dimensional coordinates of the trajectory point (x2, y2) are (x2, y2, z2).
[0046] Optionally, the three-dimensional coordinates of each facial point that overlaps with the face can be adjusted according to a preset adjustment method, and the adjusted three-dimensional coordinates of each facial point can be used as the three-dimensional coordinates of each trajectory point for drawing the trajectory.
[0047] In one example, the coordinates of a trajectory point of a drawn trajectory are (x6, y6), and the trajectory point coincides with a point (x6, y6, z6) on the face in a two-dimensional plane. The three-dimensional coordinates of the trajectory point are (x6, y6, z6+a), where a is a pre-configured adjustment value. The trajectory point can be determined to belong to the eyebrows, eyes, nose, etc. based on the distribution area of the trajectory point on the face. Different adjustment values can be configured for each organ.
[0048] In the embodiment of the present disclosure, the two-dimensional coordinates of each trajectory point are converted into three-dimensional coordinates, and the facial features of the virtual character are generated based on the three-dimensional coordinates of each trajectory point, thereby obtaining a three-dimensional facial feature effect of the virtual character, so that the facial features and the character are integrated and visually harmonious and unified.
[0049] In one possible implementation, generating facial features of a virtual character based on the drawing trajectory includes:
[0050] The image of the drawn trajectory is input into an image recognition model, and the facial features of the virtual character are obtained based on the output of the image recognition model; wherein the image recognition model is trained through a training sample set, and the training sample set includes training samples and sample labels. The training samples include two-dimensional images of each organ in the five senses, and the sample labels include three-dimensional images corresponding to each organ.
[0051] In practical applications, a pre-trained image recognition model can be used to obtain the facial features of a virtual character. The image of the drawn trajectory is input into the image recognition model, which extracts image features and outputs a 3D image based on the extracted image features.
[0052] Optionally, if the image recognition model inputs a two-dimensional image of a single organ among the facial features, the output is a three-dimensional image of the organ. The three-dimensional image of the single organ is spliced according to the distribution position of the two-dimensional image on the face to obtain the facial features of the virtual character.
[0053] Optionally, if the image recognition model inputs a two-dimensional image of the entire face including the facial features, the image recognition model outputs a three-dimensional image of the face, thereby directly obtaining a three-dimensional image of the facial features of the virtual character.
[0054] The image recognition model can be any neural network model capable of performing image recognition. The neural network model is pre-trained, and the training samples can be two-dimensional images of each of the five sense organs. For example, a training sample can be a two-dimensional image of an eye, and the sample label for such a sample is a three-dimensional image of an eye. Alternatively, the training sample can be a two-dimensional image of the entire face, including eyebrows, eyes, nose, mouth, and ears, and the sample label can be a three-dimensional image of the entire face, including eyebrows, eyes, nose, mouth, and ears.
[0055] In the disclosed embodiment, the facial features of the virtual character are obtained based on the image recognition model. The facial features obtained in this way are highly similar to the drawn trajectory, which can meet the personalized needs of the user.
[0056] In one possible implementation, generating facial features of a virtual character based on the drawing trajectory includes:
[0057] In response to a user's selection operation on the drawing trajectory, determining a selection area corresponding to the selection operation;
[0058] In response to a user's adjustment operation on the selected area, determining an adjusted drawing trajectory;
[0059] Based on the adjusted drawing trajectory, the facial features of the virtual character are determined.
[0060] In actual applications, a selection tool is pre-configured, which can be a selection box of any shape. After obtaining the drawing trajectory, the corresponding selection box is determined according to the user's selection operation, and the area framed by the selection box is determined as the selection area. The user can drag the selection box to adjust it, and the adjusted drawing trajectory is determined according to the user's adjustment operation.
[0061] The facial features of the virtual character are obtained through the adjusted trajectory. The specific implementation methods include:
[0062] Optionally, the two-dimensional coordinates of each track point in the adjusted track are converted into three-dimensional coordinates; and the facial features of the virtual character are generated based on the three-dimensional coordinates of each track point.
[0063] Optionally, the image of the adjusted trajectory is input into an image recognition model, and the facial features of the virtual character are obtained based on the output of the image recognition model.
[0064] In the disclosed embodiment, the adjusted drawing trajectory can be determined based on the user's adjustment operation, and then the facial features of the virtual character can be determined, which can meet the user's adjustment needs after drawing and achieve further optimization of the drawing trajectory.
[0065] In one possible implementation, the adjustment operation includes at least one of the following:
[0066] Size adjustment operation, position adjustment operation and rotation angle adjustment operation.
[0067] In practical applications, the adjustment operation can be a size adjustment operation, which can adjust the size of the selected area based on the user's dragging and scaling of the selection box. For example, if the selection box covers the area where an eye is located, and the user receives a zoom instruction for the selection box, the entire selected area will be zoomed in. The adjustment operation can also be a position adjustment operation, which can adjust the position of the selected area based on the user's movement instruction for the selection box. The adjustment operation can also be a rotation angle adjustment operation, which can adjust the rotation angle of the selected area based on the user's angle adjustment instruction for the selection box.
[0068] Optionally, multiple adjustment operations may be performed in a superimposed manner. For example, based on multiple adjustment operations performed by the user, the size of the selected area may be adjusted first, and then the rotation angle may be adjusted.
[0069] In the embodiment of the present disclosure, the drawing trajectory of the selected area can be adjusted in multiple dimensions according to different adjustment operations of the user, thereby optimizing the drawing trajectory and further meeting user needs.
[0070] In a possible implementation, the method further includes:
[0071] In response to a user's drawing operation on the makeup of the virtual character, determining a makeup tool corresponding to the drawing operation;
[0072] Obtain the makeup drawing trajectory of the user for the corresponding positions of the virtual character's facial features;
[0073] Generate the makeup of the virtual character based on the makeup tools and makeup drawing trajectory.
[0074] In actual applications, after obtaining the virtual character's facial features, makeup can also be applied based on the user's drawing operation. A variety of makeup tools are pre-configured for the user to choose from, such as eyebrow pencils, eyeshadow brushes, eyeliner, mascara, lipstick, etc. After receiving the user's drawing operation, the makeup tools are provided to the user. After determining which makeup tool the user has selected, the virtual character's makeup is generated based on the makeup drawing trajectory corresponding to the makeup tool and the facial features. During the makeup generation process, the two-dimensional coordinates of the makeup drawing trajectory can be converted into three-dimensional coordinates, and the virtual character's makeup is obtained based on the converted three-dimensional coordinates of the makeup drawing trajectory.
[0075] In the disclosed embodiment, the makeup of the virtual character can be generated according to the user's makeup drawing operation, making the image of the virtual character more vivid and meeting the user's personalized needs for makeup.
[0076] In one possible implementation, generating a virtual character's makeup based on a makeup tool and a makeup drawing trajectory includes:
[0077] In response to a color selection operation by the user, determining a makeup color corresponding to the makeup tool;
[0078] Generate the makeup of the virtual character based on makeup tools, makeup colors and makeup drawing trajectories.
[0079] In actual applications, multiple colors can be pre-configured and combined with various makeup tools to create different makeup effects. After the user selects the makeup tool, the makeup color, such as eyeshadow or lipstick, is determined based on the user's color selection. Based on the makeup tools, makeup colors, and makeup drawing trajectory, different makeup effects are generated for the virtual character.
[0080] In the disclosed embodiment, the makeup color corresponding to the makeup tool can be determined through the user's color selection operation, and the makeup effect can be enriched through different makeup colors.
[0081] In one possible implementation, obtaining a drawing trajectory on the face of the virtual character includes:
[0082] In response to a user's brush type selection operation, determining a brush type selected by the user;
[0083] Based on the brush type, a drawing trajectory on the avatar's face is determined.
[0084] In actual applications, different brush types can be pre-configured for users to choose from. Different types of brushes have different thicknesses and different brushstroke rendering effects (for example, pencil, liner, thick line, etc.). According to the brush type selected by the user, facial feature drawing trajectories with different thicknesses and different brushstroke rendering effects are generated and presented on the face of the virtual character.
[0085] In the disclosed embodiment, different brush types can be used to generate drawing trajectories with different rendering effects, further meeting the personalized needs of users.
[0086] Figure 2 FIG. 1 is a flow chart of a method for generating a virtual character image in one embodiment of the present disclosure. Figure 2 As shown, the method includes:
[0087] Step S201, in response to a user's drawing operation on the facial features of the avatar, obtaining a drawing trajectory on the face of the avatar;
[0088] Step S202, converting the two-dimensional coordinates of each track point in the drawn track into three-dimensional coordinates;
[0089] Step S203, generating facial features of the virtual character based on the three-dimensional coordinates of each trajectory point;
[0090] Step S204, in response to the user's drawing operation on the makeup of the virtual character, determining a makeup tool corresponding to the drawing operation;
[0091] Step S205, obtaining the makeup drawing trajectory of the user for the corresponding positions of the virtual character's facial features;
[0092] Step S206, in response to the user's color selection operation, determining the makeup color corresponding to the makeup tool;
[0093] Step S207: Generate the makeup of the virtual character based on the makeup tools, makeup colors, and makeup drawing trajectory.
[0094] The method for generating a virtual character image provided by the embodiments of the present disclosure can obtain a drawing trajectory for a character image in a virtual reality scene based on the user's drawing operation, and generate the facial features and makeup of the virtual character based on the drawing trajectory of the facial features and the drawing trajectory of the makeup, thereby obtaining a virtual character image. This can meet the user's personalized needs, expand the image generation method in the virtual world, and increase the user's sense of participation.
[0095] Figure 3 FIG. 1 is a schematic diagram of a virtual character image generating device according to an embodiment of the present disclosure. Figure 3 As shown, the virtual character image generating device may include:
[0096] The trajectory acquisition module 301 is configured to acquire a drawing trajectory on the face of the avatar in response to a user's drawing operation on the facial features of the avatar;
[0097] The facial features generation module 302 is used to generate facial features of the virtual character based on the drawing trajectory;
[0098] Among them, the virtual character is the character image in the virtual reality scene.
[0099] The virtual character image generation device provided by the embodiment of the present disclosure can obtain a drawing trajectory for the character image in the virtual reality scene according to the user's drawing operation, and generate the facial features of the virtual character based on the drawing trajectory, thereby obtaining the virtual character image. This can meet the user's personalized needs, expand the image generation method in the virtual world, and increase the user's sense of participation.
[0100] In one possible implementation, the facial features generation module 302 is configured to:
[0101] Convert the two-dimensional coordinates of each trajectory point in the drawing trajectory into three-dimensional coordinates;
[0102] Generate the facial features of the virtual character based on the three-dimensional coordinates of each trajectory point.
[0103] In one possible implementation, the facial features generation module 302 is configured to:
[0104] The image of the drawn trajectory is input into the image recognition model, and the facial features of the virtual character are obtained based on the output of the image recognition model;
[0105] Among them, the image recognition model is obtained by training a training sample set, which includes training samples and sample labels. The training samples include two-dimensional images of each organ in the five senses, and the sample labels include three-dimensional images corresponding to each organ.
[0106] In one possible implementation, the facial features generation module 302 is configured to:
[0107] In response to a user's selection operation on the drawing trajectory, determining a selection area corresponding to the selection operation;
[0108] In response to a user's adjustment operation on the selected area, determining an adjusted drawing trajectory;
[0109] Based on the adjusted drawing trajectory, the facial features of the virtual character are determined.
[0110] In a possible implementation, it further includes a makeup generation module; Figure 4 Schematic diagram of a makeup generation module in one embodiment of the present disclosure; Figure 4 As shown, the makeup generation module includes a determination unit 401, an acquisition unit 402 and a generation unit 403;
[0111] The determining unit 401 is configured to determine a makeup tool corresponding to a drawing operation performed by a user on a virtual character's makeup;
[0112] An acquisition unit 402 is configured to acquire a makeup drawing trajectory of a user for corresponding positions of facial features of a virtual character;
[0113] The generation unit 403 is configured to generate the makeup of the virtual character based on the makeup tools and the makeup drawing trajectory.
[0114] In a possible implementation, the generating unit 403 is specifically configured to:
[0115] In response to a color selection operation by the user, determining a makeup color corresponding to the makeup tool;
[0116] Generate the makeup of the virtual character based on makeup tools, makeup colors and makeup drawing trajectories.
[0117] In one possible implementation, the adjustment operation includes at least one of the following:
[0118] Size adjustment operation, position adjustment operation and rotation angle adjustment operation.
[0119] In a possible implementation, the trajectory acquisition module is specifically configured to:
[0120] In response to a user's brush type selection operation, determining a brush type selected by the user;
[0121] Based on the brush type, a drawing trajectory on the avatar's face is determined.
[0122] The functions of each unit, module or sub-module in each device of the embodiments of the present disclosure can be found in the corresponding description in the above method embodiments, and will not be repeated here.
[0123] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0124] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0125] at least one processor; and
[0126] a memory communicatively connected to the at least one processor; wherein,
[0127] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method in any embodiment of the present disclosure.
[0128] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to cause a computer to execute the method in any embodiment of the present disclosure.
[0129] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements the method in any embodiment of the present disclosure when executed by a processor.
[0130] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0131] like Figure 5As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. Various programs and information required for the operation of the device 500 can also be stored in the RAM 503. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0132] Various components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0133] The computing unit 501 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as the avatar image generation method. For example, in some embodiments, the avatar image generation method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the avatar image generation method described above can be performed. Alternatively, in other embodiments, the computing unit 501 can be configured to perform the avatar image generation method by any other suitable means (e.g., via firmware).
[0134] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-a-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive information and instructions from a storage system, at least one input device, and at least one output device, and transmit information and instructions to the storage system, the at least one input device, and the at least one output device.
[0135] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable information processing device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0136] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0137] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0138] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as an information server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital information communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0139] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0140] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.
[0141] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A method for generating a virtual character image, the method comprising: In response to a user's drawing operation on facial features of an avatar, obtaining a drawing trajectory on the face of the avatar; generating facial features of the virtual character based on the drawing trajectory; Wherein, the virtual character is a character image in a virtual reality scene; The step of generating facial features of the virtual character based on the drawing trajectory includes: Converting the two-dimensional coordinates of each track point in the drawing track into three-dimensional coordinates; generating facial features of the virtual character based on the three-dimensional coordinates of each trajectory point; The method for determining the three-dimensional coordinates includes: In the case where the drawing trajectory coincides with the face of the avatar, the three-dimensional coordinates of the facial points at the positions that coincide with the face are used as the three-dimensional coordinates of each trajectory point; In the case that the drawing trajectory does not overlap with the face of the virtual image, at least one facial point whose distance from the trajectory point meets a preset condition is determined, and the three-dimensional coordinates of the trajectory point are determined based on the three-dimensional coordinates of the at least one facial point.
2. The method according to claim 1, wherein Generating facial features of the virtual character based on the drawing trajectory includes: Inputting the image of the drawn trajectory into an image recognition model, and obtaining the facial features of the virtual character based on the output of the image recognition model; The image recognition model is obtained by training a training sample set, wherein the training sample set includes training samples and sample labels. The training samples include two-dimensional images of each organ in the five senses, and the sample labels include three-dimensional images corresponding to each organ.
3. The method according to claim 1, wherein Generating facial features of the virtual character based on the drawing trajectory includes: In response to a user's selection operation on the drawing trajectory, determining a selection area corresponding to the selection operation; In response to a user's adjustment operation on the selected area, determining an adjusted drawing trajectory; Based on the adjusted drawing trajectory, the facial features of the virtual character are determined.
4. The method according to any one of claims 1 to 3, further comprising: In response to a user's drawing operation on the makeup of the virtual character, determining a makeup tool corresponding to the drawing operation; Obtaining a makeup drawing trajectory of a user for corresponding positions of facial features of the virtual character; The makeup of the virtual character is generated based on the makeup tool and the makeup drawing trajectory.
5. The method according to claim 4, wherein Generating the makeup of the virtual character based on the makeup tool and the makeup drawing trajectory includes: In response to a color selection operation by a user, determining a makeup color corresponding to the makeup tool; The makeup of the virtual character is generated based on the makeup tool, the makeup color and the makeup drawing trajectory.
6. The method according to claim 3, wherein: The adjustment operation includes at least one of the following: Size adjustment operation, position adjustment operation and rotation angle adjustment operation.
7. The method according to any one of claims 1 to 3, wherein The obtaining of the drawing trajectory on the face of the virtual character includes: In response to a user's brush type selection operation, determining a brush type selected by the user; Based on the brush type, a drawing trajectory on the face of the virtual character is determined.
8. A device for generating a virtual character image, comprising: a trajectory acquisition module, configured to acquire a drawing trajectory on the face of the avatar in response to a user's drawing operation on the facial features of the avatar; A facial features generation module, configured to generate facial features of the virtual character based on the drawing trajectory; Wherein, the virtual character is a character image in a virtual reality scene; The facial features generation module is used to: Converting the two-dimensional coordinates of each track point in the drawing track into three-dimensional coordinates; generating facial features of the virtual character based on the three-dimensional coordinates of each trajectory point; The method for determining the three-dimensional coordinates includes: In the case where the drawing trajectory coincides with the face of the avatar, the three-dimensional coordinates of the facial points at the positions that coincide with the face are used as the three-dimensional coordinates of each trajectory point; In the case that the drawing trajectory does not overlap with the face of the virtual image, at least one facial point whose distance from the trajectory point meets a preset condition is determined, and the three-dimensional coordinates of the trajectory point are determined based on the three-dimensional coordinates of the at least one facial point.
9. The device according to claim 8, wherein The facial features generation module is used to: Inputting the image of the drawn trajectory into an image recognition model, and obtaining the facial features of the virtual character based on the output of the image recognition model; The image recognition model is obtained by training a training sample set, wherein the training sample set includes training samples and sample labels. The training samples include two-dimensional images of each organ in the five senses, and the sample labels include three-dimensional images corresponding to each organ.
10. The device according to claim 8, wherein The facial features generation module is used to: In response to a user's selection operation on the drawing trajectory, determining a selection area corresponding to the selection operation; In response to a user's adjustment operation on the selected area, determining an adjusted drawing trajectory; Based on the adjusted drawing trajectory, the facial features of the virtual character are determined.
11. The device according to any one of claims 8 to 10, further comprising a makeup generation module; the makeup generation module comprises a determination unit, an acquisition unit, and a generation unit; The determining unit is configured to determine, in response to a user's drawing operation on the makeup of the virtual character, a makeup tool corresponding to the drawing operation; The acquisition unit is used to acquire the makeup drawing trajectory of the user for the corresponding positions of the facial features of the virtual character; The generating unit is configured to generate the makeup of the virtual character based on the makeup tool and the makeup drawing trajectory.
12. The device according to claim 11, wherein The generating unit is specifically configured to: In response to a color selection operation by a user, determining a makeup color corresponding to the makeup tool; The makeup of the virtual character is generated based on the makeup tool, the makeup color and the makeup drawing trajectory.
13. The device according to claim 10, wherein The adjustment operation includes at least one of the following: Size adjustment operation, position adjustment operation and rotation angle adjustment operation.
14. The device according to any one of claims 8 to 10, wherein: The trajectory acquisition module is specifically used to: In response to a user's brush type selection operation, determining a brush type selected by the user; Based on the brush type, a drawing trajectory on the face of the virtual character is determined.
15. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
16. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.
17. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Game data processing method, game data processing device and terminal equipment
CN110639204A
Sketch-based face image generation method and system
CN111915693A
Virtual makeup trying method and device, electronic equipment and readable storage medium
CN112330528A