CN111553216A - Image processing method, electronic device, and storage medium - Google Patents

Image processing method, electronic device, and storage medium Download PDF

Info

Publication number
CN111553216A
CN111553216A CN202010313587.7A CN202010313587A CN111553216A CN 111553216 A CN111553216 A CN 111553216A CN 202010313587 A CN202010313587 A CN 202010313587A CN 111553216 A CN111553216 A CN 111553216A
Authority
CN
China
Prior art keywords
image
faces
expression
face
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010313587.7A
Other languages
Chinese (zh)
Inventor
陈露兰
邓伟泽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202010313587.7A priority Critical patent/CN111553216A/en
Publication of CN111553216A publication Critical patent/CN111553216A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/174Facial expression recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation

Abstract

The embodiment of the invention discloses an image processing method, electronic equipment and a storage medium, wherein the image processing method comprises the following steps: displaying a first image; under the condition that the first image comprises at least two faces, recognizing expressions of M faces in the at least two faces, wherein M is a positive integer; and under the condition that the expression of a target face in the M faces meets a first preset condition, performing image processing on a target area of the target face in the first image, and outputting a second image. The embodiment of the invention can be used for carrying out image processing on the target face with the expression meeting the first preset condition, but not carrying out image processing on all faces in the first image, thereby meeting the requirement that a user does not need to carry out image processing on part of faces, carrying out corresponding image processing based on the expression and being convenient and fast to operate.

Description

