技术领域Technical field
本申请涉及图像处理技术领域,尤其涉及一种获取美颜参数的方法、装置、电子设备及介质。The present application relates to the field of image processing technology, and in particular, to a method, device, electronic equipment and medium for obtaining beauty parameters.
背景技术Background technique
随着具有拍摄功能的电子设备的广泛应用,一般的,在拍摄照片或视频过程中可以选择对人脸图像进行自动美颜,即根据美颜参数对人脸图像进行美颜处理。具体的,自动美颜可以根据美学理论(如,平均脸、对称性或黄金分割等)对人脸图像进行调整。但是,依据美学理论对人脸图像进行的普适化的美颜处理,无法满足用户的个性化需求。With the widespread use of electronic devices with shooting functions, generally, during the process of taking photos or videos, you can choose to automatically beautify the face image, that is, perform beautification processing on the face image according to the beautification parameters. Specifically, automatic beautification can adjust the face image according to aesthetic theories (such as average face, symmetry, or golden section, etc.). However, universal beautification processing of facial images based on aesthetic theory cannot meet the personalized needs of users.
在相关技术中,可以通过不同的调整项目,对人脸图像中的部分区域(如,脸型、眼睛或嘴巴等)进行美颜处理。上述调整项目还可以进一步细化,如,将眼睛对应的调整项目拆分成与眼睛大小、眼睛亮度、眼球色彩分别对应的调整项目,以便于对人脸图像进行精细化地美颜处理。用户可以通过用户交互界面对上述调整项目进行逐个调整,以便于得到每个调整项目的调整结果对应的美颜参数,然后采用美颜参数对人脸图像进行美颜处理,得到美颜图像。In related technologies, beautification processing can be performed on some areas in a face image (such as face shape, eyes or mouth, etc.) through different adjustment items. The above-mentioned adjustment items can be further refined. For example, the adjustment items corresponding to the eyes are split into adjustment items corresponding to eye size, eye brightness, and eyeball color, so as to facilitate refined beautification processing of the face image. The user can adjust the above adjustment items one by one through the user interaction interface in order to obtain the beautification parameters corresponding to the adjustment results of each adjustment item, and then use the beautification parameters to perform beautification processing on the face image to obtain a beautification image.
然而,由于上述调整项目的数量可能是几个、十几个、甚至几十个,并且,各个调整项目之间对人脸图像进行美颜处理时相互影响,因此,需要对调整项目逐个调整,并根据美颜效果反复调整。然而,用户并不是专业调试人员,上述美颜参数的获取方式,操作繁琐,耗时较长,并且,采用美颜参数对人脸图像进行美颜处理后的美颜图像,难以达到用户满意的美颜效果。However, since the number of the above adjustment items may be several, a dozen, or even dozens, and each adjustment item affects each other when beautifying the face image, the adjustment items need to be adjusted one by one. And adjust it repeatedly according to the beauty effect. However, the user is not a professional debugger. The above-mentioned method of obtaining the beautification parameters is cumbersome and time-consuming. Moreover, the beautification image processed by using the beautification parameters to beautify the face image is difficult to satisfy the user. Beauty effect.
发明内容Contents of the invention
本申请实施例提供一种获取美颜参数的方法、装置、电子设备及介质,用于解决现有技术中获取美颜参数方式操作繁琐,耗时较长,并且,采用美颜参数对人脸图像进行美颜处理后的美颜图像,难以达到用户满意的美颜效果的问题。Embodiments of the present application provide a method, device, electronic device, and medium for obtaining beauty parameters, which are used to solve the problem that the method of obtaining beauty parameters in the prior art is cumbersome and time-consuming, and the use of beauty parameters for facial recognition The problem is that it is difficult to achieve user-satisfied beautification effects on beautified images after image beautification processing.
为达到上述目的,本申请的实施例采用如下技术方案:In order to achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
第一方面,提供了一种获取美颜参数的方法,该方法包括:首先通过接收并响应于用户的第一操作,触发获取自定义美颜参数。其次,提示用户拍摄第一类型图像,引导用户输入第二操作,并响应于用户的第二操作获取第一类型图像。再次,提示用户拍摄第二类型图像,引导用户输入第三操作,并响应于用户的第三操作获取第二类型图像。最后,无需用户输入其他操作,即可根据第一图像和第二图像,得到自定义美颜参数。其中,第二类型图像与第一类型图像包括同一人脸图像,第二类型图像和第一类型图像不同。The first aspect provides a method of obtaining beauty parameters, which method includes: first triggering the acquisition of custom beauty parameters by receiving and responding to the user's first operation. Secondly, the user is prompted to take a first type of image, the user is guided to input a second operation, and the first type of image is obtained in response to the user's second operation. Again, the user is prompted to take a second type of image, the user is guided to input a third operation, and the second type of image is obtained in response to the user's third operation. Finally, customized beauty parameters can be obtained based on the first image and the second image without requiring the user to input other operations. Wherein, the second type image and the first type image include the same face image, and the second type image and the first type image are different.
在一种实现中,在拍摄的预览界面接收第一操作,第一操作可以是双指上滑操作,以此,快速触发获取自定义美颜参数。In one implementation, the first operation is received on the shooting preview interface, and the first operation may be a two-finger slide-up operation, thereby quickly triggering the acquisition of custom beauty parameters.
在另一种实现中,通过预置触发路径,经过多次用户与界面的交互,触发获取自定义美颜参数。In another implementation, the preset trigger path is used to trigger the acquisition of custom beauty parameters after multiple interactions between the user and the interface.
在本申请中,提示用户拍摄第一类型图像和提示用户拍摄第二类型图像,可以采用以下至少一种提示方式:显示文字提示信息、显示图像提示信息和播放声音提示信息。示例性的,显示“请拍摄素颜人脸图像”,播放“如何将人脸对准人脸框”动画,播放“请为自己画上满意的妆容”音频,播放提示音。In this application, prompting the user to take the first type of image and prompting the user to take the second type of image can adopt at least one of the following prompting methods: displaying text prompt information, displaying image prompt information, and playing sound prompt information. For example, "Please take a picture of a person's face without makeup" is displayed, the animation "How to align the face with the face frame" is played, the audio "Please put on makeup you are satisfied with" is played, and a prompt sound is played.
应理解,在拍摄的预览界面,可以设置上层显示文字提示信息或显示图像提示信息,设置下层显示预览图像。如果文字提示信息或图像提示信息,与预览图像部分重叠,可以增加文字提示信息或图像提示信息的透明度,以使得用户能够看到完整的预览图像。It should be understood that in the shooting preview interface, you can set the upper layer to display text prompt information or display image prompt information, and the lower layer to display a preview image. If the text prompt information or image prompt information partially overlaps with the preview image, the transparency of the text prompt information or image prompt information can be increased so that the user can see the complete preview image.
在本申请中,可以在缓存中保存第一类型图像和第二类型图像,得到自定义美颜参数后,根据缓存的使用情况,暂时保留或删除第一类型图像和第二类型图像。In this application, the first type of image and the second type of image can be saved in the cache. After obtaining the custom beauty parameters, the first type of image and the second type of image can be temporarily retained or deleted according to the usage of the cache.
如此,依次响应于第一操作、第二操作和第三操作,得到自定义美颜参数,无需根据美颜效果对美颜参数进行反复调试,操作步骤简单,耗时较短。由于带妆人脸图像可以理解为用户期望达到的美颜效果,因此,对于日常拍摄的人脸图像,采用自定义美颜参数进行美颜处理后得到的美颜图像,能够达到用户满意的美颜效果。In this way, in response to the first operation, the second operation and the third operation in sequence, customized beautification parameters are obtained. There is no need to repeatedly debug the beautification parameters according to the beautification effect. The operation steps are simple and time-consuming. Since the face image with makeup can be understood as the beautification effect that the user expects to achieve, for the face images taken daily, the beautification image obtained after beautification processing using custom beautification parameters can achieve the beauty that the user is satisfied with. Color effect.
在第一方面的另一种可能的设计方式中,在美颜处理过程中应用自定义美颜参数,可以采集第一图像,根据自定义美颜参数处理第一图像得到第二图像。In another possible design method of the first aspect, custom beautification parameters are applied during the beautification process, the first image can be collected, and the first image can be processed according to the custom beautification parameters to obtain the second image.
应理解,在摄像头采集到第一图像后,响应于用户针对第一图像的图像获取操作,得到第二图像,第二图像为根据自定义美颜参数处理第一图像得到的图像。It should be understood that after the camera collects the first image, a second image is obtained in response to the user's image acquisition operation for the first image, and the second image is an image obtained by processing the first image according to the custom beautification parameters.
如此,通过得到第二图像的过程中,对采集到的第一图像进行美颜处理,即根据自定义美颜参数处理第一图像,提高响应用户操作显示第一图像的速度。In this way, in the process of obtaining the second image, beautification processing is performed on the collected first image, that is, the first image is processed according to the customized beautification parameters, thereby improving the speed of displaying the first image in response to user operations.
在第一方面的另一种可能的设计方式中,在美颜处理过程中应用自定义美颜参数,根据自定义美颜参数处理第一图像得到第二图像之前,还可以在拍摄的预览界面,显示第二图像。In another possible design method of the first aspect, custom beautification parameters are applied during the beautification process, and before the first image is processed according to the custom beautification parameters to obtain the second image, the preview interface of the shooting can also be , display the second image.
如此,通过拍摄的预览界面显示第二图像,即,显示根据自定义美颜参数处理第一图像得到的第二图像,用户通过预览界面能够即时观察到美颜效果图像(第二图像),以提高用户的拍摄速度,进而节约系统资源。In this way, the second image is displayed through the captured preview interface, that is, the second image obtained by processing the first image according to the customized beautification parameters is displayed. The user can instantly observe the beautification effect image (second image) through the preview interface, so as to Improve the user's shooting speed, thereby saving system resources.
在第一方面的另一种可能的设计方式中,在美颜处理过程中应用自定义美颜参数,根据自定义美颜参数处理第一图像得到第二图像之前,还可以在拍摄的预览界面,显示第一图像,在拍摄的预览界面包括自定义美颜应用控件,然后响应于用户针对自定义美颜应用控件的第四操作,在拍摄的预览界面显示第二图像,其中,第四操作用于触发开启美颜效果。In another possible design method of the first aspect, custom beautification parameters are applied during the beautification process, and before the first image is processed according to the custom beautification parameters to obtain the second image, the preview interface of the shooting can also be , display the first image, include the custom beauty application control in the captured preview interface, and then display the second image in the captured preview interface in response to the user's fourth operation for the custom beauty application control, wherein the fourth operation Used to trigger the beauty effect.
如此,通过响应于用户针对自定义美颜应用控件的第四操作,在拍摄预览界面显示第二图像,使得用户能够根据即时需求选取显示无美颜的第一图像,或者,显示根据自定义美颜参数处理第一图像后的第二图像,以满足用户对拍摄的预览界面显示的多样化需求。用户通过预览界面能够即时观察到美颜效果图像(第二图像),以提高用户的拍摄速度,进而节约系统资源。In this way, in response to the user's fourth operation on the custom beauty application control, the second image is displayed on the shooting preview interface, so that the user can choose to display the first image without beauty according to immediate needs, or display the first image according to the custom beauty application. The second image after the first image is processed with color parameters to meet the user's diverse needs for the display of the preview interface of the shot. The user can instantly observe the beautification effect image (second image) through the preview interface, thereby improving the user's shooting speed and thus saving system resources.
在第一方面的另一种可能的设计方式中,针对第二图像,在显示第二图像的情况下,发出美颜提示信息,用于提示第二图像为根据自定义美颜参数处理第一图像得到的图像。In another possible design method of the first aspect, for the second image, when the second image is displayed, a beauty prompt message is sent to prompt the second image to process the first image according to the customized beauty parameters. image obtained image.
应理解,美颜提示信息可以是文字信息、图形信息或声音信息,以显示屏或者声筒为载体发出,如,显示美颜提示信息或播放美颜提示信息。It should be understood that the beauty prompt information can be text information, graphic information or sound information, and is sent using a display screen or a speaker as a carrier, for example, displaying the beauty prompt information or playing the beauty prompt information.
如此,通过发出美颜提示信息,提示第二图像是经过美颜处理后的美颜图像,以便于用户确定是否对第二图像进行再处理。In this way, by issuing the beautification prompt information, it is prompted that the second image is a beautify image after beautification processing, so that the user can determine whether to reprocess the second image.
在第一方面的另一种可能的设计方式中,在显示第二图像之后,还可以接收用户输入的对第二图像的第五操作,并响应于第五操作显示图像编辑界面。其中,图像编辑界面包括一个或多个控件,一个或多个控件用于编辑第二图像。In another possible design manner of the first aspect, after displaying the second image, a fifth operation on the second image input by the user can also be received, and the image editing interface is displayed in response to the fifth operation. The image editing interface includes one or more controls, and the one or more controls are used to edit the second image.
在本申请中,一个或多个控件可以用于调节第二图像的色调、环境增强、虚化、旋转、裁剪、拍摄参数、滤镜、抠图、涂鸦、添加马赛克、添加特效和文字等。In this application, one or more controls can be used to adjust the hue, environment enhancement, blur, rotation, cropping, shooting parameters, filters, cutout, graffiti, add mosaic, add special effects and text of the second image, etc.
如此,通过图像编辑界面中的一个或多个控件,能够对第二图像进行再处理,以满足用户对图像效果的多样化编辑需求。In this way, through one or more controls in the image editing interface, the second image can be reprocessed to meet the user's diverse editing needs for image effects.
在第一方面的另一种可能的设计方式中,上述一个或多个控件包括美颜程度控制条,美颜程度控制条用于调整采用自定义美颜参数对第二图像进行美颜处理的力度。在此基础上,接收并响应于用户对美颜程度控制条的调整操作,显示第三图像。其中,第三图像是按照调整后的美颜程度控制条对应的美颜处理的力度,根据自定义美颜参数处理第二图像得到的图像。In another possible design method of the first aspect, the one or more controls include a beautification degree control bar, and the beautification degree control bar is used to adjust the beautification process of the second image using customized beautification parameters. intensity. On this basis, receiving and responding to the user's adjustment operation on the beauty degree control bar, the third image is displayed. The third image is an image obtained by processing the second image according to the customized beautification parameters according to the beautification processing intensity corresponding to the adjusted beautification degree control bar.
如此,通过对美颜程度控制条的调整操作,调整自定义美颜参数的实施力度,以提高编辑后的第三图像符合多样化编辑需求的概率。In this way, by adjusting the beautification degree control bar, the implementation intensity of the customized beautification parameters is adjusted to increase the probability that the edited third image meets diverse editing needs.
在第一方面的另一种可能的设计方式中,在提示用户拍摄第二类型图像之后,接收用户的第三操作,响应于用户的第三操作,在满足拍摄触发条件的情况下,获取第二类型图像。其中,拍摄触发条件包括以下至少一项:第二类型图像与第一类型图像相比图像背景相似度大于第一预置阈值,第二类型图像与第一类型图像相比环境光线相似度大于第二预置阈值,第二类型图像与第一类型图像相比拍摄参数相同。In another possible design approach of the first aspect, after prompting the user to shoot the second type of image, receiving the user's third operation, in response to the user's third operation, and under the condition that the shooting trigger condition is met, the third operation is obtained. Two types of images. Wherein, the shooting trigger condition includes at least one of the following: the image background similarity between the second type image and the first type image is greater than the first preset threshold, and the ambient light similarity between the second type image and the first type image is greater than the first preset threshold. Two preset thresholds, the second type of image has the same shooting parameters as the first type of image.
如此,通过拍摄触发条件限制第二类型图像的采集环境,削弱采集环境对第二类型图像的显示效果的影响,使得第一类型图像和第二类型图像之间的差别仅在于化妆效果,提高采用自定义美颜参数进行美颜处理后得到的图像,能够达到用户满意效果的概率。In this way, by limiting the collection environment of the second type of image through the shooting trigger condition, the impact of the collection environment on the display effect of the second type of image is weakened, so that the difference between the first type of image and the second type of image is only the makeup effect, improving the adoption of The probability that the image obtained after beautification processing with customized beautification parameters can achieve user-satisfactory results.
在第一方面的另一种可能的设计方式中,在接收用户的第一操作之前,还可以显示效果选取界面。其中,效果选取界面包括自定义美颜控件,第一操作是用户对自定义美颜控件的点击操作。In another possible design approach of the first aspect, before receiving the user's first operation, an effect selection interface may also be displayed. Among them, the effect selection interface includes a custom beauty control, and the first operation is the user's click operation on the custom beauty control.
如此,电子设备能够接收用户的针对效果选取界面中的自定义美颜控件的第一操作,触发开启获取美颜参数的引导流程,能够提高自定义美颜参数符合用户需求的概率,进而提高获取自定义美颜参数的速度。In this way, the electronic device can receive the user's first operation on the custom beauty control in the effect selection interface, triggering the guidance process for obtaining the beauty parameters, which can increase the probability that the custom beauty parameters meet the user's needs, thereby improving the acquisition The speed of customizing beauty parameters.
在第一方面的另一种可能的设计方式中,在第一类型图像为素颜人脸图像的情况下,相应的,第二类型图像为与第一类型图像包括同一人脸图像的带妆人脸图像;或者,在第一类型图像为带妆人脸图像的情况下,相应的,第二类型图像为与第一类型图像包括同一人脸图像的素颜人脸图像。In another possible design approach of the first aspect, when the first type of image is a face image without makeup, correspondingly, the second type of image is a person with makeup including the same face image as the first type of image. face image; or, in the case where the first type image is a face image with makeup, correspondingly, the second type image is a face image without makeup that includes the same face image as the first type image.
如此,根据第一类型图像和第二类型图像得到的自定义美颜参数,能够表示素颜人脸图像到带妆人脸图像之间的变化,以使得根据自定义美颜参数处理后的图像具有带妆的美颜效果。In this way, the custom beauty parameters obtained according to the first type of image and the second type of image can represent the change between the face image without makeup and the face image with makeup, so that the image processed according to the custom beauty parameters has Beauty effect with makeup.
在第一方面的另一种可能的设计方式中,根据第一类型图像和第二类型图像,得到自定义美颜参数,首先对第一类型图像和第二类型图像进行区域划分,然后比较每一组对应的人脸区域的像素差异,得到自定义美颜参数。具体包括:将第一类型图像和第二类型图像中的素颜人脸图像通过预置人脸区域分割算法划分为至少一个第一人脸区域,将第一类型图像和第二类型图像中的带妆人脸图像通过预置人脸区域分割算法划分为至少一个第二人脸区域;根据第一人脸区域的区域类型,比较第一人脸区域,以及与第一人脸区域对应的第二人脸区域之间的像素差异,得到自定义美颜参数,区域类型包括色彩均匀区域类型和色彩差异区域类型。In another possible design method of the first aspect, custom beauty parameters are obtained based on the first type image and the second type image, first the first type image and the second type image are divided into regions, and then each is compared. The pixel differences in a set of corresponding face areas are used to obtain customized beauty parameters. Specifically, it includes: dividing the plain face images in the first type of image and the second type of image into at least one first face area through a preset face area segmentation algorithm, dividing the facial features in the first type of image and the second type of image into at least one first face area. The makeup face image is divided into at least one second face area through a preset face area segmentation algorithm; according to the area type of the first face area, the first face area and the second face area corresponding to the first face area are compared The pixel differences between face areas are used to obtain customized beauty parameters. The area types include uniform color area types and color difference area types.
如此,根据化妆效果特征,对第一人脸区域进行分类(区域类型包括色彩均匀区域类型和色彩差异区域类型),再根据不同的区域类型建立素颜人脸图像和带妆人脸图像之间的色彩映射关系,能够提高获取自定义美颜参数的效率。In this way, the first face area is classified according to the characteristics of the makeup effect (area types include uniform color area type and color difference area type), and then the relationship between the face image without makeup and the face image with makeup is established based on different area types. The color mapping relationship can improve the efficiency of obtaining customized beauty parameters.
第二方面,提供了一种第一设备,该第一设备具有实现上述第一方面的方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。In a second aspect, a first device is provided, which has the function of implementing the method of the first aspect. This function can be implemented by hardware, or it can be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
第三方面,提供了一种电子设备,包括:一个或多个摄像头、一个处理器、显示屏、存储器和通信模块;摄像头、显示屏、存储器、通信模块和处理器耦合;其中,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当计算机指令被电子设备执行时,使得电子设备执行如第一方面中任一项的获取美颜参数的方法。In a third aspect, an electronic device is provided, including: one or more cameras, a processor, a display screen, a memory and a communication module; the camera, the display screen, a memory, a communication module and a processor coupling; wherein the memory is used for Computer program code is stored, and the computer program code includes computer instructions. When the computer instructions are executed by the electronic device, the electronic device performs the method of obtaining beauty parameters according to any one of the first aspects.
第四方面,提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机指令,当其在电子设备上运行时,使得电子设备可以执行上述第一方面中任一项的获取美颜参数的方法。In a fourth aspect, a computer-readable storage medium is provided. Computer instructions are stored in the computer-readable storage medium. When run on an electronic device, the electronic device can perform the acquisition of any one of the above-mentioned first aspects. Beauty parameter method.
第五方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机可以执行上述第一方面中任一项的获取美颜参数的方法。A fifth aspect provides a computer program product containing instructions that, when run on a computer, enable the computer to execute the method for obtaining beauty parameters in any one of the above-mentioned first aspects.
第六方面,提供了一种芯片,该芯片包括处理器和通信接口,通信接口用于与芯片之前的通信模块通信,处理器用于运行计算机程序或指令,以实现执行上述第一方面中任一项的获取美颜参数的方法。该芯片时,可以由芯片构成,也可以包含芯片和其他分立器件。In a sixth aspect, a chip is provided. The chip includes a processor and a communication interface. The communication interface is used to communicate with the communication module in front of the chip. The processor is used to run computer programs or instructions to implement any one of the above-mentioned first aspects. Item's method of obtaining beauty parameters. The chip may be composed of chips or may include chips and other discrete devices.
其中,第二方面至第六方面中任一种设计方式所带来的技术效果可参见第一方面中不同设计方式所带来的技术效果,此处不再赘述。Among them, the technical effects brought by any one of the design methods in the second to sixth aspects can be found in the technical effects brought by different design methods in the first aspect, and will not be described again here.
附图说明Description of the drawings
图1示出本申请实施例提供的获取美颜参数的方法原理示意图;Figure 1 shows a schematic principle diagram of a method for obtaining beauty parameters provided by an embodiment of the present application;
图2示出本申请实施例提供的电子设备的结构示意图;Figure 2 shows a schematic structural diagram of an electronic device provided by an embodiment of the present application;
图3示出本申请实施例提供的获取美颜参数的装置结构示意图;Figure 3 shows a schematic structural diagram of a device for obtaining beauty parameters provided by an embodiment of the present application;
图4示出本申请实施例提供的获取美颜参数的方法流程示意图之一;Figure 4 shows one of the schematic flow diagrams of a method for obtaining beauty parameters provided by an embodiment of the present application;
图5示出本申请实施例提供的预览界面的示意图之一;Figure 5 shows one of the schematic diagrams of the preview interface provided by the embodiment of the present application;
图6示出本申请实施例提供的显示效果选取界面的操作示意图;Figure 6 shows an operational schematic diagram of the display effect selection interface provided by the embodiment of the present application;
图7示出本申请实施例提供的效果选取界面的示意图之一;Figure 7 shows one of the schematic diagrams of the effect selection interface provided by the embodiment of the present application;
图8示出本申请实施例提供的自定义美颜控件的下拉菜单的显示界面示意图;Figure 8 shows a schematic diagram of the display interface of the drop-down menu of the custom beauty control provided by the embodiment of the present application;
图9示出本申请实施例提供的效果选取界面的示意图之二;Figure 9 shows the second schematic diagram of the effect selection interface provided by the embodiment of the present application;
图10示出本申请实施例提供的默认美颜控件的下拉菜单的显示界面示意图;Figure 10 shows a schematic diagram of the display interface of the drop-down menu of the default beauty control provided by the embodiment of the present application;
图11示出本申请实施例提供的预览界面的示意图之二;Figure 11 shows the second schematic diagram of the preview interface provided by the embodiment of the present application;
图12示出本申请实施例提供的预览界面的示意图之三;Figure 12 shows the third schematic diagram of the preview interface provided by the embodiment of the present application;
图13示出本申请实施例提供的图像显示界面的示意图之一;Figure 13 shows one of the schematic diagrams of the image display interface provided by the embodiment of the present application;
图14示出本申请实施例提供的重拍操作示意图;Figure 14 shows a schematic diagram of the reshooting operation provided by the embodiment of the present application;
图15示出本申请实施例提供的预览界面的示意图之四;Figure 15 shows the fourth schematic diagram of the preview interface provided by the embodiment of the present application;
图16示出本申请实施例提供的预览界面的示意图之五;Figure 16 shows the fifth schematic diagram of the preview interface provided by the embodiment of the present application;
图17示出本申请实施例提供的预览界面的示意图之六;Figure 17 shows the sixth schematic diagram of the preview interface provided by the embodiment of the present application;
图18示出本申请实施例提供的获取美颜参数的方法流程示意图之二;Figure 18 shows the second schematic flow chart of the method for obtaining beauty parameters provided by the embodiment of the present application;
图19示出本申请实施例提供的图像美颜前后对比的示意图;Figure 19 shows a schematic diagram of the comparison before and after image beautification provided by the embodiment of the present application;
图20示出本申请实施例提供的预览界面的示意图之七;Figure 20 shows the seventh schematic diagram of the preview interface provided by the embodiment of the present application;
图21示出本申请实施例提供的图像编辑界面的示意图之一;Figure 21 shows one of the schematic diagrams of the image editing interface provided by the embodiment of the present application;
图22示出本申请实施例提供的图像编辑界面的示意图之二;Figure 22 shows the second schematic diagram of the image editing interface provided by the embodiment of the present application;
图23示出本申请实施例提供的获取美颜参数的方法流程示意图之三。Figure 23 shows the third schematic flowchart of the method for obtaining beauty parameters provided by the embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请的描述中,除非另有说明,“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。另外,为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,本领域技术人员可以理解,“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分,并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。同时,在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念,便于理解。The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Among them, in the description of this application, unless otherwise stated, "at least one of the following" or similar expressions refers to any combination of these items, including single item(s) or plural items(s). random combination. For example, at least one of a, b, or c can mean: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c can be single or multiple . In addition, in order to facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, those skilled in the art can understand that words such as “first” and “second” refer to the same items or items with substantially the same functions and effects. To distinguish similar items, the number and order of execution are not limited, and words such as "first" and "second" are not necessarily different. At the same time, in the embodiments of this application, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "such as" in the embodiments of the present application is not to be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete manner that is easier to understand.
在自拍场景中,用户特别关注人脸图像中的五官协调度、皮肤光滑度、皮肤颜色、头发颜色和妆容效果。通过用户对可进行参数调整的调整项目,进行逐一或部分调整,据此获取美颜参数,然后根据美颜参数对待美颜图像进行美颜处理后,得到美颜图像。但是,采用该方式获取美颜参数,操作繁琐,耗时较长,并且,由于用户对各个调整项目之间的相互影响了解程度有限,导致美颜图像难以达到用户满意的美颜效果。In the selfie scene, users pay special attention to the coordination of facial features, skin smoothness, skin color, hair color and makeup effects in facial images. The user adjusts the adjustment items that can be parameter adjusted one by one or partially, thereby obtaining the beautification parameters, and then performs beautification processing on the beautification image according to the beautification parameters to obtain the beautification image. However, using this method to obtain beautification parameters is cumbersome and time-consuming. Moreover, because the user has limited understanding of the interaction between various adjustment items, it is difficult for the beautification image to achieve a beautification effect that the user is satisfied with.
本实施例提供一种获取美颜参数的方法,可以简化人脸图像的美颜处理流程,并得到符合用户需求的美颜图像。具体的,请参考图1,其示出本申请实施例提供的获取美颜参数的方法原理示意图。首先,电子设备可以获取同一拍摄对象的素颜人脸图像和带妆人脸图像。然后,对素颜人脸图像和带妆人脸图像进行效果差异分析,得到可以体现出用户对自身妆容的优化倾向和喜好的美颜参数。最后,可以将该美颜参数应用于电子设备拍摄时采集的人脸图像,对该人脸图像进行美颜处理得到美颜图像。This embodiment provides a method for obtaining beautification parameters, which can simplify the beautification processing process of face images and obtain beautification images that meet user needs. Specifically, please refer to FIG. 1 , which shows a schematic diagram of the principle of a method for obtaining beauty parameters provided by an embodiment of the present application. First, the electronic device can obtain the face image of the same subject without makeup and the face image with makeup. Then, the effect difference of the face image without makeup and the face image with makeup is analyzed to obtain the beauty parameters that can reflect the user's optimization tendency and preference for their own makeup. Finally, the beautification parameter can be applied to the face image collected when the electronic device is photographed, and beautification processing is performed on the face image to obtain a beautify image.
本申请实施例提供的一种获取美颜参数的方法,可应用于电子设备中,请参考图2,其示出本申请实施例提供的电子设备的结构示意图。A method for obtaining beauty parameters provided by an embodiment of the present application can be applied to electronic devices. Please refer to FIG. 2 , which shows a schematic structural diagram of an electronic device provided by an embodiment of the present application.
如图2所示,电子设备可以包括处理器210,外部存储器接口220,内部存储器221,通用串行总线(universal serial bus,USB)接口230,充电管理模块240,电源管理模块241,电池242,天线1,天线2,移动通信模块250,无线通信模块260,音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,传感器模块280,按键290,马达291,指示器292,摄像头293,显示屏294,以及用户标识模块(subscriber identification module,SIM)卡接口295等。其中传感器模块280可以包括压力传感器280A,陀螺仪传感器280B,气压传感器280C,磁传感器280D,加速度传感器280E,距离传感器280F,接近光传感器280G,指纹传感器280H,温度传感器280J,触摸传感器280K,环境光传感器280L,骨传导传感器280M等。As shown in Figure 2, the electronic device may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, and a battery 242. Antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, audio module 270, speaker 270A, receiver 270B, microphone 270C, headphone interface 270D, sensor module 280, button 290, motor 291, indicator 292, camera 293, Display 294, and subscriber identification module (SIM) card interface 295, etc. The sensor module 280 may include a pressure sensor 280A, a gyro sensor 280B, an air pressure sensor 280C, a magnetic sensor 280D, an acceleration sensor 280E, a distance sensor 280F, a proximity light sensor 280G, a fingerprint sensor 280H, a temperature sensor 280J, a touch sensor 280K, and ambient light. Sensor 280L, bone conduction sensor 280M, etc.
可以理解的是,本发明实施例示意的结构并不构成对电子设备的具体限定。在本申请另一些实施例中,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structures illustrated in the embodiments of the present invention do not constitute specific limitations on the electronic equipment. In other embodiments of the present application, the electronic device may include more or less components than shown in the figures, or some components may be combined, some components may be separated, or some components may be arranged differently. The components illustrated may be implemented in hardware, software, or a combination of software and hardware.
处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 210 may include one or more processing units. For example, the processor 210 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), an image signal processor ( image signal processor (ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc. . Among them, different processing units can be independent devices or integrated in one or more processors.
其中,控制器可以是电子设备的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。Among them, the controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
处理器210中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器210中的存储器为高速缓冲存储器。该存储器可以保存处理器210刚用过或循环使用的指令或数据。如果处理器210需要再次使用该指令或数据,可从存储器中直接调用。避免了重复存取,减少了处理器210的等待时间,因而提高了系统的效率。The processor 210 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in processor 210 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 210 . If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 210 is reduced, thus improving the efficiency of the system.
电子设备通过GPU,显示屏294,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏294和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器210可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device implements display functions through the GPU, display screen 294, and application processor. The GPU is an image processing microprocessor and is connected to the display screen 294 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or alter display information.
显示屏294用于显示图像,视频等。显示屏294包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode的,AMOLED),柔性发光二极管(flex light-emittingdiode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。在一些实施例中,电子设备可以包括1个或N个显示屏294,N为大于1的正整数。The display screen 294 is used to display images, videos, etc. Display 294 includes a display panel. The display panel can use a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode). (AMOLED), flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 294, where N is a positive integer greater than 1.
电子设备可以通过ISP,摄像头293,视频编解码器,GPU,显示屏294以及应用处理器等实现拍摄功能。The electronic device can realize the shooting function through ISP, camera 293, video codec, GPU, display screen 294 and application processor.
ISP用于处理摄像头293反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头293中。The ISP is used to process the data fed back by the camera 293. For example, when taking a photo, the shutter is opened, the light is transmitted to the camera sensor through the lens, the light signal is converted into an electrical signal, and the camera sensor passes the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 293.
摄像头293用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备可以包括1个或N个摄像头293,N为大于1的正整数。Camera 293 is used to capture still images or video. The object passes through the lens to produce an optical image that is projected onto the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to convert it into a digital image signal. ISP outputs digital image signals to DSP for processing. DSP converts digital image signals into standard RGB, YUV and other format image signals. In some embodiments, the electronic device may include 1 or N cameras 293, where N is a positive integer greater than 1.
内部存储器221可以用于存储计算机可执行程序代码,可执行程序代码包括指令。处理器210通过运行存储在内部存储器221的指令,从而执行电子设备的各种功能应用以及数据处理。内部存储器221可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器221可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。Internal memory 221 may be used to store computer executable program code, which includes instructions. The processor 210 executes instructions stored in the internal memory 221 to execute various functional applications and data processing of the electronic device. The internal memory 221 may include a program storage area and a data storage area. Among them, the stored program area can store an operating system, at least one application program required for a function (such as a sound playback function, an image playback function, etc.). The storage data area can store data created during the use of electronic equipment (such as audio data, phone books, etc.). In addition, the internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
电子设备可以通过音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device can implement audio functions through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the headphone interface 270D, and the application processor. Such as music playback, recording, etc.
音频模块270用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块270还可以用于对音频信号编码和解码。在一些实施例中,音频模块270可以设置于处理器210中,或将音频模块270的部分功能模块设置于处理器210中。The audio module 270 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. Audio module 270 may also be used to encode and decode audio signals. In some embodiments, the audio module 270 may be provided in the processor 210 , or some functional modules of the audio module 270 may be provided in the processor 210 .
扬声器270A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备可以通过扬声器270A收听音乐,或收听免提通话。Speaker 270A, also called "speaker", is used to convert audio electrical signals into sound signals. The electronic device can listen to music through speaker 270A, or listen to hands-free calls.
受话器270B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备接听电话或语音信息时,可以通过将受话器270B靠近人耳接听语音。Receiver 270B, also called "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device answers a call or a voice message, the voice can be heard by bringing the receiver 270B close to the human ear.
麦克风270C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风270C发声,将声音信号输入到麦克风270C。电子设备可以设置至少一个麦克风270C。在另一些实施例中,电子设备可以设置两个麦克风270C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,电子设备还可以设置三个,四个或更多麦克风270C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。Microphone 270C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak close to the microphone 270C with the human mouth and input the sound signal to the microphone 270C. The electronic device may be provided with at least one microphone 270C. In other embodiments, the electronic device may be provided with two microphones 270C, which in addition to collecting sound signals, may also implement a noise reduction function. In other embodiments, the electronic device can also be equipped with three, four or more microphones 270C to collect sound signals, reduce noise, identify sound sources, and implement directional recording functions, etc.
耳机接口270D用于连接有线耳机。耳机接口270D可以是USB接口230,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The headphone interface 270D is used to connect wired headphones. The headphone interface 270D may be a USB interface 230, or may be a 3.5 mm open mobile terminal platform (OMTP) standard interface or a Cellular Telecommunications Industry Association of the USA (CTIA) standard interface.
压力传感器280A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器280A可以设置于显示屏294。压力传感器280A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器280A,电极之间的电容改变。电子设备根据电容的变化确定压力的强度。当有触摸操作作用于显示屏294,电子设备根据压力传感器280A检测触摸操作强度。电子设备也可以根据压力传感器280A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。The pressure sensor 280A is used to sense pressure signals and can convert the pressure signals into electrical signals. In some embodiments, pressure sensor 280A may be disposed on display screen 294. There are many types of pressure sensors 280A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. A capacitive pressure sensor may include at least two parallel plates of conductive material. When a force is applied to pressure sensor 280A, the capacitance between the electrodes changes. Electronics determine the intensity of the pressure based on changes in capacitance. When a touch operation is performed on the display screen 294, the electronic device detects the strength of the touch operation according to the pressure sensor 280A. The electronic device may also calculate the touched position based on the detection signal of the pressure sensor 280A. In some embodiments, touch operations acting on the same touch location but with different touch operation intensities may correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold is applied to the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction to create a new short message is executed.
距离传感器280F,用于测量距离。电子设备可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备可以利用距离传感器280F测距以实现快速对焦。Distance sensor 280F, used to measure distance. Electronic devices can measure distance via infrared or laser. In some embodiments, when shooting a scene, the electronic device can utilize the distance sensor 280F to measure distance to achieve fast focusing.
环境光传感器280L用于感知环境光亮度。电子设备可以根据感知的环境光亮度自适应调节显示屏294亮度。环境光传感器280L也可用于拍照时自动调节白平衡。环境光传感器280L还可以与接近光传感器280G配合,检测电子设备是否在口袋里,以防误触。The ambient light sensor 280L is used to sense ambient light brightness. The electronic device can adaptively adjust the brightness of the display screen 294 based on perceived ambient light brightness. The ambient light sensor 280L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 280L can also cooperate with the proximity light sensor 280G to detect whether the electronic device is in the pocket to prevent accidental touching.
指纹传感器280H用于采集指纹。电子设备可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。Fingerprint sensor 280H is used to collect fingerprints. Electronic devices can use the collected fingerprint characteristics to unlock fingerprints, access application locks, take photos with fingerprints, answer incoming calls with fingerprints, etc.
触摸传感器280K,也称“触控面板”。触摸传感器280K可以设置于显示屏294,由触摸传感器280K与显示屏294组成触摸屏,也称“触控屏”。触摸传感器280K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏294提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器280K也可以设置于电子设备的表面,与显示屏294所处的位置不同。Touch sensor 280K, also called "touch panel". The touch sensor 280K can be disposed on the display screen 294. The touch sensor 280K and the display screen 294 form a touch screen, which is also called a "touch screen". The touch sensor 280K is used to detect a touch operation on or near the touch sensor 280K. The touch sensor can pass the detected touch operation to the application processor to determine the touch event type. Visual output related to the touch operation may be provided through display screen 294. In other embodiments, the touch sensor 280K may also be disposed on the surface of the electronic device at a different location from the display screen 294 .
按键290包括开机键,音量键等。按键290可以是机械按键。也可以是触摸式按键。电子设备可以接收按键输入,产生与电子设备的用户设置以及功能控制有关的键信号输入。The buttons 290 include a power button, a volume button, etc. Key 290 may be a mechanical key. It can also be a touch button. The electronic device can receive key input and generate key signal input related to user settings and function control of the electronic device.
在启动拍摄应用程序的拍摄的预览界面,用户能够观察到预览图像,同时在拍摄的预览界面还可以设置对预览图像进行美颜处理的应用控件,以及调整美颜处理所采用的美颜参数的参数调整控件,基于此,用户可以选择是否对预览图像进行美颜处理,以及调整美颜处理所采用的美颜参数。In the shooting preview interface of starting the shooting application, the user can observe the preview image. At the same time, in the shooting preview interface, the user can also set the application controls for beautifying the preview image, and adjust the beautification parameters used in the beautification process. Parameter adjustment control. Based on this, the user can choose whether to perform beautification processing on the preview image, and adjust the beautification parameters used in the beautification process.
结合图2所示的电子设备的结构,本实施例提供一种获取美颜参数的方法,具体的实现过程中,请参考图3,其示出本申请实施例提供的获取美颜参数的结构示意图。首先在电子设备的显示屏294上显示的交互界面,引导用户输入相关操作。然后通过摄像头293获取同一拍摄对象的素颜人脸图像和带妆人脸图像(即,按照用户喜好化妆完成后的美妆图像)。并且,可以将素颜人脸图像和带妆人脸图像存储或者缓存在内部存储器221中。最后,通过处理器210对素颜人脸图像和带妆人脸图像进行效果差异分析。最后,根据上述效果差异得到自定义美颜参数,其中,实现效果差异分析方式的程序和自定义美颜参数可以存储在内部存储器221中。在得到自定义美颜参数后,可以采用该自定义美颜参数对人脸图像进行美颜处理,以使得进过美颜处理后的美颜图像能够达到用户满意的美颜效果。Combined with the structure of the electronic device shown in Figure 2, this embodiment provides a method for obtaining beauty parameters. During the specific implementation process, please refer to Figure 3, which shows the structure for obtaining beauty parameters provided by the embodiment of the present application. Schematic diagram. First, an interactive interface is displayed on the display screen 294 of the electronic device to guide the user to input relevant operations. Then, the camera 293 is used to obtain the face image without makeup and the face image with makeup (that is, the beauty image after makeup is completed according to the user's preference) of the same subject. Furthermore, the face image without makeup and the face image with makeup can be stored or cached in the internal memory 221 . Finally, the processor 210 performs effect difference analysis on the face image without makeup and the face image with makeup. Finally, customized beautification parameters are obtained based on the above effect differences, wherein the program implementing the effect difference analysis method and the customized beautification parameters can be stored in the internal memory 221 . After obtaining the custom beautification parameters, the custom beautification parameters can be used to perform beautification processing on the face image, so that the beautification image after the beautification process can achieve a beautification effect that is satisfactory to the user.
下面结合附图,对本公开实施例提供的获取美颜参数的方法进行描述。具体的,请参考图4,示出本申请提供的一种获取美颜参数的方法的流程示意图之一,所述方法可以适用于电子设备中。如图4所示,该方法包括:The method for obtaining beauty parameters provided by embodiments of the present disclosure will be described below with reference to the accompanying drawings. Specifically, please refer to FIG. 4 , which shows one of the schematic flow diagrams of a method for obtaining beauty parameters provided by this application. The method can be applied to electronic devices. As shown in Figure 4, the method includes:
步骤401、电子设备接收用户的第一操作。Step 401: The electronic device receives the user's first operation.
其中,第一操作用于触发获取自定义美颜参数。在本申请实施例中,第一操作可以是通过机械按键输入的按键触发操作(如,同时长按放大音量键和缩小音量键),可以是通过触控屏输入的预置操作或预置手势的屏幕触发操作,还可以是通过摄像头采集到的特定图像的图像识别触发操作,还可以是通过音频模块接收到的预置语音的语音触发操作,还可以其他电子设备发送的无线触发操作。Among them, the first operation is used to trigger acquisition of custom beauty parameters. In this embodiment of the present application, the first operation may be a key-triggered operation input through a mechanical key (for example, pressing and holding the volume up key and the volume down key at the same time), or a preset operation or preset gesture input through the touch screen. The screen trigger operation can also be an image recognition trigger operation of a specific image collected by the camera, a voice trigger operation of a preset voice received through the audio module, or a wireless trigger operation sent by other electronic devices.
在一些实施例中,电子设备可以在拍摄的预览界面接收上述第一操作。例如,该第一操作可以是用户在图5所示的拍摄的预览界面的双指上滑操作。In some embodiments, the electronic device may receive the above-mentioned first operation in the preview interface of shooting. For example, the first operation may be the user's two-finger slide-up operation on the photographed preview interface shown in FIG. 5 .
在另一些实施例中,电子设备可以显示包括自定义美颜控件的效果选取界面。上述第一操作可以是用户对自定义美颜控件的点击操作。其中,效果选取界面是通过预置路径,响应于不断输入的用户操作显示的。In other embodiments, the electronic device may display an effect selection interface including customized beauty controls. The above-mentioned first operation may be a user's click operation on the custom beauty control. Among them, the effect selection interface is displayed through preset paths in response to continuously input user operations.
例如,电子设备响应于用户针对图6中的(a)所示的拍摄的预览界面中的更多控件的点击操作,显示图6中(b)所示的多个拍摄参数设置界面。然后,电子设备响应于用户对拍摄参数设置界面中的美颜效果控件的点击操作,显示图6中(c)所示的效果选取界面。最后,电子设备可以接收针对效果选取界面中的自定义美颜控件的第一操作。For example, the electronic device displays multiple shooting parameter setting interfaces shown in (b) of FIG. 6 in response to the user's click operations on more controls in the preview interface of the shooting shown in (a) of FIG. 6 . Then, in response to the user's click operation on the beauty effect control in the shooting parameter setting interface, the electronic device displays the effect selection interface shown in (c) in Figure 6 . Finally, the electronic device can receive a first operation for the customized beauty control in the effect selection interface.
在一种示例中,如果不存在自定义美颜参数,则电子设备响应于用户对自定义美颜控件右侧的如图6中(c)所示的状态开关的点击操作,将自定义美颜控件设置为开启状态,即,在效果选取界面接收针对自定义美颜控件的第一操作,触发获取自定义美颜参数。In one example, if there is no custom beauty parameter, the electronic device responds to the user's click operation on the status switch as shown in (c) in Figure 6 on the right side of the custom beauty control. The beauty control is set to the on state, that is, the first operation for the custom beauty control is received on the effect selection interface, triggering the acquisition of the custom beauty parameters.
在另一种示例中,如果存在自定义美颜参数,则电子设备响应于用户对自定义美颜控件右侧的状态开关的点击操作(如图7中的(a)所示),将自定义美颜控件设置为开启状态,显示自定义美颜控件的下拉菜单,该下拉菜单包括美颜效果采集控件、至少一个自定义美颜效果控件。如果效果选取界面中的自定义美颜控件右侧的开关处于开启状态,则响应于用户针对“>>”标识符的点击操作(如图7中的(b)所示),显示自定义美颜控件的下拉菜单。In another example, if there are custom beauty parameters, the electronic device will automatically change the state in response to the user's click operation on the status switch on the right side of the custom beauty control (as shown in (a) in Figure 7). The defined beauty control is set to the on state, and a drop-down menu of the custom beauty control is displayed. The drop-down menu includes a beauty effect collection control and at least one custom beauty effect control. If the switch on the right side of the custom beauty control in the effect selection interface is turned on, in response to the user's click operation on the ">>" identifier (as shown in (b) in Figure 7), the custom beauty control is displayed. The drop-down menu of the color control.
其中,如图8中(a)所示,电子设备可以在效果选取界面显示自定义美颜控件的下拉菜单,将效果选取界面分为第一显示区域和第二显示区域。具体的,电子设备将自定义美颜控件对应的区域设置为第一显示区域,将与自定义美颜控件的下拉菜单对应的区域设置为第二显示区域,通过为第一显示区域和第二显示区域中的控件和图标,设置不同的字体、字号、颜色、底纹进行区别显示,如,降低第一显示区域的透明度,将第一显示区域的底纹设置为灰色,将第一显示区域设置为非操作区域。Among them, as shown in (a) of Figure 8 , the electronic device can display a drop-down menu of custom beauty controls on the effect selection interface, and divide the effect selection interface into a first display area and a second display area. Specifically, the electronic device sets the area corresponding to the custom beauty control as the first display area, and sets the area corresponding to the drop-down menu of the custom beauty control as the second display area, by providing the first display area and the second display area. For controls and icons in the display area, set different fonts, font sizes, colors, and shading to display them differently. For example, reduce the transparency of the first display area, set the shading of the first display area to gray, and set the shading of the first display area to gray. Set to non-operating area.
其中,如图8中(b)所示,电子设备在接收到显示自定义美颜控件的下拉菜单的操作后,打开自定义美颜效果界面,显示自定义美颜控件的下拉菜单。自定义美颜效果界面与效果选取界面为不同的界面。Among them, as shown in (b) of Figure 8, after receiving the operation of displaying the drop-down menu of the custom beauty control, the electronic device opens the custom beauty effect interface and displays the drop-down menu of the custom beauty control. The custom beauty effect interface and the effect selection interface are different interfaces.
应注意的是,电子设备接收用户输入的针对效果选取界面中的美颜效果采集控件的第一操作,即通过多级控制的方式触发获取自定义美颜参数,能够提高获取到的自定义美颜参数符合用户需求的概率,进而提高获取自定义美颜参数的速度。It should be noted that the first operation of the electronic device receiving user input for the beautification effect collection control in the effect selection interface is to trigger the acquisition of custom beautification parameters through multi-level control, which can improve the obtained custom beautification parameters. The probability that the beauty parameters meet the user's needs will increase the speed of obtaining customized beauty parameters.
在本申请实施例中,效果选取界面还可以包括默认美颜控件,如图9中的(a)所示,在效果选取界面中包括默认美颜控件和自定义美颜控件。其中,默认美颜控件和自定义美颜控件,不能同时处于开启状态。In this embodiment of the present application, the effect selection interface may also include a default beauty control. As shown in (a) of Figure 9 , the effect selection interface includes a default beauty control and a custom beauty control. Among them, the default beauty control and the custom beauty control cannot be turned on at the same time.
在一种示例中,如图9中的(b)所示,如果存在唯一默认美颜效果,且不能修改美颜参数,则电子设备响应于用户对默认美颜控件右侧的状态开关的点击操作,将默认美颜控件设置为开启状态,即,将拍摄的预览界面显示的图像,根据默认美颜效果对应的美颜参数进行美颜处理。In one example, as shown in (b) of FIG. 9 , if there is a unique default beauty effect and the beauty parameters cannot be modified, the electronic device responds to the user's click on the status switch on the right side of the default beauty control. Operation: Set the default beautification control to on, that is, the captured image displayed on the preview interface will be beautified according to the beautification parameters corresponding to the default beautification effect.
在另一种示例中,如图9中的(b)所示,如果存在至少两个默认美颜效果,或/和能够修改美颜参数,则电子设备响应于用户对默认美颜控件右侧的状态开关的点击操作,将默认美颜控件设置为开启状态,并显示默认美颜控件的下拉菜单。如图9中的(c)所示,如果默认美颜控件右侧的开关处于开启状态,则电子设备可以响应于用户针对“>>”标识符的点击操作,显示自定义美颜控件的下拉菜单。In another example, as shown in (b) of FIG. 9 , if there are at least two default beauty effects, or/and the beauty parameters can be modified, the electronic device responds to the user's control of the right side of the default beauty control. Click the status switch to set the default beauty control to the on state and display the drop-down menu of the default beauty control. As shown in (c) in Figure 9, if the switch on the right side of the default beauty control is turned on, the electronic device can display the drop-down of the custom beauty control in response to the user's click operation on the ">>" identifier. menu.
需要说明的是,默认美颜控件的下拉菜单可以包括默认美颜效果,个性化美颜效果,以及个性化设置。其中,默认美颜效果可以为少女妆效果、学生妆效果、宴会妆效果等等。个性化美颜效果为通过自定义美颜调整项目的调整程度,获取个性化美颜参数,呈现个性化美颜效果。It should be noted that the drop-down menu of the default beauty control can include default beauty effects, personalized beauty effects, and personalized settings. Among them, the default beauty effects can be girl makeup effects, student makeup effects, banquet makeup effects, etc. The personalized beauty effect is to obtain the personalized beauty parameters through the adjustment degree of the customized beauty adjustment item, and present the personalized beauty effect.
其中,如图10中的(a)所示,电子设备可以在效果选取界面显示默认美颜控件的下拉菜单,将效果选取界面分为第一显示区域和第二显示区域,具体的,电子设备可以将默认美颜控件和自定义美颜控件对应的区域设置为第一显示区域,将与默认美颜控件的下拉菜单对应的显示区域设置为第二显示区域,通过为第一显示区域和第二显示区域中的控件和图标,设置不同的字体、字号、颜色、底纹进行区别显示。例如,降低第一显示区域的透明度,将第一显示区域的底纹设置为灰色,将第一显示区域设置为非操作区域。Among them, as shown in (a) of Figure 10, the electronic device can display a drop-down menu of the default beauty control on the effect selection interface, and divide the effect selection interface into a first display area and a second display area. Specifically, the electronic device The area corresponding to the default beauty control and the custom beauty control can be set as the first display area, and the display area corresponding to the drop-down menu of the default beauty control can be set as the second display area. For the controls and icons in the second display area, set different fonts, font sizes, colors, and shading to display them differently. For example, the transparency of the first display area is reduced, the shading of the first display area is set to gray, and the first display area is set as a non-operation area.
其中,如图10中的(b)所示,电子设备在接收到显示默认美颜控件的下拉菜单的操作后,还可以打开默认美颜效果界面,显示默认美颜控件的下拉菜单。默认美颜效果界面与效果选取界面为不同的界面。Among them, as shown in (b) of Figure 10, after receiving the operation of displaying the drop-down menu of the default beauty control, the electronic device can also open the default beauty effect interface and display the drop-down menu of the default beauty control. The default beauty effect interface and the effect selection interface are different interfaces.
如此,通过在效果选取界面显示默认美颜控件和自定义美颜控件,为用户提供两种获取美颜参数的方式,能够实现美颜效果的多样性,提高美颜效果能够满足用户实际需要的可能性。In this way, by displaying the default beauty controls and custom beauty controls on the effect selection interface, users are provided with two ways to obtain beauty parameters, which can achieve the diversity of beauty effects and improve the beauty effects to meet the actual needs of users. possibility.
步骤402、电子设备响应于第一操作,提示用户拍摄第一类型图像,响应于用户的第二操作获取第一类型图像。Step 402: The electronic device prompts the user to take a first type of image in response to the first operation, and acquires the first type of image in response to the user's second operation.
在本申请实施例中,电子设备可以响应于第一操作,显示拍摄的预览界面。电子设备在拍摄的预览界面可以显示提示用户拍摄第一类型图像的提示信息。并且,电子设备在拍摄的预览界面还可显示摄像头采集到的预览图像。In this embodiment of the present application, the electronic device may display a photographed preview interface in response to the first operation. The electronic device may display prompt information prompting the user to capture the first type of image in the shooting preview interface. Moreover, the electronic device can also display the preview image collected by the camera in the preview interface of the shooting.
其中,第一类型图像可以为素颜人脸图像或者带妆人脸图像。The first type of image may be a face image without makeup or a face image with makeup.
在一些实施例中,提示用户拍摄第一类型图像的提示方式可以为:显示文字提示信息,和/或,显示图像提示信息。其中,图像提示信息可以是静态显示的图像,还可以是动态播放的图像(如,动画、视频)。示例性的,文字提示信息可以为请拍摄素颜人脸图像,图像提示信息可以为如何将人脸对准人脸框的动画。可以设置在响应第一操作之后,响应第二操作之前,显示文字提示信息和静态显示的图像提示信息,和/或,循环播放或单次播放动态播放的图像提示信息。In some embodiments, the prompt method for prompting the user to take the first type of image may be: displaying text prompt information, and/or displaying image prompt information. The image prompt information may be a statically displayed image or a dynamically played image (such as animation, video). For example, the text prompt information may be, please take a picture of a person's face without makeup, and the image prompt information may be an animation of how to align the face with the face frame. It can be configured to display text prompt information and statically displayed image prompt information after responding to the first operation and before responding to the second operation, and/or display dynamically played image prompt information in a loop or in a single play.
在另一些实施例中,提示用户拍摄第一类型图像的提示方式可以为:播放声音提示信息。具体的,电子设备可以通过声筒播放提示声音信息,声音提示信息可以为提示音或提示语音。示例性的,声音提示信息可以为“请为自己画上满意的妆容”的语音。电子设备可以设置循环播放或单次播放声音提示信息。In other embodiments, the prompt method for prompting the user to take the first type of image may be: playing sound prompt information. Specifically, the electronic device can play prompt sound information through a speaker, and the sound prompt information can be a prompt sound or a prompt voice. For example, the voice prompt information may be a voice saying "Please put on makeup that you are satisfied with". The electronic device can be set to play the sound prompt information in a loop or once.
应理解,电子设备在拍摄的预览界面可以设置上层显示文字提示信息或显示图像提示信息,还可以设置下层显示预览图像。如果文字提示信息或图像提示信息,与预览图像部分重叠,电子设备可以更改文字提示信息或图像提示信息的透明度,以使得用户能够看到完整的预览图像。It should be understood that the electronic device can set the upper layer to display text prompt information or display image prompt information in the shooting preview interface, and can also set the lower layer to display a preview image. If the text prompt information or the image prompt information partially overlaps with the preview image, the electronic device can change the transparency of the text prompt information or the image prompt information so that the user can see the complete preview image.
在本申请中,针对提示用户拍摄第一类型图像的提示信息,电子设备可以响应于用户的操作不再进行提示,或者,在提示时间超过预置时间情况下,不再进行提示,或者,在接收到用户的第二操作后,不再进行提示。In this application, for the prompt information prompting the user to take the first type of image, the electronic device can no longer prompt in response to the user's operation, or, if the prompt time exceeds the preset time, no longer prompt, or, in After receiving the user's second operation, no prompt will be given.
示例性的,以第一类型图像为素颜人脸图像为例,如图11中的(a)所示,电子设备在拍摄的预览界面显示文字提示信息:请拍摄素颜人脸图像。上述提示信息可以通过消息提示框、气泡、标签等方法显示。对于消息提示框的显示方式而言,上述提示信息可以在预置位置的消息提示框中静态显示,可以在预置位置的消息提示框中滚动显示,还可以在根据预置移动规则移动显示的消息提示框中静态显示,还可以在根据预置移动规则移动显示的消息提示框中滚动显示。For example, assuming that the first type of image is a face image without makeup, as shown in (a) in Figure 11, the electronic device displays text prompt information on the shooting preview interface: Please take a face image without makeup. The above prompt information can be displayed through message prompt boxes, bubbles, labels, etc. As for the display method of the message prompt box, the above prompt information can be displayed statically in the message prompt box at the preset position, can be displayed scrollingly in the message prompt box at the preset position, or can be moved and displayed according to the preset movement rules. It can be displayed statically in the message prompt box, and can also be scrolled in the message prompt box that is moved and displayed according to the preset movement rules.
示例性的,如图11中的(b)所示,电子设备在拍摄的预览界面还可以显示人脸框,以及,显示“将人脸放置于人脸框内”的提示信息。人脸框的边界为人脸图像(正脸图像)的轮廓,提示用户需要采集正脸图像,以便于提高采用自定义美颜参数进行美颜处理后得到的美颜图像,符合用户需求的概率。可以理解的是,上述人脸框的边界是通用的模糊轮廓,该模糊轮廓能够适配所有用户的人脸图像。For example, as shown in (b) of FIG. 11 , the electronic device can also display a face frame in the preview interface of shooting, and display a prompt message of "place the face in the face frame". The boundary of the face frame is the outline of the face image (frontal image), prompting the user to collect the frontal image in order to increase the probability that the beauty image obtained after beautification processing using custom beauty parameters will meet the user's needs. It can be understood that the boundary of the above-mentioned face frame is a universal fuzzy outline, and the fuzzy outline can adapt to the face images of all users.
可选地,在本申请实施例中,由于第一类型图像可以为素颜人脸图像,还可以为带妆人脸图像,因此,电子设备可以设置第一类型图像的人脸妆容属性为素颜人脸图像,也可以设置第一类型图像的人脸妆容属性为带妆人脸图像,还可以设置记录第一类型图像的人脸妆容属性的检测结果,人脸妆容属性的检测结果为素颜人脸图像或带妆人脸图像。Optionally, in the embodiment of the present application, since the first type of image can be a face image without makeup or a face image with makeup, the electronic device can set the face makeup attribute of the first type image to be a face image without makeup. Face image, you can also set the face makeup attribute of the first type of image to a face image with makeup, and you can also set the detection result to record the face makeup attribute of the first type image, and the detection result of the face makeup attribute of the first type image is a face without makeup. image or face image with makeup.
可以理解的是,电子设备检测第一类型图像的人脸妆容属性,具体可以通过图像识别算法检测眼周皮肤颜色、皮肤光滑程度或眉毛轮廓检测人脸妆容属性为素颜人脸图像还是带妆人脸图像。其后,电子设备将检测结果作为标签标记第一图像。人脸妆容属性的检测结果可以用预置编码、预置标识符或预置文件名进行标识,示例性的,预置编码可以为00、01、88,预置标识符可以为三角形、圆形、感叹号,预置文件名可以为将文件名的首位设置为固定的单个字符、将文件名的前几位设置为固定的多个字符、将文件名的最末位设置为固定的单个字符,将文件名的最后几位设置为固定的多个字符。其中,固定的多个字符,可以为相同字符,也可以为不同字符,本申请对此不做限定。It is understandable that the electronic device detects the facial makeup attributes of the first type of image. Specifically, the image recognition algorithm can be used to detect the color of the skin around the eyes, the smoothness of the skin, or the eyebrow contour to detect whether the facial makeup attribute is a face image without makeup or a person wearing makeup. face image. Thereafter, the electronic device marks the first image with the detection result as a label. The detection results of facial makeup attributes can be identified by preset codes, preset identifiers or preset file names. For example, preset codes can be 00, 01, 88, and preset identifiers can be triangles or circles. , exclamation point, the preset file name can be set to a fixed single character for the first digit of the file name, a fixed number of characters for the first digits of the file name, and a fixed single character for the last digit of the file name. Set the last few characters of the file name to a fixed number of characters. The fixed plurality of characters may be the same characters or different characters, and this application does not limit this.
在本申请实施例中,如图12所示,在拍摄的预览界面显示预览图像后,电子设备响应于用户的第二操作(如,对拍摄操作控件的点击操作),获取第一类型图像。为了保证拍摄光线的稳定性,可以设置关闭闪光灯。In this embodiment of the present application, as shown in Figure 12, after the preview image is displayed on the photographed preview interface, the electronic device acquires the first type of image in response to the user's second operation (such as a click operation on the photographing operation control). In order to ensure the stability of the shooting light, you can set the flash to be turned off.
其中,第二操作用于获取第一类型图像,第二操作可以是通过机械按键输入的按键触发操作(如,同时长按放大音量键和缩小音量键),可以是通过触控屏输入的预置操作或预置手势的屏幕触发操作,还可以是通过摄像头采集到的特定图像的图像识别触发操作,还可以是通过音频模块接收到的预置语音的语音触发操作,还可以其他电子设备发送的无线触发操作。The second operation is used to obtain the first type of image. The second operation may be a key-triggered operation input through a mechanical key (such as long pressing the volume up key and the volume down key at the same time), or a preset input through the touch screen. It can also be a screen trigger operation of a preset operation or a preset gesture, or an image recognition trigger operation of a specific image collected by the camera, or a voice trigger operation of a preset voice received through the audio module, or it can be sent by other electronic devices. wireless triggering operation.
在一种示例中,在获取第一类型图像之后,电子设备可以不显示第一类型图像,直接缓存第一类型图像,并跳转至下一步骤。In one example, after acquiring the first type of image, the electronic device may not display the first type of image, directly cache the first type of image, and jump to the next step.
在另一种示例中,如图13所示,在获取第一类型图像之后,电子设备还可以显示第一类型图像,并显示提示操作控件,该提示控件包括重拍控件和跳转至下一步骤的继续控件。电子设备可以响应于针对重拍控件的点击操作,再次提示用户拍摄第一类型图像,如果再次接收到第二操作重新获取第一类型图像。电子设备还可以响应于针对继续控件的点击操作,跳转至下一步骤。以此重复操作方式,获取用户满意的第一类型图像。In another example, as shown in Figure 13, after acquiring the first type of image, the electronic device can also display the first type of image and display prompt operation controls, where the prompt control includes a retake control and a jump to the next Step continuation control. The electronic device may prompt the user to capture the first type of image again in response to the click operation of the reshoot control, and reacquire the first type of image if the second operation is received again. The electronic device may also jump to the next step in response to a click on the continue control. By this repeated operation method, the first type of image that is satisfactory to the user is obtained.
可选地,在本申请实施例中,在获取第一类型图像之后,电子设备还可以检测第一类型图像是否为正脸图像,在第一类型图像是正脸图像的情况下,跳转至下一步骤;在第一类型图像不是正脸图像的情况下,响应于用户的操作,重新获取第一类型图像或者跳转至下一步骤。Optionally, in this embodiment of the present application, after acquiring the first type of image, the electronic device can also detect whether the first type of image is a frontal face image. If the first type of image is a frontal face image, jump to the next step. One step; when the first type image is not a frontal image, in response to the user's operation, reacquire the first type image or jump to the next step.
示例性的,在拍摄的预览界面采集到如图14中的(a)所示的预览图像后,在响应于用户对拍摄操作控件的点击操作,获取并显示第一类型图像,如果通过检测判断第一类型图像不是正脸图像,那么如图14中的(b)所示,还可以重拍提示信息、重拍控件和继续控件,重拍提示信息为请拍摄正脸图像。其后,如图14中的(c)所示,电子设备响应于用户针对重拍控件的点击操作,删除第一类型图像,重新显示如图14中的(d)所示的用于获取第一类型图像的拍摄的预览界面。或者,如图14中的(e)所示,电子设备响应于用户针对继续作控件的点击操作,跳转至下一步骤,显示如图14中的(f)所示的用于获取第二类型图像的拍摄的预览界面。Exemplarily, after the preview image of the shooting preview interface collects the preview image as shown in (a) of Figure 14, in response to the user's click operation on the shooting operation control, the first type of image is acquired and displayed. If it is determined by detection The first type of image is not a front-face image, so as shown in (b) of Figure 14, you can also retake the prompt message, retake control and continue control. The retake prompt message is please take a front-face image. Thereafter, as shown in (c) of Figure 14 , the electronic device responds to the user's click operation on the retake control, deletes the first type of image, and redisplays the image of the first type as shown in (d) of Figure 14 for obtaining the second image. A preview interface for shooting a type of image. Or, as shown in (e) of Figure 14 , the electronic device responds to the user's click operation on the continue control, jumps to the next step, and displays a message for obtaining the second step as shown in (f) of Figure 14 Preview interface for shooting of type images.
其中,重拍控件和继续控件能够响应于单击、双击或长按操作。在显示第一类型图像、重拍提示信息、重拍控件和继续控件之后,如果经过预置时间没有接收到用户的点击操作,则电子设备默认根据针对重拍控件的点击操作,删除第一类型图像,重新显示用于拍摄第一类型图像的拍摄的预览界面。Among them, the remake control and the continue control can respond to single click, double click or long press operation. After displaying the first type of image, the retake prompt information, the retake control and the continue control, if the user's click operation is not received after the preset time, the electronic device will delete the first type by default based on the click operation on the retake control. image to redisplay the shooting preview interface for shooting the first type of image.
如此,在获取第一类型图像之后,执行下一步骤之前,显示第一类型图像、重拍提示信息、重拍控件和继续控件,以便于接收对重拍控件或继续控件的点击操作,获取能够用户满意的第一图像。In this way, after acquiring the first type of image and before executing the next step, the first type of image, the reshooting prompt information, the reshooting control and the continuation control are displayed so as to receive the click operation on the reshooting control or the continuation control and obtain the ability to The first image that users are satisfied with.
可选地,在本申请实施例中,电子设备还可以在响应用户的第二操作之前,检测拍摄的预览界面显示的预览图像是否为正脸图像;如果检测结果为否,则显示如图15中的(a)所示的调整提示信息,调整提示信息用于提示用户调整人脸与摄像头之间的距离和角度,以便于采集符合需求的预览图像;如果检测结果为是,则显示如图15中的(b)所示的操作提示信息。Optionally, in this embodiment of the present application, the electronic device can also detect whether the preview image displayed on the captured preview interface is a front-face image before responding to the user's second operation; if the detection result is no, the display is as shown in Figure 15 The adjustment prompt information shown in (a) is used to prompt the user to adjust the distance and angle between the face and the camera in order to collect a preview image that meets the needs; if the detection result is yes, it is displayed as shown in the figure The operation prompt information shown in (b) in 15.
应理解的是,调整提示信息是根据预览图像的实际显示状态确定的,如,请向上移动人脸、请向下移动人脸、请向右转头,请向左转头等。操作提示信息用于提示用户输入第二操作。It should be understood that the adjustment prompt information is determined based on the actual display status of the preview image, such as, please move the face upward, please move the face downward, please turn your head to the right, please turn your head to the left, etc. The operation prompt information is used to prompt the user to input the second operation.
如此,对拍摄的预览界面中的预览图像,检测是否为正脸图像,并显示调整提示信息提示,以及在预览图像为正脸图像的情况下,显示输入第二操作的提示信息,能够提高第一类型图像符合用户需求的概率。In this way, for the preview image in the captured preview interface, it is detected whether it is a front-face image, and the adjustment prompt information is displayed, and when the preview image is a front-face image, a prompt message for inputting the second operation is displayed, which can improve the performance of the second operation. The probability that a type of image meets the user's needs.
进一步可选地,在本申请实施例中,电子设备检测预览图像或第一类型图像是否为正脸图像,具体包括:获取预览图像或第一类型图像对应的人脸坐标列表,其中,人脸坐标列表包括人脸矩形框的两组坐标,左右眼睛坐标、鼻子坐标和左右两侧嘴角坐标。在人脸坐标列表中的列表值存在空值的情况下,确定第一类型图像不为正脸图像;在人脸坐标列表中的列表值不存在空值的情况下,确定预览图像或第一类型图像为正脸图像。Further optionally, in the embodiment of the present application, the electronic device detects whether the preview image or the first type image is a front face image, specifically including: obtaining a face coordinate list corresponding to the preview image or the first type image, where the face The coordinate list includes two sets of coordinates of the face rectangular frame, the coordinates of the left and right eyes, the coordinates of the nose, and the coordinates of the left and right corners of the mouth. When there is a null value in the list value in the face coordinate list, it is determined that the first type image is not a front face image; when there is no null value in the list value in the face coordinate list, it is determined that the preview image or the first type image is not a front face image. The type image is a front face image.
如此,通过上述方式,能够确保第一类型图像为正脸图像,以此提高根据第一类型图像得到的自定义美颜参数符合用户需求的概率。In this way, through the above method, it is possible to ensure that the first type of image is a front face image, thereby increasing the probability that the customized beauty parameters obtained based on the first type of image meet the user's needs.
可选地,在本申请实施例中,在提示拍摄第一类型图像之后,电子设备还可以响应于用户的图像导入操作,显示图库界面,然后,响应于用户针对图库界面中图像的选取操作,从图库中选取目标图像,再在拍摄的预览界面显示该目标图像,最后响应于用户的第二操作,获取第一类型图像。Optionally, in the embodiment of the present application, after being prompted to take the first type of image, the electronic device can also display the gallery interface in response to the user's image import operation, and then, in response to the user's selection operation of the image in the gallery interface, Select a target image from the gallery, display the target image in the shooting preview interface, and finally obtain the first type of image in response to the user's second operation.
如此,通过从图库导入已保存图像的方式获取第一类型图像,使得当用户所处的环境不适合改变人脸妆容属性(即,从素颜状态经化妆达到带妆状态,或者,从带妆状态经卸妆达到素颜状态),也能够获取自定义美颜参数,以降低获取自定义美颜参数的环境限制,提高获取自定义美颜功能的环境适应性。同时,用户可以在素颜状态或带妆状态同时拍摄多张图像,并从中选取一张最满意的图像作为第一类型图像,能够解决用户即时拍摄的照片满意度不高的问题,而且能否避免用户在获取自定义美颜参数的过程中重复获取第一类型图像,提高获取自定义美颜参数的效率。In this way, the first type of image is obtained by importing saved images from the gallery, so that when the environment where the user is located is not suitable for changing the facial makeup attributes (that is, from a state without makeup to a state with makeup, or from a state with makeup After removing makeup and reaching a bare-faced state), you can also obtain customized beauty parameters to reduce the environmental restrictions on obtaining custom beauty parameters and improve the environmental adaptability of obtaining customized beauty functions. At the same time, users can take multiple images at the same time without makeup or with makeup, and select the most satisfactory image as the first type of image. This can solve the problem of low satisfaction with the photos taken by users in real time, and can it be avoided In the process of obtaining custom beauty parameters, the user repeatedly obtains the first type of image, thereby improving the efficiency of obtaining custom beauty parameters.
需要说明的是,为了得到自定义美颜参数,需要获取素颜人脸图像和带妆人脸图像,结合实际的生活场景,任一用户的人脸妆容属性从素颜状态到带妆状态的上妆过程,或者从带妆状态到素颜状态的卸妆过程,可能需要较长的时间。在该时间段内,电子设备可能退出拍照应用程序,或者拍照应用程序处于后台运行状态,进而,可能导致获取自定义美颜参数的操作流程发生间断。因此,电子设备可以设置美颜效果采集控件包括效果采集菜单。上述效果采集菜单包括采集第一图像控件和采集第二图像控件。如果检测到在获取第一类型图像后发送的操作间断,则保存第一类型图像,并在效果采集菜单中的采集第一类型图像控件进行标记,标识已获取第一类型图像,在保存第一类型图像后,如果再次接收到对美颜效果采集控件的点击操作,则响应于对美颜效果采集控件的点击操作,显示上述效果采集菜单。并且,电子设备可以响应于用户针对采集第一类型图像控件的点击操作,重新提示拍摄第一类型图像,并响应于第二操作获取第一类型图像。电子设备还可以响应于用户针对采集第二类型图像控件的点击操作,跳转至下一步骤。It should be noted that in order to obtain custom beauty parameters, it is necessary to obtain face images without makeup and face images with makeup. Combined with actual life scenarios, any user's facial makeup attributes can be applied from the makeup state to the makeup state. The process, or the makeup removal process from the makeup-on state to the no-makeup state, may take a long time. During this period of time, the electronic device may exit the camera application, or the camera application may be running in the background, which may cause interruptions in the operation process of obtaining custom beauty parameters. Therefore, the electronic device can set the beauty effect collection control including the effect collection menu. The above effect collection menu includes a first image collection control and a second image collection control. If it is detected that the operation sent after acquiring the first type image is interrupted, save the first type image, and mark the acquisition first type image control in the effect acquisition menu to indicate that the first type image has been acquired, and save the first type image. After the image is typed, if a click operation on the beautification effect collection control is received again, the above-mentioned effect collection menu is displayed in response to the click operation on the beautification effect collection control. Furthermore, the electronic device may re-prompt to capture the first type of image in response to the user's click operation on the control for capturing the first type of image, and acquire the first type of image in response to the second operation. The electronic device can also jump to the next step in response to the user's click operation on the second type image acquisition control.
步骤403、电子设备提示用户拍摄第二类型图像,响应于用户的第三操作获取第二类型图像。Step 403: The electronic device prompts the user to take a second type of image, and acquires the second type of image in response to the user's third operation.
在本申请实施例中,提示用户拍摄第二类型图像的提示方式,与提示用户拍摄第一类型图像的提示方式类型,在此不再赘述。第二类型图像与第一类型图像包括同一人脸图像,第二类型图像和第一类型图像不同。In the embodiment of the present application, the prompting method for prompting the user to take the second type of image and the prompting method for prompting the user to take the first type of image will not be described again here. The second type of image and the first type of image include the same face image, and the second type of image is different from the first type of image.
在本申请实施例中,在第一类型图像为素颜人脸图像的情况下,第二类型图像为与第一类型图像包括同一人脸图像的带妆人脸图像;或者,在第一类型图像为带妆人脸图像的情况下,第二类型图像为与第一类型图像包括同一人脸图像的素颜人脸图像。In the embodiment of the present application, when the first type of image is a face image without makeup, the second type of image is a face image with makeup that includes the same face image as the first type of image; or, when the first type of image is In the case of a face image with makeup, the second type image is a face image without makeup that includes the same face image as the first type image.
在一种示例中,如果第一类型图像的检测结果为素颜人脸图像,则第二类型图像应该为带妆人脸图像,图像拍摄需求可以为提示请用户化妆或类似信息,如图16所示,请您为自己画上满意的妆容。In one example, if the detection result of the first type of image is a face image without makeup, the second type image should be a face image with makeup, and the image shooting requirement can be a prompt to ask the user to put on makeup or similar information, as shown in Figure 16 Please give yourself a satisfactory makeup look.
在另一种示例中,如果第一类型图像的检测结果为带妆人脸图像,则第二类型图像应该为素颜人脸图像,图像拍摄需求可以为提示请用户卸妆或类似信息。In another example, if the detection result of the first type of image is an image of a face with makeup, the second type of image should be an image of a face without makeup, and the image shooting requirement can be a prompt to ask the user to remove makeup or similar information.
在本申请实施例中,获取第一类型图像之后,如图16所示,电子设备再次显示拍摄的预览界面。电子设备在拍摄的预览界面显示提示用户拍摄第二类型图像的提示信息。并且,电子设备还可以在拍摄的预览界面显示摄像头采集到的预览图像。电子设备在拍摄的预览界面可以接收用户的第三操作,并响应于第三操作获取第二类型图像。In the embodiment of the present application, after acquiring the first type of image, as shown in Figure 16, the electronic device displays the captured preview interface again. The electronic device displays prompt information prompting the user to capture the second type of image in the shooting preview interface. Moreover, the electronic device can also display the preview image collected by the camera on the shooting preview interface. The electronic device may receive the user's third operation on the shooting preview interface, and acquire the second type of image in response to the third operation.
其中,第三操作用于获取第二类型图像。在本申请实施例中,第三操作可以是通过机械按键输入的按键触发操作(如,同时长按放大音量键和缩小音量键),可以是通过触控屏输入的预置操作或预置手势的屏幕触发操作,还可以是通过摄像头采集到的特定图像的图像识别触发操作,还可以是通过音频模块接收到的预置语音的语音触发操作,还可以其他电子设备发送的无线触发操作。Wherein, the third operation is used to obtain the second type of image. In this embodiment of the present application, the third operation may be a key-triggered operation input through a mechanical key (for example, pressing and holding the volume up key and the volume down key simultaneously), or a preset operation or preset gesture input through the touch screen. The screen trigger operation can also be an image recognition trigger operation of a specific image collected by the camera, a voice trigger operation of a preset voice received through the audio module, or a wireless trigger operation sent by other electronic devices.
可选地,在本申请实施例中,电子设备在拍摄的预览界面还可以通过界面控件或者屏幕识别手势,返回至上一步骤重新获取第一类型图像。用户可以通过显示的提示信息,区分当前的拍摄的预览界面用于获取第一类型图像,还是用于获取第二类型图像。Optionally, in this embodiment of the present application, the electronic device can also use interface controls or screen recognition gestures in the shooting preview interface to return to the previous step to reacquire the first type of image. The user can distinguish whether the current shooting preview interface is used to obtain the first type of image or the second type of image through the displayed prompt information.
示例性的,如图17中的(a)所示,用户根据如图16所示的提示信息,移动电子设备和用户之间的距离和角度,以使得在拍摄的预览界面显示目标图像。电子设备在拍摄的预览界面还显示提示信息,如,请您为自己画上满意的妆容,请拍摄带妆人脸图像,将人脸放置于人脸框内。然后,电子设备响应于用户对拍摄控件的点击操作,获取第二图像。在获取第二图像之后,电子设备可以不显示第二类型图像,直接缓存第二类型图像,并跳转至下一步骤。在获取第二类型图像之后,如图17中的(b)所示,电子设备还可以显示第二类型图像,并显示提示操作控件,该提示控件包括重拍控件和跳转至下一步骤的获取美颜参数控件。电子设备可以响应于针对重拍控件的点击操作,再次提示用户拍摄第二类型图像,如果再次接收到第三操作重新获取第二类型图像。电子设备还可以响应于针对继续控件的点击操作,跳转至下一步骤。以此重复操作方式,获取用户满意的第二图像。Exemplarily, as shown in (a) of Figure 17, the user moves the distance and angle between the electronic device and the user according to the prompt information shown in Figure 16, so that the target image is displayed on the shooting preview interface. The electronic device also displays a prompt message in the preview interface of the shooting, such as, please paint yourself a satisfactory makeup, please take a face image with makeup, and place the face in the face frame. Then, the electronic device acquires the second image in response to the user's click operation on the shooting control. After acquiring the second image, the electronic device may not display the second type image, directly cache the second type image, and jump to the next step. After acquiring the second type of image, as shown in (b) in Figure 17, the electronic device can also display the second type of image and display prompt operation controls. The prompt controls include a retake control and a jump to the next step. Get the beauty parameter control. The electronic device may prompt the user again to capture the second type image in response to the click operation on the reshoot control, and reacquire the second type image if the third operation is received again. The electronic device may also jump to the next step in response to a click on the continue control. This repeated operation method is used to obtain a second image that is satisfactory to the user.
在本申请实施例中,电子设备响应于用户的第三操作,在满足拍摄触发条件的情况下,获取第二类型图像,拍摄触发条件包括以下至少一项:第二类型图像与第一类型图像相比图像背景相似度大于第一预置阈值,第二类型图像与第一类型图像相比环境光线相似度大于第二预置阈值,第二类型图像与第一类型图像相比拍摄参数相同。其中,上述第一预置阈值和第二预置阈值,越接近100%,得到的自定义美颜参数越能够满足用户需求。第一类型图像对应的拍摄参数中的闪光灯状态,与第二类型图像对应的拍摄参数中的闪光灯状态都为关闭状态。其中,环境光线可以包括光线强度和光线颜色。In this embodiment of the present application, the electronic device responds to the user's third operation and acquires a second type of image when the shooting trigger condition is met. The shooting trigger condition includes at least one of the following: a second type image and a first type image. The image background similarity is greater than the first preset threshold, the ambient light similarity between the second type image and the first type image is greater than the second preset threshold, and the second type image has the same shooting parameters as the first type image. The closer the above-mentioned first preset threshold and the second preset threshold are to 100%, the better the obtained customized beauty parameters can meet the user's needs. The flashlight status in the shooting parameters corresponding to the first type of image and the flashlight status in the shooting parameters corresponding to the second type of image are both off. Among them, ambient light can include light intensity and light color.
进一步可选地,在本申请实施例中,在接收到用户的第三操作后,如果未满足拍摄触发条件,则电子设备再次检测是否满足拍摄触发条件,直到检测到满足拍摄触发条件获取第二类型图像。如果在接收到用户的第三操作后,且未满足拍摄触发条件的时间段内,再次接收到第三操作,则电子设备在满足拍摄触发条件后,响应一次第三操作。Further optionally, in this embodiment of the present application, after receiving the user's third operation, if the shooting trigger condition is not met, the electronic device again detects whether the shooting trigger condition is met, until it detects that the shooting trigger condition is met to obtain the second type image. If the third operation is received again after receiving the user's third operation and within the time period when the shooting trigger condition is not satisfied, the electronic device responds to a third operation after the shooting trigger condition is satisfied.
还需要说明的是,可以选取在室内灯光下进行拍摄第一类型图像和第二类型图像,以增加第二类型图像与第一类型图像相比环境光线相似度大于第二预置阈值的概率。It should also be noted that you can choose to shoot the first type of image and the second type of image under indoor light to increase the probability that the ambient light similarity between the second type of image and the first type of image is greater than the second preset threshold.
如此,通过拍摄触发条件限制第二类型图像的采集环境,削弱采集环境对第二类型图像的显示效果的影响,使得第一类型图像和第二类型图像之间的差别仅在于化妆效果,提高采用自定义美颜参数进行美颜处理后得到的图像,能够达到用户满意效果的概率。In this way, by limiting the collection environment of the second type of image through the shooting trigger condition, the impact of the collection environment on the display effect of the second type of image is weakened, so that the difference between the first type of image and the second type of image is only the makeup effect, improving the adoption of The probability that the image obtained after beautification processing with customized beautification parameters can achieve user-satisfactory results.
一般的,为了满足用户对美颜图像的个性化需求,需要获取自定义美颜参数,对自身的人脸图像进行美颜处理,自定义美颜参数一般应用于电子设备的拥有者本身,即上述用户为电子设备的拥有者。因此,电子设备可以通过人脸识别方式设置获取自定义美颜参数的权限,具体包括:对拍摄的预览界面中的人脸图像进行人脸识别,在上述人脸图像与上述用户的人脸一致的情况下,获取第一类型图像和第二类型图像。Generally, in order to meet the user's personalized needs for beautification images, it is necessary to obtain custom beautification parameters and perform beautification processing on one's own face image. The custom beautification parameters are generally applied to the owner of the electronic device, that is, The above-mentioned user is the owner of the electronic device. Therefore, the electronic device can set permissions to obtain custom beautification parameters through face recognition, which specifically includes: performing face recognition on the face image in the captured preview interface, where the above face image is consistent with the above user's face. In the case of , obtain the first type image and the second type image.
可选地,在本申请实施例中,在提示拍摄第二类型图像之后,电子设备还可以响应于用户的图像导入操作,显示图库界面,然后,电子设备响应于用户针对图库界面中图像的选取操作,从图库中选取目标图像。再者,电子设备在拍摄的预览界面显示该目标图像,最后电子设备响应于用户的第三操作,获取第二类型图像。Optionally, in this embodiment of the present application, after being prompted to take a second type of image, the electronic device may also respond to the user's image import operation by displaying the gallery interface, and then the electronic device may respond to the user's selection of an image in the gallery interface. Operation, select the target image from the gallery. Furthermore, the electronic device displays the target image in the shooting preview interface, and finally the electronic device responds to the user's third operation to acquire the second type of image.
如此,通过从图库导入已保存图像的方式,获取第二类型图像,使得当用户所处的环境不适合改变人脸妆容属性(即,从素颜状态经化妆达到带妆状态,或者,从带妆状态经卸妆达到素颜状态),也能够获取自定义美颜参数,以降低获取自定义美颜参数的环境限制,提高获取自定义美颜功能的环境适应性。同时,用户可以在素颜状态或带妆状态同时拍摄多张图像,并从中选取一张最满意的图像作为获取自定义美颜参数的第二类型图像,能够解决用户即时拍摄的照片满意度不高的问题,而且能否避免用户在获取自定义美颜参数的过程中重复获取第二类型图像,提高获取自定义美颜参数的效率。In this way, by importing saved images from the gallery, the second type of image is obtained, so that when the user's environment is not suitable for changing the facial makeup attributes (that is, from a state without makeup to a state with makeup, or from a state with makeup After removing makeup and reaching a no-makeup state), you can also obtain custom beauty parameters to reduce the environmental restrictions on obtaining custom beauty parameters and improve the environmental adaptability of obtaining custom beauty functions. At the same time, users can take multiple images at the same time without makeup or with makeup, and select the most satisfactory image from them as the second type of image to obtain customized beauty parameters, which can solve the problem of users' low satisfaction with the photos taken in real time. problem, and whether the user can be prevented from repeatedly obtaining the second type of image in the process of obtaining custom beauty parameters, and the efficiency of obtaining custom beauty parameters can be improved.
需要说明的是,电子设备可以设置美颜效果采集控件包括效果采集菜单。上述效果采集菜单包括采集第一图像控件和采集第二图像控件。如果检测到在获取第二类型图像前发送的操作间断,则电子设备保存第一类型图像,并在效果采集菜单中的采集第一类型图像控件进行标记,标识已获取第一类型图像。如果检测到在获取第二类型图像后发送的操作间断,则电子设备保存第一类型图像和第二类型图像,并在效果采集菜单中的采集第一类型图像控件进行标记,标识已获取第一类型图像,在效果采集菜单中的采集第二类型图像控件进行标记,标识已获取第二类型图像。然后,在保存第一类型图像,或第一类型图像和第二类型图像之后,如果再次接收到对美颜效果采集控件的点击操作,则电子设备响应于对美颜效果采集控件的点击操作,显示上述效果采集菜单。并且,电子设备可以响应于用户针对采集第一类型图像控件的点击操作,重新提示拍摄第一类型图像,并响应于第二操作获取第一类型图像,或者响应于用户针对采集第二类型图像控件的点击操作,重新提示拍摄第二类型图像,并响应于第三操作获取第二类型图像。It should be noted that the electronic device can set the beauty effect collection control including the effect collection menu. The above effect collection menu includes a first image collection control and a second image collection control. If it is detected that the operation interruption sent before acquiring the second type image is detected, the electronic device saves the first type image and marks the acquisition first type image control in the effect acquisition menu to indicate that the first type image has been acquired. If an interruption in the operation sent after acquiring the second type image is detected, the electronic device saves the first type image and the second type image, and marks the acquisition first type image control in the effect acquisition menu to indicate that the first type image has been acquired. Type image, mark the second type image acquisition control in the effect acquisition menu to indicate that the second type image has been acquired. Then, after saving the first type of image, or the first type of image and the second type of image, if a click operation on the beauty effect collection control is received again, the electronic device responds to the click operation on the beauty effect collection control, Displays the effects collection menu described above. Furthermore, the electronic device may respond to the user's click operation on the control for collecting the first type of image, re-prompt to capture the first type of image, and respond to the second operation to obtain the first type of image, or respond to the user on the control for capturing the second type of image. a click operation to re-prompt to capture a second type of image, and obtain a second type of image in response to the third operation.
步骤404、电子设备根据第一类型图像和第二类型图像,得到自定义美颜参数。Step 404: The electronic device obtains customized beauty parameters based on the first type of image and the second type of image.
可选地,在本申请实施例中,电子设备根据默认设置方式或者图像标识,确定素颜人脸图像(如图13所示)和带妆人脸图像(如图17中的(b)所示),再根据素颜人脸图像和带妆人脸图像的像素差异,得到自定义美颜参数。需要说明的是,获取美颜参数的实现过程,可以由图像处理芯片实现,或者由电子设备(安装具有确定美颜参数功能的应用程序的)中的处理器实现。需要说明的是,如果第一类型图像是素颜人脸图像,则第二类型图像是带妆人脸图像,相反的,如果第一类型图像是带妆人脸图像,则第二类型图像是素颜人脸图像。Optionally, in this embodiment of the present application, the electronic device determines the face image without makeup (as shown in Figure 13) and the face image with makeup (as shown in (b) of Figure 17 ), and then obtain customized beauty parameters based on the pixel difference between the face image without makeup and the face image with makeup. It should be noted that the process of obtaining the beautification parameters can be implemented by an image processing chip, or by a processor in an electronic device (installed with an application program capable of determining the beautification parameters). It should be noted that if the first type of image is a face image without makeup, then the second type image is a face image with makeup. On the contrary, if the first type image is a face image with makeup, then the second type image is a face image with no makeup. Face images.
在本申请实施例中,自定义美颜参数即为颜色查找表(Look-Up-Table,LUT),也可以称为LUT文件或者LUT参数,是一种红绿蓝(Red Green Blue,RGB)的映射表。具体的,一张图像包括很多像素,每个像素由RGB值表示。电子设备的显示屏可以根据该图像中每个像素点的RGB值来显示该图像。也就是说,这些RGB值会告诉显示屏如何发光,以混合出各种各样的色彩呈现给用户。如果想要改变该图像的色彩(或者风格、效果),则可以调整这些RGB值即可。LUT是一种RGB的映射表,用于表征调整前后的RGB值的对应关系。例如,请参考表1,其示出一种LUT的示例。In the embodiment of this application, the custom beauty parameter is a color look-up table (Look-Up-Table, LUT), which can also be called a LUT file or LUT parameter. It is a red, green, blue (Red Green Blue, RGB) mapping table. Specifically, an image includes many pixels, each pixel is represented by an RGB value. The display screen of the electronic device can display the image based on the RGB value of each pixel in the image. In other words, these RGB values will tell the display how to emit light to mix a variety of colors for the user. If you want to change the color (or style, effect) of the image, you can adjust these RGB values. LUT is an RGB mapping table, used to represent the corresponding relationship between RGB values before and after adjustment. For example, please refer to Table 1, which shows an example of a LUT.
表1Table 1
当原始RGB值为(14,22,24)时,经过表1所示的LUT的映射,输出RGB值为(6,9,4,)。当原始RGB值为(61,34,67)时,经过表1所示的LUT的映射,输出RGB值为(66,17,47)。当原始RGB值为(94,14,171)时,经过表1所示的LUT的映射,输出RGB值为(117,82,187)。当原始RGB值为(241,216,222)时,经过表1所示的LUT的映射,输出RGB值为(255,247,243)。When the original RGB value is (14,22,24), after mapping by the LUT shown in Table 1, the output RGB value is (6,9,4,). When the original RGB value is (61,34,67), after mapping by the LUT shown in Table 1, the output RGB value is (66,17,47). When the original RGB value is (94,14,171), after mapping by the LUT shown in Table 1, the output RGB value is (117,82,187). When the original RGB value is (241,216,222), after mapping by the LUT shown in Table 1, the output RGB value is (255,247,243).
需要说明的是,针对同一张图像,未采用LUT处理过的图像的显示效果与采用LUT处理过的图像的显示效果不同;采用不同的LUT处理同一张图像,可以得到不同风格的显示效果。本申请实施例中所述的图像的“显示效果”是指图像被显示屏显示后,可以被人眼观察到的图像效果。It should be noted that for the same image, the display effect of the image without LUT processing is different from the display effect of the image processed by LUT; using different LUTs to process the same image can obtain different styles of display effects. The "display effect" of an image described in the embodiments of this application refers to the image effect that can be observed by human eyes after the image is displayed on the display screen.
在本申请实施例中,由于素颜人脸图像和带妆人脸图像所包含的人脸图像高度相似,仅有色彩、亮度等效果维度的差异,因此,可以逐个像素分别提取素颜人脸图像和带妆人脸图像的人脸区域的色彩,建立像素级的映射关系,该映射关系用于表示素颜状态和带妆状态之间的差异,即,等效于自定义美颜参数。In the embodiment of the present application, since the face images contained in the face image without makeup and the face image with makeup are highly similar, with only differences in effect dimensions such as color and brightness, the face image without makeup and the face image with makeup can be extracted pixel by pixel respectively. The color of the face area of the face image with makeup establishes a pixel-level mapping relationship. This mapping relationship is used to represent the difference between the state without makeup and the state with makeup, that is, it is equivalent to a custom beauty parameter.
可选地,在本申请实施例中,电子设备可以首先检测素颜人脸图像或带妆人脸图像的人脸关键点并基于关键点将人脸分割为若干区域,然后分别提取每个区域的色彩信息,最后针对素颜人脸图像和带妆人脸图像相对应的人脸区域,建立像素级的对应关系,生成LUT,以提高得到自定义美颜参数的速度。Optionally, in the embodiment of the present application, the electronic device can first detect the key points of the face in the face image without makeup or the face image with makeup, segment the face into several regions based on the key points, and then extract the facial features of each region respectively. Color information, and finally establish a pixel-level correspondence between the face areas corresponding to the face image without makeup and the face image with makeup, and generate a LUT to increase the speed of obtaining customized beauty parameters.
进一步可选地,在本申请实施例中,依据总体实现思路:首先对第一图像和第二图像进行区域划分,然后比较每一组对应的人脸区域的像素差异,得到自定义美颜参数。如图18所示,本步骤404还可以通过如下步骤1801至步骤1802实现。Further optionally, in the embodiment of the present application, according to the overall implementation idea: first divide the first image and the second image into regions, and then compare the pixel differences of the corresponding face regions in each group to obtain the customized beauty parameters. . As shown in Figure 18, this step 404 can also be implemented through the following steps 1801 to 1802.
步骤1801、电子设备将素颜人脸图像通过预置人脸区域分割算法划分为至少一个第一人脸区域,将带妆人脸图像通过预置人脸区域分割算法划分为至少一个第二人脸区域。Step 1801. The electronic device divides the face image without makeup into at least one first face area through a preset face area segmentation algorithm, and divides the face image with makeup into at least one second face area through a preset face area segmentation algorithm. area.
步骤1802、电子设备根据第一人脸区域的区域类型,第一人脸区域,以及与第一人脸区域对应的第二人脸区域,得到自定义美颜参数。Step 1802: The electronic device obtains customized beauty parameters based on the area type of the first face area, the first face area, and the second face area corresponding to the first face area.
在本申请实施例中,素颜人脸图像为第一类型图像或第二类型图像,相对应的,带妆人脸图像为第二类型图像或第一类型图像。第一人脸区域与第二人脸区域一一对应,区域类型包括色彩均匀区域类型和色彩差异区域类型。可以理解的是,由于素颜人脸图像和带妆人脸图像,都符合人脸框的边界限定,从整体上图像的大小,人脸位置、人脸中的五官位置都较为相似,因此,根据相同的预置人脸区域分割算法划分的第一人脸区域与第二人脸区域时一一对应的。In this embodiment of the present application, the face image without makeup is a first type image or a second type image, and correspondingly, the face image with makeup is a second type image or a first type image. The first face area corresponds to the second face area one-to-one, and the area types include a uniform color area type and a color difference area type. It is understandable that since the face images without makeup and the face images with makeup both comply with the boundary limits of the face frame, the overall size of the image, the position of the face, and the position of the facial features in the face are relatively similar. Therefore, according to The first face area and the second face area divided by the same preset face area segmentation algorithm are in one-to-one correspondence.
进一步可选地,在本申请实施例中,上述步骤1801中的将素颜人脸图像通过预置人脸区域分割算法划分为至少一个第一人脸区域,具体实现方式为:根据预置样本,训练主动形状模型(Active Shape Model,ASM),其中,预置样本为具有脸部特征点标识的人脸图像;将素颜人脸图像输入训练好的ASM,获取素颜人脸图像的第一搜索特征点;根据第一搜索特征点,构建人脸区域的形状向量,得到至少一个第一人脸区域。Further optionally, in this embodiment of the present application, in the above step 1801, the plain face image is divided into at least one first face area through a preset face area segmentation algorithm. The specific implementation method is: according to the preset sample, Train the Active Shape Model (ASM), in which the preset samples are face images with facial feature point identifiers; input the plain face image into the trained ASM to obtain the first search feature of the plain face image points; construct a shape vector of the face area according to the first search feature point, and obtain at least one first face area.
在本申请实施例中,ASM是基于特征点分布模型(Point Distribution Model,PDM)提取形状的方法,在PDM中,外形相似的物体,如,人脸、手、心脏、肺部等几何形状,可以通过若干关键特征点的坐标依次串联形成一个形状向量。在ASM训练过程中,收集训练样本、标记人脸部特征点,构建形状向量、再对所有人脸图像进行归一化和对齐,为每个特征点构建局部特征,以此实现对ASM的训练。在完成训练后,即可根据训练好的ASM在素颜人脸图像的人脸中搜索特征点,得到人脸特征点的区域分割结果。如此,通过ASM得到的第一搜索特征点,构建人脸区域得到的第一人脸区域,与人脸五官的外轮廓相似度较高,与实际的化妆区域相对应,能够提高判断第一人脸区域对应的区域类型的准确度,进而提高用于对于自定义美颜参数的满意度。In the embodiment of this application, ASM is a method of extracting shapes based on the feature point distribution model (PDM). In PDM, objects with similar appearances, such as faces, hands, hearts, lungs and other geometric shapes, A shape vector can be formed by concatenating the coordinates of several key feature points in sequence. During the ASM training process, training samples are collected, facial feature points are marked, shape vectors are constructed, all face images are normalized and aligned, and local features are constructed for each feature point to achieve ASM training. . After completing the training, the trained ASM can be used to search for feature points in the face of the plain face image, and obtain the regional segmentation results of the face feature points. In this way, the first search feature point obtained by ASM and the first face area obtained by constructing the face area have a high similarity with the outer contour of the facial features and correspond to the actual makeup area, which can improve the judgment of the first person. The accuracy of the area type corresponding to the face area, thereby improving the degree of satisfaction with custom beauty parameters.
可以理解的是,与上述对素颜人脸图像的划分过程类似,上述步骤1801中的将带妆人脸图像通过预置人脸区域分割算法划分为至少一个第二人脸区域,具体包括:根据预置样本,训练ASM,其中,预置样本为具有脸部特征点标识的人脸图像;将带妆人脸图像输入训练好的ASM,获取带妆人脸图像的第一搜索特征点;根据第一搜索特征点,构建人脸区域的形状向量,得到至少一个第一人脸区域。对于带妆人脸图像对应的第二人脸区域的划分过程,在此不再赘述。It can be understood that, similar to the above-mentioned dividing process of the face image without makeup, the face image with makeup in step 1801 is divided into at least one second face area through the preset face area segmentation algorithm, specifically including: according to Preset samples to train ASM, where the preset samples are face images with facial feature point identifiers; input the face image with makeup into the trained ASM to obtain the first search feature point of the face image with makeup; according to First search for feature points, construct a shape vector of the face area, and obtain at least one first face area. The process of dividing the second face area corresponding to the face image with makeup will not be described again here.
需要说明的是,在本申请实施例中,对于人脸区域的划分方式还可以采取其他划分方法,在此不做限定。It should be noted that in the embodiment of the present application, other division methods can also be adopted for dividing the face area, which are not limited here.
如此,根据化妆效果特征,对第一人脸区域进行分类(区域类型包括色彩均匀区域类型和色彩差异区域类型),再根据不同的区域类型建立素颜人脸图像和带妆人脸图像之间的色彩映射关系,能够提高自定义美颜参数的获取效率。In this way, the first face area is classified according to the characteristics of the makeup effect (area types include uniform color area type and color difference area type), and then the relationship between the face image without makeup and the face image with makeup is established based on different area types. The color mapping relationship can improve the efficiency of obtaining customized beauty parameters.
进一步可选地,在本申请实施例中,在得到自定义美颜参数之前,电子设备还可以判断至少一个第一人脸区域中的每个第一人脸区域的区域类型。具体的,电子设备可以将图像特征中偏均匀和平滑的第一人脸区域的区域类型判断为色彩均匀区域类型。区域类型的判断方法具体包括:获取第一人脸区域的区域内像素的第一色彩分量均值,以及素颜人脸图像的图像内像素的第二色彩分量均值,其中,第一色彩分量均值包括:第一R分量平均值、第一G分量平均值和第一B分量平均值,第二色彩分量均值包括:第二R分量平均值、第二G分量平均值和第二B分量平均值;将第一色彩分量均值与第二色彩分量均值进行比较;在第一色彩分量均值与第二色彩分量均值之间的平均差异小于第三预置阈值的情况下,确定第一人脸区域的区域类型为色彩均匀类型;在第一色彩分量均值与第二色彩分量均值之间的平均差异大于或等于第三预置阈值的情况下,确定第一人脸区域的区域类型为色彩差异类型。Further optionally, in this embodiment of the present application, before obtaining the customized beautification parameters, the electronic device may also determine the area type of each first face area in the at least one first face area. Specifically, the electronic device may determine the area type of the first face area that is relatively uniform and smooth in the image features as a uniform color area type. The method for determining the area type specifically includes: obtaining the first color component mean value of the pixels in the first face area, and the second color component mean value of the pixels in the image of the plain face image, where the first color component mean value includes: The first R component average value, the first G component average value and the first B component average value, the second color component average value includes: the second R component average value, the second G component average value and the second B component average value; Compare the first color component mean value with the second color component mean value; when the average difference between the first color component mean value and the second color component mean value is less than the third preset threshold, determine the area type of the first face area It is a color uniform type; when the average difference between the first color component mean value and the second color component mean value is greater than or equal to the third preset threshold, the area type of the first face area is determined to be the color difference type.
可以理解的是,色彩均匀类型对应的人脸区域是均匀平坦的,色彩差异类型对应的人脸区域是细节纹理丰富的。示例性的,上述第三预置阈值可以设置为10%。It can be understood that the face area corresponding to the uniform color type is uniform and flat, and the face area corresponding to the color difference type is rich in detail and texture. For example, the above third preset threshold may be set to 10%.
如此,由于“色彩”是素颜人脸图像与带妆人脸图像的主要区别,因此,根据色彩分量均值判断第一人脸区域的区域类型,使得同一区域类型的像素分布特点类似,能够提高针对不同区域类型采用不同映射方式的准确度,进行提高得到自定义美颜参数的速度。In this way, since "color" is the main difference between a face image without makeup and a face image with makeup, the area type of the first face area is determined based on the mean value of the color components, so that the pixel distribution characteristics of the same area type are similar, which can improve the target Different area types use different mapping methods to improve the accuracy of obtaining customized beauty parameters.
在一种示例中,在第一人脸区域的区域类型为色彩均匀类型的情况下,电子设备根据第一人脸区域,以及与第一人脸区域对应的第二人脸区域,采用逐个像素点映射的方式,建立第一人脸区域和第二人脸区域的映射关系;在第一人脸区域的区域类型为色彩差异类型的情况下,电子设备根据第一人脸区域,以及与第一人脸区域对应的第二人脸区域,采用区域平均像素整体映射的方式,建立第一人脸区域和第二人脸区域的映射关系;电子设备将映射关系中的参数确定为自定义美颜参数。In one example, when the area type of the first face area is a uniform color type, the electronic device uses a pixel-by-pixel method based on the first face area and the second face area corresponding to the first face area. Point mapping is used to establish a mapping relationship between the first face area and the second face area; when the area type of the first face area is a color difference type, the electronic device determines the relationship between the first face area and the second face area based on the color difference type. The second face area corresponding to one face area uses a regional average pixel overall mapping method to establish a mapping relationship between the first face area and the second face area; the electronic device determines the parameters in the mapping relationship as custom beauty Color parameters.
在另一种示例中,在第一人脸区域的区域类型为色彩差异类型的情况下,以第一人脸区域中的第一像素点为起点,电子设备按照预置区域大小将第一人脸区域划分为至少一个第一矩形区域,并获取至少一个第一矩形区域中的每个第一矩形区域的像素平均值;以第二人脸区域中的第二像素点为起点,电子设备按照预置区域大小将第二人脸区域划分为至少一个第二矩形区域,并获取至少一个第二矩形区域中的每个第二矩形区域的像素平均值,第一像素点与第二像素点相对应;电子设备建立第一矩形区域的像素平均值,与第二矩形区域的像素平均值的映射关系。示例性的,预置区域大小可以设置为包含10000个像素点。In another example, when the area type of the first face area is the color difference type, taking the first pixel in the first face area as the starting point, the electronic device divides the first person into the first face area according to the preset area size. Divide the face area into at least one first rectangular area, and obtain the pixel average value of each first rectangular area in the at least one first rectangular area; taking the second pixel point in the second face area as a starting point, the electronic device follows The preset area size divides the second face area into at least one second rectangular area, and obtains the pixel average value of each second rectangular area in the at least one second rectangular area, and the first pixel point is relative to the second pixel point. Correspondingly: the electronic device establishes a mapping relationship between the average pixel value of the first rectangular area and the average pixel value of the second rectangular area. For example, the preset area size can be set to include 10,000 pixels.
需要说明的是,在上述示例中的映射关系是通过LUT实现的。在图像处理方面,LUT可以用来完成类似滤镜的效果,其原理是一种映射关系,输入颜色(r,g,b),通过LUT查找等到一个新的颜色(R,G,B),则完成了一次映射操作。LUT本质上属于独立像素点替换,让每个像素点都会对应一个新的颜色值。It should be noted that the mapping relationship in the above example is implemented through LUT. In terms of image processing, LUT can be used to achieve filter-like effects. The principle is a mapping relationship. Input a color (r, g, b), and wait until a new color (R, G, B) is found through the LUT. A mapping operation is completed. LUT is essentially an independent pixel replacement, so that each pixel corresponds to a new color value.
可以理解的是,由于素颜人脸图像和带妆人脸图像中的人脸图像内容高度相似,仅有色彩、亮度等效果维度的差异,因此,逐个像素分别提取第一人脸区域,以及与第一人脸区域对应的第二人脸区域的色彩,建立像素级映射关系,即,同一人脸的素颜状态和带妆状态之间的差异,等同于用户自定义的美颜参数。It can be understood that since the content of the face image in the face image without makeup and the face image with makeup are highly similar, with only differences in effect dimensions such as color and brightness, the first face area is extracted pixel by pixel, and the first face area is extracted pixel by pixel. The color of the second face area corresponding to the first face area establishes a pixel-level mapping relationship, that is, the difference between the bare makeup state and the makeup state of the same face is equivalent to the user-defined beauty parameters.
示例性的,选取至少一个第一人脸区域中包含眼部区域的目标第一人脸区域,以及与目标第一人脸区域对应的目标第二人脸区域,提取目标第一人脸区域中目标像素点的像素值(r,g,b)作为原始值1,并提取与该目标像素点对应的目标第二人脸区域中相对像素点的像素值(R,G,B)作为输出值1,以此类推,获取眼部区域完整的原始值和输出值,将全部信息存贮为表示颜色映射关系的LUT,该LUT即是用户的自定义眼部区域美颜参数。当摄像头捕捉到的人脸图像中包括眼部区域时,将LUT应用在当前捕捉到的人脸图像的眼部区域,根据查找表的对应关系建立映射,达到美化后的眼部区域效果。Exemplarily, select at least one target first face area including the eye area in the first face area, and a target second face area corresponding to the target first face area, and extract the target first face area The pixel value (r, g, b) of the target pixel point is used as the original value 1, and the pixel value (R, G, B) of the relative pixel point in the target second face area corresponding to the target pixel point is extracted as the output value 1. By analogy, obtain the complete original value and output value of the eye area, and store all the information as a LUT representing the color mapping relationship. This LUT is the user's customized eye area beauty parameter. When the face image captured by the camera includes the eye area, the LUT is applied to the eye area of the currently captured face image, and mapping is established based on the corresponding relationship in the lookup table to achieve a beautified eye area effect.
如此,根据不同的区域类型,采用不同映射方式确定自定义美颜参数,能够提高得到自定义美颜参数的速度。In this way, using different mapping methods to determine the custom beauty parameters according to different area types can increase the speed of obtaining the custom beauty parameters.
可选地,在本申请实施例中,在得到自定义美颜参数之后,电子设备可以检测是否存在已存的自定义美颜参数,如果不存在则直接保存该自定义美颜参数,如果存在则显示提示控件,用于提示用户选取替换已存的自定义美颜参数,或者增加数据项保存该自定义美颜参数。电子设备响应于用户对提示控件的选取保存方式操作指令,根据对应的保存方式保存自定义美颜参数。如此,可以保存多个自定义美颜参数,以满足用户对自定义美颜参数多样化的需求。可以理解的是,为了平衡系统资源与用户需求,可以设置自定义美颜参数的存储数量,一旦达到存储上限,则不能采用新增方式保存自定义美颜参数。Optionally, in this embodiment of the present application, after obtaining the custom beauty parameters, the electronic device can detect whether there are existing custom beauty parameters, and if they do not exist, directly save the custom beauty parameters. If they exist, A prompt control is displayed to prompt the user to choose to replace the saved custom beauty parameters, or to add a data item to save the custom beauty parameters. The electronic device responds to the user's operation instruction of selecting a saving mode on the prompt control and saves the customized beauty parameters according to the corresponding saving mode. In this way, multiple customized beauty parameters can be saved to meet the user's diverse needs for customized beauty parameters. It is understandable that in order to balance system resources and user needs, the storage quantity of custom beauty parameters can be set. Once the storage limit is reached, the new method cannot be used to save custom beauty parameters.
在本申请实施例中,由于用户对美颜处理的要求不同,用户自身的日常装扮不同,因此,第一类型图像可以为素颜人脸图像、带妆人脸图像或仿妆人脸图像。第二类型图像可以为素颜人脸图像、带妆人脸图像或仿妆人脸图像中与第一类型图像不相同的图像。假设第一类型图像为素颜人脸图像,第二类型图像为带妆人脸图像,那么根据自定义美颜参数处理素颜人脸图像,能够得到带妆人脸图像。假设第一类型图像为素颜人脸图像,第二类型图像为仿妆人脸图像,那么根据自定义美颜参数处理素颜人脸图像得到仿妆人脸图像。假设第一类型图像为带妆人脸图像,第二类型图像为仿妆人脸图像,那么根据自定义美颜参数处理带妆人脸图像得到仿妆人脸图像。In this embodiment of the present application, since users have different requirements for beauty processing and the users themselves have different daily attires, the first type of image may be a face image without makeup, a face image with makeup, or a face image with imitation makeup. The second type of image may be an image of a face without makeup, a face with makeup, or a face with imitation makeup that is different from the first type of image. Assuming that the first type of image is a face image without makeup, and the image of the second type is a face image with makeup, then the face image with makeup can be obtained by processing the face image without makeup according to the custom beauty parameters. Assume that the first type of image is a face image without makeup, and the image of the second type is a face image with fake makeup, then the face image without makeup is processed according to the custom beauty parameters to obtain a face image with fake makeup. Assume that the first type of image is a face image with makeup, and the second type of image is an image of a face with imitation makeup, then the face image with makeup is processed according to the custom beauty parameters to obtain an image of a face with imitation makeup.
本申请提供的获取美颜参数的方法,依次响应于第一操作、第二操作和第三操作,得到自定义美颜参数,无需根据美颜效果对美颜参数进行反复调试,操作步骤简单,耗时较短。由于带妆人脸图像可以理解为用户期望达到的美颜效果,因此,对于日常拍摄的人脸图像,采用自定义美颜参数进行美颜处理后得到的美颜图像,能够达到用户满意的美颜效果。The method for obtaining beautification parameters provided by this application sequentially responds to the first operation, the second operation and the third operation to obtain customized beautification parameters. There is no need to repeatedly debug the beautification parameters according to the beautification effect. The operation steps are simple. It takes less time. Since the face image with makeup can be understood as the beautification effect that the user expects to achieve, for the face images taken daily, the beautification image obtained after beautification processing using custom beautification parameters can achieve the beauty that the user is satisfied with. Color effect.
可选地,本申请实施例提供的一种获取美颜参数的方法,在美颜处理过程中应用自定义美颜参数,电子设备可以:从图库中获取已得到图像,响应于用户对已得到图像的美颜操作,得到根据自定义美颜参数处理已得到图像得到的美颜图像。Optionally, the embodiment of the present application provides a method for obtaining beautification parameters. In the process of applying customized beautification parameters, the electronic device can: obtain the obtained image from the gallery, and respond to the user's request for the obtained image. The beautification operation of the image is to obtain a beautified image obtained by processing the obtained image according to the custom beautification parameters.
如此,使得自定义美颜参数可以应用于已拍摄图像,扩大自定义美颜参数的应用范围,提供自定义美颜参数的利用率。In this way, the custom beauty parameters can be applied to the captured images, expanding the application scope of the custom beauty parameters and improving the utilization rate of the custom beauty parameters.
可选地,本申请实施例提供的一种获取美颜参数的方法,在美颜处理过程中应用自定义美颜参数,电子设备还可以:采集第一图像,根据自定义美颜参数处理第一图像得到第二图像。Optionally, the embodiments of the present application provide a method for obtaining beautification parameters. Custom beautification parameters are applied during the beautification process. The electronic device can also: collect the first image, and process the second image according to the custom beautification parameters. One image gets a second image.
应理解,在摄像头采集到第一图像后,响应于用户针对第一图像的图像获取操作,得到第二图像,第二图像为根据自定义美颜参数处理第一图像得到的图像。得到的第二图像可以直接保存,或应用。It should be understood that after the camera collects the first image, a second image is obtained in response to the user's image acquisition operation for the first image, and the second image is an image obtained by processing the first image according to the custom beautification parameters. The resulting second image can be saved directly, or applied.
如此,通过得到第二图像的过程中,对采集到的第一图像进行美颜处理,即根据自定义美颜参数处理第一图像,提高响应用户操作显示第一图像的速度。In this way, in the process of obtaining the second image, beautification processing is performed on the collected first image, that is, the first image is processed according to the customized beautification parameters, thereby improving the speed of displaying the first image in response to user operations.
进一步可选地,本申请实施例提供的一种获取美颜参数的方法,在美颜处理过程中应用自定义美颜参数,在得到第二图像之前,电子设备还可以:在拍摄的预览界面,显示第二图像。Further optionally, the embodiments of the present application provide a method for obtaining beautification parameters. Custom beautification parameters are applied during the beautification process. Before obtaining the second image, the electronic device can also: In the preview interface of the shooting , display the second image.
如此,通过拍摄的预览界面显示第二图像,即,显示根据自定义美颜参数处理第一图像得到的第二图像,用户通过预览界面能够即时观察到美颜效果图像(第二图像),以提高用户的拍摄速度,进而节约系统资源。In this way, the second image is displayed through the captured preview interface, that is, the second image obtained by processing the first image according to the customized beautification parameters is displayed. The user can instantly observe the beautification effect image (second image) through the preview interface, so as to Improve the user's shooting speed, thereby saving system resources.
进一步可选地,本申请实施例提供的一种获取美颜参数的方法,在美颜处理过程中应用自定义美颜参数,在得到第二图像之前,电子设备还可以:在拍摄的预览界面,显示第一图像,在拍摄的预览界面包括自定义美颜应用控件,然后响应于用户针对自定义美颜应用控件的第四操作,在拍摄的预览界面显示第二图像,其中,第四操作用于触发开启美颜效果。Further optionally, the embodiments of the present application provide a method for obtaining beautification parameters. Custom beautification parameters are applied during the beautification process. Before obtaining the second image, the electronic device can also: In the preview interface of the shooting , display the first image, include the custom beauty application control in the captured preview interface, and then display the second image in the captured preview interface in response to the user's fourth operation for the custom beauty application control, wherein the fourth operation Used to trigger the beauty effect.
在本申请实施例中,第四操作可以是通过机械按键输入的按键触发操作(如,同时长按放大音量键和缩小音量键),可以是通过触控屏输入的预置操作或预置手势的屏幕触发操作,还可以是通过摄像头采集到的特定图像的图像识别触发操作,还可以是通过音频模块接收到的预置语音的语音触发操作,还可以其他电子设备发送的无线触发操作。In this embodiment of the present application, the fourth operation may be a key-triggered operation input through a mechanical key (for example, pressing and holding the volume up key and the volume down key at the same time), or a preset operation or preset gesture input through the touch screen. The screen trigger operation can also be an image recognition trigger operation of a specific image collected by the camera, a voice trigger operation of a preset voice received through the audio module, or a wireless trigger operation sent by other electronic devices.
在本申请实施例中,第一图像中的人脸图像,与第一类型图像或第二类型图像中包含的人脸图像为同一人脸图像。假设电子设备的摄像头采集到的图像如图19中(a)所示的第一图像,根据自定义美颜参数处理第一图像处理得到如图19中(b)所示的第二图像。In this embodiment of the present application, the face image in the first image and the face image included in the first type image or the second type image are the same face image. Assume that the image collected by the camera of the electronic device is the first image shown in (a) in Figure 19, and the first image is processed according to the custom beauty parameters to obtain the second image shown in (b) in Figure 19.
需要说明的是,在得到自定义美颜参数之后,电子设备可以默认将效果选取界面中的“自定义美颜效果”控件其右侧的开关调整为开启状态,在拍摄的预览界面,显示根据自定义美颜参数处理第三图像得到的第二图像。It should be noted that after obtaining the customized beauty parameters, the electronic device can adjust the switch on the right side of the "custom beauty effect" control in the effect selection interface to the on state by default. In the preview interface of the shooting, the display according to The second image obtained by processing the third image with customized beauty parameters.
还需要说明的是,在得到自定义美颜参数之后,电子设备可以默认将效果选取界面中的“自定义美颜效果”控件其右侧的开关调整为关闭状态。电子设备在拍摄的预览界面显示采集的第一图像;电子设备响应于用户的第四操作,显示根据自定义美颜参数处理第一图像得到的第二图像;其中,第四操作用于触发开启美颜效果。It should also be noted that after obtaining the custom beautification parameters, the electronic device can adjust the switch on the right side of the "custom beautification effect" control in the effect selection interface to the off state by default. The electronic device displays the collected first image in the shooting preview interface; the electronic device responds to the user's fourth operation and displays the second image obtained by processing the first image according to the custom beauty parameters; wherein the fourth operation is used to trigger the opening Beauty effect.
如此,通过响应于用户针对自定义美颜应用控件的第四操作,在拍摄预览界面显示第二图像,使得用户能够根据即时需求选取显示无美颜的第一图像,还是根据自定义美颜参数处理第一图像后的第二图像,以满足用户对拍摄的预览界面显示的多样化需求。用户通过预览界面能够即时观察到美颜效果图像(第二图像),以提高用户的拍摄速度,进而节约系统资源,如电量、剩余可用按压次数、系统进程数量等。In this way, by responding to the user's fourth operation on the custom beautification application control, the second image is displayed on the shooting preview interface, so that the user can choose to display the first image without beautification or display the first image according to the custom beautification parameters according to immediate needs. The second image after the first image is processed to meet the user's diverse needs for display of the preview interface of the shot. Users can instantly observe the beautification effect image (second image) through the preview interface to increase the user's shooting speed and thereby save system resources, such as power, number of remaining available presses, number of system processes, etc.
进一步可选地,本申请实施例提供的一种获取美颜参数的方法,还包括:电子设备发出美颜提示信息,美颜提示信息用于提示第二图像为根据自定义美颜参数处理第一图像得到的图像。Further optionally, the method for obtaining beautification parameters provided by the embodiment of the present application further includes: the electronic device sends out beautification prompt information, and the beautification prompt information is used to prompt that the second image is processed according to the customized beautification parameters. An image is obtained from the image.
其中,美颜提示信息可以为文字提示信息、图像提示信息或者语音提示信息。应理解,与其他提示信息类似,美颜提示信息可以是文字信息、图形信息或声音信息,以显示屏或者声筒为载体发出,如,显示美颜提示信息或播放美颜提示信息。Among them, the beauty prompt information can be text prompt information, image prompt information or voice prompt information. It should be understood that, similar to other prompt information, the beauty prompt information can be text information, graphic information or sound information, and is sent using a display screen or a speaker as a carrier, for example, displaying the beauty prompt information or playing the beauty prompt information.
示例性的,如图20所示,在拍摄的预览界面,显示第二图像的同时,在第二图像的顶部显示“已美颜”的美颜提示信息。For example, as shown in Figure 20, in the preview interface of shooting, while the second image is displayed, the beautification prompt information of "beautiful" is displayed at the top of the second image.
如此,通过发出美颜提示信息,提示第二图像是经过美颜处理后的美颜图像,以便于用户确定是否对第二图像进行再处理。In this way, by issuing the beautification prompt information, it is prompted that the second image is a beautify image after beautification processing, so that the user can determine whether to reprocess the second image.
进一步可选地,在本申请实施例中,在显示第二图像之后,本申请实施例提供的一种获取美颜参数的方法,还包括:电子设备响应于对第二图像的第五操作,显示图像编辑界面,图像编辑界面包括一个或多个控件,一个或多个控件用于编辑第二图像。通过图像编辑界面中的一个或多个控件,可对第二图像进行再处理,以满足用户对图像的多样化编辑需求。Further optionally, in the embodiment of the present application, after displaying the second image, a method for obtaining beautification parameters provided by the embodiment of the present application further includes: the electronic device responds to the fifth operation on the second image, Display an image editing interface, the image editing interface includes one or more controls, and the one or more controls are used to edit the second image. Through one or more controls in the image editing interface, the second image can be reprocessed to meet the user's diverse editing needs for images.
在本申请实施例中,一个或多个控件可以用于调节第四图像的色调、环境增强、虚化、旋转、裁剪、拍摄参数、滤镜、抠图、涂鸦、添加马赛克、添加特效和文字等。In the embodiment of the present application, one or more controls can be used to adjust the hue, environment enhancement, blur, rotation, cropping, shooting parameters, filters, cutout, graffiti, adding mosaic, adding special effects and text of the fourth image. wait.
其中,第五操作用于编辑第二图像。在本申请实施例中,第五操作可以是通过机械按键输入的按键触发操作(如,同时长按放大音量键和缩小音量键),可以是通过触控屏输入的预置操作或预置手势的屏幕触发操作,还可以是通过摄像头采集到的特定图像的图像识别触发操作,还可以是通过音频模块接收到的预置语音的语音触发操作,还可以其他电子设备发送的无线触发操作。Wherein, the fifth operation is used to edit the second image. In this embodiment of the present application, the fifth operation may be a key-triggered operation input through a mechanical key (for example, pressing and holding the volume up key and the volume down key at the same time), or a preset operation or preset gesture input through the touch screen. The screen trigger operation can also be an image recognition trigger operation of a specific image collected by the camera, a voice trigger operation of a preset voice received through the audio module, or a wireless trigger operation sent by other electronic devices.
在一些实施例中,如图21中的(a)所示,图像编辑界面可以是在拍摄的预览界面的基础上,显示一个或多个控件构成的。一个或多个控件包括色调控件、环境增强控件、虚化控件等等。In some embodiments, as shown in (a) of Figure 21 , the image editing interface may be formed by displaying one or more controls based on the captured preview interface. The one or more controls include tint controls, environment enhancement controls, blur controls, and so on.
在另一些实施例中,如图21中的(b)所示,图像编辑界面是获取第二图像后,显示第二图像,以及一个或多个控件构成的。一个或多个控件包括色调控件、环境增强控件、虚化控件等等。In other embodiments, as shown in (b) of Figure 21 , the image editing interface is composed of acquiring the second image, displaying the second image, and one or more controls. The one or more controls include tint controls, environment enhancement controls, blur controls, and so on.
需要说明的是,一个或多个控件包括美颜程度控制条,美颜程度控制条用于调整采用自定义美颜参数对第二图像进行美颜处理的力度,在显示图像编辑界面之后,本申请实施例提供的一种获取美颜参数的方法,还包括:电子设备响应于用户对美颜程度控制条的调整操作,显示第三图像;其中,第三图像是按照调整后的美颜程度控制条对应的美颜处理的力度,根据自定义美颜参数处理第二图像得到的图像。It should be noted that one or more controls include a beautification degree control bar. The beautification degree control bar is used to adjust the intensity of the beautification processing of the second image using customized beautification parameters. After the image editing interface is displayed, this A method for obtaining beautification parameters provided in an embodiment of the application further includes: the electronic device displays a third image in response to the user's adjustment operation on the beautification degree control bar; wherein the third image is based on the adjusted beautification degree. The intensity of the beautification processing corresponding to the control bar is used to process the second image according to the custom beautification parameters.
示例性的,通过拖动操作或点击操作,更改如图22所示的美颜程度控制条的标记位置,能够改变美颜处理力度。以嘴唇颜色为例,素颜人脸图像中嘴唇颜色为浅粉色,经过带妆人脸图像中嘴唇颜色为大红色,即采集的第一图像中嘴唇颜色为浅粉色,而第二图像中的嘴唇颜色为大红色。由于大红色的色彩比较突出,可能与第二图像中的头发颜色不匹配,可以接收用户对美颜程度控制条的调整操作,将标记位置调整至中间位置,即,将美颜程度控制条对应的美颜处理的力度为50%。假设第一图像中嘴唇对应的像素点的RGB为(255,192,203),第二图像中嘴唇对应的像素点的RGB为(255,0,0),那么第三图像中嘴唇对应的像素点的RGB为(255,96,101)。For example, by changing the mark position of the beautification degree control bar as shown in Figure 22 through a drag operation or a click operation, the intensity of the beautification processing can be changed. Take the color of lips as an example. In the face image without makeup, the color of the lips is light pink. In the image of the face with makeup, the color of the lips is bright red. That is, the color of the lips in the first image collected is light pink, and the color of the lips in the second image is light pink. The color is bright red. Since the bright red color is more prominent and may not match the hair color in the second image, you can accept the user's adjustment operation on the beauty degree control bar and adjust the mark position to the middle position, that is, adjust the beauty degree control bar to the corresponding The strength of the beauty treatment is 50%. Assume that the RGB of the pixels corresponding to the lips in the first image is (255,192,203), and the RGB of the pixels corresponding to the lips in the second image is (255,0,0), then the RGB of the pixels corresponding to the lips in the third image is (255,96,101).
如此,通过对美颜程度控制条的调整操作,调整自定义美颜参数的实施力度,以提高编辑后的第三图像符合多样化编辑需求的概率。In this way, by adjusting the beautification degree control bar, the implementation intensity of the customized beautification parameters is adjusted to increase the probability that the edited third image meets diverse editing needs.
在一种示例中,如果第二图像为在拍摄的预览界面显示的图像,那么在图像编辑界面响应于用户的操作,显示第三图像之后,电子设备可以在拍摄的预览界面显示第三图像,或者得到第三图像。In one example, if the second image is an image displayed on the photographed preview interface, then after the image editing interface displays the third image in response to the user's operation, the electronic device may display the third image on the photographed preview interface, Or get a third image.
在另一种示例中,如果第二图像为已得到图像,那么在图像编辑界面响应于用户的操作,显示第三图像之后,电子设备可以得到第三图像。In another example, if the second image is an obtained image, the electronic device may obtain the third image after the image editing interface displays the third image in response to the user's operation.
如此,通过图像编辑界面中的编辑效果控件,能够对第二图像进行再处理,以满足用户对图像效果的多样化编辑需求。In this way, through the editing effect control in the image editing interface, the second image can be reprocessed to meet the user's diverse editing needs for image effects.
进一步可选地,在本申请实施例中,电子设备可以设置第一图像为前置摄像头采集的图像。在用户启动前置摄像头的情况下,电子设备设置自动应用自定义美颜参数对捕捉到的预览图像进行美颜处理。该预览图像包括第一类型图像或第二类型图像中的人脸图像。Further optionally, in this embodiment of the present application, the electronic device may set the first image to be an image collected by a front-facing camera. When the user activates the front-facing camera, the electronic device is set to automatically apply custom beautification parameters to the captured preview image for beautification processing. The preview image includes a face image in the first type image or the second type image.
进一步可选地,在本申请实施例中,电子设备还可以设置第一图像为后置摄像头采集的图像。由于后置摄像头通常用于拍摄景物或者群像,因此,在用户启动后置摄像头的情况下,电子设备设置根据用户操作,选择是否应用自定义美颜参数对捕捉到的预览图像进行美颜处理,该预览图像中包括人脸图像。可以理解的是,为了保证自定义美颜参数与人脸图像的适应性,电子设备还可以设置获取预览图像中的目标部分图像,对目标部分图像根据自定义美颜参数进行美颜处理,目标部分图像是指预览图像中包括第一类型图像或第二类型图像中的人脸图像的部分图像。Further optionally, in this embodiment of the present application, the electronic device may also set the first image to be an image collected by the rear camera. Since the rear camera is usually used to capture scenery or group portraits, when the user activates the rear camera, the electronic device settings select whether to apply custom beautification parameters to the captured preview image for beautification processing based on user operations. This preview image includes an image of a human face. It is understandable that in order to ensure the adaptability of the custom beautification parameters and the face image, the electronic device can also be set to obtain the target part of the image in the preview image, and perform beautification processing on the target part of the image according to the custom beautification parameters. The target A partial image refers to a partial image in the preview image including a face image in the first type image or the second type image.
可选地,在本申请实施例中,如图23所示,上述步骤404还可以通过下述步骤2301和步骤2302实现。Optionally, in this embodiment of the present application, as shown in Figure 23, the above step 404 can also be implemented through the following steps 2301 and 2302.
步骤2301、在检测到第一类型图像和第二类型图像需要进行去瑕处理的情况下,电子设备根据预置去瑕算法,对第一类型图像和第二类型图像进行去瑕处理,更新第一类型图像和第二类型图像。Step 2301: When it is detected that the first type of image and the second type of image need to be de-defected, the electronic device performs de-defect processing on the first type of image and the second type of image according to the preset de-defecting algorithm, and updates the second type of image. One type of image and a second type of image.
步骤2302、电子设备对比更新后的第一类型图像和第二类型图像的像素差异,得到自定义美颜参数。Step 2302: The electronic device compares the pixel differences between the updated first type image and the second type image to obtain customized beauty parameters.
示例性的,以第一类型图像为例,电子设备可以通过将第一类型图像划分为皮肤区和五官区,然后,确定第一类型图像的皮肤区中是否存在瑕疵以及瑕疵位置,最后,根据瑕疵位置进行去瑕处理。Illustratively, taking the first type of image as an example, the electronic device can divide the first type of image into a skin area and a facial features area, and then determine whether there are flaws and the location of the flaws in the skin area of the first type of image. Finally, according to Remove blemishes at defective locations.
需要说明的是,对第二类型图像进行去瑕处理的方法,与对第一类型图像进行去瑕处理的方法类似,电子设备可以采用划分皮肤区,确定第二类型图像的皮肤区中是否存在瑕疵以及瑕疵位置,最后,根据瑕疵位置进行去瑕处理。It should be noted that the method of removing defects on the second type of image is similar to the method of removing defects on the first type of image. The electronic device can divide the skin area to determine whether there are any defects in the skin area of the second type of image. Defects and defect locations, and finally, remove defects based on the location of the defects.
可理解的是,对第二类型图像进行去瑕处理的方法,电子设备可以为在确定第一类型图像的皮肤区域中是否存在瑕疵以及瑕疵位置之后,根据第一类型图像的皮肤区域的瑕疵位置,判断第二类型图像的对应位置是否存在瑕疵,如果存在则进行去瑕处理。It can be understood that, as a method for removing defects on the second type image, the electronic device may be: after determining whether there are defects and the location of the defects in the skin area of the first type image, based on the location of the defects in the skin area of the first type image , determine whether there are flaws in the corresponding position of the second type image, and if so, perform flaw removal processing.
进一步可选地,在本申请实施例中,电子设备能够检测到的瑕疵可能是痘印、痣、皱纹等实际的瑕疵皮肤,也可能化妆呈现的效果,因此,为了获取用户实际的去瑕处理意图,可以设置在获取第一类型图像和第二类型图像之后,响应于用户输入的去瑕选择操作,确定是否进行去瑕处理,然后检测第一类型图像和第二类型图像是否需要进行去瑕处理。Further optionally, in the embodiment of the present application, the flaws that can be detected by the electronic device may be actual blemishes such as acne marks, moles, wrinkles, etc., or they may also be the effects of makeup. Therefore, in order to obtain the user's actual blemish removal treatment The intention can be set to determine whether to perform the flaw removal process in response to the user input of the flaw removal selection operation after acquiring the first type image and the second type image, and then detect whether the first type image and the second type image need to be flaw removal. deal with.
可以理解的是,对于选择是否进行去瑕处理,电子设备还可以设置记录用户输入的去瑕选择操作指令,以此作为默认处理方式,以减少得到自定义美颜参数所需的必要步骤,得到自定义美颜参数的效率。或者,对于选择是否进行去瑕处理,还可以设置默认处理方式(可以为进行去瑕处理或不进行去瑕处理),如果后续接收到用户的去瑕选择操作,则记录用户的去瑕选择操作,以此作为默认处理方式。It is understandable that for selecting whether to perform blemish removal processing, the electronic device can also be set to record the blemish removal selection operation instructions input by the user as the default processing method to reduce the necessary steps required to obtain customized beauty parameters, and obtain The efficiency of customizing beauty parameters. Or, for choosing whether to perform the defect removal process, you can also set a default processing method (which can be to perform the defect removal process or not to perform the defect removal process). If the user's defect removal selection operation is subsequently received, the user's defect removal selection operation is recorded. , as the default processing method.
本申请实施例提供了一种电子设备,该电子设备可以包括:一个或多个摄像头、一个处理器、显示屏、存储器和通信模块;摄像头、显示屏、存储器、通信模块和处理器耦合;其中,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当计算机指令被电子设备执行时,使得电子设备执行如第一方面中任一项的获取美颜参数的方法。当处理器执行计算机指令时,电子设备可执行上述方法实施例中的各个功能或者步骤。该电子设备的结构可以参考图2所示的电子设备200的结构。Embodiments of the present application provide an electronic device, which may include: one or more cameras, a processor, a display screen, a memory, and a communication module; the camera, the display screen, a memory, a communication module, and a processor coupled; wherein , the memory is used to store computer program code. The computer program code includes computer instructions. When the computer instructions are executed by the electronic device, the electronic device performs the method of obtaining beauty parameters according to any one of the first aspects. When the processor executes computer instructions, the electronic device may perform various functions or steps in the above method embodiments. The structure of the electronic device may refer to the structure of the electronic device 200 shown in FIG. 2 .
本申请实施例还提供一种计算机存储介质,该计算机存储介质包括计算机指令,当所述计算机指令在电子设备上运行时,使得该电子设备执行上述方法实施例中的各个功能或者步骤。Embodiments of the present application also provide a computer storage medium that includes computer instructions. When the computer instructions are run on an electronic device, the electronic device causes the electronic device to perform each function or step in the above method embodiment.
本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行上述方法实施例中的各个功能或者步骤。An embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, it causes the computer to perform each function or step in the above method embodiment.
本申请实施例还提供一种芯片,该芯片包括处理器和通信接口,通信接口用于与芯片之前的通信模块通信,处理器用于运行计算机程序或指令,以实现执行上述方法实施例中的各个功能或者步骤。An embodiment of the present application also provides a chip. The chip includes a processor and a communication interface. The communication interface is used to communicate with the communication module in front of the chip. The processor is used to run computer programs or instructions to implement each of the above method embodiments. function or step.
通过以上实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In practical applications, the above functions can be allocated according to needs. Different functional modules are completed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, for example, multiple units or components may be The combination can either be integrated into another device, or some features can be omitted, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated. The components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed to multiple different places. . Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application are essentially or contribute to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium , including several instructions to cause a device (which can be a microcontroller, a chip, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage media include: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes.
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above contents are only specific implementation modes of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be covered by the protection scope of the present application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210577515.2ACN117201954A (en) | 2022-05-25 | 2022-05-25 | Method, device, electronic equipment and medium for acquiring beauty parameters |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210577515.2ACN117201954A (en) | 2022-05-25 | 2022-05-25 | Method, device, electronic equipment and medium for acquiring beauty parameters |
| Publication Number | Publication Date |
|---|---|
| CN117201954Atrue CN117201954A (en) | 2023-12-08 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210577515.2APendingCN117201954A (en) | 2022-05-25 | 2022-05-25 | Method, device, electronic equipment and medium for acquiring beauty parameters |
| Country | Link |
|---|---|
| CN (1) | CN117201954A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120166234A (en)* | 2024-07-24 | 2025-06-17 | 南京隶美呈科技有限公司 | User interaction interface image uniform value acquisition system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120166234A (en)* | 2024-07-24 | 2025-06-17 | 南京隶美呈科技有限公司 | User interaction interface image uniform value acquisition system |
| Publication | Publication Date | Title |
|---|---|---|
| US11443462B2 (en) | Method and apparatus for generating cartoon face image, and computer storage medium | |
| CN113129312B (en) | Image processing method, device and equipment | |
| US10783353B2 (en) | Method for detecting skin region and apparatus for detecting skin region | |
| US11696018B2 (en) | Method for displaying image in photographing scenario and electronic device | |
| CN109961453B (en) | An image processing method, device and equipment | |
| US10438329B2 (en) | Image processing method and image processing apparatus | |
| CN112328130B (en) | Display processing method and electronic device | |
| CN109191410B (en) | Face image fusion method and device and storage medium | |
| CN111327814A (en) | An image processing method and electronic device | |
| CN112262563B (en) | Image processing method and electronic device | |
| CN108234882B (en) | Image blurring method and mobile terminal | |
| EP4109879A1 (en) | Image color retention method and device | |
| CN108712603A (en) | A kind of image processing method and mobile terminal | |
| CN102262521A (en) | Image processing apparatus, method, and storage medium storing a program | |
| CN107369142A (en) | Image processing method and device | |
| CN114758037A (en) | Image generation method, device, terminal device and storage medium | |
| CN115294363A (en) | Picture processing method, related device, equipment and storage medium | |
| CN117201954A (en) | Method, device, electronic equipment and medium for acquiring beauty parameters | |
| CN111611771B (en) | Font file processing method, electronic device and readable storage medium | |
| CN107563353A (en) | A kind of image processing method, device and mobile terminal | |
| CN116320721A (en) | Shooting method, shooting device, terminal and storage medium | |
| CN113763517B (en) | Facial expression editing method and electronic device | |
| HK40040461A (en) | Photographing method and apparatus, terminal and storage medium | |
| HK40040461B (en) | Photographing method and apparatus, terminal and storage medium | |
| CN118505877A (en) | Model dyeing processing method and device, electronic equipment and storage medium |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |