WO2023241010A1 - 虚拟形象生成方法、装置、电子设备及存储介质 - Google Patents

虚拟形象生成方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2023241010A1
WO2023241010A1 PCT/CN2022/143636 CN2022143636W WO2023241010A1 WO 2023241010 A1 WO2023241010 A1 WO 2023241010A1 CN 2022143636 W CN2022143636 W CN 2022143636W WO 2023241010 A1 WO2023241010 A1 WO 2023241010A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
user
difference
matching
avatar
Prior art date
Application number
PCT/CN2022/143636
Other languages
English (en)
French (fr)
Inventor
陈嘉琳
李辰
刘恬忻
卢钰洁
曾熙
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2023241010A1 publication Critical patent/WO2023241010A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • G06V40/166Detection; Localisation; Normalisation using acquisition arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/174Facial expression recognition

Definitions

  • the present application relates to the field of electronic equipment technology, and in particular to a virtual image generation method, device, electronic equipment and storage medium.
  • the first aspect of this application provides a method for generating a virtual image, including: obtaining a user image; extracting user image representation information based on the user image; judging whether the user's image has changed based on the extracted user image representation information; if the user's image If a change occurs, an avatar corresponding to the user's image is generated.
  • a second aspect of this application provides a virtual image generation device, including: an acquisition module for acquiring a user image; an extraction module for extracting user image representation information based on the user image; and a judgment module for extracting user image representation information based on the extracted user image.
  • the user image representation information determines whether the user's image changes; the generation module is used to generate a virtual image corresponding to the user image if the user's image changes.
  • a third aspect of the present application provides an electronic device.
  • the electronic device includes a memory and a processor coupled to each other.
  • the memory is used to store program data
  • the processor is used to execute the program data to implement the aforementioned method.
  • the fourth aspect of the present application provides a computer-readable storage medium.
  • Program data is stored in the computer-readable storage medium.
  • the program data is executed by a processor, it is used to implement the aforementioned method.
  • 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 changes, an avatar corresponding to the user's image is generated. Therefore, a virtual image corresponding to the user's image can be automatically generated according to the change in the user's image, without the need for the user to manually update, but the user's avatar personality can be maintained. ization, improving the user experience.
  • Figure 1 is a schematic flow chart of an embodiment of the virtual image generation method of the present application.
  • Figure 2 is a schematic flow chart of another embodiment of the virtual image generation method of the present application.
  • Figure 3 is a schematic diagram of the preset application scenario of this application.
  • FIG. 4 is a schematic flowchart of an embodiment of step S24 in Figure 2;
  • FIG. 5 is a schematic flowchart of an embodiment of step S242 in Figure 4.
  • Figure 6 shows the virtual images corresponding to different periods in the common sense scene of Xiping
  • Figure 7 is a schematic structural diagram of an embodiment of the virtual image generation device of the present application.
  • Figure 8 is a schematic structural block diagram of an embodiment of the electronic device of the present application.
  • determining whether the user's image has changed based on the extracted user image representation information includes: matching the user image representation information with image materials in the image material library to obtain the user image representation At least one image material corresponding to the 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, it is determined that the user's image has changed.
  • the number of image materials is a plurality corresponding to different areas of the human head, and corresponding weight coefficients are set; the determination of whether the image materials obtained through matching are different from the user's current virtual image correspondence
  • the image material includes: respectively determining the degree of difference between each image material obtained by matching and the image material corresponding to the user's current virtual image; performing a weighted summation of the degree of difference based on the weight coefficient, to Obtain a comprehensive difference degree; 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.
  • generating an avatar corresponding to the user's image includes: generating an avatar of the user based on the image material obtained through matching.
  • Embodiments of the present application also provide a virtual image generation device, including: an acquisition module, used to acquire a user image; an extraction module, used to extract a user image representation information based on the user image; a judgment module, used to extract based on the user image
  • the user image representation information determines whether the user's image changes; the generation module is used to generate a virtual image corresponding to the user image if the user's image changes.
  • the acquisition module is also used to determine whether the normally-on function of the front-facing camera is turned on and whether the preset application scenario requires it before using the normally-on front camera to collect images. Use the virtual image; if so, perform the step of using the front camera in a normally open state to collect images.
  • the step further includes: applying the user's avatar to the preset application scenario.
  • the judgment module is also used to: match the user image representation information with image materials in the image material library to obtain at least one image material corresponding to the user image representation information; determine whether the matching is successful Whether the obtained image material is different from the image material corresponding to the user's current virtual image; if so, it is determined that the user's image has changed.
  • the determination module is further configured to determine whether the degree of difference between the image material obtained through matching and the image material corresponding to the user's current avatar is between the first difference threshold and the second difference. degree threshold; if yes, it is determined that the user's image has changed.
  • An embodiment of the present application also provides an electronic device.
  • the electronic device includes a memory and a processor coupled to each other.
  • the memory is used to store program data
  • the processor is used to execute the program data to achieve: obtaining user data. image; extract a user image representation information based on the user image; determine whether the user's image changes based on the extracted user image representation information; if the user's image changes, generate a virtual image corresponding to the user image.
  • the program data is executed to implement: in response to a preset time period, periodically triggering the front camera to collect images.
  • the processor is further configured to execute the program data to: determine whether the degree of difference between the image material obtained through matching and the image material corresponding to the user's current avatar is between the first Between the difference threshold and the second difference threshold; if yes, it is determined that the user's image has changed.
  • the user image can be acquired periodically. For example, after the user's image changes and a virtual image corresponding to the user image is generated, the acquisition of the user image is suspended until the next cycle is entered, and then the user image is continued to be acquired.
  • the hair information may include hairstyle information (such as straight hair, curly hair, short hair, long hair, color) and hair accessory information (such as whether there are hair accessories, number of hair accessories, color, etc.).
  • hairstyle information such as straight hair, curly hair, short hair, long hair, color
  • hair accessory information such as whether there are hair accessories, number of hair accessories, color, etc.
  • the accessory information may include headwear information (such as hat color and style, mask color and style), glasses information (such as frame color, lens color, shape, etc.), and neckwear information (such as scarves, necklaces, etc.).
  • headwear information such as hat color and style, mask color and style
  • glasses information such as frame color, lens color, shape, etc.
  • neckwear information such as scarves, necklaces, etc.
  • the age information includes the age, which can be an integer or an age range.
  • feature extraction can be performed on the user image based on a pre-trained image feature extraction model to obtain user image representation information.
  • 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, etc.), or can also be obtained by jointly training multiple models, such as a classification task training model. It is used to obtain the user's face shape information, and regression task training is used to obtain the user's accessory information, etc.
  • the type of model can be selected according to actual needs and is not limited here.
  • the currently extracted user image representation information has changed compared to the previously extracted user image representation information, for example, a new type of user image representation information has been added, or the user image representation information has changed.
  • the headgear information was not extracted last time, but the headgear information was extracted this time, or the headgear information extracted last time was A, and the headgear information extracted this time was B. B is different from A, that is, the headgear. Information changes.
  • the virtual image may be a three-dimensional virtual image (such as Omoji) or a two-dimensional virtual image (such as Moji).
  • the always-on front camera can be used to collect images in real time and perform face recognition. For example, image acquisition is performed in real time at 200-300 frames per second.
  • Step S22 In response to recognizing a human face, control the front camera to collect user images.
  • step S23 please refer to the description of the corresponding position in the previous embodiment, and details will not be described again here.
  • Step S24 Determine whether the user's image has changed based on the extracted user image representation information.
  • Step S241 Match the user's image representation information with the image materials in the image material library to obtain at least one image material corresponding to the user's image representation information.
  • Image materials are used to create the user's avatar.
  • the mapping relationship between the user's image representation information and the image materials in the image material library is pre-stored in the electronic device, so at least one corresponding image material can be matched from the image material library based on the user's image representation information. For example, if the hairstyle information in the user image representation information is black long straight, then the hairstyle material corresponding to black long straight is matched as the hairstyle of the avatar.
  • the number of image materials is multiple corresponding to different areas of the human head, and corresponding weight coefficients are set.
  • the image material may also include other areas corresponding to the user except the head, for example, it may correspond to different areas of the body, such as hands, feet, etc., or some materials related to the user's real image, such as age.
  • the image material may include but is not limited to at least one of the following: at least one of skin material, facial features material, hair material, accessories material, face material, age material, gender material and expression material.
  • the image material may also include the user's body shape material, such as height, fatness, body movements, gestures, etc.
  • the skin material can include skin color material, spot material, makeup material covering the skin, skin sagging degree, etc.
  • Facial features materials can include eyebrow materials, eye materials, nose materials, mouth materials, and ear materials.
  • Hair materials may include hairstyle materials (such as straight hair, curly hair, short hair, long hair, color), hair accessories materials (such as the presence or absence of hair accessories, number of hair accessories, colors, etc.).
  • Accessories materials can include headwear materials (such as hat color and style, mask color and style), glasses materials (such as frame color, lens color, shape, etc.), and neckwear materials (such as scarves, necklaces, etc.).
  • Face shape materials include square face, round face, oval face, oval face, etc.
  • the age material includes the size of the age, which can be an integer or an age range.
  • Gender material includes both male and female.
  • Expression materials include happy (smiling, grinning), sad (pouting), surprised (eyes widening), frowning, and calm.
  • the above types of image materials are similar to the aforementioned user image representation information. For further examples of the types of image materials, please refer to the relevant positions of the user image representation information, which will not be described again here.
  • Step S242 Determine whether the image material obtained through matching is different from the image material corresponding to the user's current avatar.
  • Step S244 Determine that the user's image has not changed.
  • the degree of difference (hereinafter referred to as the degree of difference) between the image material obtained through matching and the image material corresponding to the user's current avatar can be determined, and then based on the degree of difference, it is determined whether the image material obtained through matching is different from the user's current avatar.
  • the image material corresponding to the virtual image When there are multiple image materials, the degree of difference between each image material obtained through matching and the image material corresponding to the user's current avatar can be determined separately, and then the above difference can be obtained through mathematical calculation (such as calculating the sum or mean). Spend.
  • step S242 may be to determine 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 the first difference threshold and the second difference threshold. If so, , then it is determined that the user's image has changed; if not, it is determined that the user's image has not changed.
  • the difference when the difference is between the first difference threshold and the second difference threshold, it means that the image of the same user has changed within a certain range. For example, the user's facial features, face shape, age, etc. will not change significantly in the near future. changes, so the change corresponding to the above-mentioned degree of difference will not be too great, and is between the first degree of difference threshold and the second degree of difference threshold. If it is another user, the corresponding degree of difference is outside the first degree of difference threshold and the second degree of difference threshold. Therefore, by setting the first difference threshold and the second difference threshold, it is possible to update the avatar only for the user corresponding to the current avatar.
  • the first difference threshold and the second difference threshold can be set or modified according to actual conditions.
  • the value range of the degree of difference is 0 to 1
  • the first difference threshold and the second difference threshold may be respectively: the first difference threshold may be 0.3, and the second difference threshold may be 0.8, 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.
  • the image material is determined to be a newly added image material, and the degree of difference corresponding to the image material can be the maximum value, such as 1.
  • 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.
  • the image materials obtained through matching include A1, A2, and A3, which respectively correspond to the image materials B1, B2, and B3 corresponding to the user's current avatar. Then, the degree of difference C1 corresponding to A1 and B1 is determined, and the degree of difference C1 corresponding to A2 and B2 is determined. The degree of difference C2, and the degree of difference C3 corresponding to A3 and B3, are then weighted and summed to obtain the comprehensive degree of difference M. Specifically, you can refer to the following formula:
  • M is the comprehensive degree of difference
  • C is the degree of difference corresponding to each matched image material
  • n is the number of matched image materials
  • d is the weight corresponding to 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 set for the image material that the user is more concerned about, so that the difference corresponding to the image material can be amplified, so that the comprehensive difference meets the needs of the image change. Adjustment, thereby realizing that the image material that the user pays attention to is used to generate a new virtual image. On the contrary, you can also set a smaller virtual image for image materials that are less concerned by users, so that the image materials have less impact on the overall comprehensive difference.
  • 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 degree of difference.
  • the comprehensive difference is greater than the 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 different from the image material corresponding to the user's current virtual image.
  • the image material corresponding to the user's current avatar is the same.
  • 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.
  • Step S25 Generate the user's virtual image based on the image material obtained through matching.
  • the matched image material can be input into a pre-trained three-dimensional image model to generate the user's virtual image.
  • the structure of the three-dimensional image model can be selected according to needs, such as a convolutional neural network, etc., which is not limited here.
  • other possible implementation methods may be used to generate the user's virtual image based on the image material obtained through matching. It can be understood that the technical content of generating a user's virtual image based on the image material is existing and will not be described again here.
  • step S22 that is, controlling the front camera to collect images
  • the execution of step S22 may be suspended. That is, after AOD detects a face, it no longer turns on the camera for image collection, reducing the process from being started ineffectively and reducing the power consumption of electronic equipment.
  • Step S26 Apply the user's virtual image to the preset application scenario.
  • the user's avatar can be applied to at least one preset application scenario as shown in FIG. 3 .
  • the user's avatar is displayed on the screen interface.
  • the virtual images displayed on the screen interface in different periods are shown. Different virtual images can be displayed from Monday to Wednesday. It can be seen that through the method provided by this application, the electronic device can automatically obtain the user's real image, and generate a virtual image corresponding to the real image's clothing, makeup, hair, etc., so as to follow the changes in the user's daily image and satisfy the user's need to maintain The virtual image is personalized and the user is unaware of the entire process, which improves the user experience.
  • FIG. 7 is a schematic structural diagram of an embodiment of the virtual image generation device of the present application.
  • the virtual image 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 is used to acquire a user image; the extraction module 120 is used to extract a user image representation information based on the user image.
  • the determination module 130 is configured to determine whether the user's image has changed based on the extracted user image representation information.
  • the generation module 140 is configured to generate a virtual image corresponding to the user's image if the user's image changes.
  • obtaining user images includes: using a front-facing camera in a normally open state to collect images and perform face recognition; in response to recognizing a face, controlling the front-facing camera to collect user images.
  • using a front-facing camera in a normally-on state to collect images includes: in response to a preset time period, periodically triggering the front-facing camera to collect images.
  • the front camera in the normally open state before using the front camera in the normally open state to collect images, it further includes: determining whether the normally open function of the front camera is turned on, and whether the preset application scenario requires the use of an avatar; if so, executing the utilization Steps for image collection with the front-facing camera in the normally open state.
  • the method further includes: applying the user's avatar to a preset application scenario.
  • determining whether the user's image has changed based on the extracted user image representation information includes: matching the user image representation information with the image materials in the image material library to obtain at least one image corresponding to the user image representation information. Image material; determine whether the image material obtained through matching is different from the image material corresponding to the user's current virtual image; if so, determine that the user's image has changed.
  • determining whether the image material obtained through matching is different from the image material corresponding to the user's current avatar includes: determining the degree of difference between the image material obtained through matching and the image material corresponding to the user's current avatar. Whether it is between the first difference threshold and the second difference threshold; if so, it is determined that the user's image has changed.
  • FIG. 8 is a schematic structural block diagram of an embodiment of the electronic device of the present application.
  • the 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.
  • the electronic device 200 may include, but is not limited to: personal computers (such as desktops, laptops, tablets, PDAs, etc.), mobile phones, servers, wearable devices, as well as augmented reality (AR), virtual reality (virtual reality, abbreviated as: VR) equipment, televisions, etc., are not limited here.
  • AR augmented reality
  • VR virtual reality
  • the processor 220 is used to control itself and the memory 210 to implement the steps in any of the above method embodiments.
  • the processor 220 may also be called a CPU (Central Processing Unit).
  • the processor 220 may be an integrated circuit chip with signal processing capabilities.
  • the processor 220 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field-Programmable Gate Array, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • the processor 220 may be implemented by multiple integrated circuit chips.
  • FIG. 9 is a schematic structural block diagram of an embodiment of a computer-readable storage medium of the present application.
  • the computer-readable storage medium 300 stores program data 310.
  • the program data 310 is executed by the processor, it is used to implement the steps in any of the above method embodiments.
  • the disclosed methods and devices can be implemented in other ways.
  • the device implementation described above is only illustrative.
  • the division of modules or units is only a logical function division.
  • there may be other division methods for example, multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • a unit described as a separate component may or may not be physically separate.
  • a component shown as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of this embodiment.
  • each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the above integrated units can be implemented in the form of hardware or software functional units.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Human Computer Interaction (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Processing Or Creating Images (AREA)

Abstract

本申请公开了一种虚拟形象生成方法、装置、电子设备及存储介质,该方法包括:获取用户图像;基于用户图像提取一用户形象表征信息;基于提取到的用户形象表征信息判断用户的形象是否发生变化;若用户的形象发生变化,则生成与用户图像对应的虚拟形象。通过上述方式,本申请能够满足用户保持虚拟形象个性化的需求。

Description

虚拟形象生成方法、装置、电子设备及存储介质
本申请要求于2022年06月14日提交中国专利局、申请号为2022106729109、发明名称为“虚拟形象生成方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
【技术领域】
本申请涉及电子设备技术领域,特别是涉及一种虚拟形象生成方法、装置、电子设备及存储介质。
【背景技术】
随着生活水平的不断提高,人们对于娱乐化和个性化的需求也越来越多样性。随着人工智能技术的发展,出现了以具体用户形象为参考的虚拟形象,虚拟形象因其独特的亲和性,受到了越来越多用户的关注与喜爱。虚拟形象被应用于锁屏显示、视频通话等场景。但是,目前需要用户自行编辑得到虚拟形象,然而这个编辑过程比较繁琐,耗费时间较长,无法满足用户保持虚拟形象个性化的需求。
【发明内容】
本申请第一方面提供了一种虚拟形象生成方法,包括:获取用户图像;基于用户图像提取一用户形象表征信息;基于提取到的用户形象表征信息判断用户的形象是否发生变化;若用户的形象发生变化,则生成与用户图像对应的虚拟形象。
本申请第二方面提供了一种虚拟形象生成装置,包括:获取模块,用于获取用户图像;提取模块,用于基于所述用户图像提取一用户形象表征信息;判断模块,用于基于提取到的用户形象表征信息判断用户的形象是否发生变化;生成模块,用于若用户的形象发生变化,则生成与所述用户图像对应的虚拟形象。
本申请第三方面提供了一种电子设备,该电子设备包括相互耦接的存储器和处理器,存储器用于存储程序数据,处理器用于执行程序数据以实现前述的方法。
本申请第四方面提供了一种计算机可读存储介质,该计算机可读存储介质中存储有程序数据,程序数据在被处理器执行时,用以实现前述的方法。
本申请的有益效果是:区别于现有技术的情况,本申请通过获取用户图像,然后基于用户图像提取一用户形象表征信息,然后基于提取到的用户形象表征信息判断用户的形象是否发生变化,若用户的形象发生变化,则生成与用户图像对应的虚拟形象,由此,可以根据用户的形象的变化自动生成与用户形象对应的虚拟形象,无需用户手动更新,但是可以保持用户的虚拟形象个性化,提升了用户的体验感。
【附图说明】
为了更清楚地说明本申请中的技术方案,下面将对实施例描述中所需要的附图作简单的介绍,显而易见地,下面描述的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来说,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。其中:
图1是本申请虚拟形象生成方法一实施例的流程示意图;
图2是本申请虚拟形象生成方法另一实施例的流程示意图;
图3是本申请预设应用场景的示意图;
图4是图2中步骤S24一实施方式的流程示意图;
图5是图4中步骤S242一实施方式的流程示意图;
图6是息屏常理场景中不同时期对应的虚拟形象;
图7是本申请虚拟形象生成装置一实施例的结构示意图;
图8是本申请电子设备一实施例的结构示意框图;
图9是本申请计算机可读存储介质一实施例的结构示意框图。
【具体实施方式】
在本申请中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
本申请中的术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。本申请的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
本申请实施例提供了一种虚拟形象生成方法,包括:获取用户图像;基于所述用户图像提取一用户形象表征信息;基于提取到的用户形象表征信息判断用户的形象是否发生变化;若用户的形象发生变化,则生成与所述用户图像对应的虚拟形象。
在一些实施例中,所述获取用户图像,包括:利用处于常开状态的前置摄像头进行图像采集,并进行人脸识别;响应于识别到人脸,控制所述前置摄像头采集所述用户图像。
在一些实施例中,所述利用处于常开状态的前置摄像头进行图像采集,包括:响应于预设的时间周期,周期性触发所述前置摄像头进行图像采集。
在一些实施例中,所述利用处于常开状态的前置摄像头进行图像采集之前,进一步包括:判断所述前置摄像头的常开功能是否开启,且预设应用场景是否需要使用所述虚拟形象;若是,则执行利用处于常开状态的前置摄像头进行图像采集的步骤。
在一些实施例中,所述生成模块,还用于在所述生成与所述用户图像对应的虚拟形象之后,将所述用户的虚拟形象应用于所述预设应用场景中。
在一些实施例中,所述基于提取到的用户形象表征信息判断用户的形象是否发生变化,包括:将所述用户形象表征信息与形象素材库内的形象素材进行匹配,得到所述用户形象表征信息对应的至少一种形象素材;判断通过匹配得到的形象素材是否不同于所述用户当前的虚拟形象对应的形象素材;若是,则确定用户的形象发生变化。
在一些实施例中,所述判断通过匹配得到的形象素材是否不同于所述用户当前的虚拟形象对应的形象素材,包括:判断通过匹配得到的形象素材与所述用户当前的虚拟形象对应的形象素材之间的差异度是否介于第一差异度阈值与第二差异度阈值之间;若是,则确定用户的形象发生变化。
在一些实施例中,所述形象素材的数量为对应于人头不同区域的多个,且设置有对应的权重系数;所述判断通过匹配得到的形象素材是否不同于所述用户当前的虚拟形象对应的形象素材,包括:分别确定所述通过匹配得到的每个形象素材与所述用户当前的虚拟形象对应的形象素材的差异度;基于所述权重系数对所述差异度进行加权求和,以获得综合差异度;基于所述综合差异度判定所述通过匹配得到的形象素材是否不同于所述用户当前的虚拟形象对应的形象素材。
在一些实施例中,所述生成所述用户图像对应的虚拟形象,包括:基于通过匹配得到的所述形象素材,生成所述用户的虚拟形象。
本申请实施例还提供了一种虚拟形象生成装置,包括:获取模块,用于获取用户图像;提取模块,用于基于所述用户图像提取一用户形象表征信息;判断模块,用于基于提取到的用户形象表征信息判断用户的形象是否发生变化;生成模块,用于若用户的形象发生变 化,则生成与所述用户图像对应的虚拟形象。
在一些实施例中,所述获取模块还用于:利用处于常开状态的前置摄像头进行图像采集,并进行人脸识别;响应于识别到人脸,控制所述前置摄像头采集所述用户图像。
在一些实施例中,所述获取模块还用于:响应于预设的时间周期,周期性触发所述前置摄像头进行图像采集。
在一些实施例中,所述获取模块还用于在所述利用处于常开状态的前置摄像头进行图像采集之前:判断所述前置摄像头的常开功能是否开启,且预设应用场景是否需要使用所述虚拟形象;若是,则执行利用处于常开状态的前置摄像头进行图像采集的步骤。
在一些实施例中,所述生成与所述用户图像对应的虚拟形象之后,还包括:将所述用户的虚拟形象应用于所述预设应用场景中。
在一些实施例中,所述判断模块还用于:将所述用户形象表征信息与形象素材库内的形象素材进行匹配,得到所述用户形象表征信息对应的至少一种形象素材;判断通过匹配得到的形象素材是否不同于所述用户当前的虚拟形象对应的形象素材;若是,则确定用户的形象发生变化。
在一些实施例中,所述判断模块还用于:判断通过匹配得到的形象素材与所述用户当前的虚拟形象对应的形象素材之间的差异度是否介于第一差异度阈值与第二差异度阈值之间;若是,则确定用户的形象发生变化。
在一些实施例中,所述形象素材的数量为对应于人头不同区域的多个,且设置有对应的权重系数;所述判断模块还用于:分别确定所述通过匹配得到的每个形象素材与所述用户当前的虚拟形象对应的形象素材的差异度;基于所述权重系数对所述差异度进行加权求和,以获得综合差异度;基于所述综合差异度判定所述通过匹配得到的形象素材是否不同于所述用户当前的虚拟形象对应的形象素材。
在一些实施例中,所述生成模块还用于:基于通过匹配得到的所述形象素材,生成所述用户的虚拟形象。
本申请实施例还提供了一种电子设备,所述电子设备包括相互耦接的存储器和处理器,所述存储器用于存储程序数据,所述处理器用于执行所述程序数据以实现:获取用户图像;基于所述用户图像提取一用户形象表征信息;基于提取到的用户形象表征信息判断用户的形象是否发生变化;若用户的形象发生变化,则生成与所述用户图像对应的虚拟形象。
在一些实施例中,所述处理器还用于执行所述程序数据以实现:利用处于常开状态的前置摄像头进行图像采集,并进行人脸识别;响应于识别到人脸,控制所述前置摄像头采集所述用户图像。
在一些实施例中,执行所述程序数据以实现:响应于预设的时间周期,周期性触发所述前置摄像头进行图像采集。
在一些实施例中,所述处理器还用于执行所述程序数据以实现:在所述利用处于常开状态的前置摄像头进行图像采集之前:判断所述前置摄像头的常开功能是否开启,且预设应用场景是否需要使用所述虚拟形象;若是,则执行利用处于常开状态的前置摄像头进行图像采集的步骤。
在一些实施例中,所述处理器还用于执行所述程序数据以实现:在所述生成与所述用户图像对应的虚拟形象之后,将所述用户的虚拟形象应用于所述预设应用场景中。
在一些实施例中,所述处理器还用于执行所述程序数据以实现:将所述用户形象表征信息与形象素材库内的形象素材进行匹配,得到所述用户形象表征信息对应的至少一种形象素材;判断通过匹配得到的形象素材是否不同于所述用户当前的虚拟形象对应的形象素材;若是,则确定用户的形象发生变化。
在一些实施例中,所述处理器还用于执行所述程序数据以实现:判断通过匹配得到的形象素材与所述用户当前的虚拟形象对应的形象素材之间的差异度是否介于第一差异度 阈值与第二差异度阈值之间;若是,则确定用户的形象发生变化。
在一些实施例中,所述形象素材的数量为对应于人头不同区域的多个,且设置有对应的权重系数;所述处理器还用于执行所述程序数据以实现:分别确定所述通过匹配得到的每个形象素材与所述用户当前的虚拟形象对应的形象素材的差异度;基于所述权重系数对所述差异度进行加权求和,以获得综合差异度;基于所述综合差异度判定所述通过匹配得到的形象素材是否不同于所述用户当前的虚拟形象对应的形象素材。
在一些实施例中,所述处理器还用于执行所述程序数据以实现:基于通过匹配得到的所述形象素材,生成所述用户的虚拟形象。
本申请还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有程序数据,所述程序数据在被处理器执行时,用以实现:获取用户图像;基于所述用户图像提取一用户形象表征信息;基于提取到的用户形象表征信息判断用户的形象是否发生变化;若用户的形象发生变化,则生成与所述用户图像对应的虚拟形象。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
请参阅图1,图1是本申请虚拟形象生成方法一实施例的流程示意图。其中,本申请的执行主体为电子设备,例如手机、电脑、智能穿戴设备等。
该方法可以包括以下步骤:
步骤S11:获取用户图像。
在一示例中,可以控制摄像头对用户进行图像采集,得到用户图像。用户图像可以是单独拍摄的照片,也可以是对视频进行分帧处理或截图得到的图片。摄像头可以为前置摄像头,也可以为后置摄像头,对于摄像头的类型、数量等参数不作限定,可以根据实际需要进行设置或修改。
在另一示例中,也可以直接获取包含用户的图片作为用户图像。
在一实施方式中,可以周期性获取用户图像,例如在用户的形象发生变化,生成与用户图像对应的虚拟形象之后,暂停获取用户图像,直至进入下一个周期,再继续获取用户图像。
步骤S12:基于用户图像提取一用户形象表征信息。
用户形象表征信息用于表征用户的形象。用户形象表征信息可以包括但不限于以下至少一种:皮肤信息、五官信息、头发信息、配饰信息、脸型信息、年龄信息、性别信息和表情信息。在其他实施方式中,用户形象表征信息还可以包括用户的身形信息,例如身高、胖瘦程度以及肢体动作、手势等。
其中,皮肤信息可以包括肤色信息、斑点信息、皮肤上覆盖的彩妆信息、皮肤松弛程度等。肤色信息可以包括黄皮、黑皮、白皮,或者可以进一步根据色卡细分肤色,得到与用户实际皮肤颜色接近的肤色。斑点信息可以包括痣、痘痘、雀斑等,或者可以进一步包括痣、痘痘、雀斑等的大小、位置。皮肤上覆盖的彩妆信息可以腮红、脸绘等,或者可以进一步包括腮红、脸绘等的大小、位置。皮肤松弛程度可以包括紧致、松弛、正常等。
其中,五官信息可以包括眉毛信息、眼睛信息、鼻子信息、嘴巴信息、耳朵信息。眉毛信息可以眉毛颜色、眉毛形状等,眉毛形状例如柳叶眉、平眉、剑眉等。眼睛信息可以包括眼睛颜色(例如瞳孔颜色,或美瞳颜色),睫毛信息(如睫毛的颜色、长度、浓密程度、卷翘程度等),眼影信息(如眼睛的的颜色、晕染范围等)。鼻子信息可以包括鼻子的形状(例如鹰钩鼻、蒜头鼻等)。嘴巴信息可以包括嘴巴的颜色和形状、胡子信息(例如胡子的颜色、长度、位置等)、有无唇钉。耳朵信息可以包括耳朵的形状,左耳和右耳的耳饰颜色、耳饰款式(长款或短款等)。
其中,头发信息可以包括发型信息(例如直发、卷发、短发、长发、颜色)、发饰信息(例如有无发饰、发饰数量、颜色等)。
其中,配饰信息可以包括头饰信息(例如帽子颜色、款式,面罩颜色、款式)、眼镜信息(例如镜框颜色,镜片颜色、形状等)、领饰信息(例如丝巾、项链等)。
其中,脸型信息包括方脸、圆脸、鹅蛋脸、瓜子脸等。
其中,年龄信息包括年龄的大小,可以为整数,或者可以为年龄段。
其中,性别信息包括男性和女性。
其中,表情信息包括开心(微笑、咧嘴大笑)、难过(嘟嘴)、惊讶(瞪大眼睛)、皱眉、平静。
具体地,可以基于预先训练好的形象特征提取模型对用户图像进行特征提取,以得到用户形象表征信息。在一示例中,形象特征提取模型可以是通过对神经网络模型(例如卷积神经网络模型、循环神经网络等)进行训练得到,或者还可以通过多种模型进行联合训练得到,例如分类任务训练用于获取用户的脸型信息、回归任务训练用于获取用户的配饰信息等。模型的类型可以根据实际需要进行选取,此处不作限定。
在一些实施方式中,在将用户图像输入形象特征提取模型之前还可以将用户图像进行预处理,例如将用户图像为裁剪或拉伸为模型可以处理的尺寸,以及通过图像增强处理提升用户图像的质量。图像增强处理例如直方图均衡、伽马变换、拉普拉斯变换等,可以对图像的亮度、对比度、饱和度、色调等进行调节,以提升用户图像的质量。
在一些实施方式中,对于需要获取用户完整形象的场景,当一张用户图像无法获取到用户完整形象时,还可以获取多张用户图像,例如多张用户图像分别对应用户的不同角度,从而基于多张用户图像可以提取用户全部的形象表征信息。当一张用户图像可以获取用户完整形象的场景时,用户图像可以为一张。对于不需要获取用户完整形象的场景,对用户图像的数量可以为一张或多张,此处不作限定。用户图像的数量可以根据实际需要进行设置和修改。
步骤S13:基于提取到的用户形象表征信息判断用户的形象是否发生变化。
具体地,可以当前提取到的用户形象表征信息相比于前一次提取到的用户形象表征信息是否发生变化,例如增加新类型的用户形象表征信息,或用户形象表征信息发生改变。举例说明,例如,前一次并未提取到头饰信息,但是这一次提取到了头饰信息,或者前一次提取到的头饰信息为A,这一次提取到的头饰信息为B,B不同与A,即头饰信息发生变化。
步骤S14:若用户的形象发生变化,则生成与用户图像对应的虚拟形象。
若用户的形象发生变化,则保持用户当前的虚拟形象,并重复执行步骤S11。
其中,与用户图像对应的虚拟形象,即是与用户图像中的用户形象对应。
本实施例中,虚拟形象可以是三维虚拟形象(例如Omoji),也可以是二维虚拟形象(例如moji)。
上述方案,通过获取用户图像,然后基于用户图像提取一用户形象表征信息,然后基于提取到的用户形象表征信息判断用户的形象是否发生变化,若用户的形象发生变化,则生成与用户图像对应的虚拟形象,由此,可以根据用户的形象的变化自动生成与用户形象对应的虚拟形象,无需用户手动更新,但是可以保持用户的虚拟形象个性化,提升了用户的体验感。
请参阅图2至图6,图2是本申请虚拟形象生成方法另一实施例的流程示意图,图3是本申请预设应用场景的示意图,图4是图2中步骤S24一实施方式的流程示意图,图5是图4中步骤S242一实施方式的流程示意图,图6是息屏常理场景中不同时期对应的虚拟形象。
该方法可以包括以下步骤:
在本实施例中,步骤S21~S22为上述步骤S11的另一种实施方式,即如何获取用户图像。
步骤S21:利用处于常开状态的前置摄像头进行图像采集,并进行人脸识别。
处于常开状态的前置摄像头可以通过前置摄像头的常开功能实现,即前摄常开(always on camera,AON)功能实现。AON功能是高通同时推出的骁龙8Gen 1处理器提供的一个始终开启摄像头的功能,能够实时检测是否有人脸出现,若检测到有人脸图像出现,则可以实现解锁等操作,且功耗很低。
具体地,可以利用常开状态的前置摄像头实时进行图像采集,并进行人脸识别。例如,以1秒200-300帧实时进行图像采集。
在一些实施方式中,响应于预设的时间周期,周期性触发前置摄像头进行图像采集。预设的时间周期可以是0.01秒、1小时、12小时、一天等,可以根据实际需要进行设置或修改。举例说明,一般用户以一天为周期进行形象更换,以一天为例,可以每间隔一天触发前置摄像头进行图像采集,并进行人脸识别。或者,也可以以0.01秒为时间周期,周期性触发前置摄像头进行图像采集,即当时间周期较小时,可以看作是实时进行图像采集进行人脸识别,以实现实时检测用户形象的变化。
本实施例中,人脸识别用于检测是否有人脸出现,可以是电子设备中预设的用户的人脸,也可以是其他人脸,此处不作限定。
在其他实施方式,也可以采用处于常开状态的后置摄像头进行图像采集,并进行人脸识别。在一个示例中,当电子设备包括显示屏和后壳时,前置摄像头为靠近显示屏侧的摄像头,后置摄像头为远离显示屏,靠近后壳的摄像头。在其他实施方式,还可以采用电子设备上的任一摄像头,或与电子设备关联的其他设备上的摄像头进行图像采集,然后再将采集的图像发送至电子设备。
在一些实施方式中,在步骤S21之前还包括:判断前置摄像头的常开功能是否开启,且预设应用场景是否需要使用虚拟形象;若是,则执行步骤S21,以自动对虚拟形象进行更新;若否,则不做处理,说明此时不需要对虚拟形象进行更新,由此,可以不进行图像采集及后续操作,从而节省电子设备的能耗。
如图3所示,其中,预设应用场景可以包括但不限于:息屏常亮场景、拍照场景、设置头像场景、视频通话场景中的至少一者。电子设备可以设置上述预设应用场景是否需要使用虚拟形象,若预设应用场景都不需要使用虚拟形象,则可以不执行步骤S21,若存在预设应用场景需要使用虚拟形象,则可以执行步骤S21,来对虚拟形象进行更新。
息屏常亮(Always On Display,AOD)场景为电子设备在锁屏状态下进行局部点亮,用于将文本、图像等信息显示于息屏界面,以便于用户在息屏状态下获取信息。其中,用户的虚拟形象可以显示于息屏界面。在一实施方式中,每次息屏,虚拟形象都可以给用户眨眼、亲亲、摇头等可爱的表情,就像跟自己打招呼一样,让息屏变得有趣。息屏常亮场景还可以包括显示时钟信息、日期信息等。虚拟形象在息屏界面的显示位置、显示面积等参数可以根据实际情况进行设置或修改,此处不作限定。
拍照场景为基于用户指令开启摄像头进行拍照或摄像等场景,用户可以通过显示屏实时预览采集到的图像。在拍照场景中,用于可以使用虚拟形象进行拍照、自拍、录制视频、录制表情包等。
设置头像场景为利用用户的虚拟形象作为用户账号的账号头像。用户账号例如是电子设备所属厂商的通用账号,用于登录电子设备所属厂商的官网、商城、云服务、官方社区等。在其他实施方式中,还可以将用户的虚拟形象作为预设应用程序中用户账号的账号头像。预设应用程序可以根据实际需要进行设置,例如QQ、微博等。
视频通话场景为实时传送人的语音和图像(用户的半身像、照片、物品等)的一种通信场景。在视频通话场景中打开虚拟形象功能,可以通过用户的虚拟形象替换真人形象进行 显示,用户的每个表情动作,虚拟形象都会照做。基于虚拟形象的视频通话场景,用户可以尽情展现自己可爱的表情,另外若用户的真实形象较为潦草,也可以通过虚拟形象掩盖住。
以上的预设应用场景仅为举例,并不局限于此。
步骤S22:响应于识别到人脸,控制前置摄像头采集用户图像。
在一些实施方式中,区别于步骤S21~S22,也可以通过在预设时间段内解锁电子设备时,控制前置摄像头采集用户图像。一般地,用户在解锁电子设备时,脸是面对摄像头的,所以此时摄像头采集的图像中包含用户的可能性更高。预设时间段可以是早晨,例如,例如6点~8点,若用户在这个时间段内解锁电子设备,则控制前置摄像头采集用户图像。一般地,在早晨用户改变形象的可能性较大。
步骤S23:基于用户图像提取一用户形象表征信息。
关于步骤S23请参见前述实施例中对应位置的说明,此处不再赘述。
步骤S24:基于提取到的用户形象表征信息判断用户的形象是否发生变化。
若是,则执行步骤S25。
否则,保持用户当前的虚拟形象,并重复执行步骤S21。
步骤S241:将用户形象表征信息与形象素材库内的形象素材进行匹配,得到用户形象表征信息对应的至少一种形象素材。
形象素材用于制作用户的虚拟形象。电子设备中预先存储有用户形象表征信息与形象素材库内的形象素材的映射关系,所以基于用户形象表征信息可以从形象素材库匹配到对应的至少一种形象素材。例如,用户形象表征信息中发型信息为黑长直,则匹配与黑长直对应的发型素材,作为虚拟形象的发型。
在一些实施方式中,形象素材的数量为对应于人头不同区域的多个,且设置有对应的权重系数。在其他实施方式中,形象素材还可以包括对应用户除人头外的其他区域,例如可以对应身体不同区域,例如、手、脚等,或者一些与用户真实形象相关的素材,例如年龄。
在一示例中,形象素材可以包括但不限于以下至少一种:皮肤素材、五官素材、头发素材、配饰素材、脸型素材、年龄素材、性别素材和表情素材中的至少一种。在其他实施方式中,形象素材还可以包括用户的身形素材,例如身高、胖瘦程度以及肢体动作、手势等。
其中,皮肤素材可以包括肤色素材、斑点素材、皮肤上覆盖的彩妆素材、皮肤松弛程度等。五官素材可以包括眉毛素材、眼睛素材、鼻子素材、嘴巴素材、耳朵素材。头发素材可以包括发型素材(例如直发、卷发、短发、长发、颜色)、发饰素材(例如有无发饰、发饰数量、颜色等)。配饰素材可以包括头饰素材(例如帽子颜色、款式,面罩颜色、款式)、眼镜素材(例如镜框颜色,镜片颜色、形状等)、领饰素材(例如丝巾、项链等)。脸型素材包括方脸、圆脸、鹅蛋脸、瓜子脸等。年龄素材包括年龄的大小,可以为整数,或者可以为年龄段。性别素材包括男性和女性。表情素材包括开心(微笑、咧嘴大笑)、难过(嘟嘴)、惊讶(瞪大眼睛)、皱眉、平静。上述形象素材的类型与前述的用户形象表征信息类似,关于形象素材的类型进一步举例,可以参考用户形象表征信息相关位置,此处不再赘述。
步骤S242:判断通过匹配得到的形象素材是否不同于用户当前的虚拟形象对应的形象素材。
若是,则执行步骤S243;否则,则执行步骤S244。
步骤S243:确定用户的形象发生变化。
步骤S244:确定用户的形象未发生变化。
具体地,可以确定通过匹配得到的形象素材与用户当前的虚拟形象对应的形象素材之 间的差异度(以下简称差异度),然后基于差异度判断通过匹配得到的形象素材是否不同于用户当前的虚拟形象对应的形象素材。当形象素材为多个时,可以分别确定通过匹配得到的每个形象素材与用户当前的虚拟形象对应的形象素材之间的差异度,然后通过数学计算(例如计算和值或均值)得到上述差异度。
在一些实施方式中,步骤S242可以为判断通过匹配得到的形象素材与用户当前的虚拟形象对应的形象素材之间的差异度是否介于第一差异度阈值与第二差异度阈值之间,若是,则确定用户的形象发生变化,若否,则确定用户的形象未发生变化。其中,当差异度介于第一差异度阈值与第二差异度阈值之间时,说明同一用户的形象变化在一定的范围内,比如用户的五官、脸型、年龄等在近期不会发生较大变化,故对应上述差异度变化不会太大,介于第一差异度阈值与第二差异度阈值之间。若为其他用户,则对应差异度位于第一差异度阈值与第二差异度阈值之外。由此,通过设置第一差异度阈值与第二差异度阈值可以实现只对当前的虚拟形象对应的用户进行虚拟形象的更新。
其中,第一差异度阈值和第二差异度阈值可以根据实际情况进行设置或修改。
在一些实施方式中,差异度的取值范围为0~1,则第一差异度阈值与第二差异度阈值可以分别为第一差异度阈值可以为0.3,第二差异度阈值可以为0.8,若差异度位于0.3~0.8之间,可以确定用户的形象发生变化,否则,用户的形象未发生变化。
其中,若匹配得到的形象素材不存在与用户当前的虚拟形象对应的形象素材,则确定该形象素材为新增的形象素材,则该形象素材对应的差异度可以为最大值,例如1。
如图5所示,在另一些实施方式中,当形象素材的数量为对应于人头不同区域的多个,且设置有对应的权重系数时,步骤S242可以包括步骤S2421~S2423:
步骤S2421:分别确定通过匹配得到的每个形象素材与用户当前的虚拟形象对应的形象素材的差异度。
其中,可以通过计算通过匹配得到的每个形象素材与用户当前的虚拟形象对应的形象素材的偏差程度,得到差异度。偏差越大,对应的差异度越大,偏差越小对应的差异度越小。例如,头发的黑色和红色的偏差较大,对应的差异度越大,头发的黑色和棕色的偏差较小,对应的差异度越小。
步骤S2422:基于权重系数对差异度进行加权求和,以获得综合差异度。
例如,通过匹配得到的形象素材包括A1、A2、A3,分别对应的用户当前的虚拟形象对应的形象素材B1、B2、B3,然后分别确定A1和B1对应的差异度C1,A2和B2对应的差异度C2,以及A3和B3对应的差异度C3,然后通过加权求和得到综合差异度M。具体地,可以参见如下公式:
M=d1*C1+d2*C2+…+dn*C n,
其中,M为综合差异度,C为每个匹配得到的形象素材对应的差异度,n为匹配得到的形象素材的数量,d为每个匹配得到的形象素材对应的权重。d的取值可以根据实际情况进行设置或修改,例如,可以将用户比较关注的形象素材对应设置较大的权重,从而可以放大该形象素材对应的差异度,使得综合差异度满足形象发生改变的调节,从而实现将用户关注的形象素材用于生成新的虚拟形象。反之,也可以将用户关注度较低的形象素材设置较小的虚拟形象,以使该形象素材对整体的综合差异度影响较小。
步骤S2423:基于综合差异度判定通过匹配得到的形象素材是否不同于用户当前的虚拟形象对应的形象素材。
具体地,可以判断综合差异度是否大于预设差异度阈值,若是,则判定通过匹配得到的形象素材是不同于用户当前的虚拟形象对应的形象素材,否则,判定通过匹配得到的形象素材是与用户当前的虚拟形象对应的形象素材相同。预设差异度阈值可以根据实际需要进行设置或修改,预设差异度阈值可以为0.5、0.6、0.8等。
步骤S25:基于通过匹配得到的形象素材,生成用户的虚拟形象。
具体地,可以将匹配得到的形象素材输入预先训练好的三维形象模型,以生成用户的虚拟形象。三维形象模型的结构可以是根据需要进行选择,例如卷积神经网络等,此处不作限定。或者,也可以采用其他可能的实施方式基于通过匹配得到的形象素材,生成用户的虚拟形象。可以理解的,基于形象素材生成用户的虚拟形象的技术内容为现有的,此处不再赘述。
在一些实施方式中,在步骤S25已经更新用户的虚拟形象之后可以暂停执行步骤S22,即控制前置摄像头进行图像采集。即AOD检测到人脸后,不在开启置摄像头进行图像采集,减少流程被无效启动,降低电子设备的功耗。
步骤S26:将用户的虚拟形象应用于预设应用场景中。
具体地,可以将用户的虚拟形象应用于如图3所示的至少一个预设应用场景中。例如,将用户的虚拟形象显示于息屏界面。
如图6所示,分别为不同时期息屏界面显示的虚拟形象,其中,周一至周三可以显示不同的虚拟形象。可见,通过本申请提供的方法,电子设备可以自动获取用户的真实形象,并生成与真实形象的穿搭、妆发等对应的虚拟形象,做到跟随用户每天形象的变化而变化,满足用户保持虚拟形象个性化的需求,同时整个过程用户无感知,提升了用户的体验感。
请参阅图7,图7是本申请虚拟形象生成装置一实施例的结构示意图。
在本实施例中,虚拟形象生成装置100包括获取模块110、提取模块120、判断模块130和生成模块140。获取模块110用于获取用户图像;提取模块120用于基于所述用户图像提取一用户形象表征信息。判断模块130用于基于提取到的用户形象表征信息判断用户的形象是否发生变化。生成模块140用于若用户的形象发生变化,则生成与所述用户图像对应的虚拟形象。
在一些实施方式中,获取用户图像,包括:利用处于常开状态的前置摄像头进行图像采集,并进行人脸识别;响应于识别到人脸,控制前置摄像头采集用户图像。
在一些实施方式中,利用处于常开状态的前置摄像头进行图像采集,包括:响应于预设的时间周期,周期性触发前置摄像头进行图像采集。
在一些实施方式中,利用处于常开状态的前置摄像头进行图像采集之前,进一步包括:判断前置摄像头的常开功能是否开启,且预设应用场景是否需要使用虚拟形象;若是,则执行利用处于常开状态的前置摄像头进行图像采集的步骤。
在一些实施方式中,生成与用户图像对应的虚拟形象之后,还包括:将用户的虚拟形象应用于预设应用场景中。
在一些实施方式中,基于提取到的用户形象表征信息判断用户的形象是否发生变化,包括:将用户形象表征信息与形象素材库内的形象素材进行匹配,得到用户形象表征信息对应的至少一种形象素材;判断通过匹配得到的形象素材是否不同于用户当前的虚拟形象对应的形象素材;若是,则确定用户的形象发生变化。
在一些实施方式中,判断通过匹配得到的形象素材是否不同于用户当前的虚拟形象对应的形象素材,包括:判断通过匹配得到的形象素材与用户当前的虚拟形象对应的形象素材之间的差异度是否介于第一差异度阈值与第二差异度阈值之间;若是,则确定用户的形象发生变化。
在一些实施方式中,形象素材的数量为对应于人头不同区域的多个,且设置有对应的权重系数;判断通过匹配得到的形象素材是否不同于用户当前的虚拟形象对应的形象素材,包括:分别确定通过匹配得到的每个形象素材与用户当前的虚拟形象对应的形象素材的差异度;基于权重系数对差异度进行加权求和,以获得综合差异度;基于综合差异度判定通过匹配得到的形象素材是否不同于用户当前的虚拟形象对应的形象素材。
在一些实施方式中,生成用户图像对应的虚拟形象,包括:基于通过匹配得到的形象素材,生成用户的虚拟形象。
请参阅图8,图8是本申请电子设备一实施例的结构示意框图。
电子设备200可以包括相互耦接的存储器210和处理器220,存储器210用于存储程序数据,处理器220用于执行程序数据以实现上述任一方法实施例中的步骤。电子设备200可以包括但不限于:个人电脑(例如,台式机、笔记本电脑、平板电脑、掌上电脑等)、手机、服务器、可穿戴设备,以及增强现实(augmented reality,简称:AR)、虚拟现实(virtual reality,简称:VR)设备、电视机等,在此不做限定。
具体而言,处理器220用于控制其自身以及存储器210以实现上述任一方法实施例中的步骤。处理器220还可以称为CPU(Central Processing Unit,中央处理单元)。处理器220可能是一种集成电路芯片,具有信号的处理能力。处理器220还可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。另外,处理器220可以由多个集成电路芯片共同实现。
请参阅图9,图9是本申请计算机可读存储介质一实施例的结构示意框图。
计算机可读存储介质300存储有程序数据310,程序数据310被处理器执行时,用以实现上述任一方法实施例中的步骤。
计算机可读存储介质300可以为U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等可以存储计算机程序的介质,也可以为存储有该计算机程序的服务器,该服务器可将存储的计算机程序发送给其他设备运行,或者也可以自运行该存储的计算机程序。
在本申请所提供的几个实施例中,应该理解到,所揭露的方法和装置,可以通过其它的方式实现。例如,以上所描述的装置实施方式仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性、机械或其它的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施方式方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施方式方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述仅为本申请的实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种虚拟形象生成方法,其特征在于,包括:
    获取用户图像;
    基于所述用户图像提取一用户形象表征信息;
    基于提取到的用户形象表征信息判断用户的形象是否发生变化;
    若用户的形象发生变化,则生成与所述用户图像对应的虚拟形象。
  2. 根据权利要求1中所述的方法,其特征在于,所述获取用户图像,包括:
    利用处于常开状态的前置摄像头进行图像采集,并进行人脸识别;
    响应于识别到人脸,控制所述前置摄像头采集所述用户图像。
  3. 根据权利要求2中所述的方法,其特征在于,所述利用处于常开状态的前置摄像头进行图像采集,包括:
    响应于预设的时间周期,周期性触发所述前置摄像头进行图像采集。
  4. 根据权利要求2中所述的方法,其特征在于,所述利用处于常开状态的前置摄像头进行图像采集之前,进一步包括:
    判断所述前置摄像头的常开功能是否开启,且预设应用场景是否需要使用所述虚拟形象;
    若是,则执行利用处于常开状态的前置摄像头进行图像采集的步骤。
  5. 根据权利要求4中所述的方法,其特征在于,所述生成与所述用户图像对应的虚拟形象之后,还包括:
    将所述用户的虚拟形象应用于所述预设应用场景中。
  6. 根据权利要求1中所述的方法,其特征在于,所述基于提取到的用户形象表征信息判断用户的形象是否发生变化,包括:
    将所述用户形象表征信息与形象素材库内的形象素材进行匹配,得到所述用户形象表征信息对应的至少一种形象素材;
    判断通过匹配得到的形象素材是否不同于所述用户当前的虚拟形象对应的形象素材;
    若是,则确定用户的形象发生变化。
  7. 根据权利要求6中所述的方法,其特征在于,所述判断通过匹配得到的形象素材是否不同于所述用户当前的虚拟形象对应的形象素材,包括:
    判断通过匹配得到的形象素材与所述用户当前的虚拟形象对应的形象素材之间的差异度是否介于第一差异度阈值与第二差异度阈值之间;
    若是,则确定用户的形象发生变化。
  8. 根据权利要求6中所述的方法,其特征在于,所述形象素材的数量为对应于人头不同区域的多个,且设置有对应的权重系数;
    所述判断通过匹配得到的形象素材是否不同于所述用户当前的虚拟形象对应的形象素材,包括:
    分别确定所述通过匹配得到的每个形象素材与所述用户当前的虚拟形象对应的形象素材的差异度;
    基于所述权重系数对所述差异度进行加权求和,以获得综合差异度;
    基于所述综合差异度判定所述通过匹配得到的形象素材是否不同于所述用户当前的虚拟形象对应的形象素材。
  9. 根据权利要求6中所述的方法,其特征在于,所述生成所述用户图像对应的虚拟形象,包括:
    基于通过匹配得到的所述形象素材,生成所述用户的虚拟形象。
  10. 一种虚拟形象生成装置,其特征在于,包括:
    获取模块,用于获取用户图像;
    提取模块,用于基于所述用户图像提取一用户形象表征信息;
    判断模块,用于基于提取到的用户形象表征信息判断用户的形象是否发生变化;
    生成模块,用于若用户的形象发生变化,则生成与所述用户图像对应的虚拟形象。
  11. 根据权利要求10中所述的装置,其特征在于,所述获取模块还用于:
    利用处于常开状态的前置摄像头进行图像采集,并进行人脸识别;
    响应于识别到人脸,控制所述前置摄像头采集所述用户图像。
  12. 根据权利要求11中所述的装置,其特征在于,所述获取模块还用于:
    响应于预设的时间周期,周期性触发所述前置摄像头进行图像采集。
  13. 根据权利要求11中所述的装置,其特征在于,所述获取模块还用于在所述利用处于常开状态的前置摄像头进行图像采集之前:
    判断所述前置摄像头的常开功能是否开启,且预设应用场景是否需要使用所述虚拟形象;
    若是,则执行利用处于常开状态的前置摄像头进行图像采集的步骤。
  14. 根据权利要求13中所述的装置,其特征在于,所述生成与所述用户图像对应的虚拟形象之后,还包括:
    将所述用户的虚拟形象应用于所述预设应用场景中。
  15. 根据权利要求10中所述的装置,其特征在于,所述判断模块还用于:
    将所述用户形象表征信息与形象素材库内的形象素材进行匹配,得到所述用户形象表征信息对应的至少一种形象素材;
    判断通过匹配得到的形象素材是否不同于所述用户当前的虚拟形象对应的形象素材;
    若是,则确定用户的形象发生变化。
  16. 根据权利要求15中所述的装置,其特征在于,所述判断模块还用于:
    判断通过匹配得到的形象素材与所述用户当前的虚拟形象对应的形象素材之间的差异度是否介于第一差异度阈值与第二差异度阈值之间;
    若是,则确定用户的形象发生变化。
  17. 根据权利要求15中所述的装置,其特征在于,所述形象素材的数量为对应于人头不同区域的多个,且设置有对应的权重系数;
    所述判断模块还用于:
    分别确定所述通过匹配得到的每个形象素材与所述用户当前的虚拟形象对应的形象素材的差异度;
    基于所述权重系数对所述差异度进行加权求和,以获得综合差异度;
    基于所述综合差异度判定所述通过匹配得到的形象素材是否不同于所述用户当前的虚拟形象对应的形象素材。
  18. 根据权利要求15中所述的装置,其特征在于,所述生成模块还用于:
    基于通过匹配得到的所述形象素材,生成所述用户的虚拟形象。
  19. 一种电子设备,其特征在于,所述电子设备包括相互耦接的存储器和处理器,所述存储器用于存储程序数据,所述处理器用于执行所述程序数据以实现如权利要求1-9任一项所述的方法。
  20. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有程序数据,所述程序数据在被处理器执行时,用以实现如权利要求1-9任一项所述的方法。
PCT/CN2022/143636 2022-06-14 2022-12-29 虚拟形象生成方法、装置、电子设备及存储介质 WO2023241010A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210672910.9A CN117274034A (zh) 2022-06-14 2022-06-14 虚拟形象生成方法、装置、电子设备及存储介质
CN202210672910.9 2022-06-14

Publications (1)

Publication Number Publication Date
WO2023241010A1 true WO2023241010A1 (zh) 2023-12-21

Family

ID=89193064

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/143636 WO2023241010A1 (zh) 2022-06-14 2022-12-29 虚拟形象生成方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN117274034A (zh)
WO (1) WO2023241010A1 (zh)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110691279A (zh) * 2019-08-13 2020-01-14 北京达佳互联信息技术有限公司 一种虚拟直播的方法、装置、电子设备及存储介质
JP2020119156A (ja) * 2019-01-22 2020-08-06 日本電気株式会社 アバター生成システム、アバター生成装置、サーバ装置、アバター生成方法、およびプログラム
CN111880664A (zh) * 2020-08-03 2020-11-03 深圳传音控股股份有限公司 Ar互动方法、电子设备及可读存储介质
CN112884908A (zh) * 2021-02-09 2021-06-01 脸萌有限公司 基于增强现实的显示方法、设备、存储介质及程序产品
CN114332374A (zh) * 2021-12-30 2022-04-12 深圳市慧鲤科技有限公司 一种虚拟显示方法、设备以及存储介质
CN115205925A (zh) * 2022-06-08 2022-10-18 北京达佳互联信息技术有限公司 表情系数确定方法、装置、电子设备及存储介质
CN115546361A (zh) * 2021-06-30 2022-12-30 腾讯科技(深圳)有限公司 三维卡通形象处理方法、装置、计算机设备和存储介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020119156A (ja) * 2019-01-22 2020-08-06 日本電気株式会社 アバター生成システム、アバター生成装置、サーバ装置、アバター生成方法、およびプログラム
CN110691279A (zh) * 2019-08-13 2020-01-14 北京达佳互联信息技术有限公司 一种虚拟直播的方法、装置、电子设备及存储介质
CN111880664A (zh) * 2020-08-03 2020-11-03 深圳传音控股股份有限公司 Ar互动方法、电子设备及可读存储介质
CN112884908A (zh) * 2021-02-09 2021-06-01 脸萌有限公司 基于增强现实的显示方法、设备、存储介质及程序产品
CN115546361A (zh) * 2021-06-30 2022-12-30 腾讯科技(深圳)有限公司 三维卡通形象处理方法、装置、计算机设备和存储介质
CN114332374A (zh) * 2021-12-30 2022-04-12 深圳市慧鲤科技有限公司 一种虚拟显示方法、设备以及存储介质
CN115205925A (zh) * 2022-06-08 2022-10-18 北京达佳互联信息技术有限公司 表情系数确定方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN117274034A (zh) 2023-12-22

Similar Documents

Publication Publication Date Title
KR102241153B1 (ko) 2차원 이미지로부터 3차원 아바타를 생성하는 방법, 장치 및 시스템
US11798246B2 (en) Electronic device for generating image including 3D avatar reflecting face motion through 3D avatar corresponding to face and method of operating same
CN105825486B (zh) 美颜处理的方法及装置
US11657557B2 (en) Method and system for generating data to provide an animated visual representation
US20190130652A1 (en) Control method, controller, smart mirror, and computer readable storage medium
JP4449723B2 (ja) 画像処理装置、画像処理方法、およびプログラム
CN111432267B (zh) 视频调整方法、装置、电子设备及存储介质
CN111382648A (zh) 人脸动态表情的检测方法、装置、设备及存储介质
TW202129524A (zh) 妝容處理方法、裝置、電子設備及儲存媒體
WO2021082787A1 (zh) 虚拟操作对象的生成方法和装置、存储介质及电子设备
CN105405157A (zh) 肖像画生成装置、肖像画生成方法
WO2022252866A1 (zh) 一种互动处理方法、装置、终端及介质
CN105095917A (zh) 图像处理方法、装置及终端
WO2022257766A1 (zh) 图像处理方法、装置、设备及介质
CN112190921A (zh) 一种游戏交互方法及装置
CN114187166A (zh) 图像处理方法、智能终端及存储介质
WO2023241010A1 (zh) 虚拟形象生成方法、装置、电子设备及存储介质
KR101507410B1 (ko) 모바일 단말의 라이브 메이크업 촬영 방법 및 장치
CN112446821B (zh) 一种图像处理方法、装置及电子设备
WO2022034779A1 (ja) 画像処理装置および画像処理方法
CN112037338A (zh) Ar形象的创建方法、终端设备以及可读存储介质
TW201629907A (zh) 三維頭像產生系統及其裝置、產生方法
CN117389676B (zh) 一种基于显示界面的智能发型适配展示方法
TWM508085U (zh) 三維頭像產生系統及其裝置
KR20230117240A (ko) 디지털 메이크업 팔레트

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22946674

Country of ref document: EP

Kind code of ref document: A1