Image processing method, electronic device, and storage medium
Technical Field
Embodiments of the present invention relate to the field of communications technologies, and in particular, to an image processing method, an electronic device, and a storage medium.
Background
As the shooting performance of electronic devices (such as mobile phones) is continuously improved, the simple shooting function has not been able to meet the user's requirements. One shooting requirement of the user is to perform image processing (such as beautifying processing, sticker adding and the like) on the shot person photo.
The current image processing method is to process all the people in the picture. However, some users are reluctant to perform image processing on the face area in the photo, and the users perform corresponding image processing operations, which results in a complicated operation process.
Disclosure of Invention
The embodiment of the invention provides an image processing method, electronic equipment and a storage medium, which can solve the problem of complicated operation process of image processing in a photo.
In order to solve the technical problem, the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides an image processing method, which is applied to an electronic device, and the method includes:
displaying a first image;
under the condition that the first image comprises at least two faces, recognizing expressions of M faces in the at least two faces, wherein M is a positive integer;
and under the condition that the expression of a target face in the M faces meets a first preset condition, performing image processing on a target area of the target face in the first image, and outputting a second image.
In a second aspect, an embodiment of the present invention provides an electronic device, including:
the image display module is used for displaying a first image;
the expression recognition module is used for recognizing the expressions of M faces in the at least two faces under the condition that the first image comprises the at least two faces, wherein M is a positive integer;
and the image processing module is used for carrying out image processing on the target area of the target face in the first image and outputting a second image under the condition that the expression of the target face in the M faces meets a first preset condition.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor, where the computer program, when executed by the processor, implements the steps of the image processing method described above.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the image processing method described above.
In the embodiment of the present invention, by recognizing the expressions of M faces in the first image, image processing is performed on the region of the target face of which the expression satisfies the first predetermined condition among the M faces. Therefore, in the embodiment of the present invention, the user can make corresponding expressions according to needs, so that the electronic device performs image processing on the target face whose expression meets the first predetermined condition, rather than performing image processing on all faces in the first image. Corresponding image processing can be carried out based on the expression, the operation is convenient, and for the same image, image processing can be carried out on one part of face in the image, and image processing can not be carried out on the other part of face, so that the requirement that the user does not need to carry out image processing on the part of face is met, and the use experience of the user is improved.
Drawings
Fig. 1 is a schematic flowchart of an image processing method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating an image processing interface according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating another image processing method according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating another image processing method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 6 shows a hardware structure diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides an image processing method. Fig. 1 is a schematic flow diagram of an image processing method according to an embodiment of the present invention. As shown in fig. 1, the image processing method includes:
step 101, displaying a first image.
Alternatively, the first image may be a preview image on a capture preview interface (such as a capture preview interface or a video preview interface). For example, the electronic device displays the previewed first image on a capture preview interface. Optionally, after the first image for previewing is displayed on the shooting preview interface, a shooting input of a user can be received, and shooting is performed in response to the shooting input, so that the first image in the form of a photo or a video frame is obtained.
Alternatively, the first image may be a photograph taken or an image pre-stored in the electronic device.
Step 102, under the condition that the first image comprises at least two faces, identifying expressions of M faces in the at least two faces, wherein M is a positive integer.
Optionally, the M faces are faces in a predetermined region (such as a central region) in the first image. Alternatively, the M faces are faces selected by the user in the first image.
Optionally, in a case that the first image is a preview image taken on a preview interface or a shot photograph, before recognizing expressions of M faces of at least two faces, the image processing method further includes: receiving an input of a user to turn on a predetermined photographing function (such as an expressive beauty function) on a photographing preview interface; in response to the input, a photographing function is turned on. Then, a face algorithm is used to identify the face on the preview image.
And 103, under the condition that the expression of the target face in the M faces meets a first preset condition, performing image processing on the target area of the target face in the first image, and outputting a second image.
Optionally, the first predetermined condition includes that the expression of the target face matches a predetermined expression. Wherein the matching of the expression of the target face with the predetermined expression comprises that the expression of the target face is consistent with the predetermined expression or the similarity is greater than a predetermined similarity threshold.
The predetermined emotions may be system default or user-defined. Optionally, the user clicks a setting button on the shooting preview interface, the electronic device may display an interface for setting a predetermined expression, and the user may set the predetermined expression according to the user's own needs. For example, the predetermined expression is set to a smile expression, so that after the first image shown in fig. 2 is obtained, image processing is performed on a face 201 having the smile expression in the first image, and a face 202 having no smile expression is not subjected to image processing.
Wherein the image processing comprises beautifying and/or adding a sticker. The beautifying treatment comprises beautifying, tardy beautifying or anti-beautifying for improving the face value.
In the embodiment of the present invention, by recognizing the expressions of M faces in the first image, image processing is performed on the region of the target face of which the expression satisfies the first predetermined condition among the M faces. Therefore, in the embodiment of the present invention, the user can make corresponding expressions according to needs, so that the electronic device performs image processing on the target face whose expression meets the first predetermined condition, rather than performing image processing on all faces in the first image. Corresponding image processing can be carried out based on the expression, the operation is convenient, and to same image, can carry out image processing to some face in this image, and can not carry out image processing to another part face, has satisfied the user and need not carry out image processing's demand to some face, has promoted user's use and has experienced, also can improve interestingly.
In the case that the first image is a preview image taken on a preview interface or a shot photo, if the facial expression in the first image is not obvious enough, the facial expression cannot be accurately recognized. To solve the technical problem, an embodiment of the present invention provides another image processing method, as shown in fig. 3, the image processing method includes:
step 301, displaying a first image;
step 302, under the condition that the first image includes at least two faces, acquiring a first video associated with the first image, wherein a difference value between the starting shooting time or the ending shooting time of the first video and the shooting time of the first image is within a preset time range.
And 303, amplifying the change range of the facial expression in the first video to obtain a second video.
Step 304, performing expression recognition on the faces in the second video to obtain expressions of M faces in the first image, wherein M is a positive integer;
step 305, under the condition that the expression of the target face in the M faces meets a first preset condition, performing image processing on the target area of the target face in the first image, and outputting a second image.
Step 301 and step 305 are similar to step 101 and step 103 in the embodiment of fig. 1, and are not repeated here. The following mainly describes steps 302 to 304 in the embodiment of the present invention.
In step 302, optionally, in the case that the first image is a preview image, the first video may be synthesized from a plurality of first preview images subsequent to the first image, wherein a difference between a shooting time of a last preview image in the plurality of first preview images and a shooting time of the first image is within a predetermined time range. In this way, the difference between the end capturing time of the first video composed of the plurality of first preview images and the capturing time of the first image is within the predetermined time range.
Alternatively, in the case where the first image is a preview image, the first video may be synthesized from a plurality of second preview images preceding the first image, where a difference between a capturing time of an initial preview image in the plurality of second preview images and a capturing time of the first image is within a predetermined time range. In this way, the difference between the shooting start time of the first video composed of the plurality of second preview images and the shooting time of the first image is within the predetermined time range.
Alternatively, after the first image is displayed, if a photographing input by the user is received, the first image is saved in the form of a photograph or a video frame in response to the photographing input. The first video may be a video taken after the first image is taken. The difference between the start shooting time of the first video and the shooting time of the first image (i.e., the time in response to the shooting input) is within a predetermined time range.
The difference value between the shooting starting time or the shooting ending time of the first video and the shooting time of the first image is within a preset time range, so that the facial expression in the first video can represent the facial expression in the first image. As an example, the difference between the shooting start time or shooting end time of the first video and the shooting time of the first image is zero, such as immediately after the first image is shot, the shot includes the first video, so that the facial expression in the first video substantially coincides with the facial expression in the first image. The duration of the first video is predetermined, for example, the duration of the first video is 5 seconds or 3 seconds.
In step 303, the Eulerian Video Magnification algorithm (Eulerian Video Magnification) may be used to magnify the variation range of the facial expression in the first Video to obtain a second Video. The expression amplification processing which is not easy to be perceived by naked eyes is realized, so that the expression which is easy to be perceived by human eyes is changed. For example, the amplitude of the rise of the corners of the user's mouth is increased, or the color change of the expressive action is enhanced.
In step 304, since the facial expression in the second video is amplified, the facial expression in the second video is more easily recognized, and the facial expression of each face recognized based on the second video can be regarded as the facial expression in the first image.
In step 304, optionally, performing expression recognition on the face in the second video, which specifically includes: extracting facial expression features in the second video; and inputting the extracted facial expression features into a pre-trained deep learning model, and outputting the facial expression in the second video.
In step 304, optionally, performing expression recognition on the face in the second video, which specifically includes: extracting facial expression features in the second video; and performing similarity matching on the facial expression characteristics in the second video and the pre-stored facial expression characteristics to obtain the facial expression in the second video.
Additionally, after step 305, the second image may be saved to an album. The user can also quit the expression beautifying function according to the requirement.
The solution of the embodiment of the present invention is further illustrated by two examples.
For example, the electronic device displays the previewed first image on the shooting preview interface, and immediately shoots the first video after obtaining the first image existing in a photo. And then amplifying the change amplitude of the facial expression in the first video to obtain a second video. And recognizing the facial expression in the first image through the second video.
For another example, the electronic device displays a previewed first image on a shooting preview interface, then acquires a plurality of images previewed before the first image, and combines the plurality of images into a first video. And amplifying the change amplitude of the facial expression in the first video to obtain a second video. And recognizing the facial expression in the first image through the second video.
In the embodiment of the invention, the change amplitude of the facial expression in the first video is amplified to obtain the second video. Therefore, even if the facial expression in the first video is not obvious enough, the facial expression in the first video is amplified, so that the facial expression is more obviously expressed in the second video. Therefore, the facial expression at the time of capturing the first image can be accurately recognized using the second video.
Optionally, after performing expression recognition on the faces in the second video to obtain expressions of M faces, the image processing method further includes:
and respectively displaying a target identifier corresponding to the face in the area of each face in the M faces, wherein the target identifier is used for indicating the expression of the face corresponding to the target identifier. For example, a label of smiling is added to the face a in the first image, and a label of putting aside is added to the face B in the first image. Therefore, the target mark is used for indicating the expression information such as smiling expression or mouth-left expression of the corresponding face.
Then, a target face with an expression meeting a first predetermined condition can be determined from the M faces according to the target identifier corresponding to each face in the M faces.
In the embodiment of the invention, the target identification corresponding to the face is respectively displayed in the area of each face in the M faces, so that a user can conveniently check whether the recognized facial expression is correct or not.
Optionally, after the target region of each of the M faces respectively displays the target identifier corresponding to the face, the image processing method further includes:
and storing the target identification corresponding to each face in the M faces, and deleting the first video and the second video.
In the embodiment of the invention, the target identification corresponding to each face in the M faces is stored, so that the expression of each face can be recognized once by using the second video. If the expression of each face needs to be identified again due to the fact that image processing needs to be carried out again subsequently, the expression of each face can be obtained according to the target identification corresponding to each face, the second video does not need to be used again for identifying the facial expression, and data processing efficiency is improved.
In addition, since the first video and the second video have roles in recognizing a facial expression, the two videos have no other role after recognizing the facial expression. Therefore, the first video and the second video can be deleted, and the first video and the second video are prevented from occupying limited storage space. Of course, the first video or the second video may also be saved, which may be determined according to actual situations, and this is not limited in the embodiment of the present invention.
If the user is far away from the lens in the case of shooting the first image, the face area is smaller in the picture of the first video, and even if the change range of the facial expression in the first video is amplified, the face area is smaller in the picture of the second video. Therefore, when the second video is used for face recognition, the interference of the non-face area in the second video to the face recognition is large.
In view of the above technical problem, optionally, before acquiring the first video associated with the first image, the image processing method further includes:
under the condition that the first image is a preview image displayed on a shooting preview interface, acquiring the proportion of the area of M faces on the shooting preview interface to the total area of the shooting preview interface;
in the case where the ratio is less than a predetermined threshold, increasing the zoom factor;
and under the condition that the zoom multiple is increased to meet a second preset condition, shooting is carried out to obtain a first video.
Wherein the second predetermined condition comprises increasing the zoom factor to a predetermined zoom factor. Or, the second predetermined condition includes that the zoom magnification is increased to the maximum on the premise that all the M faces are in the shooting preview interface.
In the embodiment of the invention, when the ratio of the area of the M faces on the shooting preview interface to the total area of the shooting preview interface is smaller than a preset threshold, which indicates that the face area is smaller on the shooting preview interface, the zoom factor is increased. Therefore, the face area in the shot first video is larger, so that the situation that excessive interference content (such as a non-face area) exists in the first video is avoided, the situation that excessive interference content exists in the second video is also avoided, and the facial expression can be recognized more accurately based on the second video.
Optionally, recognizing the expressions of M faces of at least two faces includes:
identifying a region of each of the M faces in the first image;
acquiring a target expression image matched with the region similarity of each face in the M faces;
acquiring the expression corresponding to each target expression image based on the corresponding relation between the preset expression image and the expression;
and determining the expression of each face in the M faces according to the expression corresponding to each target facial expression image.
The first image in the embodiment of the present invention may be an image captured by an electronic device, and may also be an image captured by another electronic device or an image downloaded from a network.
For example, a face a and a face B exist in the first image, the expression feature of the face a is extracted from the area of the face a in the first image, the similarity between the expression feature of the face a and the expression feature of the predetermined expression image is calculated, and the target expression image C with the highest similarity is obtained from the predetermined expression image. Similarly, a target expression image D with the highest similarity to the expression features of the face B is obtained from the preset expression images. The target expression image C is preset to correspond to the smile expression, and the target expression image D corresponds to the expression for lifting the eyebrows. Therefore, the face a in the first image is a smiling expression, and the face B is an expression for lifting the eyebrows.
In the embodiment of the present invention, the expression of each face in the first image may be recognized by using the first image, so that the region of the target face in the first image is image-processed based on the expression of each face.
An embodiment of the present invention provides another image processing method, as shown in fig. 4, the image processing method includes:
step 401, displaying the first image.
Step 402, recognizing expressions of M faces in at least two faces under the condition that the first image comprises at least two faces, wherein M is a positive integer;
step 403, under the condition that the expression of the target face in the M faces meets a first predetermined condition, acquiring a target image processing mode corresponding to the expression of the target face according to a preset correspondence between the expression and the image processing mode.
And step 404, performing image processing on the region of the target face in the first image according to the target image processing mode, and outputting a second image.
Step 401 and step 402 are similar to step 101 and step 102 in the embodiment of fig. 1, and are not repeated here. The following mainly describes step 403 and step 404.
In step 403, optionally, the correspondence between the expressions and the image processing manners includes a correspondence between the expressions and the beauty functions, that is, different expressions correspond to different beauty functions. For example, in the first image, the expression of the face a is a smiling expression, and the expression of the face B is an expression of raising eyebrows. Then, in step 404, based on the corresponding relationship between the expression and the beautifying function, the face a in the first image is thinned and whitened, and the face B in the first image is beautified.
In step 403, optionally, the correspondence between the expression and the image processing manner includes a correspondence between the expression and the beauty degree, that is, different expressions correspond to different degrees of beauty. For example, in the first image, the expression of the face a is a smile expression, and the expression of the face B is a smile expression. Then, in step 404, based on the correspondence between the expression and the beauty degree, the face a in the first image is beautified by level 6, and the face B in the first image is beautified by level 3.
Optionally, before step 401, the user may customize the corresponding relationship between the expression and the image processing manner. For example, the user may set face thinning and whitening corresponding to smiling expressions, and lift the expression of eyebrows corresponding to disguising and beautifying. Or the user sets that the expression for lifting the eyebrows corresponds to 6 levels of beauty; the expression of the slightly open eyes corresponds to a level 3 beauty (i.e., a bad or reverse beauty). In addition, the correspondence may be a system default.
In the embodiment of the invention, the expressions of the faces are different, so that the image processing modes of the face area in the first image are different, and the requirements of the user on image processing of different faces in the same image in different modes are met.
So far, fig. 1 to 4 illustrate an image processing method according to an embodiment of the present invention. In any of the above embodiments, the first image may be a preview image or a photograph. Or the first image is a frame image in the video. Thus, the image processing method in the embodiment of the invention can be applied to not only scenes for taking photos, but also scenes for taking videos.
Based on the image processing method of the foregoing embodiment, accordingly, an embodiment of the present invention provides an electronic device, as shown in fig. 5, the electronic device includes:
an image display module 501, configured to display a first image;
an expression recognition module 502, configured to recognize expressions of M faces of the at least two faces when the first image includes the at least two faces, where M is a positive integer;
the image processing module 503 is configured to, when an expression of a target face in the M faces satisfies a first predetermined condition, perform image processing on a target area of the target face in the first image, and output a second image.
In the embodiment of the present invention, by recognizing the expressions of M faces in the first image, image processing is performed on the region of the target face of which the expression satisfies the first predetermined condition among the M faces. Therefore, in the embodiment of the present invention, the user can make corresponding expressions according to needs, so that the electronic device performs image processing on the target face whose expression meets the first predetermined condition, rather than performing image processing on all faces in the first image. Corresponding image processing can be carried out based on the expression, the operation is convenient, and aiming at the same image, image processing can be carried out on one part of face in the image, image processing can not be carried out on the other part of face, the requirement that the user does not need to carry out image processing on the part of face is met, and the use experience of the user is improved.
Optionally, the electronic device further comprises:
the video acquisition module is used for acquiring a first video associated with a first image, wherein the difference value between the starting shooting time or the ending shooting time of the first video and the shooting time of the first image is within a preset time range;
the expression processing module is used for amplifying the change amplitude of the facial expression in the first video to obtain a second video;
the expression recognition module 502 is specifically configured to perform expression recognition on the faces in the second video to obtain expressions of M faces.
In the embodiment of the invention, the change amplitude of the facial expression in the first video is amplified to obtain the second video. Therefore, even if the facial expression in the first video is not obvious enough, the facial expression in the first video is amplified, so that the facial expression is more obviously expressed in the second video. Therefore, the facial expression at the time of capturing the first image can be accurately recognized using the second video.
Optionally, the electronic device further comprises:
and the expression identifier display module is used for respectively displaying a target identifier corresponding to the face in the area of each face in the M faces, and the target identifier is used for indicating the expression of the face corresponding to the target identifier.
In the embodiment of the invention, the target identification corresponding to the face is respectively displayed in the area of each face in the M faces, so that a user can conveniently check whether the recognized facial expression is correct or not.
Optionally, the electronic device further comprises:
the identification storage module is used for storing a target identification corresponding to each face in the M faces;
and the video deleting module is used for deleting the first video and the second video.
In the embodiment of the invention, the target identification corresponding to each face in the M faces is stored, so that the expression of each face can be recognized once by using the second video. If the expression of each face needs to be identified again due to the fact that image processing needs to be carried out again subsequently, the expression of each face can be obtained according to the target identification corresponding to each face, the second video does not need to be used again for identifying the facial expression, and data processing efficiency is improved.
In addition, since the first video and the second video have roles in recognizing a facial expression, the two videos have no other role after recognizing the facial expression. Therefore, the first video and the second video can be deleted, and the first video and the second video are prevented from occupying limited storage space. Of course, the first video or the second video may also be saved, which may be determined according to actual situations, and this is not limited in the embodiment of the present invention.
Optionally, the electronic device further comprises:
the area ratio acquisition module is used for acquiring the ratio of the area of the M faces on the shooting preview interface to the total area of the shooting preview interface under the condition that the first image is a preview image displayed on the shooting preview interface;
the zooming multiple increasing module is used for increasing the zooming multiple under the condition that the proportion is smaller than a preset threshold value;
and the video shooting module is used for shooting under the condition that the zoom multiple is increased to meet a second preset condition to obtain a first video.
In the embodiment of the invention, when the ratio of the area of the M faces on the shooting preview interface to the total area of the shooting preview interface is smaller than a preset threshold, which indicates that the face area is smaller on the shooting preview interface, the zoom factor is increased. Therefore, the face area in the shot first video is larger, so that the situation that excessive interference content (such as a non-face area) exists in the first video is avoided, the situation that excessive interference content exists in the second video is also avoided, and the facial expression can be recognized more accurately based on the second video.
Optionally, the expression recognition module 502 includes:
the region identification module is used for identifying the region of each face in the M faces in the first image;
the expression image acquisition module is used for acquiring a target expression image matched with the region similarity of each face in the M faces;
the expression acquisition module is used for acquiring expressions corresponding to the target expression images respectively based on the corresponding relation between the preset expression images and the expressions;
and the expression determining module is used for determining the expression of each face in the M faces according to the expression corresponding to each target facial expression image.
In the embodiment of the present invention, the expression of each face in the first image may be recognized by using the first image, so that the region of the target face in the first image is image-processed based on the expression of each face.
Optionally, the image processing module 503 comprises:
the processing mode acquisition module is used for acquiring a target image processing mode corresponding to the expression of the target face according to the preset corresponding relation between the expression and the image processing mode;
and the image output module is used for carrying out image processing on the region of the target face in the first image according to the target image processing mode and outputting a second image.
In the embodiment of the invention, the expressions of the faces are different, so that the image processing modes of the face area in the first image are different, and the requirements of the user on image processing of different faces in the same image in different modes are met.
Fig. 6 shows a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention, where the electronic device 600 includes, but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, a processor 610, and a power supply 611. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 6 does not constitute a limitation of the electronic device, and that the electronic device may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. In the embodiment of the present invention, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
The display unit 606 is configured to display a first image;
a processor 610, configured to identify expressions of M faces of the at least two faces, where M is a positive integer, if the first image includes the at least two faces;
the processor 610 is further configured to perform image processing on a target area of a target face in the first image and output a second image when an expression of the target face in the M faces satisfies a first predetermined condition.
In the embodiment of the present invention, by recognizing the expressions of M faces in the first image, image processing is performed on the region of the target face of which the expression satisfies the first predetermined condition among the M faces. Therefore, in the embodiment of the present invention, the user can make corresponding expressions according to needs, so that the electronic device performs image processing on the target face whose expression meets the first predetermined condition, rather than performing image processing on all faces in the first image. The image processing method and the image processing device have the advantages that image processing can be carried out on one part of face in the image aiming at the same image, image processing can be not carried out on the other part of face, the requirement that a user does not need to carry out image processing on the part of face is met, and use experience of the user is improved.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 601 may be used for receiving and sending signals during a message sending and receiving process or a call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 610; in addition, the uplink data is transmitted to the base station. In general, radio frequency unit 601 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. Further, the radio frequency unit 601 may also communicate with a network and other devices through a wireless communication system.
The electronic device provides wireless broadband internet access to the user via the network module 602, such as assisting the user in sending and receiving e-mails, browsing web pages, and accessing streaming media.
The audio output unit 603 may convert audio data received by the radio frequency unit 601 or the network module 602 or stored in the memory 609 into an audio signal and output as sound. Also, the audio output unit 603 may also provide audio output related to a specific function performed by the electronic apparatus 600 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 603 includes a speaker, a buzzer, a receiver, and the like.
The input unit 604 is used to receive audio or video signals. The input Unit 604 may include a Graphics Processing Unit (GPU) 6041 and a microphone 6042, and the Graphics processor 6041 processes image data of a still picture or video obtained by an image capturing apparatus (such as a camera) in a video capture mode or an image capture mode. The processed image frames may be displayed on the display unit 606. The image frames processed by the graphic processor 6041 may be stored in the memory 609 (or other storage medium) or transmitted via the radio frequency unit 601 or the network module 602. The microphone 6042 can receive sound, and can process such sound into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 601 in case of the phone call mode.
The electronic device 600 also includes at least one sensor 605, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 6061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 6061 and/or the backlight when the electronic apparatus 600 is moved to the ear. As one type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of an electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 605 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 606 is used to display information input by the user or information provided to the user. The Display unit 606 may include a Display panel 6061, and the Display panel 6061 may be configured by a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 607 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device. Specifically, the user input unit 607 includes a touch panel 6071 and other input devices 6072. Touch panel 6071, also referred to as a touch screen, may collect touch operations by a user on or near it (e.g., operations by a user on or near touch panel 6071 using a finger, stylus, or any suitable object or accessory). The touch panel 6071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 610, receives a command from the processor 610, and executes the command. In addition, the touch panel 6071 can be implemented by various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The user input unit 607 may include other input devices 6072 in addition to the touch panel 6071. Specifically, the other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a track ball, a mouse, and a joystick, which are not described herein again.
Further, the touch panel 6071 can be overlaid on the display panel 6061, and when the touch panel 6071 detects a touch operation on or near the touch panel 6071, the touch operation is transmitted to the processor 610 to determine the type of the touch event, and then the processor 610 provides a corresponding visual output on the display panel 6061 according to the type of the touch event. Although the touch panel 6071 and the display panel 6061 are shown in fig. 6 as two separate components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 6071 and the display panel 6061 may be integrated to implement the input and output functions of the electronic device, and this is not limited here.
The interface unit 608 is an interface for connecting an external device to the electronic apparatus 600. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 608 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the electronic device 600 or may be used to transmit data between the electronic device 600 and external devices.
The memory 609 may be used to store software programs as well as various data. The memory 609 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 609 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 610 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 609, and calling data stored in the memory 609, thereby performing overall monitoring of the electronic device. Processor 610 may include one or more processing units; preferably, the processor 610 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 610.
The electronic device 600 may further include a power supply 611 (e.g., a battery) for supplying power to the various components, and preferably, the power supply 611 may be logically connected to the processor 610 via a power management system, such that the power management system may be used to manage charging, discharging, and power consumption.
In addition, the electronic device 600 includes some functional modules that are not shown, and are not described in detail herein.
An embodiment of the present invention further provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, where the computer program, when executed by the processor, implements each process of the image processing method embodiment, and can achieve the same technical effect, and details are not repeated here to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the embodiment of the image processing method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. An image processing method applied to an electronic device, the method comprising:
displaying a first image;
under the condition that the first image comprises at least two faces, recognizing expressions of M faces in the at least two faces, wherein M is a positive integer;
and under the condition that the expression of a target face in the M faces meets a first preset condition, performing image processing on a target area of the target face in the first image, and outputting a second image.
2. The method of claim 1, wherein before the recognizing the expressions of the M faces of the at least two faces, the method further comprises:
acquiring a first video associated with the first image, wherein the difference value between the starting shooting time or the ending shooting time of the first video and the shooting time of the first image is within a preset time range;
amplifying the change amplitude of the facial expression in the first video to obtain a second video;
the recognizing the expressions of the M faces of the at least two faces includes:
and performing expression recognition on the faces in the second video to obtain the expressions of the M faces.
3. The method of claim 2, wherein after performing expression recognition on the faces in the second video to obtain the expressions of the M faces, the method further comprises:
and respectively displaying a target identifier corresponding to the face in the area of each face in the M faces, wherein the target identifier is used for indicating the expression of the face corresponding to the target identifier.
4. The method according to claim 3, wherein after the target region of each of the M faces respectively displays a target identifier corresponding to the face, the method further comprises:
and storing the target identification corresponding to each face in the M faces, and deleting the first video and the second video.
5. The method of claim 2, wherein prior to the obtaining the first video associated with the first image, the method further comprises:
under the condition that the first image is a preview image displayed on a shooting preview interface, acquiring the proportion of the area of the M faces on the shooting preview interface to the total area of the shooting preview interface;
increasing a zoom factor if the ratio is less than a predetermined threshold;
and shooting to obtain the first video under the condition that the zoom multiple is increased to meet a second preset condition.
6. The method of claim 1, wherein the recognizing the expressions of the M faces of the at least two faces comprises:
identifying a region of each of the M faces in the first image;
acquiring a target expression image matched with the region similarity of each face in the M faces;
acquiring the expression corresponding to each target expression image based on the corresponding relation between the preset expression image and the expression;
and determining the expression of each face in the M faces according to the expression corresponding to each target face expression image.
7. The method according to any one of claims 1 to 6, wherein the image processing the target region of the target face in the first image and outputting a second image comprises:
acquiring a target image processing mode corresponding to the expression of the target face according to a preset corresponding relation between the expression and the image processing mode;
and according to the target image processing mode, carrying out image processing on the region of the target human face in the first image, and outputting the second image.
8. An electronic device, comprising:
the image display module is used for displaying a first image;
the expression recognition module is used for recognizing the expressions of M faces in the at least two faces under the condition that the first image comprises the at least two faces, wherein M is a positive integer;
and the image processing module is used for carrying out image processing on the target area of the target face in the first image and outputting a second image under the condition that the expression of the target face in the M faces meets a first preset condition.
9. An electronic device, comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the image processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the image processing method according to any one of claims 1 to 7.
CN202010313587.7A 2020-04-20 2020-04-20 Image processing method, electronic device, and storage medium Pending CN111553216A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010313587.7A CN111553216A (en) 2020-04-20 2020-04-20 Image processing method, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010313587.7A CN111553216A (en) 2020-04-20 2020-04-20 Image processing method, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
CN111553216A true CN111553216A (en) 2020-08-18

