WO2023045961A1 - Virtual object generation method and apparatus, and electronic device and storage medium - Google Patents

Virtual object generation method and apparatus, and electronic device and storage medium Download PDF

Info

Publication number
WO2023045961A1
WO2023045961A1 PCT/CN2022/120158 CN2022120158W WO2023045961A1 WO 2023045961 A1 WO2023045961 A1 WO 2023045961A1 CN 2022120158 W CN2022120158 W CN 2022120158W WO 2023045961 A1 WO2023045961 A1 WO 2023045961A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
virtual object
target part
information
rendering
Prior art date
Application number
PCT/CN2022/120158
Other languages
French (fr)
Chinese (zh)
Inventor
孙仁辉
苏柳
Original Assignee
上海商汤智能科技有限公司
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 上海商汤智能科技有限公司 filed Critical 上海商汤智能科技有限公司
Publication of WO2023045961A1 publication Critical patent/WO2023045961A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/203D [Three Dimensional] animation
    • G06T13/403D [Three Dimensional] animation of characters, e.g. humans, animals or virtual beings
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects

Abstract

The present disclosure relates to a virtual object generation method and apparatus, and an electronic device and a storage medium. The method comprises: acquiring, from an original virtual object, a target part to be processed; according to hue information of the target part, dividing the target part into a plurality of target regions; according to a preset color parameter, respectively performing, on the plurality of target regions, rendering processing that matches the hues of the target regions, so as to obtain a plurality of rendering results; and on the basis of the plurality of rendering results, generating a target virtual object.

Description

