Virtual facial makeup drawing method and device, storage medium and equipment
By obtaining and displaying the user's face images and drawing virtual face makeup in response to user input operations, the problem of lack of interactivity and modernity in traditional Peking Opera face makeup learning methods is solved, and the user's participation and experience is improved.
Patent Information
- Application Number
- CN202411426475.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-02-14
AI Technical Summary
The learning and dissemination methods of traditional Peking Opera facials lack interaction and modernity, and it is difficult to spread widely among young people. Existing virtual reality technology is used for Facebook synthesis, but the lack of interaction with users leads to insufficient experience.
By obtaining the user's face image and displaying it to the user using a display interactive device, in response to the user's input operations, the drawing gestures and drawing areas are determined, and the virtual facemap is drawn based on this information. Optionally, use the pre-stored Facebook library and face part area model to match the drawing gestures and draw face patterns.
It realizes the real-time drawing experience of users on virtual face images, and improves users' participation and experience in the process of facial synthesis.
Smart Images

Figure CN119444889A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, storage medium, and equipment for drawing a virtual face. Background Art
[0002] As an important part of traditional Chinese culture, Peking Opera masks have a unique artistic form and visual impact. However, the learning and dissemination methods of traditional Peking Opera masks are relatively simple, lacking interactivity and modernity, which limits their dissemination and popularity among young people.
[0003] At present, there are some methods that use virtual reality technology to synthesize facial makeup onto the user's face. However, such methods lack interaction with the user and provide insufficient user experience.
[0004] Therefore, the present invention provides a method, device, storage medium and equipment for drawing a virtual face. Summary of the invention
[0005] This specification provides a method and device for drawing a virtual face, so as to partially solve the above problems existing in the prior art.
[0006] This manual adopts the following technical solutions:
[0007] This specification provides a method for drawing a virtual face, including:
[0008] Get the user's facial image;
[0009] Displaying the facial image to the user through a display interaction device;
[0010] In response to an input operation of the user on the display interaction device, determining a drawing gesture and a drawing area of the user on the facial image;
[0011] According to the drawing gesture, facial drawing is performed in the drawing area.
[0012] Optionally, performing facial drawing in the drawing area according to the drawing gesture specifically includes:
[0013] In a pre-stored facial database, a facial pattern matching the drawing gesture is determined as a target pattern;
[0014] The target texture is drawn in the drawing area.
[0015] Optionally, after obtaining the user's facial image, the following steps are further included:
[0016] Determine each facial region of the facial image using a pre-trained facial region model;
[0017] Determine the mapping relationship between the face partition and each face spectrum partition;
[0018] In the pre-stored facial database, the facial texture matching the drawing gesture is determined as the target texture, specifically including:
[0019] According to the mapping relationship, determining the facial partition corresponding to the drawing area as the target partition;
[0020] Each facial pattern in the target partition in the facial pattern library is used as a pattern to be selected;
[0021] Determine the difference between each of the candidate textures and the drawing gesture;
[0022] According to the difference, a candidate texture corresponding to the drawing gesture is determined as a target texture.
[0023] Optionally, also include:
[0024] When there is no facial pattern matching the drawing gesture in the facial database;
[0025] Determine a coloring area corresponding to the drawing area according to the drawing area and the drawn part of the facial image, wherein the coloring area includes a texture area and a background area;
[0026] In response to a color selection operation by the user, the color selected by the user is covered in the coloring area.
[0027] Optionally, in response to the user's color selection operation, covering the color selected by the user in the coloring area specifically includes:
[0028] In response to the user's color selection operation, the color selected by the user is covered in the painted area, and the selectable colors of the texture area and the background color area are not completely the same.
[0029] Optionally, also include:
[0030] In response to a selection operation by a user, determining a half region of the facial image selected by the user as a target half region;
[0031] The drawn facial makeup of the target half area is symmetrically covered to the remaining half area of the facial image.
[0032] Optionally, after displaying the facial image to the user through a display interaction device, the method further includes:
[0033] In response to the selection operation of the user on the display interaction device, determining the target face profile of the user;
[0034] According to the drawing gesture, the facial drawing performed in the drawing area specifically includes:
[0035] According to the drawing gesture, the target face is drawn in the drawing area.
[0036] This specification provides a device for drawing a virtual face, comprising:
[0037] An acquisition module, which acquires the user's facial image;
[0038] A display module displays the facial image to the user through a display interactive device;
[0039] a determination module, in response to an input operation of the user on the display interaction device, determining a drawing gesture and a drawing area of the user on the facial image;
[0040] A drawing module performs facial drawing in the drawing area according to the drawing gesture.
[0041] This specification provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the method for drawing a virtual face is implemented.
[0042] This specification provides a device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for drawing a virtual face when executing the program.
[0043] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0044] In the method for drawing a virtual face provided in the present specification, a facial image of a user is obtained, and the facial image is displayed to the user through a display interaction device. In response to an input operation of the user on the display interaction device, a drawing gesture and a drawing area of the user on the facial image are determined, and the face is drawn in the drawing area according to the drawing gesture.
[0045] It can be seen from the above method that the method can enable users to experience the process of drawing the face makeup on the virtual face image in real time, thereby improving the user's participation in the face makeup synthesis process. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:
[0047] Figure 1A flowchart of a method for drawing a virtual face in this specification;
[0048] Figure 2 A schematic diagram of the process of determining drawing gestures and drawing areas in this manual;
[0049] Figure 3 This is a schematic diagram of the shape of the facial makeup patterns in this manual;
[0050] Figure 4 It is a schematic diagram of the process of drawing a face in a drawing area according to a drawing gesture in this manual;
[0051] Figure 5 A schematic diagram of a device for drawing a virtual face provided in this specification;
[0052] Figure 6 The corresponding Figure 1 Schematic diagram of electronic equipment. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0054] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0055] Figure 1 The figure is a flowchart of a method for drawing a virtual face in this specification. The method for drawing a virtual face specifically comprises the following steps:
[0056] S100: Acquire a user's facial image.
[0057] The existing face composition technology often adopts the method of adjusting the transparency of the face picture and then covering it on the user's facial image. In this face covering process, the user's participation is low, and it cannot reflect the face creation process. Therefore, this specification provides a method for drawing a virtual face. The method provided in this specification can be applied to a server or mobile terminal that is equipped with a virtual face drawing application. The following only describes the method provided in this specification with the server as the subject.
[0058] First, after the user connects to the server through a mobile terminal, the user's facial image is obtained. The method for obtaining the facial image can be to obtain the facial image uploaded by the user to the server, or to call a camera device connected to the server to capture the user's facial image in real time.
[0059] Specifically, after obtaining the user's facial image, the facial image may be detected to determine the integrity of the user's face in the facial image. When the user's face in the facial image is incomplete, the user may be prompted to re-upload the facial image.
[0060] S102: Displaying the facial image to the user via a display interaction device.
[0061] After acquiring the user's facial image, the facial image can be displayed to the user through a display interaction device connected to the server, wherein the display interaction device can be various commonly used mobile terminals.
[0062] In one or more embodiments of the present specification, after acquiring the user's facial image, the range and outline of the user's face in the facial image can be determined through a face detection model, and the facial image can be preprocessed according to the detected range and outline of the user's face, and the preprocessed facial image can be displayed to the user.
[0063] Among them, the above-mentioned face detection model can be trained based on various commonly used face detection models, such as the Viola-Jones model, convolutional neural network, etc., which will not be elaborated in this specification; the preprocessing may include adjusting the brightness, lightness, and contrast of the facial image according to preset parameters, and replacing or blurring the background area of the facial image without a portrait.
[0064] S104: In response to an input operation of the user on the display interaction device, determining a drawing gesture and a drawing area of the user on the facial image.
[0065] After the user receives the facial image displayed by the server through the mobile terminal, the user can draw the facial makeup on the facial image through the mobile terminal.
[0066] Specifically, Figure 2 As shown, the user can simulate the handwriting of the facial makeup with an input trajectory through the input device of the mobile terminal held by the user. A continuous input trajectory can be regarded as an input operation. After obtaining the user's input operation, the server can determine the user's drawing gesture on the facial image according to the input trajectory, and determine the user's drawing area on the facial image according to the positional relationship between the input trajectory and the facial image.
[0067] Determining the drawing gesture according to the input trajectory may be to obtain the drawing gesture after smoothing the input trajectory; the above-mentioned drawing area is the area in the face image covered by the user's input trajectory. It should be noted that when the user's input trajectory exceeds the range of the user's face, the drawing area only includes the area within the range of the user's face.
[0068] S106: Performing facial drawing in the drawing area according to the drawing gesture.
[0069] After the drawing gesture and the drawing area are determined, the facial makeup pattern corresponding to the drawing gesture can be determined according to the drawing gesture, and the facial makeup pattern can be drawn in the drawing area.
[0070] The facial texture corresponding to the drawing gesture may be determined by generating the facial texture according to the drawing gesture or matching pre-stored facial texture according to the drawing gesture, and this specification does not limit this.
[0071] After determining the facial pattern matching the drawing gesture, the facial pattern may be drawn in the drawing area to cover the drawing area with the facial pattern.
[0072] In one or more embodiments of the present specification, a pre-trained facial texture generation model may be used, the drawing gesture may be input into the facial texture generation model to generate a facial texture corresponding to the drawing gesture, and the generated facial texture may be drawn in the drawing area.
[0073] Specifically, the facial texture generation model can be any commonly used image generation model, such as a convolutional neural network, a diffusion model, etc. The process of training the facial texture generation model can be: using facial drawing handwriting as sample input, determining the loss of the facial texture generation model according to the difference between the output result of the facial texture generation model and the facial texture corresponding to the facial drawing handwriting as the input sample, and training the facial texture generation model according to the loss. Among them, a pressure sensing device can be used to capture the drawing process of a professional facial painter, determine the facial drawing handwriting in the process, and use the facial texture drawn by the facial painter in this process as the facial texture corresponding to the facial drawing handwriting, and determine each input sample and annotation in turn.
[0074] like Figure 1 The method for drawing a virtual face mask can enable users to experience the drawing process of the face mask on a virtual face image in real time, thereby improving the user's participation in the face mask synthesis process.
[0075] In addition, in Figure 1In step S106 shown, a facial pattern matching the drawing gesture is determined in a pre-stored facial pattern library as a target pattern, and the target pattern is drawn in the drawing area.
[0076] The facial textures and the gesture templates corresponding to each facial texture can be pre-stored in the pre-stored facial library, so that after receiving the drawing gesture, the server can use the image matching model to determine the difference between the drawing gesture and each gesture template, and use the facial texture corresponding to the gesture template with the smallest difference from the drawing gesture as the target texture.
[0077] Among them, Figure 3 As shown, the shape of a facial mask pattern can be determined according to the step-by-step process of drawing the face in the traditional facial mask drawing process, which is usually a connected area in a facial mask.
[0078] Specifically, to determine the difference between the drawing gesture and each gesture template, a preset feature extraction method can be used, such as a scale-invariant feature transform (SIFT) algorithm, a speeded-up robust features (SURF) algorithm, etc., to respectively extract features of the drawing gesture and each gesture template, and then determine the difference between the features of the drawing gesture and the features of the gesture template.
[0079] In one or more embodiments of the present specification, when determining the gesture template that matches the drawing gesture, the transformation relationship between the drawing gesture and the gesture template that matches it can be determined, and the facial makeup texture corresponding to the gesture template is transformed in direction according to the transformation relationship, and the size of the facial makeup texture is transformed according to the drawing area, and the transformed facial makeup texture is drawn in the drawing area. Figure 4 As shown, the drawing gesture A matches the gesture template B, and the facial pattern C is the facial pattern corresponding to the gesture template B. Then the facial pattern C drawn in the drawing area needs to be transformed in size and direction accordingly.
[0080] Furthermore, in Figure 1 After step S100, the method further includes: using a pre-trained face region model to determine each face region of the face image, and determining a mapping relationship between the face region and each face spectrum partition; and then Figure 1 In step S106 shown, according to the mapping relationship, the facial mask partition corresponding to the drawing area is determined as the target partition, each facial mask texture of the target partition in the facial mask library is used as a to-be-selected texture, the difference between each to-be-selected texture and the drawing gesture is determined, and according to the difference, the to-be-selected texture corresponding to the drawing gesture is determined as the target texture.
[0081] In the actual process of drawing the face mask, different areas of the face mask have different texture characteristics. For example, the mouth has many beard-shaped textures, and the eye textures are mostly around the eye sockets. The texture types in different areas are not the same.
[0082] Therefore, in order to make the facial lines in the face drawn by the user arranged more reasonably and accelerate the matching process between the drawing gesture and the facial lines, the facial partition where each facial line is located can be determined in advance, and then after determining the facial partition corresponding to the drawing area, the facial partition corresponding to the facial partition is used as the target partition, and only the facial lines in the target partition are matched with the drawing gesture to determine the difference between each facial line in the target partition and the drawing gesture.
[0083] Among them, the facial map partition may include: forehead area, nose area, eye area, mouth area, cheek area; correspondingly, the face area may also include forehead area, nose area, eye area, mouth area, cheek area, then the above mapping relationship is that the forehead area of the face area corresponds to the forehead area of the face area, and so on.
[0084] When the drawing area covers multiple face partitions, the area ratios of different face partitions in the drawing area may be calculated, and the partition with the largest area ratio may be determined as the face partition corresponding to the drawing area.
[0085] In one or more embodiments of the present specification, when a drawing area covers multiple face regions, the drawing area may be adjusted according to the face region corresponding to the drawing area, and the drawing area may be adjusted to be within the face region corresponding to the drawing area.
[0086] Among them, the face segmentation model can be a convolutional neural network model, or the face segmentation model can be established according to a facial key point detection algorithm. Similar implementation methods are relatively mature and will not be described in detail in this specification.
[0087] In addition, in Figure 1 In step S106 shown, when there is no facial texture matching the drawing gesture in the facial library, a colored area corresponding to the drawing area is determined based on the drawing area and the drawn part of the facial image, and the colored area includes a texture area and a background color area. In response to the user's color selection operation, the color selected by the user is covered in the colored area.
[0088] From the above, after the server receives the drawing gesture, the image matching model can be used to determine the difference between the drawing gesture and each gesture template, and a difference threshold can be preset. When the difference between the drawing gesture and each gesture template is not less than the difference threshold, it is deemed that there is no facial texture matching the drawing gesture in the facial library. Therefore, the drawing gesture is identified as a coloring gesture, and the coloring area corresponding to the drawing area is determined according to the drawing area corresponding to the drawing gesture and the drawn part of the facial image. The coloring area may include a texture area and a background color area. After determining the coloring area, the server can display the optional colors of the coloring area to the user through the display interaction device, and in response to the user's color selection operation, the color selected by the user is covered in the coloring area.
[0089] The texture area is a connected area covered by a facial texture drawn by a user in the facial image, and the background area is a connected area of the user's face in the facial image that is not covered by the facial texture.
[0090] In one or more embodiments of the present specification, when the drawing area corresponding to the drawing gesture covers both the area covered by the facial makeup lines and the area not covered by the facial makeup lines in the facial image, the coloring area corresponding to the drawing area is determined according to the area ratio of the area covered by the facial makeup lines in the drawing area. Specifically, a coloring area threshold can be preset, and when the area ratio of the area covered by the facial makeup lines in the drawing area is higher than the coloring area threshold, the texture area corresponding to the facial makeup lines in the drawing area is determined and the texture area is colored; when the area ratio of the area covered by the facial makeup lines in the drawing area is not higher than the coloring area threshold, the background color area corresponding to the drawing area is colored.
[0091] It should be noted that the range of a drawing area may be smaller than the range of the texture area corresponding to the drawing area, and the range of the texture area corresponding to the drawing area is determined based on the complete range of the facial makeup texture in the drawing area; similarly, the range of a drawing area may be smaller than the range of the background color area corresponding to the drawing area, and the range of the background color area corresponding to the drawing area is determined based on the complete range of the background color area.
[0092] Furthermore, in Figure 1 In step S106 shown, in response to the user's color selection operation, the color selected by the user is covered in the painted area, and the selectable colors of the texture area and the background color area are not completely the same.
[0093] Depending on the color characteristics of the facial makeup, the optional color ranges for the base color and the texture may be different.
[0094] In addition, in response to the user's selection operation, the half area of the facial image selected by the user is determined as the target half area, and the drawn facial makeup of the target half area is symmetrically covered to the remaining half area of the facial image.
[0095] According to the development characteristics of facial masks, most facial masks are designed to be symmetrical on the left and right. Therefore, when users are drawing a stack of facial masks, they only need to complete the drawing of half of them without the need for additional repetitive work. On the one hand, this conforms to the rules and aesthetics of facial mask culture, and on the other hand, it reduces users' unnecessary operations and speeds up the drawing process of virtual facial masks.
[0096] Specifically, the server may preset a half-area covering function. In response to the user's selection operation, when the server receives an instruction to execute the half-area covering function, the server may determine the half area of the facial image selected by the user as the target half area, and symmetrically cover the drawn facial makeup of the target half area to the remaining half area of the facial image.
[0097] In addition, in Figure 1 After step S102 shown in FIG. 1 , in response to the user's selection operation on the display interaction device, the user's target face profile is determined; thus, in the example Figure 1 In step S106 shown, the target face is drawn in the drawing area according to the drawing gesture.
[0098] After displaying the facial image to the user through the display interactive device, the server may also display preset optional facial masks to the user. After receiving the user's selection operation, the server determines the target facial mask selected by the user, so that in the subsequent facial mask drawing process, the facial mask drawing of the target facial mask is performed in the drawing area according to the drawing gesture. In this facial mask drawing process, only the facial mask texture corresponding to the drawing area in the target facial mask can be determined, without determining the difference between the drawing gesture and the facial mask texture.
[0099] During the process of drawing the virtual facial makeup, steps S104 to S106 need to be repeatedly performed multiple times until the drawing of the virtual facial makeup is completed.
[0100] In one or more embodiments of the present specification, the server may store the drawing gestures and drawing areas of the user during a virtual face drawing process, so that after determining the current drawing gesture and drawing area, the current drawing gesture and the drawing gestures stored historically may be used as a user gesture group, the difference between the user gesture group and each gesture template group corresponding to each pre-stored facial makeup is determined, the facial makeup corresponding to the gesture template group with the smallest difference from the user gesture group is used as the template facial makeup, and the area drawn by the user is adjusted according to the template facial makeup.
[0101] Among them, a gesture template group includes all the gesture templates of a face and the position of each gesture template in the face. Therefore, the specific method for determining the difference between the user gesture group and the gesture template group can be: determine the drawn area composed of the drawing areas of all drawing gestures in the user gesture group, determine the face range corresponding to the drawn area in the face, the face trajectory composed of the gesture templates within the face range of each gesture template group, and determine the historical trajectory formed by each drawing gesture in the user gesture group, and determine the difference between the face trajectory and the historical trajectory.
[0102] Adjusting the user's drawn face according to the template face may be to determine the area drawn by the user, and replace the facial texture in the area drawn by the user with the facial texture of the template face corresponding to the drawn area according to the mapping relationship between the face partition and each facial partition.
[0103] In one or more embodiments of the specification, in response to the user's selection operation on the display interactive device, basic knowledge of Peking Opera facial makeup is displayed to the user, the content of the basic knowledge includes the origin, classification, symbolic meaning, etc. of the facial makeup, and the display method of the basic knowledge includes multimedia forms such as pictures, texts, and videos. In this way, the user can learn the knowledge related to Peking Opera facial makeup more directly.
[0104] In one or more embodiments of the present specification, the method further includes displaying a facial makeup creation tool to the user in response to a selection operation of the user on a display interactive device, so that the user can use the facial makeup creation tool to design a personalized facial makeup pattern on the real interactive device, wherein the facial makeup creation tool includes a brush, paint, and facial makeup texture components.
[0105] The above is a method for drawing a virtual face mask provided by one or more embodiments of this specification. Based on the same idea, this specification also provides a corresponding device for drawing a virtual face mask, such as Figure 5 shown.
[0106] Figure 5 A schematic diagram of a device for drawing a virtual face provided in this specification specifically includes:
[0107] An acquisition module 500 is used to acquire a user's facial image;
[0108] A display module 502 displays the facial image to the user through a display interactive device;
[0109] A determination module 504, in response to an input operation of the user on the display interaction device, determines a drawing gesture and a drawing area of the user on the facial image;
[0110] The drawing module 506 performs facial drawing in the drawing area according to the drawing gesture.
[0111] Optionally, the drawing module 506 is specifically configured to: determine a facial pattern matching the drawing gesture in a pre-stored facial pattern library as a target pattern, and draw the target pattern in the drawing area.
[0112] Optionally, the acquisition module 500 is further used to: determine each face region of the face image using a pre-trained face region model, and determine a mapping relationship between the face region and each face spectrum partition;
[0113] The drawing module 506 is specifically used to: determine the facial mask partition corresponding to the drawing area according to the mapping relationship as the target partition, use each facial mask texture of the target partition in the facial mask library as a to-be-selected texture, determine the difference between each to-be-selected texture and the drawing gesture, and determine the to-be-selected texture corresponding to the drawing gesture as the target texture according to the difference.
[0114] Optionally, the drawing module 506 is further used for: when there is no facial texture matching the drawing gesture in the facial library, determining a colored area corresponding to the drawing area according to the drawing area and the drawn part of the facial image, the colored area including a texture area and a background color area, and in response to a color selection operation by the user, covering the colored area with the color selected by the user.
[0115] Optionally, the drawing module 506 is specifically used to: in response to the user's color selection operation, cover the color selected by the user in the coloring area, and the selectable colors of the texture area and the background area are not completely the same.
[0116] Optionally, the drawing module 506 is further used to: in response to a user selection operation, determine the half area of the facial image selected by the user as the target half area, and symmetrically cover the drawn facial makeup of the target half area to the remaining half area of the facial image.
[0117] Optionally, the determination module 504 is further configured to: determine a target face profile of the user in response to a selection operation of the user on the display interaction device;
[0118] The drawing module 506 is specifically configured to draw the target face in the drawing area according to the drawing gesture.
[0119] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 A method for drawing a virtual face is provided.
[0120] This manual also provides Figure 6 The schematic structure diagram of the electronic device shown in FIG. Figure 6As mentioned above, at the hardware level, the virtual face drawing device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 Of course, in addition to the software implementation, this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0121] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0122] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0123] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0124] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0125] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0126] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0127] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0128] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0129] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0130] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0131] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0132] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0133] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0134] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0135] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0136] The above description is only an embodiment of this specification and is not intended to limit this specification. For those skilled in the art, this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification should be included in the scope of the claims of this application.
Claims
1. A method for drawing a virtual face, characterized in that: The method comprises: Get the user's facial image; Displaying the facial image to the user through a display interaction device; In response to an input operation of the user on the display interaction device, determining a drawing gesture and a drawing area of the user on the facial image; According to the drawing gesture, facial drawing is performed in the drawing area.
2. The method according to claim 1, characterized in that According to the drawing gesture, facial drawing is performed in the drawing area, specifically including: In a pre-stored facial database, a facial pattern matching the drawing gesture is determined as a target pattern; The target texture is drawn in the drawing area.
3. The method according to claim 2, characterized in that After obtaining the user's facial image, it also includes: Determine each facial region of the facial image using a pre-trained facial region model; Determine the mapping relationship between the face partition and each face spectrum partition; In the pre-stored facial database, the facial texture matching the drawing gesture is determined as the target texture, specifically including: According to the mapping relationship, determining the facial partition corresponding to the drawing area as the target partition; Each facial pattern in the target partition in the facial pattern library is used as a pattern to be selected; Determine the difference between each of the candidate textures and the drawing gesture; According to the difference, a candidate texture corresponding to the drawing gesture is determined as a target texture.
4. The method according to claim 2, characterized in that Also includes: When there is no facial pattern matching the drawing gesture in the facial database; Determine a coloring area corresponding to the drawing area according to the drawing area and the drawn part of the facial image, wherein the coloring area includes a texture area and a background area; In response to a color selection operation by the user, the color selected by the user is covered in the coloring area.
5. The method according to claim 4, characterized in that In response to the user's color selection operation, covering the color selected by the user in the coloring area specifically includes: In response to the user's color selection operation, the color selected by the user is covered in the painted area, and the selectable colors of the texture area and the background color area are not completely the same.
6. The method according to claim 1, characterized in that Also includes: In response to a selection operation by a user, determining a half region of the facial image selected by the user as a target half region; The drawn facial makeup of the target half area is symmetrically covered to the remaining half area of the facial image.
7. The method according to claim 1, characterized in that After the facial image is displayed to the user through the display interaction device, the method further includes: In response to the selection operation of the user on the display interaction device, determining the target face profile of the user; According to the drawing gesture, the facial drawing performed in the drawing area specifically includes: According to the drawing gesture, the target face is drawn in the drawing area.
8. A device for drawing virtual facial makeup, characterized in that: include: An acquisition module, which acquires the user's facial image; A display module displays the facial image to the user through a display interactive device; a determination module, in response to an input operation of the user on the display interaction device, determining a drawing gesture and a drawing area of the user on the facial image; A drawing module performs facial drawing in the drawing area according to the drawing gesture.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. A device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.