Family

ID=72005801

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010313587.7A Pending CN111553216A (en) 2020-04-20 2020-04-20 Image processing method, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN111553216A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101247482A (en) * 2007-05-16 2008-08-20 北京思比科微电子技术有限公司 Method and device for implementing dynamic image processing
CN108182714A (en) * 2018-01-02 2018-06-19 腾讯科技(深圳)有限公司 Image processing method and device, storage medium
WO2018188453A1 (en) * 2017-04-11 2018-10-18 腾讯科技(深圳)有限公司 Method for determining human face area, storage medium, and computer device
CN110175596A (en) * 2019-06-04 2019-08-27 重庆邮电大学 The micro- Expression Recognition of collaborative virtual learning environment and exchange method based on double-current convolutional neural networks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101247482A (en) * 2007-05-16 2008-08-20 北京思比科微电子技术有限公司 Method and device for implementing dynamic image processing
WO2018188453A1 (en) * 2017-04-11 2018-10-18 腾讯科技(深圳)有限公司 Method for determining human face area, storage medium, and computer device
CN108182714A (en) * 2018-01-02 2018-06-19 腾讯科技(深圳)有限公司 Image processing method and device, storage medium
CN110175596A (en) * 2019-06-04 2019-08-27 重庆邮电大学 The micro- Expression Recognition of collaborative virtual learning environment and exchange method based on double-current convolutional neural networks

