Image processing method and device, electronic equipment and storage medium
By automatically determining the beauty mode and intensity in the terminal display interface and performing image processing based on user parameters, the problem of complex user operation in the existing technology is solved, and the automation and accuracy of beauty processing are achieved.
Patent Information
- Application Number
- CN202410330518.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-21
- Publication Date
- 2025-09-23
AI Technical Summary
The image processing method in the prior art requires manual adjustment of the beauty function, which makes the user operation complicated.
By responding to the activation signal of the beautification function and the detection of the target face in the display interface of the terminal, the beautification mode and beautification intensity are automatically determined, and the beautification processing is performed based on the user parameters corresponding to the target face.
It realizes automatic and accurate acquisition of beauty mode and intensity, simplifies user operation and avoids the complexity of manual adjustment.
Smart Images

Figure CN120689244A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to an image processing method, device, electronic device, and storage medium. Background Art
[0002] Currently, when shooting or editing photos, especially selfies, faces in images often need to beautify, for example, by brightening eyes, smoothing skin, or whitening them. Related image processing methods often require manual adjustment of the beauty function, which complicates user operation. Summary of the Invention
[0003] The present disclosure provides an image processing method, apparatus, electronic device, computer-readable storage medium, and computer program product to at least address the problem that most related technologies require manual adjustment of beauty functions, resulting in complex user operations. The technical solutions of the present disclosure are as follows:
[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an image processing method, comprising: in a display interface of a terminal, in response to detecting a start signal of a beautification function, starting the beautification function; in response to detecting the presence of a target face in the display interface of the terminal, starting beautification processing, wherein the beautification processing comprises determining a beautification mode of the target face and a beautification intensity of the target face, wherein the beautification mode of the target face and / or the beautification intensity of the target face are determined based on parameters of a user corresponding to the target face.
[0005] In one embodiment of the present disclosure, the initiating beautification processing includes: determining the beautification intensity of the target face based on the age of the user corresponding to the target face.
[0006] In one embodiment of the present disclosure, determining the beautification strength of the target face based on the age of the user corresponding to the target face includes: obtaining N target beauty categories of the beauty mode of the target face; and determining the beauty strength of the target face under the i-th target beauty category based on the age of the user corresponding to the target face and the i-th target beauty category, where N is a positive integer and i is a positive integer not greater than N.
[0007] In one embodiment of the present disclosure, determining the beauty intensity of the target face under the i-th target beauty category based on the age of the user corresponding to the target face and the i-th target beauty category includes: identifying the target interval in which the age of the user corresponding to the target face is located; obtaining a mapping relationship between candidate intervals, candidate beauty categories, and candidate beauty intensities; and based on the mapping relationship, obtaining a candidate beauty intensity that has a mapping relationship with the target interval and the i-th target beauty category as the beauty intensity of the target face under the i-th target beauty category.
[0008] In one embodiment of the present disclosure, the initiating the beautification process includes: determining a beautification mode for the target face based on the number of the target faces.
[0009] In one embodiment of the present disclosure, determining the beautification mode of the target face based on the number of the target faces includes: if there are multiple target faces, screening out a reference face from the multiple target faces; and determining the beautification mode of each target face based on the user corresponding to the reference face.
[0010] In one embodiment of the present disclosure, said selecting a reference face from the plurality of target faces includes: obtaining the size of the target face; and selecting the reference face from the plurality of target faces based on the sizes of the plurality of target faces.
[0011] In one embodiment of the present disclosure, the selecting the reference face from the plurality of target faces based on the sizes of the plurality of target faces includes: selecting the target face with the largest area from the plurality of target faces as the reference face.
[0012] In one embodiment of the present disclosure, determining the beautification mode of the target face based on the number of the target faces includes: if the number of the target faces is one, determining the beautification mode of the target face based on the user corresponding to the target face.
[0013] In one embodiment of the present disclosure, the initiating beautification processing includes: performing beautification processing on the target face in the first image frame based on the beautification mode of the target face and the beautification intensity of the target face to generate a video, wherein the video includes multiple second image frames, and the beauty parameters of the target faces in the multiple second image frames are gradually adjusted from the initial beauty parameters to the target beauty parameters over time within a duration period.
[0014] In one embodiment of the present disclosure, the beautification processing is performed on the target face in the first image frame based on the beautification mode of the target face and the beautification intensity of the target face to generate a video, including: determining the target beauty parameters based on the beautification mode of the target face and the beautification intensity of the target face; determining the beauty parameters of the second image frame based on the target beauty parameters and the video progress corresponding to the second image frame; beautification processing is performed on the target face in the first image frame based on the beauty parameters of the second image frame to obtain the second image frame; and generating the video based on multiple second image frames.
[0015] In one embodiment of the present disclosure, the method further includes: displaying the video on a display interface of the terminal.
[0016] In one embodiment of the present disclosure, before displaying the video, it also includes: obtaining the beauty mode of the user corresponding to the target face from the storage space; and identifying that the beauty mode of the target face is different from the beauty mode of the user corresponding to the target face.
[0017] In one embodiment of the present disclosure, after identifying that the beautification mode of the target face is different from the beautification mode of the user corresponding to the target face, it also includes: updating the beautification mode of the user corresponding to the target face in the storage space to the beautification mode of the target face.
[0018] According to a second aspect of an embodiment of the present disclosure, an image processing device is provided, including: a first startup module, configured to execute in the display interface of a terminal, and to start the beautification function in response to detecting a startup signal of the beautification function; a second startup module, configured to execute in response to detecting the presence of a target face in the display interface of the terminal, and to start beautification processing, wherein the beautification processing includes determining a beautification mode of the target face and a beautification intensity of the target face, wherein the beautification mode of the target face and / or the beautification intensity of the target face are determined based on parameters of a user corresponding to the target face.
[0019] In one embodiment of the present disclosure, the second starting module is further configured to execute: determining the beautification strength of the target face based on the age of the user corresponding to the target face.
[0020] In one embodiment of the present disclosure, the second startup module is further configured to execute: obtaining N target beauty categories of the beauty mode of the target face; and determining the beauty intensity of the target face in the i-th target beauty category based on the age of the user corresponding to the target face and the i-th target beauty category, where N is a positive integer and i is a positive integer not greater than N.
[0021] In one embodiment of the present disclosure, the second startup module is further configured to execute: identifying a target age range of the user corresponding to the target face; obtaining a mapping relationship between candidate intervals, candidate beauty categories, and candidate beauty intensities; and based on the mapping relationship, obtaining a candidate beauty intensity that has a mapping relationship with both the target interval and the i-th target beauty category as the beauty intensity of the target face under the i-th target beauty category.
[0022] In one embodiment of the present disclosure, the second starting module is further configured to execute: determining a beautification mode of the target face based on the number of the target faces.
[0023] In one embodiment of the present disclosure, the second startup module is further configured to execute: if there are multiple target faces, filter out a reference face from the multiple target faces; and determine a beauty mode for each target face based on the user corresponding to the reference face.
[0024] In one embodiment of the present disclosure, the second starting module is further configured to execute: obtaining the size of the target face; and screening the reference face from the multiple target faces based on the sizes of the multiple target faces.
[0025] In one embodiment of the present disclosure, the second starting module is further configured to execute: screening out a target face with the largest area from the multiple target faces as the reference face.
[0026] In one embodiment of the present disclosure, the second starting module is further configured to execute: if the number of the target face is one, determine the beautification mode of the target face based on the user corresponding to the target face.
[0027] In one embodiment of the present disclosure, the second startup module is further configured to execute: based on the beautification mode of the target face and the beautification intensity of the target face, beautify the target face in the first image frame to generate a video, wherein the video includes multiple second image frames, and the beauty parameters of the target faces in the multiple second image frames are gradually adjusted from the initial beauty parameters to the target beauty parameters over time within a duration period.
[0028] In one embodiment of the present disclosure, the second startup module is further configured to execute: determining the target beautification parameters based on the beautification mode of the target face and the beautification intensity of the target face; determining the beautification parameters of the second image frame based on the target beautification parameters and the video progress corresponding to the second image frame; performing beautification processing on the target face in the first image frame based on the beauty parameters of the second image frame to obtain the second image frame; and generating the video based on multiple second image frames.
[0029] In one embodiment of the present disclosure, the second starting module is further configured to execute: displaying the video on a display interface of the terminal.
[0030] In one embodiment of the present disclosure, before displaying the video, the second startup module is further configured to execute: obtaining the beauty mode of the user corresponding to the target face from the storage space; and identifying that the beauty mode of the target face is different from the beauty mode of the user corresponding to the target face.
[0031] In one embodiment of the present disclosure, after identifying that the beauty mode of the target face is different from the beauty mode of the user corresponding to the target face, the second startup module is further configured to execute: updating the beauty mode of the user corresponding to the target face in the storage space to the beauty mode of the target face.
[0032] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to implement the steps of the method described in the first aspect of the embodiment of the present disclosure.
[0033] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the method described in the first aspect of the embodiment of the present disclosure are implemented.
[0034] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor of an electronic device, the computer program implements the steps of the method described in the first aspect of the embodiment of the present disclosure.
[0035] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects: in the display interface of the terminal, in response to detecting the start signal of the beautification function, the beautification function is started, and in response to detecting the presence of a target face in the display interface of the terminal, the beautification processing is started, wherein the beautification processing includes determining the beautification mode of the target face and the beautification intensity of the target face, wherein the beautification mode of the target face and / or the beautification intensity of the target face are determined based on the parameters of the user corresponding to the target face. Thus, the parameters of the user corresponding to the face can be taken into account to determine the beautification mode and / or the beautification intensity of the face, and the automatic and accurate acquisition of the beautification mode and / or the beautification intensity can be achieved. Compared with the related technologies that mostly require manual adjustment of the beautification mode and / or the beautification intensity, which has the problem of complex user operation, the present solution does not require manual adjustment of the beautification mode and / or the beautification intensity, which can simplify user operation and achieve automatic beautification processing.
[0036] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.
[0038] Figure 1 The figure is a flowchart of an image processing method according to an exemplary embodiment.
[0039] Figure 2 is a flowchart of an image processing method according to another exemplary embodiment.
[0040] Figure 3 is a flowchart of an image processing method according to another exemplary embodiment.
[0041] Figure 4 is a flowchart of an image processing method according to another exemplary embodiment.
[0042] Figure 5 is a block diagram of an image processing apparatus according to an exemplary embodiment.
[0043] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0044] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0045] It should be noted that the terms "first," "second," and the like in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure as detailed in the appended claims.
[0046] The acquisition, storage, use, and processing of data in the technical solution disclosed herein are in compliance with the provisions of relevant laws and regulations.
[0047] Figure 1 is a flowchart of an image processing method according to an exemplary embodiment. Figure 1 As shown, the image processing method of the embodiment of the present disclosure includes the following steps.
[0048] S101 , in a display interface of a terminal, in response to detecting a start signal of a beautification function, starting a beautification function.
[0049] It should be noted that the image processing method of the embodiment of the present disclosure is executed by an electronic device, such as a terminal, where the terminal may include a mobile phone, a laptop, a desktop computer, a vehicle-mounted terminal, a smart home appliance, a wearable device, etc. Among them, wearable devices may include wrist-worn devices (such as smart watches and smart bracelets), head-worn devices, foot-worn devices, etc. The image processing method of the embodiment of the present disclosure can be executed by the image processing device of the embodiment of the present disclosure, and the image processing device of the embodiment of the present disclosure can be configured in any electronic device to execute the image processing method of the embodiment of the present disclosure.
[0050] The image processing method of the disclosed embodiments can also be executed collaboratively by a terminal and a server, or based on the collaborative execution of multiple terminals or devices; for example, the terminal can perform image frame acquisition and display, and the terminal can send the image frames to the server, which can process the image frames; for another example, a terminal with a camera function (such as a camera, a video camera, etc.) can acquire image frames, a terminal with a display function (such as a monitor, a television, a mobile phone, a tablet, etc.) can preview and display the image frames, and a terminal with image processing capabilities (such as a mobile phone, a tablet, a laptop, etc.) can process the image frames. In some possible implementations, the image processing method can be implemented by a processor calling computer-readable instructions stored in a memory.
[0051] It should be noted that the display interface of the terminal is not limited too much, for example, it can include the camera preview interface, camera application interface, etc. The beauty function can adopt any beauty function in the relevant technology, and is not limited too much here.
[0052] It should be noted that the activation signal of the beauty function is used to activate the beauty function. There are no excessive restrictions on the activation signal of the beauty function. For example, it may include a touch signal, a voice signal, a gesture signal, a posture signal, etc.
[0053] In one embodiment, the method further includes generating a start signal for the beauty function based on interaction data between the user and the terminal. It should be noted that the interaction data is not limited to too many aspects and may include, for example, touch data, voice data, gesture data, posture data, etc.
[0054] In some examples, the display interface of the terminal includes a capture button, and a start signal for the beauty function may be generated in response to detecting a user clicking the capture button.
[0055] In some examples, voice recognition can be performed on the user's voice signal to obtain recognized text. If the recognized text includes a set keyword, a signal to activate the beauty function is generated. It should be noted that the set keyword is not limited to too many, for example, it can include "turn on beauty", "activate beauty", "turn on beauty", etc.
[0056] In some examples, in response to detecting a target gesture of the user, if the target gesture is a setting gesture, a start signal for the beautification function may be generated.
[0057] S102, in response to detecting the presence of a target face in the display interface of the terminal, starting beautification processing, wherein the beautification processing includes determining a beautification mode of the target face and a beautification intensity of the target face, wherein the beautification mode of the target face and / or the beautification intensity of the target face are determined based on parameters of a user corresponding to the target face.
[0058] It should be noted that, in response to detecting the presence of a target face in the display interface of the terminal, the number of the target face is at least one, and there is no excessive limitation on the number of the target faces.
[0059] It should be noted that the target face beauty mode can adopt any beauty mode known in the relevant art, without further limitation here. The beauty modes of different target faces may be different or the same. Determining the target face beauty mode can be achieved by adopting any beauty mode acquisition method known in the relevant art, without further limitation here.
[0060] It should be noted that there are no specific restrictions on the beautification intensity of the target face. For example, if the beautification intensity ranges from 0 to 1, the beautification intensity of the target face can be any value between 0 and 1. Alternatively, if the beautification intensity ranges from 0 to 100, the beautification intensity of the target face can be any value between 0 and 100. Alternatively, the beautification intensity can be pre-classified into multiple candidate levels, and the beautification intensity of the target face can be any of the candidate levels. Different target faces may have different beautification intensities, and the same target face may have different beautification intensities under different beautification categories.
[0061] It should be noted that there are not too many restrictions on user parameters. For example, they may include the user's age, gender, city, beauty preferences, etc.
[0062] In one embodiment, the method further includes determining parameters of a user corresponding to the target face based on the target face. For example, the parameters of the user corresponding to the target face may be determined based on feature data of the target face. It should be noted that the feature data of the target face is not excessively limited and may include, for example, the category of facial parts (such as eyes, nose, mouth), the location of the facial parts in the target face, the size of the facial parts, a target parameter for representing the area occupied by the facial parts in the target face, facial skin texture, facial color, facial wrinkle parameters, etc.
[0063] In an embodiment of the present disclosure, starting the beautification process includes determining a beautification mode and / or a beautification intensity of the target face based on parameters of a user corresponding to the target face.
[0064] For example, if the terminal display interface only includes face A, the beautification mode and / or beautification intensity of face A can be determined based on the parameters of user 1 corresponding to face A. It should be noted that face A is the target face in this embodiment.
[0065] For example, if the terminal's display interface includes faces A and B, the beauty mode and / or beauty intensity for face A can be determined based on the parameters of user 1 corresponding to face A, and the beauty mode and / or beauty intensity for face B can be determined based on the parameters of user 2 corresponding to face B. For example, if the beauty mode for face A is Hydration and the beauty mode for face B is Native, or if the beauty mode for faces A and B are both Hydration, and if the beauty intensity ranges from 0 to 1, the beauty intensity for face A is 0.3, and the beauty intensity for face B is 0.6. It should be noted that in this embodiment, faces A and B are both target faces.
[0066] In one embodiment, initiating the beautification process includes obtaining a target tag corresponding to a user parameter corresponding to a target face, obtaining a mapping relationship between candidate tags and candidate beautification modes, and based on the mapping relationship, obtaining a candidate beautification mode that has a mapping relationship with each target tag as the beautification mode for the target face. It is understood that different candidate tags may be mapped to different candidate beautification modes.
[0067] In one embodiment, initiating the beautification process includes obtaining a target tag corresponding to a parameter of a user corresponding to a target face, obtaining a mapping relationship between candidate tags and candidate beautification intensities, and based on the mapping relationship, obtaining a candidate beautification intensity that has a mapping relationship with each target tag as the beautification intensity for the target face. It is understood that different candidate tags may be mapped to different candidate beautification intensities.
[0068] It should be noted that there are not too many restrictions on candidate labels and target labels. For example, they may include age labels (such as children, youth, middle-aged, elderly, etc.), gender labels, city labels, beauty preference labels, etc.
[0069] In one embodiment, starting the beautification process includes performing beautification on the target face in the first image frame based on the beautification mode and beautification intensity of the target face, wherein the first image frame is an image frame displayed on the display interface of the terminal.
[0070] In one embodiment, in response to detecting the presence of the target face in the display interface of the terminal, the method further includes capturing a first image frame and displaying the first image frame in the display interface of the terminal.
[0071] For example, if the display interface of the terminal only includes face A, face A in the first image frame may be beautified based on the beautification mode and beautification intensity of face A. It should be noted that face A is the target face in this embodiment.
[0072] For example, if the terminal's display interface includes faces A and B, face A in the first image frame may be beautified based on the beautification mode and beautification intensity of face A, and face B in the first image frame may be beautified based on the beautification mode and beautification intensity of face B. It should be noted that in this embodiment, faces A and B are both target faces.
[0073] In some examples, the target face in the first image frame is beautified based on the beautification mode of the target face and the beautification intensity of the target face, including determining target beauty parameters based on the beautification mode of the target face and the beautification intensity of the target face, and beautifying the target face in the first image frame based on the target beauty parameters.
[0074] In some examples, target beauty parameters are determined based on the beauty mode of the target face and the beauty intensity of the target face, including obtaining a first ratio corresponding to the beauty intensity of the target face, and obtaining the product of the beauty parameters of the beauty mode of the target face and the first ratio as the target beauty parameters.
[0075] In some examples, target beauty parameters are determined based on the beautification mode and the beautification intensity of the target face, including obtaining a second ratio corresponding to the beauty intensity of the target face in the i-th target beauty category, obtaining the beauty parameters of the beauty mode of the target face in the i-th target beauty category, and obtaining the product of the beauty parameters in the i-th target beauty category and the second ratio as the target beauty parameters of the target face in the i-th target beauty category.
[0076] It should be noted that the relevant content of the target beauty category can be found in the following embodiments and will not be repeated here.
[0077] In some examples, beautification processing is performed on the target face in the first image frame based on the target beautification parameters, including beautification processing under the i-th target beauty category on the target face in the first image frame based on the target beauty parameters of the target face under the i-th target beauty category.
[0078] In some examples, obtaining the first ratio includes the following possible implementations:
[0079] Method 1: If the beauty intensity value ranges from 0 to 1, the beauty intensity of the target face is used as the first ratio.
[0080] Method 2: If the beauty intensity ranges from 0 to 100, the ratio of the beauty intensity of the target face to 100 is used as the first ratio.
[0081] Method 3: If the beautification intensity value range is multiple candidate levels, and the beautification intensity of the target face is the target level, obtain the mapping relationship between the candidate levels and the candidate ratios, and based on the mapping relationship, obtain the candidate ratio having a mapping relationship with the target level as the first ratio.
[0082] It should be noted that, for the relevant content of obtaining the second ratio, reference may be made to the relevant content of obtaining the first ratio, which will not be repeated here.
[0083] The image processing method provided by the embodiment of the present disclosure starts the beauty function in response to detecting a start signal of the beauty function in the display interface of the terminal, and starts the beauty processing in response to detecting the presence of a target face in the display interface of the terminal, wherein the beauty processing includes determining the beauty mode of the target face and the beauty intensity of the target face, wherein the beauty mode of the target face and / or the beauty intensity of the target face are determined based on the parameters of the user corresponding to the target face. Thus, the parameters of the user corresponding to the face can be taken into account to determine the beauty mode and / or beauty intensity of the face, and the automatic and accurate acquisition of the beauty mode and / or beauty intensity can be achieved. Compared with the related art, most of which require manual adjustment of the beauty mode and / or beauty intensity, and there is a problem of complex user operation, the present solution does not require manual adjustment of the beauty mode and / or beauty intensity, which can simplify user operation and achieve automatic beauty processing.
[0084] Figure 2 is a flowchart of an image processing method according to another exemplary embodiment. Figure 2 As shown, the image processing method of the embodiment of the present disclosure includes the following steps.
[0085] S201 , in a display interface of a terminal, in response to detecting a start signal of a beautification function, starting a beautification function.
[0086] S202 : In response to detecting that a target face exists in a display interface of the terminal, determining a beauty mode for the target face.
[0087] For the relevant contents of steps S201-S202, please refer to the above embodiment and will not be repeated here.
[0088] S203: Determine the beautification intensity of the target face based on the age of the user corresponding to the target face.
[0089] In one embodiment, determining the beautification intensity of the target face based on the age of the user corresponding to the target face includes identifying a target interval within which the age of the user corresponding to the target face falls, obtaining a mapping relationship between candidate intervals and candidate beautification intensities, and based on the mapping relationship, obtaining a candidate beautification intensity that has a mapping relationship with the target interval as the beautification intensity of the target face. It is understood that different candidate intervals may map to different candidate beautification intensities.
[0090] In one embodiment, determining the beautification intensity of the target face based on the age of the user corresponding to the target face includes obtaining N target beautification categories of the beautification mode of the target face, and determining the beautification intensity of the target face in the i-th target beautification category based on the age of the user corresponding to the target face and the i-th target beautification category, where N is a positive integer and i is a positive integer not greater than N. Thus, the beautification intensity of the target face in the target beautification category can be determined by comprehensively considering the age of the user corresponding to the target face and the target beautification category.
[0091] In some examples, based on the age of the user corresponding to the target face and the i-th target beauty category, determining the beauty intensity of the target face under the i-th target beauty category includes identifying a target interval within which the age of the user corresponding to the target face falls, obtaining a mapping relationship between candidate intervals, candidate beauty categories, and candidate beauty intensities, and based on the mapping relationship, obtaining a candidate beauty intensity that has a mapping relationship with both the target interval and the i-th target beauty category as the beauty intensity of the target face under the i-th target beauty category. It will be understood that different candidate intervals may map to different candidate beauty intensities, and different candidate beauty categories may map to different candidate beauty intensities.
[0092] It should be noted that there are not too many restrictions on candidate beauty categories and target beauty categories. For example, they may include brightening eyes, whitening teeth, smoothing skin, and even skin.
[0093] The image processing method provided by the embodiments of the present disclosure can determine the beautification intensity of the target face by taking into account the age of the user corresponding to the target face, and can realize automatic and accurate acquisition of the beautification intensity.
[0094] Based on any of the above embodiments, the beautification mode of the target face can be determined by using any beautification mode acquisition method in the relevant technology, which is not limited here.
[0095] In one embodiment, starting the beautification process includes determining a beautification mode for the target face based on feature data of the target face.
[0096] In some examples, a beautification mode of the target face is determined based on parameters of the user corresponding to the target face, including determining the beautification mode of the target face based on the age and gender of the user corresponding to the target face.
[0097] For example, based on the age and gender of the user corresponding to the target face, determining the beauty mode for the target face includes identifying the target interval within which the age of the user corresponding to the target face falls, obtaining a mapping relationship between candidate intervals, candidate genders, and candidate beauty modes, and then, based on the mapping relationship, obtaining a candidate beauty mode that has a mapping relationship with both the target interval and the gender of the user corresponding to the target face as the beauty mode for the target face. It is understandable that different candidate intervals may map to different candidate beauty modes, and different candidate genders may map to different candidate beauty modes. The target interval is any candidate interval.
[0098] For example, the mapping relationship between candidate intervals, candidate genders, and candidate beauty modes is shown in Table 1.
[0099] Table 1 Mapping relationship between candidate intervals, candidate genders, and candidate beauty modes
[0100]
[0101] Figure 3 is a flowchart of an image processing method according to another exemplary embodiment. Figure 3 As shown, the image processing method of the embodiment of the present disclosure includes the following steps.
[0102] S301 , in a display interface of a terminal, in response to detecting a start signal of a beautification function, starting a beautification function.
[0103] For the relevant content of step S301, please refer to the above embodiment and will not be repeated here.
[0104] S302 : In response to detecting that there are target faces in the display interface of the terminal, determine a beautification mode for the target faces based on the number of the target faces.
[0105] In the embodiments of the present disclosure, the beautification mode of the target face is determined based on the number of target faces, including the following possible implementations:
[0106] Method 1: Identify the first interval in which the number of target faces falls, obtain a mapping relationship between the second interval and the candidate beautification mode, and based on the mapping relationship, obtain a candidate beautification mode having a mapping relationship with the first interval as the beautification mode for each target face.
[0107] It is understandable that different second intervals may map different candidate beautification modes, and the first interval is any second interval.
[0108] Method 2: If there are multiple target faces, select a benchmark face from the multiple target faces, and determine the beauty mode for each target face based on the user corresponding to the benchmark face.
[0109] It should be noted that the reference face is any target face.
[0110] In one embodiment, selecting a reference face from a plurality of target faces includes randomly selecting a reference face from a plurality of target faces.
[0111] In one embodiment, a reference face is selected from multiple target faces, including a target face corresponding to a target user as the reference face. It should be noted that the target user is not particularly limited and may include, for example, a user operating the electronic device, a user associated with the electronic device, or the owner of the electronic device.
[0112] In one embodiment, selecting a reference face from a plurality of target faces includes selecting a previously authenticated face from the plurality of target faces to serve as the reference face. For example, a previously authenticated face database may be pre-established, and the target face may be compared with authenticated faces in the previously authenticated face database. Based on the comparison results, the target face is identified as an authenticated face.
[0113] In one embodiment, selecting a reference face from multiple target faces includes obtaining the size of the target faces and selecting the reference face from the multiple target faces based on the sizes of the multiple target faces. Thus, the reference face can be selected based on the sizes of the multiple target faces. It is understood that different target faces may have different sizes.
[0114] It should be noted that there are not too many restrictions on the size of the face. For example, it can include the width, length, area, etc. of the face.
[0115] In some examples, a reference face is selected from the multiple target faces based on their sizes, including selecting a target face with the largest size from the multiple target faces as the reference face.
[0116] In some examples, a reference face is selected from the multiple target faces based on their sizes, including selecting a target face with the largest area from the multiple target faces as the reference face.
[0117] In one embodiment, the beautification mode of each target face is determined based on the user corresponding to the benchmark face, including determining the beautification mode of the benchmark face based on the user corresponding to the benchmark face, and using the beautification mode of the benchmark face as the beautification mode of the remaining target faces other than the benchmark face.
[0118] It should be noted that, for the relevant content of determining the beautification mode of the benchmark face based on the user corresponding to the benchmark face, reference can be made to the relevant content of determining the beautification mode of the target face based on the user corresponding to the target face, which will not be repeated here.
[0119] For example, if faces A, B, and C appear on the terminal's display interface, face B can be selected from faces A, B, and C as the reference face. Based on user 2 corresponding to face B, the beauty mode for face B is determined, and the beauty mode for face B is used as the beauty mode for faces A and C. It should be noted that in this embodiment, faces A, B, and C are all target faces.
[0120] Method 3: If there is only one target face, determine the beauty mode for the target face based on the user corresponding to the target face.
[0121] For example, if only face A exists on the display interface of the terminal, the beauty mode of face A can be determined based on user 1 corresponding to face A. It should be noted that face A is the target face in this embodiment.
[0122] It should be noted that, for the relevant content of determining the beautification mode of the target face based on the user corresponding to the target face, please refer to the above embodiment and will not be repeated here.
[0123] S303: Determine the beautification intensity of the target face based on the parameters of the user corresponding to the target face.
[0124] For the relevant content of step S303, please refer to the above embodiment and will not be repeated here.
[0125] The image processing method provided by the embodiments of the present disclosure can take into account the number of target faces, determine the beautification mode of the target face, and realize automatic and accurate acquisition of the beautification mode. Compared with the related technologies that mostly require manual adjustment of the beautification mode and have the problem of complex user operation, this solution does not require manual adjustment of the beautification mode, can simplify user operation, and can realize automatic beautification processing.
[0126] Figure 4 is a flowchart of an image processing method according to another exemplary embodiment. Figure 4 As shown, the image processing method of the embodiment of the present disclosure includes the following steps.
[0127] S401 , in a display interface of a terminal, in response to detecting a start signal of a beautification function, starting a beautification function.
[0128] S402: In response to detecting that a target face exists in the display interface of the terminal, determining a beautification mode for the target face.
[0129] S403: Determine the beautification intensity of the target face based on the parameters of the user corresponding to the target face.
[0130] For the relevant contents of steps S401-S403, please refer to the above embodiment and will not be repeated here.
[0131] S404, based on the beautification mode and beautification intensity of the target face, beautify the target face in the first image frame to generate a video, wherein the video includes multiple second image frames, and the beautification parameters of the target face in the multiple second image frames are gradually adjusted from the initial beautification parameters to the target beautification parameters over time within a duration period.
[0132] For example, the beauty parameters of the target faces of multiple second image frames at adjacent moments may be the same. For example, a video includes second image frames 1 to 20, which are sorted from earliest to latest according to display time. The beauty parameters of the target faces of second image frames 1 to 5 are all X1, the beauty parameters of the target faces of second image frames 6 to 10 are all X2, the beauty parameters of the target faces of second image frames 11 to 15 are all X3, and the beauty parameters of the target faces of second image frames 15 to 20 are all X4. Among them, X1 to X4 are different beauty parameters.
[0133] For example, the second image frames correspond to the beauty parameters of the target face one-to-one, that is, the beauty parameters of the target face of multiple second image frames are adjusted frame by frame. For example, a video includes second image frames 1 to 4, and second image frames 1 to 4 are sorted from earliest to latest according to display time. The beauty parameters of the target face of second image frame 1 are X1, the beauty parameters of the target face of second image frame 2 are X2, the beauty parameters of the target face of second image frame 3 are X3, and the beauty parameters of the target face of second image frame 4 are X4.
[0134] It should be noted that there are no excessive restrictions on the adjustment step length of the beautification parameters of the target face of multiple second image frames within the duration period. For example, the adjustment step length is a fixed value, or can be dynamically updated over time. There are no excessive restrictions here.
[0135] In one embodiment, the adjustment step size is a fixed value, that is, the beautification parameters of the target face of multiple second image frames are uniformly adjusted to the target beautification parameters with the initial beautification parameters over time within a duration period, thereby achieving automatic uniform adjustment of the beautification parameters of the target face and improving the smoothness of the beautification processing.
[0136] It should be noted that there are no specific restrictions on the initial and target beauty parameters. The initial and target beauty parameters are not equal, and there are no specific restrictions on the relationship between the initial and target beauty parameters. For example, the initial beauty parameters may be smaller than the target beauty parameters, or the initial beauty parameters may be larger than the target beauty parameters. The initial beauty parameters may vary for different target beauty categories, and the target beauty parameters may also vary for different target beauty categories.
[0137] In one embodiment, the beauty parameters of the target face in the i-th target beauty category of the multiple second image frames are gradually adjusted from the initial beauty parameters of the target face in the i-th target beauty category to the target beauty parameters of the target face in the i-th target beauty category over time within a duration period.
[0138] For example, the parameters of the target face in the first image frame may be obtained as the initial beautification parameters.
[0139] For example, the target beauty parameters can be determined based on the beauty mode and beauty intensity of the target face. It should be noted that the process of obtaining the target beauty parameters can be referred to the above embodiment and will not be repeated here.
[0140] In the embodiments of the present disclosure, based on the beautification mode and beautification intensity of the target face, the target face in the first image frame is beautified to generate a video, including the following possible implementations:
[0141] Method 1: Based on the beautification mode and beautification intensity of the target face, determine the target beautification parameters; based on the target beautification parameters and the video progress corresponding to the second image frame, determine the beautification parameters of the second image frame; based on the beautification parameters of the second image frame, beautify the target face in the first image frame to obtain the second image frame; and generate a video based on multiple second image frames.
[0142] It should be noted that the video progress value ranges from 0 to 1, and there is a one-to-one correspondence between each second image frame and the video progress. The video progress of multiple second image frames gradually changes from 0 to 1 over time within the duration period. The video progress corresponding to the second image frame refers to the ratio of the duration from the display time of the first second image frame to the display time of the second image frame to the total duration of the video. In other words, it is the ratio of the video duration in the second image frame to the total duration of the video.
[0143] In one embodiment, based on the target beauty parameters and the video progress corresponding to the second image frame, the beauty parameters of the second image frame are determined, including obtaining the difference between the target beauty parameters and the initial beauty parameters, obtaining the product of the difference and the video progress corresponding to the second video frame, and obtaining the sum of the product and the initial beauty parameters as the beauty parameters of the second image frame.
[0144] In one embodiment, the initial beautification parameter is zero, and the beautification parameter of the second image frame is determined based on the target beautification parameter and the video progress corresponding to the second image frame, including obtaining the product of the target beautification parameter and the video progress corresponding to the second image frame as the beautification parameter of the second image frame.
[0145] Method 2: Based on the beautification mode and beautification intensity of the target face, determine the target beautification parameters; based on the initial beautification parameters and the target beautification parameters, determine the beautification parameters of the second image frame; based on the beautification parameters of the second image frame, perform beautification processing on the target face in the first image frame to obtain a second image frame; and generate a video based on multiple second image frames.
[0146] In one embodiment, based on the initial beautification parameters and the target beautification parameters, the beautification parameters of the second image frame are determined, the absolute value of the difference between the initial beautification parameters and the target beautification parameters is obtained, and based on the absolute value of the difference and the number of the plurality of second image frames, the beauty parameters of the plurality of second image frames are determined.
[0147] For example, based on the absolute value of the difference and the number M of the second image frames, the beauty parameters of each of the second image frames are determined. This includes obtaining the ratio of the absolute value of the difference to (M-1) as the adjustment step size, and sequentially numbering the second image frames from 1 to M. The second image frames are sorted from earliest to latest according to display time. That is, the earlier the display time of the second image frame, the smaller the corresponding number, and the later the display time of the second image frame, the larger the corresponding number.
[0148] If the initial beautification parameter is less than the target beautification parameter, obtain the product of the adjustment step and the number -1 of the second image frame, and obtain the sum of the product and the initial beautification parameter as the beautification parameter of the second image frame.
[0149] Alternatively, if the initial beautification parameter is less than the target beautification parameter, the product of the adjustment step and the number of the second image frame -1 is obtained, and the difference between the initial beautification parameter and the product is obtained as the beautification parameter of the second image frame.
[0150] For example, if the initial beautification parameter is 1, the target beautification parameter is 6, and the number of second image frames M = 11, then the adjustment step size = 5 / 10 = 0.5X, then the beauty parameter of the second image frame numbered 1 = 1+0.5*(1-1) = 1, the beauty parameter of the second image frame numbered 2 = 1+0.5*(2-1) = 1.5, the beauty parameter of the second image frame numbered 3 = 1+0.5*(3-1) = 2, the beauty parameter of the second image frame numbered 10 = 1+0.5*(10-1) = 5.5, and the beauty parameter of the second image frame numbered 11 = 1+0.5*(11-1) = 6.
[0151] For example, if the initial beautification parameter is 6, the target beautification parameter is 1, and the number of second image frames M = 11, then the adjustment step size = 5 / 10 = 0.5, then the beauty parameter of the second image frame numbered 1 = 6-0.5*(1-1) = 6, the beauty parameter of the second image frame numbered 2 = 6-0.5*(2-1) = 5.5, the beauty parameter of the second image frame numbered 3 = 6-0.5*(3-1) = 5, the beauty parameter of the second image frame numbered 10 = 6-0.5*(10-1) = 1.5, and the beauty parameter of the second image frame numbered 11 = 6-0.5*(11-1) = 1.
[0152] In one embodiment, before generating the video, the method further includes detecting a first operation. It should be noted that the first operation is used to trigger the generation of the video. For example, if the display interface of the terminal includes a beauty gradient button, the first operation may include clicking the beauty gradient button.
[0153] S405: Display the video on the display interface of the terminal.
[0154] In one embodiment, before displaying the video on the terminal's display interface, the method further includes detecting a second operation. It should be noted that the second operation is used to trigger the display of the video. For example, if the terminal's display interface includes a beauty gradient button, the second operation may include clicking the beauty gradient button.
[0155] In one embodiment, before displaying the video, the method further includes obtaining the beauty mode of the user corresponding to the target face from a storage space and identifying that the beauty mode of the target face is different from the beauty mode of the user corresponding to the target face. Thus, the video can be displayed when the beauty mode of the target face is different from the beauty mode of the user corresponding to the target face, and the video can be displayed when the beauty mode of the target face is the same as the beauty mode of the user corresponding to the target face.
[0156] It should be noted that the beauty mode of the user corresponding to the target face may be stored in the storage space in advance.
[0157] In some examples, the beauty mode of the user corresponding to the target face in the storage space is the beauty mode of the target face in the third image frame, and the capture time of the third image frame is earlier than the capture time of the first image frame.
[0158] If the target face exists in the first image frame, before obtaining the beauty mode of the target face, it also includes collecting a third image frame. If the target face exists in the third image frame, the beauty mode of the target face is obtained, the beauty mode of the target face is used as the beauty mode of the user corresponding to the target face, and the beauty mode of the user corresponding to the target face is stored in the storage space.
[0159] In some examples, after identifying that the beauty mode of the target face differs from the beauty mode of the user corresponding to the target face, the process further includes updating the beauty mode of the user corresponding to the target face in the storage space to the beauty mode of the target face. Thus, if the beauty mode of the target face differs from the beauty mode of the user corresponding to the target face, the beauty mode of the user corresponding to the target face in the storage space can be updated, thereby improving the accuracy and real-time performance of the stored beauty mode of the user corresponding to the target face.
[0160] The image processing method provided by the embodiments of the present disclosure performs beauty processing on a target face in a first image frame based on the beauty mode and beauty intensity of the target face, generating a video. The video includes multiple second image frames, and the beauty parameters of the target face in the multiple second image frames are gradually adjusted from initial beauty parameters to target beauty parameters over time within a sustained period. This enables automatic and gradual adjustment of the beauty parameters, improving the smoothness, accuracy, and automation of the beauty parameter adjustment and achieving a gradual beauty effect.
[0161] Based on any of the above embodiments, the method further includes performing facial recognition on the first image frame to obtain a facial recognition result, wherein the facial recognition result is used to indicate whether the first image frame contains a target face. It should be noted that facial recognition on the first image frame can be implemented using any facial recognition method in the relevant art, and is not further limited herein.
[0162] In some examples, face recognition is performed on the first image frame to obtain a face recognition result, including extracting a face image from the first image frame, performing feature extraction on the face image to obtain a target feature, obtaining a matching degree between the target feature and a face feature in a face feature library, and obtaining a face recognition result based on the matching degree.
[0163] For example, if there is at least one facial feature whose corresponding matching degree is greater than a set threshold, a facial recognition result is generated to indicate that the target face exists in the first image frame; if the matching degree corresponding to each facial feature is less than or equal to the set threshold, a facial recognition result is generated to indicate that the target face does not exist in the first image frame.
[0164] In some examples, before extracting features from facial images, face alignment is also performed on the facial images.
[0165] It should be noted that there are no excessive restrictions on the matching degree. For example, the matching degree can be obtained based on the Euclidean distance and / or cosine similarity between the target feature and the facial feature.
[0166] Figure 5 FIG. 1 is a block diagram of an image processing apparatus according to an exemplary embodiment. Figure 5The image processing device 100 according to the embodiment of the present disclosure includes: a first starting module 110 and a second starting module 120 .
[0167] The first activation module 110 is configured to execute in the display interface of the terminal and activate the beautification function in response to detecting an activation signal of the beautification function;
[0168] The second startup module 120 is configured to execute beautification processing in response to detecting the presence of a target face in the display interface of the terminal, wherein the beautification processing includes determining a beautification mode of the target face and a beautification intensity of the target face, wherein the beautification mode of the target face and / or the beautification intensity of the target face are determined based on parameters of a user corresponding to the target face.
[0169] In one embodiment of the present disclosure, the second starting module 120 is further configured to execute: determining the beautification strength of the target face based on the age of the user corresponding to the target face.
[0170] In one embodiment of the present disclosure, the second startup module 120 is further configured to execute: obtaining N target beauty categories of the beauty mode of the target face; and determining the beauty intensity of the target face in the i-th target beauty category based on the age of the user corresponding to the target face and the i-th target beauty category, where N is a positive integer and i is a positive integer not greater than N.
[0171] In one embodiment of the present disclosure, the second startup module 120 is further configured to execute: identifying a target age range of the user corresponding to the target face; obtaining a mapping relationship between candidate intervals, candidate beauty categories, and candidate beauty intensities; and based on the mapping relationship, obtaining a candidate beauty intensity that has a mapping relationship with both the target interval and the i-th target beauty category as the beauty intensity of the target face under the i-th target beauty category.
[0172] In one embodiment of the present disclosure, the second starting module 120 is further configured to execute: determining a beautification mode for the target face based on the number of the target faces.
[0173] In one embodiment of the present disclosure, the acquisition module 120 is further configured to execute: if there are multiple target faces, filter out a reference face from the multiple target faces; and determine a beauty mode for each target face based on the user corresponding to the reference face.
[0174] In one embodiment of the present disclosure, the second starting module 120 is further configured to execute: obtaining the size of the target face; and screening the reference face from the multiple target faces based on the sizes of the multiple target faces.
[0175] In one embodiment of the present disclosure, the second starting module 120 is further configured to execute: selecting a target face with the largest area from the multiple target faces as the reference face.
[0176] In one embodiment of the present disclosure, the second starting module 120 is further configured to execute: if the number of the target face is one, determining the beautification mode of the target face based on the user corresponding to the target face.
[0177] In one embodiment of the present disclosure, the second startup module 120 is further configured to execute: based on the beautification mode of the target face and the beautification intensity of the target face, beautify the target face in the first image frame to generate a video, wherein the video includes multiple second image frames, and the beauty parameters of the target faces in the multiple second image frames are gradually adjusted from the initial beauty parameters to the target beauty parameters over time within a duration period.
[0178] In one embodiment of the present disclosure, the second startup module 120 is further configured to execute: determining the target beautification parameters based on the beautification mode of the target face and the beautification intensity of the target face; determining the beautification parameters of the second image frame based on the target beautification parameters and the video progress corresponding to the second image frame; performing beautification processing on the target face in the first image frame based on the beautification parameters of the second image frame to obtain the second image frame; and generating the video based on multiple second image frames.
[0179] In one embodiment of the present disclosure, the second starting module 120 is further configured to execute: displaying the video on a display interface of the terminal.
[0180] In one embodiment of the present disclosure, before displaying the video, the second startup module 120 is further configured to execute: obtaining the beauty mode of the user corresponding to the target face from the storage space; and identifying that the beauty mode of the target face is different from the beauty mode of the user corresponding to the target face.
[0181] In one embodiment of the present disclosure, after identifying that the beauty mode of the target face is different from the beauty mode of the user corresponding to the target face, the second startup module 120 is further configured to execute: updating the beauty mode of the user corresponding to the target face in the storage space to the beauty mode of the target face.
[0182] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0183] The image processing device provided by the embodiment of the present disclosure starts the beauty function in response to detecting a start signal of the beauty function in the display interface of the terminal, and starts the beauty processing in response to detecting the presence of a target face in the display interface of the terminal, wherein the beauty processing includes determining the beauty mode of the target face and the beauty intensity of the target face, wherein the beauty mode of the target face and / or the beauty intensity of the target face are determined based on the parameters of the user corresponding to the target face. Thus, the parameters of the user corresponding to the face can be taken into account to determine the beauty mode and / or beauty intensity of the face, and the automatic and accurate acquisition of the beauty mode and / or beauty intensity can be achieved. Compared with the related art, most of which require manual adjustment of the beauty mode and / or beauty intensity, which has the problem of complex user operation, the present solution does not require manual adjustment of the beauty mode and / or beauty intensity, which can simplify user operation and achieve automatic beauty processing.
[0184] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment.
[0185] like Figure 6 As shown, the electronic device 200 includes:
[0186] The memory 210 and the processor 220 , and the bus 230 connecting different components (including the memory 210 and the processor 220 ), the memory 210 stores a computer program, and when the processor 220 executes the program, the image processing method described in the embodiment of the present disclosure is implemented.
[0187] Bus 230 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0188] The electronic device 200 typically includes a variety of electronic device-readable media. These media can be any available media that can be accessed by the electronic device 200, including volatile and non-volatile media, removable and non-removable media.
[0189] The memory 210 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 240 and / or cache memory 250. The electronic device 200 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 260 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 Not shown, often called a "hard drive"). Although Figure 6 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 230 via one or more data medium interfaces. Memory 210 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present disclosure.
[0190] A program / utility 280 having a set (at least one) of program modules 270 may be stored, for example, in memory 210. Such program modules 270 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 270 generally implement the functions and / or methods of the embodiments described herein.
[0191] The electronic device 200 may also communicate with one or more external devices 290 (e.g., a keyboard, a pointing device, a display 291, etc.), and may also communicate with one or more devices that enable a user to interact with the electronic device 200, and / or any device that enables the electronic device 200 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed through an input / output (I / O) interface 292. Furthermore, the electronic device 200 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 293. Figure 6 As shown, the network adapter 293 communicates with other modules of the electronic device 200 via the bus 230. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0192] The processor 220 executes various functional applications and data processing by running programs stored in the memory 210 .
[0193] It should be noted that the implementation process and technical principles of the electronic device of this embodiment can be found in the aforementioned explanation of the image processing method of the embodiment of the present disclosure, and will not be repeated here.
[0194] The electronic device provided by the embodiment of the present disclosure can execute the image processing method as described above, in the display interface of the terminal, in response to detecting the start signal of the beauty function, the beauty function is started, and in response to detecting the presence of a target face in the display interface of the terminal, the beauty processing is started, wherein the beauty processing includes determining the beauty mode of the target face and the beauty intensity of the target face, wherein the beauty mode of the target face and / or the beauty intensity of the target face are determined based on the parameters of the user corresponding to the target face. Therefore, the parameters of the user corresponding to the face can be taken into account to determine the beauty mode and / or beauty intensity of the face, and the automatic and accurate acquisition of the beauty mode and / or beauty intensity can be achieved. Compared with the related art, most of the beauty modes and / or beauty intensity need to be manually adjusted, which has the problem of complex user operation. In this solution, there is no need to manually adjust the beauty mode and / or beauty intensity, which can simplify user operation and achieve automatic beauty processing.
[0195] In order to implement the above embodiments, the present disclosure further provides a computer-readable storage medium having computer program instructions stored thereon, which implement the steps of the image processing method provided by the present disclosure when the program instructions are executed by a processor.
[0196] Alternatively, the computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, or the like.
[0197] In order to implement the above embodiments, the present disclosure further provides a computer program product, including a computer program, characterized in that when the computer program is executed by a processor of an electronic device, the image processing method as described above is implemented.
[0198] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0199] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. An image processing method, characterized in that: include: In response to detecting a start signal of a beauty function, the terminal starts the beauty function in a display interface of the terminal; In response to detecting the presence of a target face in the display interface of the terminal, beautification processing is started, wherein the beautification processing includes determining a beautification mode of the target face and a beautification intensity of the target face, wherein the beautification mode of the target face and / or the beautification intensity of the target face are determined based on parameters of a user corresponding to the target face.
2. The method according to claim 1, characterized in that The starting of the beautification process includes: The beautification intensity of the target face is determined based on the age of the user corresponding to the target face.
3. The method according to claim 2, characterized in that The determining the beautification intensity of the target face based on the age of the user corresponding to the target face includes: Obtaining N target beauty categories of the beauty mode of the target face; Based on the age of the user corresponding to the target face and the i-th target beauty category, determine the beauty intensity of the target face in the i-th target beauty category, where N is a positive integer and i is a positive integer not greater than N.
4. The method according to claim 3, characterized in that The determining, based on the age of the user corresponding to the target face and the i-th target beautification category, the beautification intensity of the target face in the i-th target beautification category includes: Identify the target age range of the user corresponding to the target face; Obtain the mapping relationship between candidate intervals, candidate beauty categories, and candidate beauty intensities; Based on the mapping relationship, a candidate beautification intensity having a mapping relationship with both the target interval and the i-th target beautification category is obtained as the beautification intensity of the target face under the i-th target beautification category.
5. The method according to claim 1, wherein The starting of the beautification process includes: Based on the number of the target faces, a beauty mode for the target faces is determined.
6. The method according to claim 5, characterized in that The determining, based on the number of the target faces, a beautification mode of the target faces includes: If there are multiple target faces, select a reference face from the multiple target faces; Based on the user corresponding to the reference face, a beauty mode for each target face is determined.
7. The method according to claim 6, characterized in that The step of selecting a reference face from the plurality of target faces comprises: Obtaining the size of the target face; The reference face is selected from the plurality of target faces based on the sizes of the plurality of target faces.
8. The method according to claim 7, characterized in that The step of selecting the reference face from the plurality of target faces based on the sizes of the plurality of target faces comprises: A target face with the largest area is selected from the plurality of target faces as the reference face.
9. The method according to claim 5, characterized in that The determining, based on the number of the target faces, a beautification mode of the target faces includes: If the number of the target face is one, a beautification mode for the target face is determined based on the user corresponding to the target face.
10. The method according to any one of claims 1 to 9, characterized in that The starting of the beautification process includes: Based on the beautification mode of the target face and the beautification intensity of the target face, the target face in the first image frame is beautified to generate a video, wherein the video includes multiple second image frames, and the beauty parameters of the target faces in the multiple second image frames are gradually adjusted from the initial beauty parameters to the target beauty parameters over time within a duration period.
11. The method according to claim 10, characterized in that The process of performing beauty processing on the target face in the first image frame based on the beauty mode of the target face and the beauty intensity of the target face to generate a video includes: Determining the target beautification parameters based on the beautification mode of the target face and the beautification intensity of the target face; Determining the beauty parameters of the second image frame based on the target beauty parameters and the video progress corresponding to the second image frame; performing beauty processing on the target face in the first image frame based on the beauty parameters of the second image frame to obtain the second image frame; The video is generated based on a plurality of the second image frames.
12. The method according to claim 10, characterized in that The method further comprises: The video is displayed on a display interface of the terminal.
13. The method according to claim 12, characterized in that Before displaying the video, the method further includes: Obtaining the beauty mode of the user corresponding to the target face from the storage space; The beautification mode for identifying the target face is different from the beautification mode of the user corresponding to the target face.
14. The method according to claim 13, characterized in that After identifying that the beautification mode of the target face is different from the beautification mode of the user corresponding to the target face, the method further includes: The beautification mode of the user corresponding to the target face in the storage space is updated to the beautification mode of the target face.
15. An image processing device, characterized in that: include: A first activation module is configured to be executed in a display interface of the terminal and activate the beautification function in response to detecting an activation signal of the beautification function; The second startup module is configured to execute beautification processing in response to detecting the presence of a target face in the display interface of the terminal, wherein the beautification processing includes determining a beautification mode of the target face and a beautification intensity of the target face, wherein the beautification mode of the target face and / or the beautification intensity of the target face are determined based on parameters of a user corresponding to the target face.
16. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: Implement the steps of the method according to any one of claims 1 to 14.
17. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the method according to any one of claims 1 to 14 are implemented.