Virtual image generation method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202210672910.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-14
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2042-06-14
AI Technical Summary
但是,目前需要用户自行编辑得到虚拟形象,然而这个编辑过程比较繁琐,耗费时间较长,无法满足用户保持虚拟形象个性化的需求
[0007]本申请的有益效果是:区别于现有技术的情况,本申请通过获取用户图像,然后基于用户图像提取一用户形象表征信息,然后基于提取到的用户形象表征信息判断用户的形象是否发生变化,若用户的形象发生变化,则生成与用户图像对应的虚拟形象,由此,可以根据用户的形象的变化自动生成与用户形象对应的虚拟形象,无需用户手动更新,但是可以保持用户的虚拟形象个性化,提升了用户的体验感。
Smart Images

Figure CN117274034B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic equipment technology, and in particular to a method, apparatus, electronic device, and storage medium for generating virtual images. Background Technology
[0002] As living standards continue to improve, people's demands for entertainment and personalization are becoming increasingly diverse. With the development of artificial intelligence technology, virtual avatars based on specific user images have emerged. These virtual avatars, due to their unique approachability, have gained increasing attention and popularity. Virtual avatars are being used in scenarios such as lock screen displays and video calls. However, currently, users need to edit their virtual avatars themselves, a process that is cumbersome and time-consuming, failing to meet users' needs for maintaining a personalized virtual avatar. Summary of the Invention
[0003] The first aspect of this application provides a method for generating a virtual avatar, comprising: acquiring a user image; extracting user image representation information based on the user image; determining whether the user's image has changed based on the extracted user image representation information; and generating a virtual avatar corresponding to the user image if the user's image has changed.
[0004] A second aspect of this application provides a virtual avatar generation apparatus, comprising: an acquisition module for acquiring a user image; an extraction module for extracting user image representation information based on the user image; a judgment module for judging whether the user's image has changed based on the extracted user image representation information; and a generation module for generating a virtual avatar corresponding to the user image if the user's image has changed.
[0005] A third aspect of this application provides an electronic device including a memory and a processor coupled to each other, the memory being used to store program data and the processor being used to execute the program data to implement the aforementioned method.
[0006] A fourth aspect of this application provides a computer-readable storage medium storing program data, which, when executed by a processor, is used to implement the aforementioned method.
[0007] The beneficial effects of this application are as follows: Unlike the prior art, this application obtains a user image, then extracts user image representation information based on the user image, and then determines whether the user's image has changed based on the extracted user image representation information. If the user's image has changed, a virtual image corresponding to the user image is generated. Thus, a virtual image corresponding to the user's image can be automatically generated according to changes in the user's image without requiring the user to manually update it, but it can maintain the personalization of the user's virtual image and improve the user's experience. Attached Figure Description
[0008] To more clearly illustrate the technical solutions in this application, the accompanying drawings required in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Among them:
[0009] Figure 1 This is a flowchart illustrating an embodiment of the virtual avatar generation method of this application;
[0010] Figure 2 This is a flowchart illustrating another embodiment of the virtual avatar generation method of this application;
[0011] Figure 3 This is a schematic diagram of the intended application scenario of this application;
[0012] Figure 4 yes Figure 2 A flowchart illustrating an implementation method for step S24;
[0013] Figure 5 yes Figure 4 A flowchart illustrating an implementation method for step S242;
[0014] Figure 6 These are virtual images corresponding to different periods in the normal scenario of the screen being off;
[0015] Figure 7 This is a schematic diagram of the structure of an embodiment of the virtual avatar generation device of this application;
[0016] Figure 8 This is a schematic block diagram of the structure of an embodiment of the electronic device of this application;
[0017] Figure 9 This is a schematic block diagram of an embodiment of a computer-readable storage medium of this application. Detailed Implementation
[0018] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0019] The terms "first" and "second" in this application are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.
[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0021] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the virtual avatar generation method of this application. The executing entity of this application is an electronic device, such as a mobile phone, computer, or smart wearable device.
[0022] The method may include the following steps:
[0023] Step S11: Obtain the user image.
[0024] In one example, the camera can be controlled to capture images of the user, resulting in a user image. The user image can be a single photograph, or it can be an image obtained by processing frames from a video or by taking a screenshot. The camera can be a front-facing camera or a rear-facing camera; there are no restrictions on the type, number, or other parameters of the camera, which can be set or modified according to actual needs.
[0025] In another example, you can also directly obtain an image containing the user as the user image.
[0026] In one implementation, user images can be acquired periodically. For example, after a user's image changes and a virtual image corresponding to the user image is generated, the acquisition of user images can be paused until the next cycle begins, at which point the acquisition of user images can continue.
[0027] Step S12: Extract user image representation information based on user image.
[0028] User image representation information is used to represent a user's image. User image representation information may include, but is not limited to, at least one of the following: skin information, facial features information, hair information, accessory information, face shape information, age information, gender information, and facial expression information. In other embodiments, user image representation information may also include the user's body shape information, such as height, weight, and body movements and gestures.
[0029] The skin information can include skin tone, blemishes, makeup application, and skin laxity. Skin tone information can include yellow, dark, and fair skin, or be further subdivided using a color chart to obtain a skin tone close to the user's actual skin color. Blemish information can include moles, acne, freckles, etc., or can be further detailed including their size and location. Makeup application information can include blush, face paint, etc., or can be further detailed including their size and location. Skin laxity can be categorized as firm, loose, or normal.
[0030] The facial features information can include eyebrow, eye, nose, mouth, and ear information. Eyebrow information includes color and shape, with shapes such as willow-leaf, straight, and arched eyebrows. Eye information includes eye color (e.g., pupil color, or contact lens color), eyelash information (e.g., eyelash color, length, density, and curl), and eyeshadow information (e.g., eyeshadow color and blending area). Nose information includes nose shape (e.g., hooked nose, bulbous nose). Mouth information includes mouth color and shape, beard information (e.g., beard color, length, and location), and whether a lip piercing is present. Ear information includes ear shape, and the color and style of earrings (long or short, etc.) for the left and right ears.
[0031] The hair information may include hairstyle information (e.g., straight hair, curly hair, short hair, long hair, color) and hair accessory information (e.g., whether there are hair accessories, the number of hair accessories, color, etc.).
[0032] The accessory information may include headwear information (such as hat color and style, mask color and style), eyeglasses information (such as frame color, lens color and shape), and neck accessory information (such as scarf, necklace, etc.).
[0033] The face shape information includes square face, round face, oval face, heart-shaped face, etc.
[0034] The age information includes the full age, which can be an integer or an age range.
[0035] The gender information includes both male and female.
[0036] The facial expressions include happy (smiling, grinning), sad (pouting), surprised (wide-eyed), frowning, and calm.
[0037] Specifically, features can be extracted from user images based on a pre-trained image feature extraction model to obtain user image representation information. In one example, the image feature extraction model can be obtained by training a neural network model (such as a convolutional neural network model, a recurrent neural network model, etc.), or it can be obtained by jointly training multiple models, such as training for a classification task to obtain the user's facial structure information, and training for a regression task to obtain the user's accessory information. The type of model can be selected according to actual needs and is not limited here.
[0038] In some implementations, the user image can be preprocessed before being input into the image feature extraction model. This preprocessing may include cropping or stretching the user image to a size that the model can handle, and improving the image quality through image enhancement techniques. Image enhancement techniques, such as histogram equalization, gamma transform, and Laplacian transform, can adjust the image's brightness, contrast, saturation, and hue to improve the image quality.
[0039] In some implementations, for scenarios requiring a complete user image, when a single user image is insufficient, multiple user images can be acquired. For example, multiple user images can correspond to different angles of the user, allowing for the extraction of all the user's visual representation information based on these multiple images. In scenarios where a single user image can capture a complete user image, only one user image is required. For scenarios where a complete user image is not required, the number of user images can be one or more, without limitation. The number of user images can be set and modified according to actual needs.
[0040] Step S13: Determine whether the user's image has changed based on the extracted user image representation information.
[0041] Specifically, this can be determined by whether the currently extracted user image representation information has changed compared to the previously extracted user image representation information. For example, has a new type of user image representation information been added, or has the user image representation information changed? For instance, if headwear information was not extracted previously, but is extracted this time, or if the headwear information extracted previously was A, and this time it is B, and B is different from A, then the headwear information has changed.
[0042] Step S14: If the user's image changes, a virtual avatar corresponding to the user's image is generated.
[0043] If the user's avatar changes, the user's current virtual avatar is maintained, and step S11 is repeated.
[0044] The virtual image corresponding to the user image is the one that corresponds to the user image in the user image.
[0045] In this embodiment, the virtual avatar can be a three-dimensional virtual avatar (e.g., Omoji) or a two-dimensional virtual avatar (e.g., moji).
[0046] The above solution acquires a user image, extracts user image representation information based on the user image, and then determines whether the user's image has changed based on the extracted user image representation information. If the user's image has changed, a virtual image corresponding to the user image is generated. Thus, a virtual image corresponding to the user's image can be automatically generated according to changes in the user's image without requiring the user to manually update it, while maintaining the personalization of the user's virtual image and improving the user experience.
[0047] Please see Figures 2 to 6 , Figure 2 This is a flowchart illustrating another embodiment of the virtual avatar generation method of this application. Figure 3 This is a schematic diagram illustrating the intended application scenario of this application. Figure 4 yes Figure 2 A flowchart illustrating an implementation method for step S24. Figure 5 yes Figure 4 A flowchart illustrating an embodiment of step S242. Figure 6 These are virtual images corresponding to different periods in the normal scenario of the screen being off.
[0048] The method may include the following steps:
[0049] In this embodiment, steps S21 to S22 are another implementation of step S11 above, namely, how to obtain user images.
[0050] Step S21: Use the front-facing camera, which is always on, to capture images and perform face recognition.
[0051] The always-on front-facing camera can be enabled through its always-on camera (AON) function. AON, a feature provided by Qualcomm's Snapdragon 8 Gen 1 processor, allows the camera to be constantly on. It can detect faces in real time, and if a face is detected, it can unlock the device, among other things, with very low power consumption.
[0052] Specifically, the always-on front-facing camera can be used to capture images in real time and perform facial recognition. For example, images can be captured in real time at 200-300 frames per second.
[0053] In some implementations, the front-facing camera is periodically triggered to capture images in response to a preset time period. The preset time period can be 0.01 seconds, 1 hour, 12 hours, or 1 day, and can be set or modified according to actual needs. For example, if a user typically changes their appearance daily, the front-facing camera can be triggered to capture images and perform facial recognition every other day. Alternatively, the front-facing camera can be periodically triggered to capture images with a time period of 0.01 seconds. When the time period is short, it can be considered as real-time image capture for facial recognition, enabling real-time detection of changes in the user's appearance.
[0054] In this embodiment, face recognition is used to detect whether a face is present. It can be the face of a user preset in the electronic device, or other faces, and is not limited here.
[0055] In other implementations, a rear-facing camera that is always on can be used for image acquisition and facial recognition. In one example, when the electronic device includes a display screen and a rear cover, the front-facing camera is a camera located closer to the display screen, and the rear-facing camera is a camera located away from the display screen and closer to the rear cover. In other implementations, any camera on the electronic device, or a camera on another device associated with the electronic device, can be used for image acquisition, and then the acquired images can be sent to the electronic device.
[0056] In some implementations, before step S21, the method further includes: determining whether the always-on function of the front-facing camera is enabled and whether the preset application scenario requires the use of a virtual avatar; if yes, then step S21 is executed to automatically update the virtual avatar; if no, then no processing is performed, indicating that it is not necessary to update the virtual avatar at this time. Thus, image acquisition and subsequent operations can be omitted, thereby saving the energy consumption of the electronic device.
[0057] like Figure 3 As shown, the preset application scenarios may include, but are not limited to, at least one of the following: always-on screen scenario, photo-taking scenario, avatar-setting scenario, and video call scenario. The electronic device can set whether the above preset application scenarios require the use of a virtual avatar. If none of the preset application scenarios require the use of a virtual avatar, step S21 can be skipped. If there are preset application scenarios that require the use of a virtual avatar, step S21 can be executed to update the virtual avatar.
[0058] The Always On Display (AOD) scenario involves partially lighting up an electronic device while the screen is locked to display text, images, and other information on the always-on display screen, allowing the user to access information even when the screen is off. A virtual avatar of the user can be displayed on the always-on display screen. In one embodiment, each time the screen is turned off, the virtual avatar can give the user cute expressions such as blinking, kissing, or shaking its head, as if greeting itself, making the always-on display screen more fun. The Always On Display scenario can also include displaying clock information, date information, etc. The display position and display area of the virtual avatar on the always-on display screen can be set or modified according to actual needs and are not limited here.
[0059] The photo-taking scenario involves activating the camera based on user commands to take photos or videos, and users can preview the captured images in real time on the display screen. Within this scenario, users can use virtual avatars to take photos, selfies, record videos, and create emojis.
[0060] The profile picture setting scenario utilizes the user's virtual avatar as the account avatar. The user account could be a generic account belonging to the manufacturer of the electronic device, used to log in to the manufacturer's official website, online store, cloud services, official community, etc. In other implementations, the user's virtual avatar can also be used as the account avatar in a preset application. Preset applications can be configured according to actual needs, such as QQ, Weibo, etc.
[0061] Video calls are a communication scenario where voice and images (a user's half-body image, photo, objects, etc.) are transmitted in real time. Enabling the virtual avatar function in a video call allows the user's real image to be displayed instead of their real one; the virtual avatar will mimic every facial expression and movement of the user. In video calls based on virtual avatars, users can freely display their cute expressions, and if the user's real image is messy, it can be covered up with a virtual avatar.
[0062] The above-mentioned application scenarios are merely examples and are not limited to these.
[0063] Step S22: In response to the recognition of a face, control the front-facing camera to capture the user's image.
[0064] In some implementations, unlike steps S21-S22, the front-facing camera can be controlled to capture the user's image when the electronic device is unlocked within a preset time period. Generally, when a user unlocks the electronic device, their face is facing the camera, so the image captured by the camera at this time is more likely to include the user. The preset time period can be in the morning, for example, from 6:00 AM to 8:00 AM. If the user unlocks the electronic device within this time period, the front-facing camera is controlled to capture the user's image. Generally, users are more likely to change their appearance in the morning.
[0065] Step S23: Extract user image representation information based on user image.
[0066] For details regarding step S23, please refer to the description of the corresponding position in the foregoing embodiments; it will not be repeated here.
[0067] Step S24: Determine whether the user's image has changed based on the extracted user image representation information.
[0068] If so, proceed to step S25.
[0069] Otherwise, maintain the user's current virtual avatar and repeat step S21.
[0070] Step S241: Match the user image representation information with the image materials in the image material library to obtain at least one image material corresponding to the user image representation information.
[0071] Image assets are used to create a user's virtual avatar. Electronic devices pre-store a mapping relationship between user avatar representation information and image assets in an image asset library. Therefore, based on the user avatar representation information, at least one corresponding image asset can be matched from the image asset library. For example, if the user avatar representation information indicates a hairstyle of long, straight black hair, then the corresponding hairstyle asset will be matched as the virtual avatar's hairstyle.
[0072] In some implementations, the number of image materials corresponds to multiple areas of the human head, and each material has a corresponding weighting coefficient. In other implementations, the image materials may also include areas of the user other than the head, such as different areas of the body, like hands and feet, or materials related to the user's real appearance, such as age.
[0073] In one example, the image assets may include, but are not limited to, at least one of the following: skin assets, facial features assets, hair assets, accessory assets, face shape assets, age assets, gender assets, and facial expression assets. In other embodiments, the image assets may also include the user's body shape assets, such as height, weight, and body movements and gestures.
[0074] The data includes: skin texture (e.g., skin tone, blemishes, makeup applied to the skin, skin laxity); facial features (e.g., eyebrows, eyes, nose, mouth, ears); hair texture (e.g., straight, curly, short, long, color) and hair accessory texture (e.g., presence, quantity, color); accessories texture (e.g., presence, quantity, color); headwear texture (e.g., hat color, style, mask color, style); glasses texture (e.g., frame color, lens color, shape); and neckwear texture (e.g., scarves, necklaces); face shape texture (e.g., square, round, oval, heart-shaped); age texture (age, which can be an integer or a range); gender texture (male and female); and facial expression texture (happy (smiling, grinning), sad (pouting), surprised (wide-eyed), frowning, and calm). The types of these image materials are similar to those in the aforementioned user image representation information. Further examples of image material types can be found in the relevant sections of the user image representation information; they will not be elaborated upon here.
[0075] Step S242: Determine whether the image material obtained through matching is different from the image material corresponding to the user's current virtual image.
[0076] If yes, proceed to step S243; otherwise, proceed to step S244.
[0077] Step S243: Determine if the user's image has changed.
[0078] Step S244: Determine that the user's image has not changed.
[0079] Specifically, the degree of difference (hereinafter referred to as difference) between the matched image material and the image material corresponding to the user's current virtual avatar can be determined. Then, based on the degree of difference, it can be determined whether the matched image material is different from the image material corresponding to the user's current virtual avatar. When there are multiple image materials, the degree of difference between each matched image material and the image material corresponding to the user's current virtual avatar can be determined separately, and then the aforementioned degree of difference can be obtained through mathematical calculation (e.g., calculating the sum or mean).
[0080] In some implementations, step S242 can be to determine whether the difference between the matched image material and the image material corresponding to the user's current virtual image is between a first difference threshold and a second difference threshold. If yes, it is determined that the user's image has changed; otherwise, it is determined that the user's image has not changed. Specifically, when the difference is between the first and second difference thresholds, it indicates that the image change for the same user is within a certain range. For example, the user's facial features, face shape, age, etc., are unlikely to change significantly in the near future, so the corresponding difference will not be too large, falling between the first and second difference thresholds. For other users, the corresponding difference is outside the first and second difference thresholds. Therefore, by setting the first and second difference thresholds, it is possible to update the virtual image only for the user corresponding to the current virtual image.
[0081] The first and second difference thresholds can be set or modified according to the actual situation.
[0082] In some implementations, the difference value ranges from 0 to 1. The first difference threshold and the second difference threshold can be 0.3 and 0.8, respectively. If the difference is between 0.3 and 0.8, it can be determined that the user's image has changed; otherwise, the user's image has not changed.
[0083] If the matched image material does not have an image material corresponding to the user's current virtual image material, then the image material is determined to be a newly added image material, and the difference degree corresponding to the image material can be the maximum value, such as 1.
[0084] like Figure 5 As shown, in some other embodiments, when the number of image materials corresponds to multiple areas of the human head and corresponding weighting coefficients are set, step S242 may include steps S2421 to S2423:
[0085] Step S2421: Determine the degree of difference between each image material obtained through matching and the image material corresponding to the user's current virtual image.
[0086] The difference degree can be calculated by determining the degree of deviation between each matched image and the image corresponding to the user's current virtual avatar. A larger deviation corresponds to a larger difference degree, and a smaller deviation corresponds to a smaller difference degree. For example, a larger deviation between black and red hair corresponds to a larger difference degree, while a smaller deviation between black and brown hair corresponds to a smaller difference degree.
[0087] Step S2422: Calculate the weighted sum of the differences based on the weight coefficients to obtain the comprehensive difference.
[0088] For example, the matched avatar materials include A1, A2, and A3, which correspond to the avatar materials B1, B2, and B3 of the user's current virtual avatar, respectively. Then, the difference degree C1 between A1 and B1, the difference degree C2 between A2 and B2, and the difference degree C3 between A3 and B3 are determined. Finally, a weighted sum is used to obtain the overall difference degree M. See the following formula for details:
[0089] M = d1*C1 + d2*C2 + ... + dn*Cn,
[0090] Where M represents the overall difference degree, C represents the difference degree corresponding to each matched image material, n represents the number of matched image materials, and d represents the weight of each matched image material. The value of d can be set or modified according to the actual situation. For example, a larger weight can be assigned to image materials that users pay more attention to, thereby amplifying the difference degree of that image material and ensuring that the overall difference degree meets the adjustment for changes in the image, thus enabling the use of image materials that users pay attention to to generate new virtual images. Conversely, image materials with low user attention can be assigned a smaller virtual image, so that the image material has a smaller impact on the overall difference degree.
[0091] Step S2423: Determine whether the image material obtained through matching is different from the image material corresponding to the user's current virtual image based on the comprehensive difference degree.
[0092] Specifically, it can be determined whether the overall difference is greater than a preset difference threshold. If so, it is determined that the image material obtained through matching is different from the image material corresponding to the user's current virtual image; otherwise, it is determined that the image material obtained through matching is the same as the image material corresponding to the user's current virtual image. The preset difference threshold can be set or modified according to actual needs, and the preset difference threshold can be 0.5, 0.6, 0.8, etc.
[0093] Step S25: Generate the user's virtual avatar based on the image materials obtained through matching.
[0094] Specifically, the matched image materials can be input into a pre-trained 3D image model to generate a virtual avatar for the user. The structure of the 3D image model can be selected as needed, such as a convolutional neural network, and is not limited here. Alternatively, other possible implementation methods can be used to generate a virtual avatar for the user based on the matched image materials. It is understood that the technical content of generating a virtual avatar for the user based on image materials is existing and will not be elaborated here.
[0095] In some implementations, after the user's virtual avatar has been updated in step S25, step S22 can be paused, i.e., the front-facing camera can be controlled to capture images. That is, once the AOD detects a face, the front-facing camera is no longer activated for image capture, reducing unnecessary process starts and lowering the power consumption of the electronic device.
[0096] Step S26: Apply the user's virtual avatar to the preset application scenario.
[0097] Specifically, the user's virtual avatar can be applied to, for example... Figure 3 In at least one of the preset application scenarios shown. For example, displaying the user's virtual avatar on the always-on display screen.
[0098] like Figure 6 The images shown depict the virtual avatars displayed on the always-on display screen at different times, with different avatars displayed from Monday to Wednesday. It is evident that, through the method provided in this application, electronic devices can automatically acquire the user's real-life image and generate a virtual avatar corresponding to that image in terms of clothing, makeup, and hairstyle. This allows the avatar to change with the user's daily appearance, satisfying the user's need to maintain a personalized virtual avatar. Furthermore, the entire process is seamless for the user, enhancing the user experience.
[0099] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of an embodiment of the virtual avatar generation device of this application.
[0100] In this embodiment, the virtual avatar generation device 100 includes an acquisition module 110, an extraction module 120, a judgment module 130, and a generation module 140. The acquisition module 110 acquires a user image; the extraction module 120 extracts user avatar representation information based on the user image; the judgment module 130 determines whether the user's avatar has changed based on the extracted user avatar representation information; and the generation module 140 generates a virtual avatar corresponding to the user image if the user's avatar has changed.
[0101] In some implementations, acquiring a user image includes: capturing an image using a front-facing camera that is always on, and performing facial recognition; and controlling the front-facing camera to capture the user image in response to facial recognition.
[0102] In some implementations, image acquisition is performed using a front-facing camera that is always on, including periodically triggering the front-facing camera to acquire images in response to a preset time period.
[0103] In some implementations, before using the always-on front-facing camera to capture images, the method further includes: determining whether the always-on function of the front-facing camera is enabled, and whether the preset application scenario requires the use of a virtual avatar; if so, then performing the step of using the always-on front-facing camera to capture images.
[0104] In some implementations, after generating a virtual avatar corresponding to the user's image, the method further includes applying the user's virtual avatar to a preset application scenario.
[0105] In some implementations, determining whether a user's image has changed based on the extracted user image representation information includes: matching the user image representation information with image materials in an image material library to obtain at least one image material corresponding to the user image representation information; determining whether the image material obtained through matching is different from the image material corresponding to the user's current virtual image; if so, determining that the user's image has changed.
[0106] In some implementations, determining whether the image material obtained through matching is different from the image material corresponding to the user's current virtual image includes: determining whether the degree of difference between the image material obtained through matching and the image material corresponding to the user's current virtual image is between a first difference threshold and a second difference threshold; if so, then it is determined that the user's image has changed.
[0107] In some implementations, the number of image materials is multiple corresponding to different areas of the human head, and each is assigned a corresponding weight coefficient. Determining whether the image materials obtained through matching are different from the image materials corresponding to the user's current virtual avatar includes: determining the degree of difference between each image material obtained through matching and the image materials corresponding to the user's current virtual avatar; performing a weighted summation of the degree of difference based on the weight coefficient to obtain a comprehensive degree of difference; and determining whether the image materials obtained through matching are different from the image materials corresponding to the user's current virtual avatar based on the comprehensive degree of difference.
[0108] In some implementations, generating a virtual avatar corresponding to a user image includes: generating a virtual avatar of the user based on image materials obtained through matching.
[0109] Please see Figure 8 , Figure 8 This is a schematic block diagram of the structure of an embodiment of the electronic device of this application.
[0110] Electronic device 200 may include a memory 210 and a processor 220 coupled to each other. The memory 210 is used to store program data, and the processor 220 is used to execute the program data to implement the steps in any of the above method embodiments. Electronic device 200 may include, but is not limited to: personal computers (e.g., desktop computers, laptop computers, tablet computers, PDAs, etc.), mobile phones, servers, wearable devices, and augmented reality (AR) and virtual reality (VR) devices, televisions, etc., without limitation.
[0111] Specifically, processor 220 controls itself and memory 210 to implement the steps in any of the above method embodiments. Processor 220 may also be referred to as a CPU (Central Processing Unit). Processor 220 may be an integrated circuit chip with signal processing capabilities. Processor 220 may also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. A general-purpose processor may be a microprocessor or any conventional processor. Furthermore, processor 220 may be implemented by multiple integrated circuit chips.
[0112] Please see Figure 9 , Figure 9 This is a schematic block diagram of an embodiment of a computer-readable storage medium of this application.
[0113] The computer-readable storage medium 300 stores program data 310, which, when executed by a processor, is used to implement the steps in any of the above method embodiments.
[0114] The computer-readable storage medium 300 can be a medium that can store computer programs, such as a USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk. It can also be a server that stores the computer program, which can send the stored computer program to other devices for execution or run the stored computer program itself.
[0115] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0116] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0117] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0118] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0119] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for generating virtual avatars, characterized in that, include: Get user image; Extract user image representation information based on the user image; Determine whether the user's image has changed based on the extracted user image representation information; If the user's image changes, a virtual avatar corresponding to the user's image is generated; The step of determining whether a user's image has changed based on the extracted user image representation information includes: The user image representation information is matched with the image materials in the image material library to obtain at least one image material corresponding to the user image representation information; Determine whether the image material obtained through matching is different from the image material corresponding to the user's current virtual image; If so, then it is determined that the user's image has changed.
2. The method according to claim 1, characterized in that, The acquisition of the user image includes: The front-facing camera, which is always on, is used to capture images and perform facial recognition. In response to the recognition of a face, the front-facing camera is controlled to capture the user's image.
3. The method according to claim 2, characterized in that, The method of image acquisition using a front-facing camera that is always open includes: In response to a preset time period, the front-facing camera is periodically triggered to capture images.
4. The method according to claim 2, characterized in that, Before acquiring images using the normally open front-facing camera, the process further includes: Determine whether the always-on function of the front camera is enabled, and whether the virtual avatar is required in the preset application scenario; If so, then proceed with the step of capturing images using the front-facing camera, which is always on.
5. The method according to claim 4, characterized in that, After generating the virtual avatar corresponding to the user image, the process further includes: The user's virtual avatar is applied to the preset application scenario.
6. The method according to claim 1, characterized in that, The determination of whether the image material obtained through matching is different from the image material corresponding to the user's current virtual image includes: Determine whether the difference between the image material obtained through matching and the image material corresponding to the user's current virtual image is between a first difference threshold and a second difference threshold; If so, then it is determined that the user's image has changed.
7. The method according to claim 1, characterized in that, The number of image materials is multiple, corresponding to different areas of the human head, and each material has a corresponding weighting coefficient. The determination of whether the image material obtained through matching is different from the image material corresponding to the user's current virtual image includes: Determine the degree of difference between each image material obtained through matching and the image material corresponding to the user's current virtual image; The difference degree is weighted and summed based on the weighting coefficients to obtain the comprehensive difference degree. Based on the comprehensive difference, it is determined whether the image material obtained through matching is different from the image material corresponding to the user's current virtual image.
8. The method according to claim 1, characterized in that, The generation of the virtual avatar corresponding to the user image includes: Based on the image materials obtained through matching, a virtual avatar of the user is generated.
9. A virtual avatar generation device, characterized in that, include: The acquisition module is used to acquire user images; The extraction module is used to extract user image representation information based on the user image; The judgment module is used to determine whether the user's image has changed based on the extracted user image representation information. The generation module is used to generate a virtual image corresponding to the user's image if the user's image changes. The step of determining whether a user's image has changed based on the extracted user image representation information includes: The user image representation information is matched with the image materials in the image material library to obtain at least one image material corresponding to the user image representation information; Determine whether the image material obtained through matching is different from the image material corresponding to the user's current virtual image; If so, then it is determined that the user's image has changed.
10. An electronic device, characterized in that, The electronic device includes a memory and a processor coupled to each other, the memory being used to store program data and the processor being used to execute the program data to implement the method as described in any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program data, which, when executed by a processor, is used to implement the method as described in any one of claims 1-8.
Citation Information
Patent Citations
Emoji recording and sending
CN110520901A
Virtual live broadcast method and device, electronic equipment and storage medium
CN110691279A
AR interaction method, electronic equipment and readable storage medium
CN111880664A
Avatar appearance transformation in a virtual universe
US20100083148A1
Avatars Reflecting User States
US20110296324A1