Similar Documents

Publication Publication Date Title
CN110740259B (en) Video processing method and electronic equipment
CN110706179B (en) Image processing method and electronic equipment
CN108491775B (en) Image correction method and mobile terminal
CN109600550B (en) Shooting prompting method and terminal equipment
CN109461117B (en) Image processing method and mobile terminal
CN108989672B (en) Shooting method and mobile terminal
CN107623778B (en) Incoming call answering method and mobile terminal
CN109005336B (en) Image shooting method and terminal equipment
CN109819167B (en) Image processing method and device and mobile terminal
CN109194839B (en) Display control method, terminal and computer readable storage medium
CN108683850B (en) Shooting prompting method and mobile terminal
CN108052819B (en) Face recognition method, mobile terminal and computer readable storage medium
CN110062171B (en) Shooting method and terminal
CN109448069B (en) Template generation method and mobile terminal
CN108984143B (en) Display control method and terminal equipment
CN111401463A (en) Method for outputting detection result, electronic device, and medium
CN108174110B (en) Photographing method and flexible screen terminal
CN108924413B (en) Shooting method and mobile terminal
CN111080747A (en) Face image processing method and electronic equipment
CN111064888A (en) Prompting method and electronic equipment
CN107809515B (en) Display control method and mobile terminal
CN107817963B (en) Image display method, mobile terminal and computer readable storage medium
CN111402157B (en) Image processing method and electronic equipment
CN110443752B (en) Image processing method and mobile terminal
CN108282611B (en) Image processing method and mobile terminal

Legal Events

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