虚拟对象的生成方法及装置、电子设备和存储介质Method and device for generating virtual object, electronic device and storage medium
相关申请的交叉引用Cross References to Related Applications
本公开基于申请号为202111137693.5、申请日为2021年9月27日、申请名称为“虚拟对象的生成方法及装置、电子设备和存储介质”的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本公开作为参考。This disclosure is based on the Chinese patent application with the application number 202111137693.5, the application date is September 27, 2021, and the application name is "virtual object generation method and device, electronic equipment and storage medium", and requires the priority of the Chinese patent application Right, the entire content of this Chinese patent application is hereby incorporated into this disclosure as a reference.
技术领域technical field
本公开涉及计算机视觉领域,涉及一种虚拟对象的生成方法及装置、电子设备和存储介质。The present disclosure relates to the field of computer vision, and relates to a method and device for generating a virtual object, electronic equipment and a storage medium.
背景技术Background technique
随着计算机视觉技术的发展,可以与用户交互的虚拟对象已经愈发广泛地应用于人们的生活之中,比如各种智能设备中的拟人对象等。With the development of computer vision technology, virtual objects that can interact with users have been more and more widely used in people's lives, such as anthropomorphic objects in various smart devices.
然而,随着应用场景的不同,这些拟人对象可能需要作出形象或颜色上的改变,如何使得改变后的对象依然具有较为真实和自然的人物效果,成为目前一个亟待解决的问题。However, with different application scenarios, these anthropomorphic objects may need to be changed in image or color. How to make the changed objects still have a more realistic and natural character effect has become an urgent problem to be solved.
发明内容Contents of the invention
本公开提出了一种虚拟对象的生成方案。The present disclosure proposes a virtual object generation scheme.
根据本公开的一方面,提供了一种,该方法包括:According to an aspect of the present disclosure, there is provided a method comprising:
获取原始虚拟对象中待处理的目标部位;根据所述目标部位的色调信息,将所述目标部位划分为多个目标区域;根据预设颜色参数,对所述多个目标区域分别进行与所述目标区域的色调匹配的渲染处理,得到多个渲染结果;基于所述多个渲染结果,生成目标虚拟对象。Obtain the target part to be processed in the original virtual object; divide the target part into multiple target areas according to the color tone information of the target part; A plurality of rendering results are obtained through the rendering processing of the tone matching of the target area; based on the plurality of rendering results, a target virtual object is generated.
在一种可能的实现方式中,所述获取原始虚拟对象中待处理的目标部位,包括:获取原始虚拟对象,其中,所述原始虚拟对象根据虚拟信息所生成;根据所述虚拟信息,从所述原始虚拟对象中提取所述待处理的目标部位。In a possible implementation manner, the obtaining the target part to be processed in the original virtual object includes: obtaining the original virtual object, wherein the original virtual object is generated according to virtual information; according to the virtual information, the The target part to be processed is extracted from the original virtual object.
在一种可能的实现方式中,所述虚拟信息包括以下至少之一:预设的虚拟对象生成信息,响应于用户的动作所生成的虚拟对象控制信息。In a possible implementation manner, the virtual information includes at least one of the following: preset virtual object generation information, and virtual object control information generated in response to user actions.
在一种可能的实现方式中,所述色调信息包括以下至少之一:高光信息、阴影信息以及中间调信息;所述根据所述目标部位的色调信息,将所述目标部位划分为多个目标区域,包括以下至少之一:基于所述目标部位的高光信息,从所述目标部位中提取得到高光区域;基于所述目标部位的阴影信息,从所述目标部位中提取得到阴影区域;基于所述目标部位的中间调信息,从所述目标部位中提取得到中间调区域。In a possible implementation manner, the tone information includes at least one of the following: highlight information, shadow information, and midtone information; according to the tone information of the target portion, the target portion is divided into multiple targets The area includes at least one of the following: based on the highlight information of the target part, a highlight area is extracted from the target part; based on the shadow information of the target part, a shadow area is extracted from the target part; The midtone information of the target part is extracted from the target part to obtain a midtone area.
在一种可能的实现方式中,所述基于所述目标部位的高光信息,从所述目标部位中提取得到高光区域,包括:基于所述目标部位的灰度图,进行正片叠底混合,得到第一混合结果;根据所述第一混合结果,确定所述目标部位中像素点的第一透明度;根据第一预设透明度阈值和所述第一透明度,对所述目标部位中的像素点进行提取,得到所述高光区域。In a possible implementation manner, the extracting the highlight area from the target part based on the highlight information of the target part includes: performing multiplicative blending based on the grayscale image of the target part to obtain The first mixing result; according to the first mixing result, determine the first transparency of the pixels in the target part; according to the first preset transparency threshold and the first transparency, perform a process on the pixels in the target part Extract to get the highlight area.
在一种可能的实现方式中,所述基于所述目标部位的阴影信息,从所述目标部位中提取得到阴影区域,包括:基于所述目标部位的反向灰度图,进行正片叠底混合,得到第二混合结果;根据所述第二混合结果,确定所述目标部位中像素点的第二透明度;根据第二预设透明度阈值和所述第二透明度,对所述目标部位中的像素点进行提取,得到所述阴影区域。In a possible implementation manner, the extracting the shadow area from the target part based on the shadow information of the target part includes: performing multiplication and blending based on the reverse grayscale image of the target part , to obtain the second mixed result; according to the second mixed result, determine the second transparency of the pixel in the target part; according to the second preset transparency threshold and the second transparency, for the pixel in the target part Points are extracted to get the shaded area.
在一种可能的实现方式中,所述基于所述目标部位的中间调信息,从所述目标部位中提取得到中间调区域,包括:基于所述目标部位的灰度图,进行排除混合,得到第三混合结果;根据所述第三混合结果,确定所述目标部位中像素点的第三透明度;根据第三预设透明度阈值和所述第三透明度,对所述目标部位中的像素点进行提取,得到所述中间调区域。In a possible implementation manner, the extracting the midtone area from the target part based on the midtone information of the target part includes: performing exclusion mixing based on the grayscale image of the target part to obtain The third mixing result; according to the third mixing result, determine the third transparency of the pixels in the target part; according to the third preset transparency threshold and the third transparency, perform a process on the pixels in the target part Extract to obtain the midtone region.
在一种可能的实现方式中,所述根据预设颜色参数,对所述多个目标区域分别进行与所述目标区域的色调匹配的渲染处理,得到多个渲染结果,包括:根据所述预设颜色参数, 对所述多个目标区域分别进行渲染,得到多个中间渲染结果;根据所述多个目标区域的色调,确定所述多个目标区域分别对应的处理方式;按照所述多个目标区域分别对应的处理方式,将所述目标部位的灰度图分别与所述多个中间渲染结果进行混合处理,得到多个渲染结果。In a possible implementation manner, the performing rendering processing on the multiple target areas according to the preset color parameters to match the color tone of the target areas to obtain multiple rendering results includes: Color parameters are set, and the multiple target areas are respectively rendered to obtain multiple intermediate rendering results; according to the hues of the multiple target areas, the processing methods corresponding to the multiple target areas are determined; The processing manners corresponding to the target areas respectively mix the grayscale images of the target parts with the multiple intermediate rendering results to obtain multiple rendering results.
在一种可能的实现方式中,所述目标区域包括以下至少之一:高光区域、阴影区域以及中间调区域;所述根据所述多个目标区域的色调,确定所述多个目标区域分别对应的处理方式,包括:在所述目标区域包括高光区域的情况下,确定所述处理方式包括滤色混合;在所述目标区域包括阴影区域的情况下,确定所述处理方式包括正片叠底混合;在所述目标区域包括中间调区域的情况下,确定所述处理方式包括正常混合。In a possible implementation manner, the target area includes at least one of the following: a highlight area, a shadow area, and a midtone area; according to the hues of the multiple target areas, it is determined that the multiple target areas correspond to The processing method includes: in the case that the target area includes a highlight area, determining that the processing method includes color filter blending; in the case that the target area includes a shadow area, determining that the processing method includes multiply blending ; If the target area includes a midtone area, determine that the processing method includes normal mixing.
在一种可能的实现方式中,所述基于所述多个渲染结果,生成目标虚拟对象,包括:将所述多个渲染结果进行叠加,得到目标渲染结果;基于预设渲染参数,利用所述目标渲染结果对所述原始虚拟对象中的目标部位进行渲染,得到所述目标虚拟对象。In a possible implementation manner, the generating the target virtual object based on the multiple rendering results includes: superimposing the multiple rendering results to obtain the target rendering result; based on preset rendering parameters, using the The target rendering result renders the target part in the original virtual object to obtain the target virtual object.
在一种可能的实现方式中,所述方法还包括:响应于针对所述目标虚拟对象的交互操作,根据所述交互操作中的交互信息,控制所述目标虚拟对象执行与所述交互信息匹配的虚拟动作。In a possible implementation manner, the method further includes: in response to an interaction operation on the target virtual object, controlling the target virtual object to perform matching with the interaction information according to interaction information in the interaction operation. virtual action.
根据本公开的一方面,提供了一种虚拟对象的生成装置,包括:According to an aspect of the present disclosure, a device for generating a virtual object is provided, including:
获取部分,用于获取原始虚拟对象中待处理的目标部位;划分部分,用于根据所述目标部位的色调信息,将所述目标部位划分为多个目标区域;渲染部分,用于根据预设颜色参数,对所述多个目标区域分别进行与所述目标区域的色调匹配的渲染处理,得到多个渲染结果;生成部分,用于基于所述多个渲染结果,生成目标虚拟对象。The acquisition part is used to obtain the target part to be processed in the original virtual object; the division part is used to divide the target part into multiple target areas according to the hue information of the target part; the rendering part is used to divide the target part into multiple target areas according to the preset The color parameter is used to perform rendering processing on the multiple target areas to match the color tone of the target areas to obtain multiple rendering results; the generating part is configured to generate the target virtual object based on the multiple rendering results.
在一种可能的实现方式中,所述获取部分被配置为:获取原始虚拟对象,其中,所述原始虚拟对象根据虚拟信息所生成;根据所述虚拟信息,从所述原始虚拟对象中提取所述待处理的目标部位。In a possible implementation manner, the acquiring part is configured to: acquire an original virtual object, wherein the original virtual object is generated according to virtual information; extract the original virtual object from the original virtual object according to the virtual information Describe the target site to be treated.
在一种可能的实现方式中,所述虚拟信息包括以下至少之一:预设的虚拟对象生成信息,响应于用户的动作所生成的虚拟对象控制信息。In a possible implementation manner, the virtual information includes at least one of the following: preset virtual object generation information, and virtual object control information generated in response to user actions.
在一种可能的实现方式中,所述色调信息包括以下至少之一:高光信息、阴影信息以及中间调信息;所述划分部分用于以下至少之一:基于所述目标部位的高光信息,从所述目标部位中提取得到高光区域;基于所述目标部位的阴影信息,从所述目标部位中提取得到阴影区域;基于所述目标部位的中间调信息,从所述目标部位中提取得到中间调区域。In a possible implementation manner, the tone information includes at least one of the following: highlight information, shadow information, and midtone information; the division part is used for at least one of the following: based on the highlight information of the target part, from extracting a highlight area from the target part; extracting a shadow area from the target part based on the shadow information of the target part; extracting a midtone from the target part based on the midtone information of the target part area.
在一种可能的实现方式中,所述划分部分还被配置为:基于所述目标部位的灰度图,进行正片叠底混合,得到第一混合结果;根据所述第一混合结果,确定所述目标部位中像素点的第一透明度;根据第一预设透明度阈值和所述第一透明度,对所述目标部位中的像素点进行提取,得到所述高光区域。In a possible implementation manner, the dividing part is further configured to: perform multiply blending based on the grayscale image of the target part to obtain a first blending result; determine the first blending result according to the first blending result The first transparency of the pixels in the target part; according to the first preset transparency threshold and the first transparency, extract the pixels in the target part to obtain the highlight area.
在一种可能的实现方式中,所述划分部分还被配置为:基于所述目标部位的反向灰度图,进行正片叠底混合,得到第二混合结果;根据所述第二混合结果,确定所述目标部位中像素点的第二透明度;根据第二预设透明度阈值和所述第二透明度,对所述目标部位中的像素点进行提取,得到所述阴影区域。In a possible implementation manner, the dividing part is further configured to: perform multiplicative blending based on the reverse grayscale image of the target part to obtain a second blending result; according to the second blending result, Determine the second transparency of the pixels in the target part; extract the pixels in the target part according to a second preset transparency threshold and the second transparency to obtain the shadow area.
在一种可能的实现方式中,所述划分部分还被配置为:基于所述目标部位的灰度图,进行排除混合,得到第三混合结果;根据所述第三混合结果,确定所述目标部位中像素点的第三透明度;根据第三预设透明度阈值和所述第三透明度,对所述目标部位中的像素点进行提取,得到所述中间调区域。In a possible implementation manner, the dividing part is further configured to: perform exclusion mixing based on the grayscale image of the target part to obtain a third mixing result; determine the target The third transparency of the pixels in the part; according to the third preset transparency threshold and the third transparency, extract the pixels in the target part to obtain the midtone area.
在一种可能的实现方式中,所述渲染部分被配置为:根据所述预设颜色参数,对所述多个目标区域分别进行渲染,得到多个中间渲染结果;根据所述多个目标区域的色调,确定所述多个目标区域分别对应的处理方式;按照所述多个目标区域分别对应的处理方式,将所述目标部位的灰度图分别与所述多个中间渲染结果进行混合处理,得到多个渲染结果。In a possible implementation manner, the rendering part is configured to: respectively render the multiple target areas according to the preset color parameters to obtain multiple intermediate rendering results; Tone, determine the processing methods corresponding to the multiple target areas respectively; according to the processing modes corresponding to the multiple target areas, respectively mix the grayscale image of the target part with the multiple intermediate rendering results , to get multiple rendering results.
在一种可能的实现方式中,所述目标区域包括以下至少之一:高光区域、阴影区域以 及中间调区域;所述渲染部分还被配置为:在所述目标区域包括高光区域的情况下,确定所述处理方式包括滤色混合;在所述目标区域包括阴影区域的情况下,确定所述处理方式包括正片叠底混合;在所述目标区域包括中间调区域的情况下,确定所述处理方式包括正常混合。In a possible implementation manner, the target area includes at least one of the following: a highlight area, a shadow area, and a midtone area; the rendering part is further configured to: when the target area includes a highlight area, determining that the processing includes screen blending; determining that the processing includes multiply blending if the target area includes a shadow area; determining that the processing includes a midtone area if the target area includes a Methods include normal mixing.
在一种可能的实现方式中,所述生成部分被配置为:将所述多个渲染结果进行叠加,得到目标渲染结果;基于预设渲染参数,利用所述目标渲染结果对所述原始虚拟对象中的目标部位进行渲染,得到所述目标虚拟对象。In a possible implementation manner, the generating part is configured to: superimpose the multiple rendering results to obtain a target rendering result; based on preset rendering parameters, use the target rendering result to process the original virtual object Render the target part in the image to obtain the target virtual object.
在一种可能的实现方式中,所述装置还被配置为:响应于针对所述目标虚拟对象的交互操作,根据所述交互操作中的交互信息,控制所述目标虚拟对象执行与所述交互信息匹配的虚拟动作。In a possible implementation manner, the device is further configured to: in response to an interaction operation on the target virtual object, according to interaction information in the interaction operation, control the target virtual object to perform an interaction with the target virtual object. Information matching virtual action.
根据本公开的一方面,提供了一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为:执行上述虚拟对象的生成方法。According to an aspect of the present disclosure, there is provided an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to: execute the method for generating the above-mentioned virtual object.
根据本公开的一方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述虚拟对象的生成方法。According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method for generating a virtual object is realized.
根据本公开的一方面,提供了一种计算机程序产品,计算机程序产品包括计算机程序或指令,在所述计算机程序或指令在计算机上运行的情况下,使得所述计算机执行时实现上述虚拟对象的生成方法。According to an aspect of the present disclosure, a computer program product is provided, the computer program product includes a computer program or instructions, and when the computer program or instructions are run on a computer, the computer is executed to realize the above virtual object. generate method.
在本公开实施例中,通过响应于获取原始虚拟对象中待处理的目标部位,并根据目标部位的色调信息,将目标部位划分为多个目标区域,并根据预设颜色参数,对多个目标区域分别进行与目标区域的色调匹配的渲染处理,来得到多个渲染结果,并根据多个渲染结果生成目标虚拟对象。通过上述过程,可以基于虚拟对象目标部位的色调,将目标部位划分成多个目标区域,并分别对多个目标区域进行相应的渲染处理,从而使得在对虚拟对象的形象进行改变的过程中,利用原始虚拟对象原有的色调信息,依然得到具有较为真实自然效果的目标虚拟对象,比如可以根据高光、阴影和中间调等色调将目标部位划分成高光区域、阴影区域和中间调区域,从而在对高光区域进行渲染处理的过程中,尽可能调高渲染的亮度,对阴影区域进行渲染处理的过程中,尽可能减小渲染的亮度,对中间调区域进行渲染处理的过程中,尽可能保持渲染的亮度,使得目标虚拟对象的渲染效果与原始虚拟对象原本的色调分布情况相匹配,提升目标虚拟对象的真实性和自然程度。In the embodiment of the present disclosure, by responding to the acquisition of the target parts to be processed in the original virtual object, and according to the hue information of the target parts, the target parts are divided into multiple target areas, and according to the preset color parameters, the multiple target parts The areas are respectively subjected to rendering processing matching the tone of the target area to obtain multiple rendering results, and the target virtual object is generated according to the multiple rendering results. Through the above process, based on the hue of the target part of the virtual object, the target part can be divided into multiple target areas, and corresponding rendering processing is performed on the multiple target areas, so that in the process of changing the image of the virtual object, Using the original tone information of the original virtual object, the target virtual object with a more realistic and natural effect can still be obtained. For example, the target part can be divided into a highlight area, a shadow area, and a mid-tone area according to the tones such as highlights, shadows, and mid-tones. In the process of rendering the highlight area, increase the rendering brightness as much as possible, in the process of rendering the shadow area, reduce the rendering brightness as much as possible, and in the process of rendering the midtone area, keep the The brightness of the rendering enables the rendering effect of the target virtual object to match the original tone distribution of the original virtual object, improving the authenticity and naturalness of the target virtual object.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the accompanying drawings.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。The accompanying drawings here are incorporated into the description and constitute a part of the present description. These drawings show embodiments consistent with the present disclosure, and are used together with the description to explain the technical solution of the present disclosure.
图1示出根据本公开一实施例的虚拟对象的生成方法的流程图。Fig. 1 shows a flowchart of a method for generating a virtual object according to an embodiment of the present disclosure.
图2示出根据本公开一实施例的目标部位的示意图。FIG. 2 shows a schematic diagram of a target site according to an embodiment of the present disclosure.
图3示出根据本公开一实施例的第一混合结果的示意图。FIG. 3 shows a schematic diagram of a first mixing result according to an embodiment of the present disclosure.
图4示出根据本公开一实施例的高光区域的示意图。FIG. 4 shows a schematic diagram of a highlight region according to an embodiment of the disclosure.
图5示出根据本公开一实施例的第二混合结果的示意图。FIG. 5 shows a schematic diagram of a second mixing result according to an embodiment of the present disclosure.
图6示出根据本公开一实施例的阴影区域的示意图。FIG. 6 shows a schematic diagram of a shaded area according to an embodiment of the present disclosure.
图7示出根据本公开一实施例的第三混合结果的示意图。FIG. 7 shows a schematic diagram of a third mixing result according to an embodiment of the present disclosure.
图8示出根据本公开一实施例的中间调区域的示意图。FIG. 8 shows a schematic diagram of a midtone region according to an embodiment of the present disclosure.
图9示出根据本公开一实施例的高光区域的渲染结果的示意图。Fig. 9 shows a schematic diagram of a rendering result of a highlight area according to an embodiment of the present disclosure.
图10示出根据本公开一实施例的阴影区域的渲染结果的示意图。Fig. 10 shows a schematic diagram of a rendering result of a shadow area according to an embodiment of the present disclosure.
图11示出根据本公开一实施例的中间调区域的渲染结果的示意图。Fig. 11 shows a schematic diagram of a rendering result of a midtone region according to an embodiment of the present disclosure.
图12示出根据本公开一实施例的目标虚拟对象的示意图。Fig. 12 shows a schematic diagram of a target virtual object according to an embodiment of the present disclosure.
图13示出根据本公开一实施例的虚拟对象的生成装置的框图。Fig. 13 shows a block diagram of an apparatus for generating a virtual object according to an embodiment of the present disclosure.
图14示出根据本公开实施例的一种电子设备的框图。Fig. 14 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
图15示出根据本公开实施例的一种电子设备的框图。Fig. 15 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
具体实施方式Detailed ways
为了以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。For purposes of the following, various exemplary embodiments, features, and aspects of the present disclosure will be described in detail with reference to the accompanying drawings. The same reference numbers in the figures indicate functionally identical or similar elements. While various aspects of the embodiments are shown in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as superior or better than other embodiments.
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。The term "and/or" in this article is just an association relationship describing associated objects, which means that there can be three relationships, for example, A and/or B can mean: A exists alone, A and B exist simultaneously, and there exists alone B these three situations. In addition, the term "at least one" herein means any one of a variety or any combination of at least two of the more, for example, including at least one of A, B, and C, which may mean including from A, Any one or more elements selected from the set formed by B and C.
另外,为了更好地说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific implementation manners. It will be understood by those skilled in the art that the present disclosure may be practiced without some of the specific details. In some instances, methods, means, components and circuits that are well known to those skilled in the art have not been described in detail so as to obscure the gist of the present disclosure.
图1示出根据本公开一实施例的虚拟对象的生成方法的流程图,该方法可以应用于虚拟对象的生成装置或虚拟对象的生成系统等,虚拟对象的生成装置可以为终端设备、服务器或者其他处理设备等。其中,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字助理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等。在一个示例中,该可以应用于云端服务器或本地服务器,云端服务器可以为公有云服务器,也可以为私有云服务器,根据实际情况灵活选择即可。Fig. 1 shows a flowchart of a method for generating a virtual object according to an embodiment of the present disclosure, the method can be applied to a virtual object generation device or a virtual object generation system, etc., the virtual object generation device can be a terminal device, a server or other processing equipment, etc. Wherein, the terminal device may be user equipment (User Equipment, UE), mobile device, user terminal, terminal, cellular phone, cordless phone, personal digital assistant (Personal Digital Assistant, PDA), handheld device, computing device, vehicle-mounted device, Wearable equipment etc. In an example, this can be applied to a cloud server or a local server, and the cloud server can be a public cloud server or a private cloud server, which can be flexibly selected according to actual conditions.
在一些可能的实现方式中,该也可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。In some possible implementation manners, this may also be implemented by the processor calling computer-readable instructions stored in the memory.
如图1所示,在一种可能的实现方式中,所述可以包括:As shown in Figure 1, in a possible implementation manner, the description may include:
步骤S11,获取原始虚拟对象中待处理的目标部位。Step S11, acquiring the target part to be processed in the original virtual object.
其中,原始虚拟对象可以是具有形象改变需求的任意虚拟对象,比如可以是显示在电脑等智能设备的屏幕中,且与用户进行交互的数字虚拟对象,比如数字人等,或是显示在屏幕中,且可以根据用户的动作进行驱动,跟随用户的动作而进行行动的虚拟类对象,比如Avatar(阿凡达)等网络虚拟形象等。Among them, the original virtual object can be any virtual object that needs image change, for example, it can be a digital virtual object that is displayed on the screen of a smart device such as a computer and interacts with the user, such as a digital human, or displayed on the screen , and can be driven according to the actions of the user, a virtual class object that follows the actions of the user, such as network avatars such as Avatar (Avatar).
目标部位可以是原始虚拟对象中需要进行形象变换的任意部位,目标部位包含哪些部位,其实现形式可以根据实际情况灵活决定,比如目标部位可以是头发部位、脸部部位、唇部部位或是眼部部位等,随着目标部位的不同,对原始虚拟对象进行处理的方式也可以灵活变化。The target part can be any part of the original virtual object that needs image transformation. Which parts are included in the target part, the realization form can be flexibly determined according to the actual situation. For example, the target part can be the hair part, face part, lip part or eye part. Parts, etc., with different target parts, the way of processing the original virtual object can also be flexibly changed.
步骤S11的实现方式可以根据实际情况灵活决定,详见下述各公开实施例,在此先不做展开。The implementation of step S11 can be flexibly determined according to the actual situation, see the following disclosed embodiments for details, and will not be expanded here.
步骤S12,根据目标部位的色调信息,将目标部位划分为多个目标区域。Step S12, dividing the target part into a plurality of target regions according to the hue information of the target part.
其中,色调信息可以反映目标部位的相对明暗程度。色调信息包含的信息内容可以根据实际情况灵活决定,在一种可能的实现方式中,色调信息可以包括以下至少之一:高光信息、阴影信息以及中间调信息中。Wherein, the hue information may reflect the relative lightness and darkness of the target part. Information contained in the hue information may be flexibly determined according to actual conditions. In a possible implementation manner, the hue information may include at least one of the following: highlight information, shadow information, and midtone information.
其中,高光信息可以反映目标部位中具有较高亮度的区域,阴影信息可以反映目标部位中具有较低亮度的区域,而中间调信息则可以反映目标部位中亮度处于高光和阴影之间的区域。Among them, the highlight information can reflect the region with higher brightness in the target part, the shadow information can reflect the region with lower brightness in the target part, and the midtone information can reflect the region in the target part whose brightness is between the highlight and the shadow.
不同的色调信息可以通过不同的色调方式从目标部位中确定,在一些可能的实现方式 中,可以直接根据目标部位中像素点的亮度来获取上述色调信息,在一些可能的实现方式中,也可以通过不同的方式对目标部位进行处理,以得到不同的色调信息。获取色调信息的方式可以详见下述各公开实施例,在此先不做展开。Different hue information can be determined from the target part through different hue methods. In some possible implementations, the above-mentioned hue information can be obtained directly according to the brightness of the pixel in the target part. In some possible implementations, it can also be The target part is processed in different ways to obtain different hue information. The manner of acquiring hue information can be referred to the following disclosed embodiments in detail, and will not be expanded here.
目标区域包含的区域类型与区域位置等,均可以目标部位中色调信息的实际情况灵活决定,多个目标区域之间可以存在重叠区域,也可以彼此之间相互独立,在本公开实施例中不做限制。The area type and area position contained in the target area can be flexibly determined according to the actual situation of the tone information in the target area. There may be overlapping areas between multiple target areas, and they may also be independent of each other. In the embodiment of the present disclosure, no Do limit.
在一些可能的实现方式中,目标区域可以包括以下至少之一:高光区域、阴影区域和中间调区域。In some possible implementation manners, the target area may include at least one of the following: a highlight area, a shadow area, and a midtone area.
根据色调信息,将目标部位划分为多个目标区域的方式可以随着色调信息的不同而灵活发生变化,比如可以根据获取的高光信息、阴影信息以及中间调信息,将目标部位中的像素点分别划分到高光区域、阴影区域和中间调区域等。步骤S12的一些可能的实现方式可以详见下述各公开实施例,在此先不做展开。According to the hue information, the method of dividing the target part into multiple target areas can be flexibly changed with the different hue information. For example, according to the obtained highlight information, shadow information and midtone information, the pixels in the target part Divided into highlight area, shadow area and midtone area etc. For some possible implementation manners of step S12, reference may be made to the following disclosed embodiments in detail, which will not be expanded here.
步骤S13,根据预设颜色参数,对多个目标区域分别进行与目标区域的色调匹配的渲染处理,得到多个渲染结果。Step S13 , according to preset color parameters, perform rendering processing on the multiple target areas to match the color tone of the target areas, to obtain multiple rendering results.
其中,预设颜色参数可以为对目标部位进行渲染的相关颜色,该预设颜色参数的形式可以为颜色值或是RGB通道值等。对于多个目标区域来说,不同目标区域对应的预设颜色参数可以相同,也可以不同,可以根据实际情况进行灵活设定,不局限于本公开各实施例。Wherein, the preset color parameter may be a relevant color for rendering the target part, and the format of the preset color parameter may be a color value or an RGB channel value. For multiple target areas, the preset color parameters corresponding to different target areas may be the same or different, and may be flexibly set according to actual conditions, and are not limited to the embodiments of the present disclosure.
渲染结果可以是目标区域经过渲染处理后所得到的结果。随着目标区域的不同,渲染处理的方式也可能不同,因此可以分别对多个目标区域进行相应的渲染处理,以得到多个渲染结果。步骤S13的一些可能的实现方式可以详见下述各公开实施例,在此先不做展开。The rendering result may be a result obtained after the target area is rendered. Depending on the target area, the rendering processing manner may also be different. Therefore, corresponding rendering processing may be performed on multiple target areas to obtain multiple rendering results. For some possible implementation manners of step S13, reference may be made to the following disclosed embodiments in detail, which will not be expanded here.
步骤S14,根据多个渲染结果,生成目标虚拟对象。Step S14, generating a target virtual object according to multiple rendering results.
其中,目标虚拟对象,可以是对原始虚拟对象的目标部位进行改变或处理后所得到的虚拟对象,生成目标虚拟对象的方式可以根据实际情况灵活决定,比如可以将多个渲染结果进行融合以得到目标虚拟对象,或是将多个渲染结果与原始虚拟对象进行融合以得到目标虚拟对象。在一些可能的实现方式中,多个渲染结果也可以分别属于多个图层,在这种情况下,可以通过图层叠加以得到目标虚拟对象。Among them, the target virtual object can be a virtual object obtained by changing or processing the target part of the original virtual object. The method of generating the target virtual object can be flexibly determined according to the actual situation. For example, multiple rendering results can be fused to obtain the target virtual object, or combine multiple rendering results with the original virtual object to obtain the target virtual object. In some possible implementation manners, multiple rendering results may also respectively belong to multiple layers. In this case, the target virtual object may be obtained by superimposing layers.
步骤S14的一些可能的实现方式可以详见下述各公开实施例,在此先不做展开。For some possible implementation manners of step S14, reference may be made to the following disclosed embodiments in detail, which will not be expanded here.
在本公开实施例中,通过响应于获取原始虚拟对象中待处理的目标部位,并根据目标部位的色调信息,将目标部位划分为多个目标区域,并根据预设颜色参数,对多个目标区域分别进行与目标区域的色调匹配的渲染处理,来得到多个渲染结果,并根据多个渲染结果生成目标虚拟对象。通过上述过程,可以基于虚拟对象目标部位的色调,将目标部位划分成多个目标区域,并分别对多个目标区域进行相应的渲染处理,从而使得在对虚拟对象的形象进行改变的过程中,利用原始虚拟对象原有的色调信息,依然得到具有较为真实自然效果的目标虚拟对象,比如可以根据高光、阴影和中间调等色调将目标部位划分成高光区域、阴影区域和中间调区域,从而在对高光区域进行渲染处理的过程中,尽可能调高渲染的亮度,对阴影区域进行渲染处理的过程中,尽可能减小渲染的亮度,对中间调区域进行渲染处理的过程中,尽可能保持渲染的亮度,使得目标虚拟对象的渲染效果与原始虚拟对象原本的色调分布情况相匹配,提升目标虚拟对象的真实性和自然程度。In the embodiment of the present disclosure, by responding to the acquisition of the target parts to be processed in the original virtual object, and according to the hue information of the target parts, the target parts are divided into multiple target areas, and according to the preset color parameters, the multiple target parts The areas are respectively subjected to rendering processing matching the tone of the target area to obtain multiple rendering results, and the target virtual object is generated according to the multiple rendering results. Through the above process, based on the hue of the target part of the virtual object, the target part can be divided into multiple target areas, and corresponding rendering processing is performed on the multiple target areas, so that in the process of changing the image of the virtual object, Using the original tone information of the original virtual object, the target virtual object with a more realistic and natural effect can still be obtained. For example, the target part can be divided into a highlight area, a shadow area, and a mid-tone area according to the tones such as highlights, shadows, and mid-tones. In the process of rendering the highlight area, increase the rendering brightness as much as possible, in the process of rendering the shadow area, reduce the rendering brightness as much as possible, and in the process of rendering the midtone area, keep the The brightness of the rendering enables the rendering effect of the target virtual object to match the original tone distribution of the original virtual object, improving the authenticity and naturalness of the target virtual object.
在一种可能的实现方式中,步骤S11可以包括:In a possible implementation manner, step S11 may include:
获取原始虚拟对象,其中,原始虚拟对象根据虚拟信息所生成;Obtaining an original virtual object, wherein the original virtual object is generated according to virtual information;
根据虚拟信息,从原始虚拟对象中提取待处理的目标部位。According to the virtual information, the target part to be processed is extracted from the original virtual object.
其中,原始虚拟对象的实现形式可以参考上述各公开实施例。在一种可能的实现方式中,原始虚拟对象可以是根据虚拟信息所生成的。For the implementation form of the original virtual object, reference may be made to the above disclosed embodiments. In a possible implementation manner, the original virtual object may be generated according to virtual information.
虚拟信息可以是存储于各类智能设备或服务器中的电子数据或信息等,随着虚拟对象类型的不同,虚拟信息包括的信息内容也可以发生变化。Virtual information can be electronic data or information stored in various smart devices or servers, and the information content included in virtual information can also change with different types of virtual objects.
举例来说,对于数字人等根据系统控制与用户交互的虚拟对象,虚拟信息可以包括系统中预设的虚拟对象生成信息,该预设的虚拟对象生成信息可以用于生成原始虚拟对象,包含的信息内容在本公开实施例中不做限制,比如可以包括原始虚拟对象中目标部位的图像或是目标部位在原始虚拟对象的原始图像中的位置等。For example, for digital humans and other virtual objects that interact with users according to system control, the virtual information may include virtual object generation information preset in the system, and the preset virtual object generation information may be used to generate the original virtual object, including The information content is not limited in this embodiment of the present disclosure, for example, it may include an image of the target part in the original virtual object or a position of the target part in the original image of the original virtual object.
在一个示例中,对于Avatar等可以根据用户的动作进行驱动的虚拟对象,虚拟信息可以包括以下至少之一:预设的虚拟对象生成信息,响应于用户的动作所生成的虚拟对象控制信息,该控制信息可以响应于用户的动作,来对原始虚拟对象的动作以及声音等内容进行控制,以实现原始虚拟对象和用户的交互等。该控制信息包含的信息内容在本公开实施例中也不做限制,在一个示例中,该控制信息中也可以包含原始虚拟对象中目标部位的图像或目标部位在原始虚拟对象的原始图像中的位置等。In an example, for virtual objects such as Avatars that can be driven according to user actions, the virtual information may include at least one of the following: preset virtual object generation information, virtual object control information generated in response to user actions, the The control information may respond to the user's action to control the action of the original virtual object and content such as sound, so as to realize the interaction between the original virtual object and the user. The information contained in the control information is not limited in this embodiment of the present disclosure. In an example, the control information may also include the image of the target part in the original virtual object or the image of the target part in the original image of the original virtual object. location etc.
如上述公开实施例所述,虚拟信息包含的信息内容可能不同,因此根据虚拟信息获取目标部位的方式也可以灵活选择。比如可以直接从虚拟信息中获取目标部位的图像,比如直接获取头发贴图、嘴唇贴图或是眼部贴图等。图2示出根据本公开一实施例的目标部位的示意图,从图中可以看出,在一个示例中,可以直接从虚拟信息中获取头发贴图,以得到目标部位。As described in the above disclosed embodiments, the content of information contained in the virtual information may be different, so the manner of acquiring the target part according to the virtual information can also be flexibly selected. For example, images of target parts can be obtained directly from virtual information, such as hair textures, lip textures, or eye textures. Fig. 2 shows a schematic diagram of a target part according to an embodiment of the present disclosure. It can be seen from the figure that in an example, a hair texture can be obtained directly from virtual information to obtain a target part.
在一些可能的实现方式中,也可以根据虚拟信息中目标部位的位置,从原始虚拟对象的原始图像中进行截取或提取,来得到目标部位的图像等。In some possible implementation manners, the image of the target part can also be obtained by intercepting or extracting from the original image of the original virtual object according to the position of the target part in the virtual information.
通过本公开实施例,可以根据原始虚拟对象的虚拟信息,来直接获取待处理的目标部位,获取方式简便快捷,从而可以提升整个虚拟对象生成过程的效率。Through the embodiments of the present disclosure, the target part to be processed can be directly acquired according to the virtual information of the original virtual object, and the acquisition method is simple and fast, thereby improving the efficiency of the entire virtual object generation process.
在一种可能的实现方式中,步骤S12可以包括以下至少之一:In a possible implementation manner, step S12 may include at least one of the following:
步骤S121,基于目标部位的高光信息,从目标部位中提取得到高光区域。Step S121 , based on the highlight information of the target part, a highlight region is extracted from the target part.
步骤S122,基于目标部位的阴影信息,从目标部位中提取得到阴影区域。Step S122, based on the shadow information of the target part, the shadow area is extracted from the target part.
步骤S123,基于目标部位的中间调信息,从目标部位中提取得到中间调区域。Step S123 , based on the midtone information of the target part, a midtone area is extracted from the target part.
其中,步骤S121、步骤S122和步骤S123的编号仅用于对上述不同的步骤进行区分,并不限制不同步骤的实现顺序,不同步骤可以同时执行,也可以依次执行,顺序在本公开实施例中不做限制。步骤S12可以同时包含上述三个步骤,也可以选择性地执行其中的部分步骤。Wherein, the numbers of step S121, step S122, and step S123 are only used to distinguish the above-mentioned different steps, and do not limit the implementation order of different steps. Different steps can be executed simultaneously or sequentially, and the order is in the embodiments of the present disclosure. No restrictions. Step S12 may include the above three steps at the same time, and may also selectively execute some of the steps.
通过本公开实施例,可以根据高光信息、阴影信息和中间调信息中的至少之一,灵活地将目标部位划分为高光区域、阴影区域和中间调区域中的至少之一,从而有效提升对目标部位进行处理的灵活程度,便于灵活快速地生成虚拟对象。Through the embodiments of the present disclosure, the target part can be flexibly divided into at least one of the highlight area, shadow area, and mid-tone area according to at least one of the highlight information, shadow information, and mid-tone information, thereby effectively improving the accuracy of the target. The flexibility of parts processing facilitates flexible and fast generation of virtual objects.
在一种可能的实现方式中,步骤S121可以包括:In a possible implementation, step S121 may include:
基于目标部位的灰度图,进行正片叠底混合,得到第一混合结果;Based on the grayscale image of the target part, perform multiplication and bottom blending to obtain the first blending result;
根据第一混合结果,确定目标部位中像素点的第一透明度;determining the first transparency of the pixels in the target part according to the first mixing result;
根据第一预设透明度阈值和第一透明度,对目标部位中的像素点进行提取,得到高光区域。According to the first preset transparency threshold and the first transparency, pixel points in the target part are extracted to obtain a highlight area.
其中,目标部位的灰度图,可以是对目标部位进行灰度处理所得到的图像。基于目标部位的灰度图进行正片叠底混合,可以是将目标部位的灰度图自身进行正片叠底形式的混合,以得到第一混合结果,具体来说,可以是将目标部位的灰度图复制后,基于两张相同的灰度图进行正片叠底混合,来得到第一混合结果。图3示出根据本公开一实施例的第一混合结果的示意图,如图所示,在一个示例中,通过对灰度图进行处理所得到的第一混合结果,可以反映目标部位的高光信息。Wherein, the grayscale image of the target part may be an image obtained by performing grayscale processing on the target part. Multiply blending based on the grayscale image of the target part may be to blend the grayscale image of the target part itself to obtain the first blending result. Specifically, it may be to combine the grayscale image of the target part After the image is copied, multiply and blend based on two identical grayscale images to obtain the first blending result. Fig. 3 shows a schematic diagram of a first blending result according to an embodiment of the present disclosure. As shown in the figure, in an example, the first blending result obtained by processing a grayscale image can reflect highlight information of a target part .
因此,基于该第一混合结果,可以进一步确定目标部位中的高光区域。Therefore, based on the first mixing result, the highlight area in the target site can be further determined.
在一些实施例中,可以获取第一混合结果中各像素点的alpha通道值,该alpha通道值可以通过灰度与透明度之间的映射关系,映射为透明度的值,从而确定目标部位中各像素点的第一透明度。映射关系的具体映射方式可以根据实际情况灵活设定,在本公开实施例中不做限制。In some embodiments, the alpha channel value of each pixel in the first mixed result can be obtained, and the alpha channel value can be mapped to a transparency value through the mapping relationship between grayscale and transparency, so as to determine the value of each pixel in the target part The first transparency of the point. The specific mapping manner of the mapping relationship can be flexibly set according to the actual situation, and is not limited in this embodiment of the present disclosure.
第一预设阈值可以是用于对目标部位中属于高光区域的像素点进行筛选的预设阈值,该第一预设阈值的具体数值在本公开实施例中不做限制。The first preset threshold may be a preset threshold for filtering the pixel points belonging to the highlight area in the target part, and the specific value of the first preset threshold is not limited in this embodiment of the present disclosure.
根据第一预设阈值,可以判断目标部位中各像素点的第一透明度是否位于第一预设阈值的范围以内,在目标部位中各像素点的第一透明度位于第一预设阈值的范围以内的情况下,确定该像素点属于高光区域,在目标部位中各像素点的第一透明度不位于第一预设阈值的范围以内的情况下,认为该像素点属于高光区域以外的区域,通过上述筛选过程,可以从目标部位中筛选得到属于高光区域的多个像素点,继而对目标部位中属于高光区域的像素点进行提取以得到高光区域。图4示出根据本公开一实施例的高光区域的示意图,从图4中可以看出,通过本公开实施例提出的方法,可以有效且准确地从目标部位中提取出高光区域。According to the first preset threshold, it can be judged whether the first transparency of each pixel in the target part is within the range of the first preset threshold, and the first transparency of each pixel in the target part is within the range of the first preset threshold In the case of , it is determined that the pixel belongs to the highlight area. If the first transparency of each pixel in the target part is not within the range of the first preset threshold, the pixel is considered to belong to an area other than the highlight area. Through the above In the screening process, a plurality of pixel points belonging to the high-light area can be obtained from the target part by screening, and then the pixel points belonging to the high-light area in the target part are extracted to obtain the high-light area. FIG. 4 shows a schematic diagram of a highlight area according to an embodiment of the present disclosure. It can be seen from FIG. 4 that the highlight area can be effectively and accurately extracted from a target part through the method proposed by the embodiment of the present disclosure.
通过本公开实施例,可以利用对目标部位的灰度图进行正片叠底混合来得到反映高光信息的第一混合结果,从而根据该混合结果从目标部位中提取得到高光区域,这种获取高光信息的方式快速便捷,且准确性较高,在提高目标部位的处理效率的同时,可以有效提升目标部位处理后的精确度,继而提升生成的目标虚拟对象的真实效果。Through the embodiments of the present disclosure, the first blending result reflecting the highlight information can be obtained by multiplying and blending the grayscale image of the target part, so that the highlight region can be extracted from the target part according to the blending result. This method of obtaining highlight information The method is fast and convenient, and has high accuracy. While improving the processing efficiency of the target part, it can effectively improve the accuracy of the target part after processing, and then improve the real effect of the generated target virtual object.
在一种可能的实现方式中,步骤S122可以包括:In a possible implementation manner, step S122 may include:
基于目标部位的反向灰度图,进行正片叠底混合,得到第二混合结果;Based on the reverse grayscale image of the target part, perform positive and bottom blending to obtain the second blending result;
根据第二混合结果,确定目标部位中像素点的第二透明度;determining the second transparency of the pixels in the target part according to the second mixing result;
根据第二预设透明度阈值和第二透明度,对目标部位中的像素点进行提取,得到阴影区域。According to the second preset transparency threshold and the second transparency, pixel points in the target part are extracted to obtain a shadow area.
其中,目标部位的反向灰度图,可以是对目标部位中各像素点进行反向灰度处理后所得到的图像,反向灰度可以对目标部位的图像灰度范围进行线性或非线性取反,以得到与目标部位的灰度图相反的图像。基于目标部位的反向灰度图进行正片叠底混合,可以是将目标部位的反向灰度图自身进行正片叠底形式的混合,以得到第二混合结果,其实现形式可以参照基于目标部位的灰度图进行正片叠底混合以得到第一混合结果的方式。图5示出根据本公开一实施例的第二混合结果的示意图,如图所示,在一个示例中,通过对灰度图进行处理所得到的第二混合结果,可以反映目标部位的阴影信息。Wherein, the reverse grayscale image of the target part can be an image obtained by performing reverse grayscale processing on each pixel in the target part, and the reverse grayscale can perform linear or non-linear processing on the image grayscale range of the target part. Invert to get the image opposite to the grayscale image of the target site. Multiply blending based on the reverse grayscale image of the target part, which can be mixed in the form of multiplying the reverse grayscale image of the target part itself to obtain the second blending result. The implementation form can refer to Based on the target part The way the grayscale image is multiplied and blended to get the first blended result. Fig. 5 shows a schematic diagram of a second blending result according to an embodiment of the present disclosure. As shown in the figure, in an example, the second blending result obtained by processing the grayscale image can reflect the shadow information of the target part .
因此,基于该第二混合结果,可以进一步确定目标部位中的阴影区域。Therefore, based on the second mixing result, the shadow area in the target site can be further determined.
在一些实施例中,可以获取第二混合结果中各像素点的alpha通道值,该alpha通道值可以通过灰度与透明度之间的映射关系,映射为透明度的值,从而确定目标部位中各像素点的第二透明度。其中,映射关系可以参考上述公开实施例。In some embodiments, the alpha channel value of each pixel in the second mixed result can be obtained, and the alpha channel value can be mapped to a transparency value through the mapping relationship between grayscale and transparency, so as to determine the value of each pixel in the target part Secondary transparency of the point. For the mapping relationship, reference may be made to the above disclosed embodiments.
第二预设阈值可以是用于对目标部位中属于阴影区域的像素点进行筛选的预设阈值,该第二预设阈值的具体数值在本公开实施例中不做限制。在一种可能的实现方式中,第二预设阈值和第一预设阈值的数值不同。The second preset threshold may be a preset threshold used to filter the pixels belonging to the shaded area in the target part, and the specific value of the second preset threshold is not limited in this embodiment of the present disclosure. In a possible implementation manner, the second preset threshold is different from the first preset threshold.
根据第二预设阈值,可以判断目标部位中各像素点的第二透明度是否位于第二预设阈值的范围以内,在目标部位中各像素点的第二透明度位于第二预设阈值的范围以内的情况下,确定该像素点属于阴影区域,在目标部位中各像素点的第二透明度不位于第二预设阈值的范围以内的情况下,认为该像素点属于阴影区域以外的区域,通过上述筛选过程,可以从目标部位中筛选得到属于阴影区域的多个像素点,继而对目标部位中属于阴影区域的像素点进行提取以得到阴影区域。图6示出根据本公开一实施例的阴影区域的示意图,从图6中可以看出,通过本公开实施例提出的方法,可以有效且准确地从目标部位中提取出阴影区域。According to the second preset threshold, it can be judged whether the second transparency of each pixel in the target part is within the range of the second preset threshold, and the second transparency of each pixel in the target part is within the range of the second preset threshold In the case of , it is determined that the pixel belongs to the shaded area. If the second transparency of each pixel in the target part is not within the range of the second preset threshold, the pixel is considered to belong to an area other than the shaded area. Through the above In the screening process, a plurality of pixel points belonging to the shadow area may be screened from the target part, and then the pixel points belonging to the shadow area in the target part are extracted to obtain the shadow area. FIG. 6 shows a schematic diagram of a shadow area according to an embodiment of the present disclosure. It can be seen from FIG. 6 that the shadow area can be effectively and accurately extracted from the target part through the method proposed by the embodiment of the present disclosure.
通过本公开实施例,可以利用对目标部位的反向灰度图进行正片叠底混合来得到反映阴影信息的第二混合结果,从而根据该混合结果从目标部位中提取得到阴影区域,这种获取阴影信息的方式快速便捷,且便于和获取高光信息的方式同时进行批量处理,准确性较高,进一步提升了目标部位的确定效率和处理精确度,继而提升目标虚拟对象的显示效果。Through the embodiments of the present disclosure, the second blending result reflecting the shadow information can be obtained by multiplying and blending the reverse grayscale image of the target part, so as to extract the shadow area from the target part according to the blending result. This acquisition The method of shadow information is fast and convenient, and it is convenient to perform batch processing at the same time as the method of obtaining highlight information, with high accuracy, which further improves the determination efficiency and processing accuracy of the target part, and then improves the display effect of the target virtual object.
在一种可能的实现方式中,步骤S123可以包括:In a possible implementation manner, step S123 may include:
基于目标部位的灰度图,进行排除混合,得到第三混合结果;Based on the grayscale image of the target part, performing exclusion mixing to obtain a third mixing result;
根据第三混合结果,确定目标部位中像素点的第三透明度;determining the third transparency of the pixels in the target part according to the third mixing result;
根据第三预设透明度阈值和第三透明度,对目标部位中的像素点进行提取,得到中间调区域。According to the third preset transparency threshold and the third transparency, the pixels in the target part are extracted to obtain a midtone area.
其中,目标部位的灰度图的实现形式可以参考上述各公开实施例。基于目标部位的灰度图进行排除混合,可以是将目标部位的灰度图自身进行排除形式的混合,以得到第三混合结果,其实现形式可以参照上述各公开实施例。其中,排除混合可以是PS(Photoshop)编辑软件中的一种图像混合模式,可以改变图像的亮度及灰度,基于该排除混合的结果,可以获知目标部位的中间调信息。图7示出根据本公开一实施例的第三混合结果的示意图,如图7所示,在一个示例中,通过对灰度图进行处理所得到的第三混合结果,可以反映目标部位的中间调信息。For the implementation form of the grayscale image of the target part, reference may be made to the above disclosed embodiments. Excluding and mixing based on the grayscale image of the target part may be to mix the grayscale image of the target part itself in a form of exclusion to obtain a third mixed result, and its implementation form may refer to the above-mentioned disclosed embodiments. Wherein, the exclusion mixing can be an image mixing mode in PS (Photoshop) editing software, which can change the brightness and gray scale of the image, and based on the result of the exclusion mixing, the middle tone information of the target part can be obtained. Fig. 7 shows a schematic diagram of a third blending result according to an embodiment of the present disclosure. As shown in Fig. 7, in an example, the third blending result obtained by processing the grayscale image can reflect the middle of the target part call information.
因此,基于该第三混合结果,可以进一步确定目标部位中的中间调区域。Therefore, based on the third mixing result, the midtone region in the target site can be further determined.
在一些实施例中,可以获取第三混合结果中各像素点的alpha通道值,该alpha通道值可以通过灰度与透明度之间的映射关系,映射为透明度的值,从而确定目标部位中各像素点的第三透明度。其中,映射关系可以参考上述公开实施例。In some embodiments, the alpha channel value of each pixel in the third mixed result can be obtained, and the alpha channel value can be mapped to a transparency value through the mapping relationship between grayscale and transparency, so as to determine the value of each pixel in the target part The third transparency of the point. For the mapping relationship, reference may be made to the above disclosed embodiments.
第三预设阈值可以是用于对目标部位中属于中间调区域的像素点进行筛选的预设阈值,该第三预设阈值的具体数值在本公开实施例中不做限制。在一种可能的实现方式中,第三预设阈值与第二预设阈值和第一预设阈值的数值均不相同。The third preset threshold may be a preset threshold used to filter the pixels belonging to the midtone area in the target part, and the specific value of the third preset threshold is not limited in this embodiment of the present disclosure. In a possible implementation manner, the third preset threshold is different from the second preset threshold and the first preset threshold.
根据第三预设阈值,可以判断目标部位中各像素点的第三透明度是否位于第三预设阈值的范围以内,在目标部位中各像素点的第三透明度位于第三预设阈值的范围以内的情况下,确定该像素点属于中间调区域,在目标部位中各像素点的第三透明度不位于第三预设阈值的范围以内的情况下,认为该像素点属于中间调区域以外的区域,通过上述筛选过程,可以从目标部位中筛选得到属于中间调区域的多个像素点,继而对目标部位中属于中间调区域的像素点进行提取以得到中间调区域。图8示出根据本公开一实施例的中间调区域的示意图,从图中可以看出,通过本公开实施例提出的方法,可以有效且准确地从目标部位中提取出中间调区域。According to the third preset threshold, it can be judged whether the third transparency of each pixel in the target part is within the range of the third preset threshold, and the third transparency of each pixel in the target part is within the range of the third preset threshold In the case of , it is determined that the pixel belongs to the midtone area, and if the third transparency of each pixel in the target part is not within the range of the third preset threshold, the pixel is considered to belong to an area other than the midtone area, Through the above screening process, a plurality of pixel points belonging to the midtone region can be obtained from the target part by screening, and then the pixel points belonging to the midtone region in the target part are extracted to obtain the midtone region. Fig. 8 shows a schematic diagram of a midtone region according to an embodiment of the present disclosure. It can be seen from the figure that the midtone region can be effectively and accurately extracted from the target part through the method proposed by the embodiment of the present disclosure.
通过本公开实施例,可以利用对目标部位的灰度图进行排除混合来得到反映中间调信息的第三混合结果,从而根据该混合结果从目标部位中提取得到中间调区域,这种获取中间调信息的方式快速便捷,且便于和获取高光信息和阴影信息的方式同时进行批量处理,从而整体提升了虚拟对象生成的整体效率和虚拟对象的显示效果。Through the embodiments of the present disclosure, the grayscale image of the target part can be excluded and mixed to obtain the third mixed result reflecting the midtone information, so that the midtone area can be extracted from the target part according to the mixed result. This method of obtaining the midtone The information method is fast and convenient, and it is convenient to perform batch processing at the same time as the method of obtaining highlight information and shadow information, thereby improving the overall efficiency of virtual object generation and the display effect of virtual objects.
在一种可能的实现方式中,步骤S13可以包括:In a possible implementation, step S13 may include:
步骤S131,根据预设颜色参数,对多个目标区域分别进行渲染,得到多个中间渲染结果。In step S131 , according to the preset color parameters, the multiple target regions are respectively rendered to obtain multiple intermediate rendering results.
步骤S132,根据多个目标区域的色调,确定多个目标区域分别对应的处理方式。Step S132, according to the hues of the multiple target areas, determine the processing modes corresponding to the multiple target areas.
步骤S133,按照多个目标区域分别对应的处理方式,将目标部位的灰度图分别与多个中间渲染结果进行混合处理,得到多个渲染结果。In step S133 , according to the corresponding processing methods of the multiple target regions, the grayscale image of the target part is mixed with multiple intermediate rendering results to obtain multiple rendering results.
其中,中间渲染结果可以是将预设颜色参数渲染至目标区域后所得到的渲染结果。预设颜色参数的实现形式可以参考上述各公开实施例。该预设颜色参数可以根据需求进行灵活设定。Wherein, the intermediate rendering result may be a rendering result obtained after rendering preset color parameters to the target area. For the implementation form of the preset color parameters, reference may be made to the above disclosed embodiments. The preset color parameters can be flexibly set according to requirements.
多个目标区域中,不同目标区域可以对应相同的预设颜色参数,也可以对应不同的预设颜色参数,根据实际情况灵活选择即可。在一种可能的实现方式中,对每个目标区域,可以分别与对应的预设颜色参数进行混合,以得到每个目标区域所对应的中间渲染结果。Among the multiple target areas, different target areas may correspond to the same preset color parameters, or may correspond to different preset color parameters, which can be flexibly selected according to the actual situation. In a possible implementation manner, each target area may be mixed with a corresponding preset color parameter to obtain an intermediate rendering result corresponding to each target area.
由于不同的目标区域可以基于不同的色调信息所划分,因此不同的目标区域可以对应不同的色调,如上述公开实施例中提到的高光区域对应高光,阴影区域对应阴影以及中间调区域对应中间调等。Since different target areas can be divided based on different tone information, different target areas can correspond to different tones, as mentioned in the above disclosed embodiments, the highlight area corresponds to the highlight, the shadow area corresponds to the shadow, and the midtone area corresponds to the midtone wait.
不同色调的目标区域,其进行的处理方式也可以不同,其中色调与处理方式之间的对 应关系可以详见下述各公开实施例,在此先不做展开。Target areas with different hues can be processed in different ways, and the corresponding relationship between hues and processing methods can be found in the following disclosed embodiments in detail, and will not be expanded here.
在确定各目标区域的处理方式后,可以按照该处理方式,将目标部位分别与各中间渲染结果进行混合处理,以得到多个渲染结果。After the processing method of each target area is determined, the target part can be mixed with each intermediate rendering result according to the processing method, so as to obtain multiple rendering results.
通过本公开实施例,可以按照不同目标区域所对应的色调,来分别对各目标区域进行相应处理方式的混合处理,以得到各目标区域的渲染结果,从而使得不同的目标区域可以具有与色调对应的渲染效果,有效提升虚拟对象的整体生成效果的精确度和丰富程度,也提升了虚拟对象生成过程的灵活性。Through the embodiments of the present disclosure, according to the hues corresponding to different target areas, the corresponding processing methods can be mixed for each target area to obtain the rendering results of each target area, so that different target areas can have colors corresponding to the hue. The rendering effect effectively improves the accuracy and richness of the overall virtual object generation effect, and also improves the flexibility of the virtual object generation process.
在一种可能的实现方式中,步骤S132可以包括:In a possible implementation manner, step S132 may include:
在目标区域包括高光区域的情况下,确定处理方式包括滤色混合;In the case where the target area includes a highlight area, determine that the processing method includes color filter blending;
在目标区域包括阴影区域的情况下,确定处理方式包括正片叠底混合;Where the target area includes shaded areas, determine that the processing includes multiply blending;
在目标区域包括中间调区域的情况下,确定处理方式包括正常混合。Where the target area includes the midtone area, it is determined that the processing includes normal mixing.
通过上述公开实施例可以看出,在目标区域为高光区域的情况下,可以将高光区域的中间渲染结果和目标部位按照滤色混合的方式进行混合处理,以得到高光区域的渲染结果。图9示出根据本公开一实施例的高光区域的渲染结果的示意图,从图中可以看出,滤色混合可以令混合结果更加明亮,从而充分保留高光区域的色调性质,提升处理效果。It can be seen from the above disclosed embodiments that, when the target area is a high-light area, the intermediate rendering result of the high-light area and the target part may be mixed in a color-filtering manner to obtain a rendering result of the high-light area. FIG. 9 shows a schematic diagram of a rendering result of a highlight region according to an embodiment of the present disclosure. It can be seen from the figure that color filter blending can make the blending result brighter, thereby fully retaining the tonal properties of the highlight region and improving the processing effect.
在目标区域为阴影区域的情况下,可以将阴影区域的中间渲染效果和目标部位按照正片叠底混合的方式进行混合处理,以得到阴影区域的渲染结果。图10示出根据本公开一实施例的阴影区域的渲染结果的示意图,从图中可以看出,正片叠底混合可以令混合结果变暗,从而充分保留阴影区域的色调性质,提升处理效果。In the case that the target area is a shadow area, the intermediate rendering effect of the shadow area and the target part may be mixed in a multiply blending manner to obtain a rendering result of the shadow area. FIG. 10 shows a schematic diagram of the rendering result of the shadow area according to an embodiment of the present disclosure. It can be seen from the figure that multiply blending can darken the blending result, thereby fully retaining the tonal properties of the shadow area and improving the processing effect.
在目标区域为中间调区域的情况下,可以将中间调区域的中间渲染效果和目标部位按照正常混合的方式进行混合处理,以得到中间调区域的渲染结果。图11示出根据本公开一实施例的中间调区域的渲染结果的示意图,从图中可以看出,正常混合对于混合结果的亮度影响较小,从而充分保留中间调区域的色调性质,提升处理效果。In the case that the target area is a midtone area, the intermediate rendering effect of the midtone area and the target part may be mixed in a normal mixing manner to obtain a rendering result of the midtone area. Fig. 11 shows a schematic diagram of the rendering result of the midtone region according to an embodiment of the present disclosure. It can be seen from the figure that normal blending has little influence on the brightness of the blending result, thereby fully retaining the tonal properties of the midtone region and improving processing Effect.
通过上述各公开实施例可以看出,针对不同目标区域的色调,采用不同的混合方式进行混合,可以使得得到的渲染结果与目标部位的原始色调性质一致,从而大大提升了生成的目标虚拟对象的真实性。It can be seen from the above-mentioned disclosed embodiments that, for the hues of different target areas, different mixing methods are used for mixing, which can make the obtained rendering results consistent with the original hue properties of the target parts, thereby greatly improving the quality of the generated target virtual objects. authenticity.
在一种可能的实现方式中,步骤S14可以包括:In a possible implementation, step S14 may include:
步骤S141,将多个渲染结果进行叠加,得到目标渲染结果;Step S141, superimposing multiple rendering results to obtain a target rendering result;
步骤S142,根据预设渲染,对目标唇妆结果与原始虚拟对象中的目标部位进行渲染,得到目标用户图像。Step S142, according to the preset rendering, render the target lip makeup result and the target part in the original virtual object to obtain the target user image.
在一种可能的实现方式中,上述多个目标区域可以分别在多个图层中进行确定,在这种情况下,得到的多个渲染结果也可以分别属于多个图层,因此,在一个示例中,可以将多个图层中的渲染结果进行叠加,来得到目标渲染结果。In a possible implementation manner, the above-mentioned multiple target areas can be determined in multiple layers respectively. In this case, the multiple rendering results obtained can also belong to multiple layers respectively. Therefore, in a In the example, the rendering results in multiple layers can be superimposed to obtain the target rendering result.
叠加的方式可以根据实际情况灵活决定,比如可以为图层之间的直接叠加,在一些可能的实现方式中,也可以通过某种或某些混合方式实现叠加,比如可以将多个图层通过正片叠底的方式进行混合叠加。The way of overlay can be flexibly decided according to the actual situation, for example, it can be direct overlay between layers, and in some possible implementations, overlay can also be realized through some or some mixed methods, for example, multiple layers can be passed through Multiply the way to mix and overlay.
在一种可能的实现方式中,也可以是直接将多个渲染结果进行融合或混合,以得到目标渲染结果。In a possible implementation manner, multiple rendering results may also be directly fused or mixed to obtain a target rendering result.
在得到目标渲染结果后,可以根据预设渲染参数,对目标渲染结果与原始虚拟对象中的目标部位进行渲染以得到目标虚拟对象,渲染的方式同样在本公开实施例中不做限制,比如可以将相同位置像素点的像素值进行相加或相乘等,来实现渲染,或是将相同位置的像素点的像素值进行加权融合。After the target rendering result is obtained, the target rendering result and the target part in the original virtual object can be rendered according to the preset rendering parameters to obtain the target virtual object. The rendering method is also not limited in this embodiment of the disclosure, for example, The pixel values of the same position pixels are added or multiplied to achieve rendering, or the pixel values of the same position pixels are weighted and fused.
其中,加权融合中目标渲染结果的融合权重可以根据预设渲染参数来确定,预设渲染参数可以为预先设定的参数值,用以指示目标渲染结果在渲染过程中的权重等。The fusion weight of the target rendering result in the weighted fusion may be determined according to preset rendering parameters, and the preset rendering parameter may be a preset parameter value used to indicate the weight of the target rendering result in the rendering process.
在一种可能的实现方式中,该预设渲染参数可以为透明度,将目标渲染结果与透明度相乘后再与原始虚拟对象的目标部位进行相加,可以得到目标虚拟对象,通过改变预设渲 染参数中的透明度,可以改变整个目标虚拟对象的透明度效果。In a possible implementation, the preset rendering parameter can be transparency. The target rendering result can be multiplied by the transparency and then added to the target part of the original virtual object to obtain the target virtual object. By changing the preset rendering The transparency in the parameter can change the transparency effect of the entire target virtual object.
图12示出根据本公开一实施例的目标虚拟对象的示意图,从图中可以看出,通过本公开各实施例提出的虚拟对象生成方法,可以得到效果较为真实自然的目标虚拟对象。FIG. 12 shows a schematic diagram of a target virtual object according to an embodiment of the present disclosure. It can be seen from the figure that a target virtual object with a more realistic and natural effect can be obtained through the method for generating a virtual object proposed by each embodiment of the present disclosure.
通过本公开实施例,可以根据预设渲染参数,利用目标渲染结果对原始虚拟对象中的目标部位进行渲染,以得到目标虚拟对象,通过更改预设渲染参数,可以便于对目标虚拟对象的效果进行调整,从而提升整个目标虚拟对象生成过程的灵活性和自主程度。Through the embodiments of the present disclosure, the target part in the original virtual object can be rendered by using the target rendering result according to the preset rendering parameters to obtain the target virtual object. By changing the preset rendering parameters, the effect of the target virtual object can be easily Adjustment, so as to improve the flexibility and autonomy of the whole target virtual object generation process.
在一种可能的实现方式中,本公开实施例提出的方法还可以包括:In a possible implementation manner, the method proposed in the embodiment of the present disclosure may further include:
响应于针对目标虚拟对象的交互操作,根据交互操作中的交互信息,控制目标虚拟对象执行与交互信息匹配的虚拟动作。In response to the interactive operation on the target virtual object, according to the interaction information in the interactive operation, the target virtual object is controlled to perform a virtual action matching the interaction information.
其中,交互操作可以是用户对目标虚拟对象发出的交互指示,比如控制目标虚拟对象进行动作改变或是说话等,或是向目标虚拟对象传递信息。Wherein, the interactive operation may be an interactive instruction issued by the user to the target virtual object, such as controlling the target virtual object to change an action or speak, or to transmit information to the target virtual object.
交互信息可以是交互操作中用户所输入的相关信息,比如文字指令信息、语音指令信息或是触摸指令信息等。The interaction information may be related information input by the user during the interaction operation, such as text instruction information, voice instruction information, or touch instruction information.
根据交互信息,可以控制目标虚拟对象执行与交互信息匹配的虚拟动作,比如交互信息可以指示目标虚拟对象执行跳舞或指挥等动作,则可以根据该交互信息控制目标虚拟对象执行该类动作等。According to the interaction information, the target virtual object can be controlled to perform virtual actions that match the interaction information. For example, the interaction information can instruct the target virtual object to perform actions such as dancing or directing, and the target virtual object can be controlled to perform such actions according to the interaction information.
通过本公开实施例,可以实现目标虚拟对象与用户之间的交互,提升生成的目标虚拟对象的应用范围和实用性。Through the embodiments of the present disclosure, the interaction between the target virtual object and the user can be realized, and the application range and practicability of the generated target virtual object can be improved.
图13示出根据本公开一实施例的虚拟对象的生成装置的框图。如图所示,所述虚拟对象生成装置20可以包括:Fig. 13 shows a block diagram of an apparatus for generating a virtual object according to an embodiment of the present disclosure. As shown in the figure, the virtual object generation device 20 may include:
获取部分21,被配置为获取原始虚拟对象中待处理的目标部位。The acquiring part 21 is configured to acquire the target part to be processed in the original virtual object.
划分部分22,被配置为根据目标部位的色调信息,将目标部位划分为多个目标区域。The division part 22 is configured to divide the target site into a plurality of target areas according to the tone information of the target site.
渲染部分23,被配置为根据预设颜色参数,对多个目标区域分别进行与目标区域的色调匹配的渲染处理,得到多个渲染结果。The rendering part 23 is configured to, according to preset color parameters, respectively perform rendering processing on the multiple target areas to match the color tone of the target areas, and obtain multiple rendering results.
生成部分24,被配置为基于多个渲染结果,生成目标虚拟对象。The generation part 24 is configured to generate the target virtual object based on the plurality of rendering results.
在一种可能的实现方式中,获取部分被配置为:获取原始虚拟对象,其中,原始虚拟对象根据虚拟信息所生成;根据虚拟信息,从原始虚拟对象中提取待处理的目标部位。In a possible implementation manner, the obtaining part is configured to: obtain an original virtual object, wherein the original virtual object is generated according to virtual information; and extract a target part to be processed from the original virtual object according to the virtual information.
在一种可能的实现方式中,虚拟信息包括以下至少之一:预设的虚拟对象生成信息,响应于用户的动作所生成的虚拟对象控制信息。In a possible implementation manner, the virtual information includes at least one of the following: preset virtual object generation information, and virtual object control information generated in response to user actions.
在一种可能的实现方式中,色调信息包括以下至少之一:高光信息、阴影信息以及中间调信息;划分部分被配置为以下至少之一:基于目标部位的高光信息,从目标部位中提取得到高光区域;基于目标部位的阴影信息,从目标部位中提取得到阴影区域;基于目标部位的中间调信息,从目标部位中提取得到中间调区域。In a possible implementation manner, the tone information includes at least one of the following: highlight information, shadow information, and midtone information; the division part is configured as at least one of the following: based on the highlight information of the target part, the A highlight area; based on the shadow information of the target part, a shadow area is extracted from the target part; based on the midtone information of the target part, a midtone area is extracted from the target part.
在一种可能的实现方式中,划分部分还被配置为:基于目标部位的灰度图,进行正片叠底混合,得到第一混合结果;根据第一混合结果,确定目标部位中像素点的第一透明度;根据第一预设透明度阈值和第一透明度,对目标部位中的像素点进行提取,得到高光区域。In a possible implementation manner, the dividing part is further configured to: perform multiply and bottom blending based on the grayscale image of the target part to obtain a first blending result; determine the first blending result of the pixel in the target part according to the first blending result - Transparency: according to the first preset transparency threshold and the first transparency, the pixel points in the target part are extracted to obtain a highlight area.
在一种可能的实现方式中,划分部分还被配置为:基于目标部位的反向灰度图,进行正片叠底混合,得到第二混合结果;根据第二混合结果,确定目标部位中像素点的第二透明度;根据第二预设透明度阈值和第二透明度,对目标部位中的像素点进行提取,得到阴影区域。In a possible implementation manner, the division part is further configured to: perform multiply and bottom blending based on the reverse grayscale image of the target part to obtain a second blending result; determine the pixel points in the target part according to the second blending result the second transparency; according to the second preset transparency threshold and the second transparency, pixel points in the target part are extracted to obtain a shadow area.
在一种可能的实现方式中,划分部分还被配置为:基于目标部位的灰度图,进行排除混合,得到第三混合结果;根据第三混合结果,确定目标部位中像素点的第三透明度;根据第三预设透明度阈值和第三透明度,对目标部位中的像素点进行提取,得到中间调区域。In a possible implementation, the dividing part is further configured to: perform exclusion mixing based on the grayscale image of the target part to obtain a third mixing result; determine the third transparency of the pixels in the target part according to the third mixing result ; According to the third preset transparency threshold and the third transparency, extract the pixels in the target part to obtain the midtone area.
在一种可能的实现方式中,渲染部分被配置为:根据预设颜色参数,对多个目标区域分别进行渲染,得到多个中间渲染结果;根据多个目标区域的色调,确定多个目标区域分别对应的处理方式;按照多个目标区域分别对应的处理方式,将目标部位的灰度图分别与 多个中间渲染结果进行混合处理,得到多个渲染结果。In a possible implementation manner, the rendering part is configured to: respectively render multiple target areas according to preset color parameters to obtain multiple intermediate rendering results; determine multiple target areas according to the hues of multiple target areas Respectively corresponding processing methods; according to the corresponding processing methods of multiple target areas, the grayscale image of the target part is mixed with multiple intermediate rendering results to obtain multiple rendering results.
在一种可能的实现方式中,目标区域包括以下至少之一:高光区域、阴影区域以及中间调区域;渲染部分还被配置为:在目标区域包括高光区域的情况下,确定处理方式包括滤色混合;在目标区域包括阴影区域的情况下,确定处理方式包括正片叠底混合;在目标区域包括中间调区域的情况下,确定处理方式包括正常混合。In a possible implementation manner, the target area includes at least one of the following: a highlight area, a shadow area, and a midtone area; the rendering part is further configured to: when the target area includes a highlight area, determine that the processing method includes color filtering blending; in a case where the target area includes a shadow area, determining the processing method includes multiply blending; in a case where the target area includes a midtone area, determining a processing method includes normal blending.
在一种可能的实现方式中,生成部分被配置为:将多个渲染结果进行叠加,得到目标渲染结果;基于预设渲染参数,利用目标渲染结果对原始虚拟对象中的目标部位进行渲染,得到目标虚拟对象。In a possible implementation, the generation part is configured to: superimpose multiple rendering results to obtain a target rendering result; based on preset rendering parameters, use the target rendering result to render the target part in the original virtual object to obtain The target dummy.
在一种可能的实现方式中,装置还被配置为:响应于针对目标虚拟对象的交互操作,根据交互操作中的交互信息,控制目标虚拟对象执行与交互信息匹配的虚拟动作。In a possible implementation manner, the device is further configured to: in response to an interaction operation on the target virtual object, according to interaction information in the interaction operation, control the target virtual object to perform a virtual action that matches the interaction information.
本公开涉及增强现实领域,通过获取现实环境中的目标对象的图像信息,进而借助各类视觉相关算法实现对目标对象的相关特征、状态及属性进行检测或识别处理,从而得到与具体应用匹配的虚拟与现实相结合的AR效果。示例性的,目标对象可涉及与人体相关的脸部、肢体、手势、动作等,或者与物体相关的标识物、标志物,或者与场馆或场所相关的沙盘、展示区域或展示物品等。视觉相关算法可涉及视觉定位、SLAM、三维重建、图像注册、背景分割、对象的关键点提取及跟踪、对象的位姿或深度检测等。具体应用不仅可以涉及跟真实场景或物品相关的导览、导航、讲解、重建、虚拟效果叠加展示等交互场景,还可以涉及与人相关的特效处理,比如妆容美化、肢体美化、特效展示、虚拟模型展示等交互场景。可通过卷积神经网络,实现对目标对象的相关特征、状态及属性进行检测或识别处理。上述卷积神经网络是基于深度学习框架进行模型训练而得到的网络模型。This disclosure relates to the field of augmented reality. By acquiring the image information of the target object in the real environment, and then using various visual correlation algorithms to detect or identify the relevant features, states and attributes of the target object, and thus obtain the image information that matches the specific application. AR effect combining virtual and reality. Exemplarily, the target object may involve faces, limbs, gestures, actions, etc. related to the human body, or markers and markers related to objects, or sand tables, display areas or display items related to venues or places. Vision-related algorithms can involve visual positioning, SLAM, 3D reconstruction, image registration, background segmentation, object key point extraction and tracking, object pose or depth detection, etc. Specific applications can not only involve interactive scenes such as guided tours, navigation, explanations, reconstructions, virtual effect overlays and display related to real scenes or objects, but also special effects processing related to people, such as makeup beautification, body beautification, special effect display, virtual Interactive scenarios such as model display. The relevant features, states and attributes of the target object can be detected or identified through the convolutional neural network. The above-mentioned convolutional neural network is a network model obtained by performing model training based on a deep learning framework.
应用场景示例Application Scenario Example
在计算机视觉领域,如何对原始虚拟对象的发色进行改变,生成具有较为真实自然的头发效果的目标虚拟对象,成为目前一个亟待解决的问题。In the field of computer vision, how to change the hair color of the original virtual object to generate a target virtual object with a more realistic and natural hair effect has become an urgent problem to be solved.
本公开应用示例提出了一种虚拟对象的生成方法,包括如下过程:The disclosed application example proposes a method for generating a virtual object, including the following process:
获取原始虚拟对象的头发贴图,对该头发贴图进行灰度处理,得到灰度图x。Obtain the hair texture of the original virtual object, and perform grayscale processing on the hair texture to obtain a grayscale image x.
基于该灰度图x,针对头发部位进行高光、阴影和中间调区域的分离,得到高光区域、阴影区域和中间调区域等三个目标区域,其中,Based on the grayscale image x, the highlight, shadow and midtone regions are separated for the hair part, and three target regions are obtained, including the highlight region, shadow region and midtone region, among which,
高光分离的过程可以包括:The process of highlight separation can include:
将x和x自身进行正片叠底混合,得到第一混合结果。获取第一混合结果中的alpha通道值,根据alpha通道值的黑白关系,将alpha通道值映射为透明度,从而得到目标部位中各像素点的第一透明度,基于第一透明度,从头发部位中筛选属于高光区域的像素点,得到高光区域。Multiply blend x and x itself to get the first blend result. Obtain the alpha channel value in the first blending result, and map the alpha channel value to transparency according to the black-and-white relationship of the alpha channel value, so as to obtain the first transparency of each pixel in the target part, based on the first transparency, filter from the hair part The pixels belonging to the highlight area get the highlight area.
阴影分离的过程可以包括:The process of shadow separation can include:
对x进行反向灰度处理得到反向灰度图,将反向灰度图和反向灰度图自身进行正片叠底混合,得到第二混合结果。获取第二混合结果中的alpha通道值,根据alpha通道值的黑白关系,将alpha通道值映射为透明度,从而得到目标部位中各像素点的第二透明度,基于第二透明度,从头发部位中筛选属于阴影区域的像素点,得到阴影区域。Reverse grayscale processing is performed on x to obtain a reverse grayscale image, and the reverse grayscale image and the reverse grayscale image itself are multiplied and mixed to obtain a second mixed result. Obtain the alpha channel value in the second blending result, and map the alpha channel value to transparency according to the black-and-white relationship of the alpha channel value, so as to obtain the second transparency of each pixel in the target part, based on the second transparency, filter from the hair part Pixels belonging to the shaded area get the shaded area.
中间调分离的过程可以包括:The process of separating midtones can include:
将x和x自身进行排除混合,得到第三混合结果。获取第三混合结果中的alpha通道值,根据alpha通道值的黑白关系,将alpha通道值映射为透明度,从而得到目标部位中各像素点的第三透明度,基于第三透明度,从头发部位中筛选属于中间调区域的像素点,得到中间调区域。Perform exclusion mixing of x and x itself to obtain a third mixing result. Obtain the alpha channel value in the third blending result, and map the alpha channel value to transparency according to the black-and-white relationship of the alpha channel value, so as to obtain the third transparency of each pixel in the target part, based on the third transparency, filter from the hair part The pixels belonging to the midtone area are obtained from the midtone area.
在分别得到高光区域、阴影区域和中间调区域后,可以将预设颜色参数分别与高光区域、阴影区域和中间调区域进行混合,分别得到中间渲染结果a、b和c。After obtaining the highlight area, shadow area, and midtone area, the preset color parameters can be mixed with the highlight area, shadow area, and midtone area to obtain intermediate rendering results a, b, and c, respectively.
将得到的中间渲染结果a与x进行滤色混合,得到渲染结果d;Filter and mix the obtained intermediate rendering result a with x to obtain the rendering result d;
将得到的中间渲染结果b与x进行正片叠底混合,得到渲染结果e;Multiply and mix the obtained intermediate rendering result b with x to obtain the rendering result e;
将得到的中间渲染结果c与x进行正常混合,得到渲染结果f。The obtained intermediate rendering result c is normally mixed with x to obtain the rendering result f.
将渲染结果d、e和f所在的三个图层进行叠加,即打包成一组得到目标渲染结果g,该目标渲染结果g可以对原始虚拟对象的头发部位进行渲染以得到目标虚拟对象,改变g的透明度即可以改变目标虚拟对象的透明效果,其中目标渲染结果g可以与原始虚拟对象通过正常混合的方式进行混合。Superimpose the three layers where the rendering results d, e, and f are located, that is, pack them into a group to obtain the target rendering result g. The target rendering result g can render the hair part of the original virtual object to obtain the target virtual object. Change g The transparency of the target virtual object can change the transparency effect, wherein the target rendering result g can be mixed with the original virtual object through normal mixing.
本公开应用示例中提出的,可以通过对不同色调的目标区域进行处理,使得染发效果更加自然且可以实现所见即所得的处理效果。而且本公开实施例提出的方法可以实现更多的参数定义,比如不同目标区域的预设颜色参数的更改,目标渲染结果与原始虚拟对象的预设渲染参数的更改等,从而使得虚拟对象的生成效果更加可控,方便定制相关参数。与相关方法中将头发贴图保存为一个PS操作过程中的PSD文件,通过更改PSD的结果来更改虚拟对象中头发的渲染效果相比,unity设计者可以通过本公开应用示例提出的方法,对虚拟对象的发色等进行手动更改,并在更改后直接显示该目标虚拟对象,unity开发者也可以基于本公开应用示例的方法进行底层设定,并保留修改头发颜色的接口,以便于相关的使用者可以直接实现颜色更改来得到目标虚拟对象等。As proposed in the application example of the present disclosure, the hair dyeing effect can be made more natural and a WYSIWYG processing effect can be realized by processing target areas of different tones. Moreover, the method proposed in the embodiment of the present disclosure can achieve more parameter definitions, such as the change of the preset color parameters of different target areas, the change of the target rendering result and the preset rendering parameters of the original virtual object, etc., so that the generation of virtual objects The effect is more controllable, and it is convenient to customize related parameters. Compared with saving the hair texture as a PSD file in the PS operation process in the related method, and changing the rendering effect of the hair in the virtual object by changing the result of the PSD, the unity designer can use the method proposed in the application example of this disclosure to make a virtual The hair color of the object can be manually changed, and the target virtual object will be displayed directly after the change. Unity developers can also set the bottom layer based on the method of this disclosed application example, and retain the interface for modifying the hair color, so as to facilitate related use The user can directly realize the color change to obtain the target virtual object and so on.
可以理解,本公开提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开不再赘述。It can be understood that the above-mentioned method embodiments mentioned in this disclosure can all be combined with each other to form a combined embodiment without violating the principle and logic. Due to space limitations, this disclosure will not repeat them.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that in the above-mentioned method of specific implementation, the writing order of each step does not imply a strict execution order and constitutes any limitation on the implementation process, and the execution order of each step should be based on its function and possible internal Logically OK.
本公开实施例还提出一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。计算机可读存储介质可以是易失性计算机可读存储介质或非易失性计算机可读存储介质。Embodiments of the present disclosure also provide a computer-readable storage medium, on which computer program instructions are stored, and the above-mentioned method is implemented when the computer program instructions are executed by a processor. The computer readable storage medium may be a volatile computer readable storage medium or a nonvolatile computer readable storage medium.
本公开实施例还提出一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为上述方法。An embodiment of the present disclosure also proposes an electronic device, including: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured as the above method.
本公开实施例还提出一种计算机程序产品,计算机程序产品包括计算机程序或指令,在所述计算机程序或指令在计算机上运行的情况下,使得所述计算机执行时实现上述虚拟对象的生成方法。The embodiment of the present disclosure also proposes a computer program product, the computer program product includes a computer program or an instruction, and when the computer program or instruction is run on a computer, the computer implements the method for generating a virtual object described above when executed.
在实际应用中,上述存储器可以是易失性存储器(volatile memory),随机存取存储器(Random Access Memory,RAM);或者非易失性存储器(non-volatile memory),例如只读存储器(Read Only Memory,ROM),可擦式可编程只读存储器(Erasable Programmable Read Only Memory,EPROM或闪存)、静态随机存取存储器(Static Random-Access Memory,SRAM)、便携式压缩盘只读存储器(Compact Disk Read Only Memory,CD-ROM)、数字多功能盘(Digital versatile Disc,DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。。In practical applications, the above-mentioned memory can be volatile memory (volatile memory), random access memory (Random Access Memory, RAM); or non-volatile memory (non-volatile memory), such as read-only memory (Read Only Memory, ROM), Erasable Programmable Read Only Memory (Erasable Programmable Read Only Memory, EPROM or flash memory), Static Random-Access Memory (Static Random-Access Memory, SRAM), Portable Compact Disk Read-Only Memory (Compact Disk Read Only Memory, CD-ROM), Digital versatile disc (Digital versatile Disc, DVD), memory sticks, floppy disks, mechanical encoding devices, such as punched cards or raised structures in grooves on which instructions are stored, and the aforementioned any suitable combination. As used herein, computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., pulses of light through fiber optic cables), or transmitted electrical signals. .
上述处理器可以为专用集成电路(Application Specific Integrated Circuit,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(Digital signal processing device,DSPD)、可编程逻辑器件(programmable logic device,PLD)、现场可编程门阵列(Field Programmable Gate Array,FPGA)、控制器、微控制器中的至少一种。可以理解地,对于不同的设备,用于实现上述处理器功能的电子器件还可以为其它,本公开实施例不作具体限定。The above-mentioned processor can be an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a digital signal processor (Digital Signal Processing, DSP), a digital signal processing device (Digital signal processing device, DSPD), a programmable logic device (programmable logic device) , PLD), Field Programmable Gate Array (Field Programmable Gate Array, FPGA), controller, microcontroller at least one. It can be understood that, for different devices, the electronic device used to implement the above processor function may also be other, which is not specifically limited in this embodiment of the present disclosure.
电子设备可以被提供为终端、服务器或其它形态的设备。Electronic devices may be provided as terminals, servers, or other forms of devices.
基于前述实施例相同的技术构思,本公开实施例还提供了一种计算机程序,该计算机程序被处理器执行时实现上述方法。Based on the same technical idea as the foregoing embodiments, the embodiments of the present disclosure further provide a computer program, which implements the above method when the computer program is executed by a processor.
图14是根据本公开实施例的一种电子设备800的框图。例如,电子设备800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等终端。FIG. 14 is a block diagram of an electronic device 800 according to an embodiment of the present disclosure. For example, the electronic device 800 may be a terminal such as a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, or a personal digital assistant.
参照图14,电子设备800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(Input/Output,I/O)的接口812,传感器组件814,以及通信组件816。14, electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input/output (Input/Output, I/O) interface 812 , sensor component 814 , and communication component 816 .
处理组件802通常控制电子设备800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个部分,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体单元,以方便多媒体组件808和处理组件802之间的交互。The processing component 802 generally controls the overall operations of the electronic device 800, such as those associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. Additionally, processing component 802 may include one or more components that facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia unit to facilitate interaction between multimedia component 808 and processing component 802 .
存储器804被配置为存储各种类型的数据以支持在电子设备800的操作。这些数据的示例包括用于在电子设备800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(Static Random-Access Memory,SRAM),电可擦除可编程只读存储器(Electrically Erasable Programmable read only memory,EEPROM),可擦除可编程只读存储器(Erasable Programmable Read-Only Memory,EPROM),可编程只读存储器(Programmable Read-Only Memory,PROM),只读存储器(Read-Only Memory,ROM),磁存储器,快闪存储器,磁盘或光盘。The memory 804 is configured to store various types of data to support operations at the electronic device 800 . Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like. The memory 804 can be realized by any type of volatile or non-volatile storage device or their combination, such as Static Random-Access Memory (Static Random-Access Memory, SRAM), Electrically Erasable Programmable Read-Only Memory (Electrically Erasable Programmable read only memory, EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), programmable read-only memory (Programmable Read-Only Memory, PROM), read-only memory (Read-Only Memory, ROM), magnetic memory, flash memory, magnetic disk or optical disk.
电源组件806为电子设备800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备800生成、管理和分配电力相关联的组件。The power supply component 806 provides power to various components of the electronic device 800 . Power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic device 800 .
多媒体组件808包括在所述电子设备800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(Liquid Crystal Display,LCD)和触摸面板(Touch panel,TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。The multimedia component 808 includes a screen providing an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (Liquid Crystal Display, LCD) and a touch panel (Touch panel, TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may not only sense a boundary of a touch or swipe action, but also detect duration and pressure associated with the touch or swipe action. In some embodiments, the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capability.
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(microphone,MIC),当电子设备800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a microphone (microphone, MIC), and when the electronic device 800 is in an operation mode, such as a calling mode, a recording mode and a voice recognition mode, the microphone is configured to receive an external audio signal. Received audio signals may be further stored in memory 804 or sent via communication component 816 . In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: a home button, volume buttons, start button, and lock button.
传感器组件814包括一个或多个传感器,用于为电子设备800提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备800的打开/关闭状态,组件的相对定位,例如所述组件为电子设备800的显示器和小键盘,传感器组件814还可以检测电子设备800或电子设备800一个组件的位置改变,用户与电子设备800接触的存在或不存在,电子设备800方位或加速/减速和电子设备800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如(Complementary Metal Oxide Semiconductor,互补金属氧化物半导体)或CCD(Charge-coupled Device,电荷耦合元件)图像传感器,用于在成像应用中使用。 在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。 Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of electronic device 800 . For example, the sensor component 814 can detect the open/closed state of the electronic device 800, the relative positioning of components, such as the display and the keypad of the electronic device 800, the sensor component 814 can also detect the electronic device 800 or a Changes in position of components, presence or absence of user contact with electronic device 800 , electronic device 800 orientation or acceleration/deceleration and temperature changes in electronic device 800 . Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. The sensor component 814 may also include an optical sensor, such as a (Complementary Metal Oxide Semiconductor, Complementary Metal Oxide Semiconductor) or a CCD (Charge-coupled Device, Charge-Coupled Device) image sensor, for use in imaging applications. In some embodiments, the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
通信组件816被配置为便于电子设备800和其他设备之间有线或无线方式的通信。电子设备800可以接入基于通信标准的无线网络,如WiFi,2G(2-Generation wireless telephone technology,第二代移动通信技术)或3G(3-Generation wireless telephone technology,第三代移动通信技术),或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(Near Field Communication,NFC)部分,以促进短程通信。例如,在NFC部分可基于射频识别(Radio Frequency Identification,RFID)技术,红外数据协会(Infrared Data Association,IrDA)技术,超宽带(Ultra Wide Band,UWB)技术,蓝牙(Bluetooth,BT)技术和其他技术来实现。The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access wireless networks based on communication standards, such as WiFi, 2G (2-Generation wireless telephone technology, second-generation mobile communication technology) or 3G (3-Generation wireless telephone technology, third-generation mobile communication technology), or a combination of them. In an exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a Near Field Communication (NFC) portion to facilitate short-range communication. For example, the NFC part can be based on Radio Frequency Identification (RFID) technology, Infrared Data Association (Infrared Data Association, IrDA) technology, Ultra Wide Band (Ultra Wide Band, UWB) technology, Bluetooth (Bluetooth, BT) technology and other technology to achieve.
在示例性实施例中,电子设备800可以被一个或多个应用专用集成电路(Application Specific Integrated Circuit,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(Digital signal processing device,DSPD)、可编程逻辑器件(programmable logic device,PLD)、现场可编程门阵列(Field Programmable Gate Array,FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing devices (Digital signal processing device , DSPD), programmable logic device (programmable logic device, PLD), field programmable gate array (Field Programmable Gate Array, FPGA), controller, microcontroller, microprocessor or other electronic components to implement, used to perform the above method.
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器804,上述计算机程序指令可由电子设备800的处理器820执行以完成上述方法。In an exemplary embodiment, there is also provided a non-volatile computer-readable storage medium, such as the memory 804 including computer program instructions, which can be executed by the processor 820 of the electronic device 800 to implement the above method.
图15是根据本公开实施例的一种电子设备1900的框图。例如,电子设备1900可以被提供为一服务器。参照图15,电子设备1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的部分。此外,处理组件1922被配置为执行指令,以执行上述方法。FIG. 15 is a block diagram of an electronic device 1900 according to an embodiment of the present disclosure. For example, electronic device 1900 may be provided as a server. Referring to FIG. 15 , electronic device 1900 includes processing component 1922 , which further includes one or more processors, and a memory resource represented by memory 1932 for storing instructions executable by processing component 1922 , such as application programs. An application program stored in memory 1932 may include one or more portions each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
电子设备1900还可以包括一个电源组件1926被配置为执行电子设备1900的电源管理,一个有线或无线网络接口1950被配置为将电子设备1900连接到网络,和一个输入输出(I/O)接口1958。电子设备1900可以操作基于存储在存储器1932的操作系统,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM或类似。Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input-output (I/O) interface 1958 . The electronic device 1900 can operate based on an operating system stored in the memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器1932,上述计算机程序指令可由电子设备1900的处理组件1922执行以完成上述方法。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium, such as the memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to implement the above method.
本公开可以是系统、方法、计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。The present disclosure may be a system, method, computer program product. A computer program product may include a computer readable storage medium having computer readable program instructions thereon for causing a processor to implement various aspects of the present disclosure.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(Random Access Memory,RAM)、只读存储器(Read Only Memory,ROM)、可擦式可编程只读存储器(Electrical Programmable Read Only Memory,EPROM或闪存)、静态随机存取存储器(Static Random Access Memory,SRAM)、便携式压缩盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、数字多功能盘(Digital Video Disc,DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。A computer readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device. A computer readable storage medium may be, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (non-exhaustive list) of computer-readable storage media include: portable computer disk, hard disk, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), erasable Electrical Programmable Read Only Memory (EPROM or flash memory), Static Random Access Memory (Static Random Access Memory, SRAM), Portable Compact Disc Read-Only Memory (CD-ROM) , Digital Video Disc (DVD), memory sticks, floppy disks, mechanically encoded devices such as punched cards or raised structures in grooves with instructions stored thereon, and any suitable combination of the foregoing. As used herein, computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., pulses of light through fiber optic cables), or transmitted electrical signals.
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理 设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or downloaded to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or a network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
用于执行本公开实施例操作的计算机程序指令可以是汇编指令、指令集架构(Industry Standard Architecture,ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(local area network,LAN)或广域网(Wide Area Network,WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(programmable logic array,PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开实施例的各个方面。Computer program instructions for performing operations of embodiments of the present disclosure may be assembly instructions, instruction set architecture (Industry Standard Architecture, ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or in a or any combination of programming languages, including object-oriented programming languages—such as Smalltalk, C++, etc., and conventional procedural programming languages—such as “C” or similar programming languages language. Computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement. In cases involving a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it may be connected to an external computer such as use an Internet service provider to connect via the Internet). In some embodiments, electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGAs) or programmable logic arrays (programmable logic arrays, PLAs), are personalized by utilizing state information of computer-readable program instructions, The electronic circuit can execute computer readable program instructions, thereby implementing various aspects of the embodiments of the present disclosure.
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It should be understood that each block of the flowcharts and/or block diagrams, and combinations of blocks in the flowcharts and/or block diagrams, can be implemented by computer-readable program instructions.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine such that when executed by the processor of the computer or other programmable data processing apparatus , producing an apparatus for realizing the functions/actions specified in one or more blocks in the flowchart and/or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause computers, programmable data processing devices and/or other devices to work in a specific way, so that the computer-readable medium storing instructions includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks in flowcharts and/or block diagrams.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。It is also possible to load computer-readable program instructions into a computer, other programmable data processing device, or other equipment, so that a series of operational steps are performed on the computer, other programmable data processing device, or other equipment to produce a computer-implemented process , so that instructions executed on computers, other programmable data processing devices, or other devices implement the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams.
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个部分、程序段或指令的一部分,所述部分、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a portion, a program segment, or a portion of an instruction that includes one or more Executable instructions. In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified function or action , or may be implemented by a combination of dedicated hardware and computer instructions.
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。Having described various embodiments of the present disclosure above, the foregoing description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and alterations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principle of each embodiment, practical application or technical improvement in the market, or to enable other ordinary skilled in the art to understand each embodiment disclosed herein.
工业实用性Industrial Applicability
本公开涉及一种虚拟对象的生成方法及装置、电子设备和存储介质。所述方法包括:获取原始虚拟对象中待处理的目标部位;根据所述目标部位的色调信息,将所述目标部位划分为多个目标区域;根据预设颜色参数,对所述多个目标区域分别进行与所述目标区域的色调匹配的渲染处理,得到多个渲染结果;基于所述多个渲染结果,生成目标虚拟对象。通过上述过程,可以基于虚拟对象目标部位的色调,将目标部位划分成多个目标区域,并分别对多个目标区域进行相应的渲染处理,从而使得在对虚拟对象的形象进行改变的过程中,利用原始虚拟对象原有的色调信息,依然得到具有较为真实自然效果的目标虚拟对象,比如可以根据高光、阴影和中间调等色调将目标部位划分成高光区域、阴影区域和中间调区域,从而在对高光区域进行渲染处理的过程中,尽可能调高渲染的亮度,对阴影区域进行渲染处理的过程中,尽可能减小渲染的亮度,对中间调区域进行渲染处理的过程中,尽可能保持渲染的亮度,使得目标虚拟对象的渲染效果与原始虚拟对象原本的色调分布情况相匹配,提升目标虚拟对象的真实性和自然程度。The disclosure relates to a method and device for generating a virtual object, electronic equipment and a storage medium. The method includes: acquiring target parts to be processed in the original virtual object; dividing the target parts into multiple target areas according to the hue information of the target parts; Performing rendering processing that matches the color tone of the target area respectively to obtain multiple rendering results; based on the multiple rendering results, a target virtual object is generated. Through the above process, based on the hue of the target part of the virtual object, the target part can be divided into multiple target areas, and corresponding rendering processing is performed on the multiple target areas, so that in the process of changing the image of the virtual object, Using the original tone information of the original virtual object, the target virtual object with a more realistic and natural effect can still be obtained. For example, the target part can be divided into a highlight area, a shadow area, and a mid-tone area according to the tones such as highlights, shadows, and mid-tones. In the process of rendering the highlight area, increase the rendering brightness as much as possible, in the process of rendering the shadow area, reduce the rendering brightness as much as possible, and in the process of rendering the midtone area, keep the The brightness of the rendering enables the rendering effect of the target virtual object to match the original tone distribution of the original virtual object, improving the authenticity and naturalness of the target virtual object.

Claims (15)

  1. 一种虚拟对象的生成方法,包括:A method for generating a virtual object, comprising:
    获取原始虚拟对象中待处理的目标部位;Obtain the target part to be processed in the original virtual object;
    根据所述目标部位的色调信息,将所述目标部位划分为多个目标区域;dividing the target site into a plurality of target areas according to the hue information of the target site;
    根据预设颜色参数,对所述多个目标区域分别进行与所述目标区域的色调匹配的渲染处理,得到多个渲染结果;performing rendering processing on the plurality of target areas according to the preset color parameters to match the color tone of the target areas, to obtain multiple rendering results;
    基于所述多个渲染结果,生成目标虚拟对象。Based on the plurality of rendering results, a target virtual object is generated.
  2. 根据权利要求1所述的方法,其中,所述获取原始虚拟对象中待处理的目标部位,包括:The method according to claim 1, wherein said obtaining the target part to be processed in the original virtual object comprises:
    获取所述原始虚拟对象,其中,所述原始虚拟对象根据虚拟信息所生成;acquiring the original virtual object, wherein the original virtual object is generated according to virtual information;
    根据所述虚拟信息,从所述原始虚拟对象中提取所述待处理的目标部位。According to the virtual information, the target part to be processed is extracted from the original virtual object.
  3. 根据权利要求2所述的方法,其中,所述虚拟信息包括以下至少之一:预设的虚拟对象生成信息、响应于用户的动作所生成的虚拟对象控制信息。The method according to claim 2, wherein the virtual information includes at least one of the following: preset virtual object generation information, virtual object control information generated in response to user actions.
  4. 根据权利要求1至3中任意一项所述的方法,其中,所述色调信息包括以下至少之一:高光信息、阴影信息以及中间调信息;The method according to any one of claims 1 to 3, wherein the tone information includes at least one of the following: highlight information, shadow information, and midtone information;
    所述根据所述目标部位的色调信息,将所述目标部位划分为多个目标区域,包括以下至少之一:The said target part is divided into a plurality of target areas according to the hue information of the target part, including at least one of the following:
    基于所述目标部位的高光信息,从所述目标部位中提取得到高光区域;Based on the highlight information of the target part, extracting a highlight region from the target part;
    基于所述目标部位的阴影信息,从所述目标部位中提取得到阴影区域;Extracting a shadow area from the target part based on the shadow information of the target part;
    基于所述目标部位的中间调信息,从所述目标部位中提取得到中间调区域。Based on the midtone information of the target part, a midtone area is extracted from the target part.
  5. 根据权利要求4所述的方法,其中,所述基于所述目标部位的高光信息,从所述目标部位中提取得到高光区域,包括:The method according to claim 4, wherein said extracting a highlight region from the target part based on the highlight information of the target part comprises:
    基于所述目标部位的灰度图,进行正片叠底混合,得到第一混合结果;Based on the grayscale image of the target part, perform multi-layer blending to obtain a first blending result;
    根据所述第一混合结果,确定所述目标部位中像素点的第一透明度;determining a first transparency of pixels in the target part according to the first mixing result;
    根据第一预设透明度阈值和所述第一透明度,对所述目标部位中的像素点进行提取,得到所述高光区域。According to the first preset transparency threshold and the first transparency, pixel points in the target part are extracted to obtain the highlight area.
  6. 根据权利要求4或5所述的方法,其中,所述基于所述目标部位的阴影信息,从所述目标部位中提取得到阴影区域,包括:The method according to claim 4 or 5, wherein said extracting a shadow area from said target part based on the shadow information of said target part comprises:
    基于所述目标部位的反向灰度图,进行正片叠底混合,得到第二混合结果;Based on the reverse grayscale image of the target part, perform multi-fold blending to obtain a second blending result;
    根据所述第二混合结果,确定所述目标部位中像素点的第二透明度;determining a second transparency of pixels in the target part according to the second mixing result;
    根据第二预设透明度阈值和所述第二透明度,对所述目标部位中的像素点进行提取,得到所述阴影区域。According to the second preset transparency threshold and the second transparency, pixel points in the target part are extracted to obtain the shadow area.
  7. 根据权利要求4至6中任意一项所述的方法,其中,所述基于所述目标部位的中间调信息,从所述目标部位中提取得到中间调区域,包括:The method according to any one of claims 4 to 6, wherein said midtone region extracted from said target part based on the midtone information of said target part comprises:
    基于所述目标部位的灰度图,进行排除混合,得到第三混合结果;Based on the grayscale image of the target part, performing exclusion mixing to obtain a third mixing result;
    根据所述第三混合结果,确定所述目标部位中像素点的第三透明度;determining a third transparency of pixels in the target part according to the third mixing result;
    根据第三预设透明度阈值和所述第三透明度,对所述目标部位中的像素点进行提取,得到所述中间调区域。According to the third preset transparency threshold and the third transparency, pixel points in the target part are extracted to obtain the midtone area.
  8. 根据权利要求1至7中任意一项所述的方法,其中,所述根据预设颜色参数,对所述多个目标区域分别进行与所述目标区域的色调匹配的渲染处理,得到多个渲染结果,包括:The method according to any one of claims 1 to 7, wherein, according to the preset color parameters, the plurality of target areas are respectively subjected to rendering processing that matches the color tone of the target areas to obtain a plurality of rendered Results, including:
    根据所述预设颜色参数,对所述多个目标区域分别进行渲染,得到多个中间渲染结果;Rendering the plurality of target areas respectively according to the preset color parameters to obtain a plurality of intermediate rendering results;
    根据所述多个目标区域的色调,确定所述多个目标区域分别对应的处理方式;According to the hues of the multiple target areas, determine processing modes corresponding to the multiple target areas;
    按照所述多个目标区域分别对应的处理方式,将所述目标部位的灰度图分别与所述多个中间渲染结果进行混合处理,得到多个渲染结果。According to the processing manners respectively corresponding to the multiple target regions, the grayscale image of the target part is mixed with the multiple intermediate rendering results respectively to obtain multiple rendering results.
  9. 根据权利要求8所述的方法,其中,所述目标区域包括以下至少之一:高光区域、 阴影区域和中间调区域;The method according to claim 8, wherein the target area comprises at least one of the following: a highlight area, a shadow area, and a midtone area;
    所述根据所述多个目标区域的色调,确定所述多个目标区域分别对应的处理方式,包括:The determining the processing methods respectively corresponding to the multiple target areas according to the hues of the multiple target areas includes:
    在所述目标区域包括高光区域的情况下,确定所述处理方式包括滤色混合;In the case that the target area includes a highlight area, determining that the processing method includes color filter mixing;
    在所述目标区域包括阴影区域的情况下,确定所述处理方式包括正片叠底混合;In the case where the target area includes a shaded area, determining that the processing method includes multiplying and blending;
    在所述目标区域包括中间调区域的情况下,确定所述处理方式包括正常混合。In a case where the target area includes a midtone area, it is determined that the processing manner includes normal mixing.
  10. 根据权利要求1至9中任意一项所述的方法,其中,所述基于所述多个渲染结果,生成目标虚拟对象,包括:The method according to any one of claims 1 to 9, wherein said generating a target virtual object based on said plurality of rendering results comprises:
    将所述多个渲染结果进行叠加,得到目标渲染结果;superimposing the plurality of rendering results to obtain a target rendering result;
    基于预设渲染参数,利用所述目标渲染结果对所述原始虚拟对象中的目标部位进行渲染,得到所述目标虚拟对象。Based on preset rendering parameters, the target part in the original virtual object is rendered by using the target rendering result to obtain the target virtual object.
  11. 根据权利要求1至10中任意一项所述的方法,其中,所述方法还包括:The method according to any one of claims 1 to 10, wherein the method further comprises:
    响应于针对所述目标虚拟对象的交互操作,根据所述交互操作中的交互信息,控制所述目标虚拟对象执行与所述交互信息匹配的虚拟动作。In response to an interactive operation on the target virtual object, according to interaction information in the interactive operation, the target virtual object is controlled to perform a virtual action that matches the interaction information.
  12. 一种虚拟对象的生成装置,包括:A device for generating a virtual object, comprising:
    获取部分,被配置为获取原始虚拟对象中待处理的目标部位;an acquisition part configured to acquire a target part to be processed in the original virtual object;
    划分部分,被配置为根据所述目标部位的色调信息,将所述目标部位划分为多个目标区域;a dividing part configured to divide the target part into a plurality of target regions according to the tone information of the target part;
    渲染部分,被配置为根据预设颜色参数,对所述多个目标区域分别进行与所述目标区域的色调匹配的渲染处理,得到多个渲染结果;The rendering part is configured to, according to preset color parameters, respectively perform rendering processing on the plurality of target areas matching the color tone of the target areas to obtain multiple rendering results;
    生成部分,被配置为基于所述多个渲染结果,生成目标虚拟对象。The generation part is configured to generate a target virtual object based on the plurality of rendering results.
  13. 一种电子设备,包括:An electronic device comprising:
    处理器;processor;
    用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;
    其中,所述处理器被配置为调用所述存储器存储的指令,以执行权利要求1至11中任意一项所述的方法。Wherein, the processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1-11.
  14. 一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现权利要求1至11中任意一项所述的方法。A computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 11 is implemented.
  15. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行用于实现权利要求1至11中任意一项所述的方法。A computer program, comprising computer readable code, when the computer readable code is run in the electronic device, the processor in the electronic device executes the method for implementing any one of claims 1 to 11 .
PCT/CN2022/120158 2021-09-27 2022-09-21 Virtual object generation method and apparatus, and electronic device and storage medium WO2023045961A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111137693.5A CN113870400A (en) 2021-09-27 2021-09-27 Virtual object generation method and device, electronic equipment and storage medium
CN202111137693.5 2021-09-27

Publications (1)

Publication Number Publication Date
WO2023045961A1 true WO2023045961A1 (en) 2023-03-30

Family

ID=78991376

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/120158 WO2023045961A1 (en) 2021-09-27 2022-09-21 Virtual object generation method and apparatus, and electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN113870400A (en)
WO (1) WO2023045961A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113870400A (en) * 2021-09-27 2021-12-31 北京市商汤科技开发有限公司 Virtual object generation method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104700371A (en) * 2015-03-18 2015-06-10 厦门美图之家科技有限公司 Generation method and system of masking
US20160284070A1 (en) * 2015-03-27 2016-09-29 Google Inc. User Sliders for Simplified Adjustment of Images
CN107273837A (en) * 2017-06-07 2017-10-20 广州视源电子科技股份有限公司 The method and system virtually made up
CN112700528A (en) * 2020-12-21 2021-04-23 南京理工大学 Virtual object shadow rendering method for head-mounted augmented reality equipment
CN112767285A (en) * 2021-02-23 2021-05-07 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium
CN113870400A (en) * 2021-09-27 2021-12-31 北京市商汤科技开发有限公司 Virtual object generation method and device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104700371A (en) * 2015-03-18 2015-06-10 厦门美图之家科技有限公司 Generation method and system of masking
US20160284070A1 (en) * 2015-03-27 2016-09-29 Google Inc. User Sliders for Simplified Adjustment of Images
CN107273837A (en) * 2017-06-07 2017-10-20 广州视源电子科技股份有限公司 The method and system virtually made up
CN112700528A (en) * 2020-12-21 2021-04-23 南京理工大学 Virtual object shadow rendering method for head-mounted augmented reality equipment
CN112767285A (en) * 2021-02-23 2021-05-07 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium
CN113870400A (en) * 2021-09-27 2021-12-31 北京市商汤科技开发有限公司 Virtual object generation method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113870400A (en) 2021-12-31

Similar Documents

Publication Publication Date Title
WO2022179026A1 (en) Image processing method and apparatus, electronic device, and storage medium
US11114130B2 (en) Method and device for processing video
CN109816764B (en) Image generation method and device, electronic equipment and storage medium
WO2022179025A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN113160094A (en) Image processing method and device, electronic equipment and storage medium
CN110944230B (en) Video special effect adding method and device, electronic equipment and storage medium
CN109948093B (en) Expression picture generation method and device and electronic equipment
WO2023045941A1 (en) Image processing method and apparatus, electronic device and storage medium
WO2023045979A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN111338743B (en) Interface processing method and device and storage medium
CN111445415B (en) Image restoration method and device, electronic equipment and storage medium
WO2023045961A1 (en) Virtual object generation method and apparatus, and electronic device and storage medium
CN113822798B (en) Method and device for training generation countermeasure network, electronic equipment and storage medium
CN107424130B (en) Picture beautifying method and device
CN111583142A (en) Image noise reduction method and device, electronic equipment and storage medium
WO2023045950A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN113570581A (en) Image processing method and device, electronic equipment and storage medium
CN111935418B (en) Video processing method and device, electronic equipment and storage medium
WO2023045946A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN113450431B (en) Virtual hair dyeing method, device, electronic equipment and storage medium
WO2023142645A1 (en) Image processing method and apparatus, and electronic device, storage medium and computer program product
WO2023273050A1 (en) Living body detection method and apparatus, electronic device, and storage medium
CN113570583A (en) Image processing method and device, electronic equipment and storage medium
CN111553865B (en) Image restoration method and device, electronic equipment and storage medium
CN113762212A (en) Image processing method and device, electronic equipment and storage medium

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: 22872007

Country of ref document: EP

Kind code of ref document: A1