CN111047511A - Image processing method and electronic equipment - Google Patents

Image processing method and electronic equipment Download PDF

Info

Publication number
CN111047511A
CN111047511A CN201911419698.XA CN201911419698A CN111047511A CN 111047511 A CN111047511 A CN 111047511A CN 201911419698 A CN201911419698 A CN 201911419698A CN 111047511 A CN111047511 A CN 111047511A
Authority
CN
China
Prior art keywords
color
makeup
beautified
image
preset
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
CN201911419698.XA
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 CN201911419698.XA priority Critical patent/CN111047511A/en
Publication of CN111047511A publication Critical patent/CN111047511A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the invention provides an image processing method and electronic equipment, wherein the method comprises the steps of firstly receiving a first input aiming at an area to be beautified in an image to be beautified, responding to the first input, determining the area to be beautified of a target, displaying color options, acquiring a plurality of reference images before displaying the color options, extracting the top N colors which are distributed most in the reference images to be used as alternative colors, and using at least one color in the alternative colors as a preset makeup color. Then, a second input for the target color option is received, in response to the second input, the preset makeup color corresponding to the target color option is determined as the target color, and the color of the makeup area in the target area to be beautified is set as the target color. Like this, can improve user's selectivity to a certain extent, and then richen beautiful makeup effect to and can ensure that beautiful makeup effect is comparatively natural to a certain extent.

Description

Image processing method and electronic equipment
Technical Field
The present invention relates to the field of electronic devices, and in particular, to an image processing method and an electronic device.
Background
With the continuous development of image processing technology, the demand of people for image beautification processing is no longer limited to modifying flaws in images. In order to improve the beautifying effect, there is an increasing demand for adding makeup to the face of a person in an image.
In the prior art, the beautification treatment is often directly carried out on the human body area according to a fixed makeup template for the image to be beautified. In the mode of directly beautifying according to the fixed template, the user selectivity is low, and the beautifying effect of the image is relatively harsh and poor.
Disclosure of Invention
The embodiment of the invention provides an image processing method and electronic equipment, and aims to solve the problems that when beautifying an image, user selectivity is low, and the beautifying effect of the image is relatively harsh and poor.
In order to solve the technical problem, the invention is realized as follows:
in a first aspect, an embodiment of the present invention further provides an image processing method, which is applied to an electronic device, and the method includes:
receiving a first input aiming at an area to be beautified in an image to be beautified;
responding to the first input, determining a target area to be beautified, and displaying color options, wherein different color options correspond to different preset makeup colors;
receiving a second input for the target color option;
in response to the second input, determining a preset makeup color corresponding to the target color option as a target color;
setting the color of a makeup area in the target area to be beautified as the target color;
wherein, before the displaying the color option, the method further comprises:
acquiring a plurality of reference images;
and extracting the top N colors distributed most in the reference image as alternative colors, and taking at least one color in the alternative colors as the preset makeup color. .
In a second aspect, an embodiment of the present invention further provides an electronic device, including:
the first receiving module is used for receiving a first input aiming at an area to be beautified in an image to be beautified;
the first determining module is used for responding to the first input, determining a target area to be beautified and displaying color options, wherein different color options correspond to different preset makeup colors;
a second receiving module for receiving a second input for the target color option;
a second determination module, configured to determine, in response to the second input, a preset makeup color corresponding to the target color option as a target color;
the setting module is used for setting the color of the makeup area in the target area to be beautified as the target color;
wherein the electronic device further comprises:
a first obtaining module, configured to obtain a plurality of reference images before the first determining module performs displaying the color option;
and the extracting module is used for extracting the top N colors which are most distributed in the reference image as alternative colors, and taking at least one color in the alternative colors as the preset makeup color.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor, a memory, and an image processing program stored on the memory and executable on the processor, and when executed by the processor, the image processing program implements the steps of the image processing method according to the first aspect.
In a fourth aspect, the embodiment of the present invention provides a computer-readable storage medium, where an image processing program is stored on the computer-readable storage medium, and when executed by a processor, the image processing program implements the steps of the image processing method according to the first aspect.
In summary, the image processing method provided in the embodiment of the present invention may receive a first input for an area to be beautified in an image to be beautified, determine an area to be beautified of a target in response to the first input, and display color options, before displaying the color options, obtain a plurality of reference images, extract the top N colors most distributed in the reference images as candidate colors, and use at least one of the candidate colors as a preset makeup color. Then, a second input for the target color option is received, in response to the second input, the preset makeup color corresponding to the target color option is determined as the target color, and the color of the makeup area in the target area to be beautified is set as the target color. Compared with the mode of beautifying the human body area directly according to the fixed makeup template, the embodiment of the invention provides various preset makeup colors for users by extracting the color which is most distributed in the reference image as the preset makeup color, thereby improving the selectivity of the users to a certain extent and enriching the beautifying effect. Meanwhile, the preset makeup colors are the colors distributed most in the image, so that the mode of selecting the target color from the preset makeup colors by the user to makeup the target area to be beautified selected by the user can ensure that the makeup effect is natural to a certain extent.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a flow chart illustrating steps of an image processing method according to an embodiment of the present invention;
FIG. 2-1 is a flow chart illustrating steps of another image processing method provided by an embodiment of the present invention;
FIG. 2-2 is a schematic diagram of a reference image according to an embodiment of the present invention;
2-3 are schematic structural diagrams of a three-dimensional color space provided by embodiments of the invention;
FIGS. 2-4 are schematic diagrams of a standard facial feature point provided by an embodiment of the present invention;
FIGS. 2-5 are schematic diagrams of an image to be beautified according to an embodiment of the present invention;
FIGS. 2-6 are schematic diagrams of another image to be beautified according to an embodiment of the present invention;
FIGS. 2-7 are schematic diagrams of a make-up area on the cheek region provided by an embodiment of the present invention;
FIGS. 2-8 are schematic diagrams of a makeup area for a nose area according to an embodiment of the present invention;
fig. 3 is a block diagram of an electronic device according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a hardware structure 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.
Fig. 1 is a flowchart of steps of an image processing method provided by an embodiment of the present invention, where the method may be applied to an electronic device, and as shown in fig. 1, the method may include:
step 101, receiving a first input aiming at an area to be beautified in an image to be beautified.
In the embodiment of the invention, the image to be beautified can be a preview real-time image acquired by a camera of the electronic equipment, and the preview real-time image can be a preview picture containing a human face, or the image to be beautified can also be an image prestored in the electronic equipment. For example, a user may select a picture pre-stored in the electronic device, and accordingly, the electronic device may use the selected picture as an image to be beautified. The image to be beautified may be an image including a face, and the number of faces specifically included may be one or more, which is not limited in the embodiment of the present invention. Further, the area to be beautified can be preset according to each component of the face in the image to be beautified. The area to be beautified contained in the face can be a component which can be beautified when makeup is determined according to actual experience. For example, the area to be beautified may include a forehead area, an eye area, a nose area, a cheek area, a mouth area, and the like.
In the embodiment of the invention, the first input can be selection operation of an area to be beautified in an image to be beautified, and the selection operation can be single click, double click, long press and the like. The user can execute a first input when the beautification processing is required to be performed on the area to be beautified in the image to be beautified, and accordingly the electronic device can receive the first input. For example, the first input may be a click operation performed in a preview face picture captured by a camera. Or, the first input may also be a selection operation of a preset makeup option, and accordingly, the electronic device may determine the area to be beautified corresponding to the makeup option selected by the user as the area to be beautified selected by the first input. The preset makeup options may be makeup detail items corresponding to each area to be beautified, such as eye makeup, lipstick, blush, etc., displayed for the user. Further, the display operation may be performed in a case where an beautification function of the electronic apparatus is activated.
It should be noted that, in the embodiment of the present invention, the boundary between the areas to be beautified may also be displayed in the image to be beautified, so that the user can distinguish different areas to be beautified conveniently, and further, the user can select the area conveniently.
And 102, responding to the first input, determining the target area to be beautified, and displaying color options, wherein different color options correspond to different preset makeup colors.
In the embodiment of the invention, the target area to be beautified can be the area to be beautified selected by the first input. For example, assuming that the user selects the lip region through the first input, the lip region may be determined as the target region to be beautified.
Further, after receiving the first input, it may be considered that the user needs to beautify the face, and therefore, the electronic device may further display the color option. Wherein, the preset makeup color corresponding to the color options can be obtained by performing the following steps of obtaining the preset makeup color before displaying the color options: a plurality of reference images are acquired. In the embodiment of the present invention, the reference image may include a picture acquired from a network in a crawler manner. For example, a crawl tool may be used to search the full web and crawl the pictures that appear and then use the crawled pictures as reference images. The reference image may also include images taken from pictures stored in the electronic device. Therefore, the sources of the reference images can be enriched by acquiring the network images, and the reference images can better accord with the preference of the user to a certain extent by acquiring the images stored in the electronic equipment. It should be noted that the number of the specifically acquired parameter images may be set according to actual requirements, which is not limited in the embodiment of the present invention. For example, the number of parameter images may be 431078129.
Then, the top N colors distributed most in the reference image are extracted as alternative colors, and at least one color in the alternative colors is used as the preset makeup color. In this step, the number of each color in the reference image may be counted, and then the top N colors with the most distribution may be determined according to the number, and used as the candidate colors. When the preset makeup color is determined, a part of colors may be selected from the candidate colors as the preset makeup color, or all the candidate colors may be used as the preset makeup color. In this way, since the most distributed colors tend to be colors having stronger applicability, by using the most distributed colors as the preset makeup colors, the effect of making up the beauty based on these preset makeup colors in the subsequent steps can be ensured. Further, each color option displayed may correspond to one preset makeup color, with different color options corresponding to different preset makeup colors. Therefore, the user can conveniently select the color options corresponding to the preset makeup colors through displaying. It should be noted that the operation of obtaining the preset makeup color may be completed before receiving the first input or may be completed after receiving the first input, and the embodiment of the present invention is not limited thereto.
Step 103, receiving a second input for the target color option.
In the embodiment of the present invention, the second input may be a selection operation of the target color option, and the selection operation may be a single click, a double click, a long press, or the like. The user may perform a second input when the target color needs to be determined, and accordingly, the electronic device may receive the second input.
And 104, responding to the second input, and determining the preset makeup color corresponding to the target color option as the target color.
In an embodiment of the present invention, the target color option may be a color option selected by the second input. For example, assuming that the preset makeup color corresponding to the target color option selected by the second input is white, the white color may be determined as the target color.
And 105, setting the color of the makeup area in the target area to be beautified as the target color.
In the embodiment of the invention, the makeup area can be an area to be processed when the area to be beautified of the target is beautified, and the size of the makeup area can be the same as or smaller than that of the area to be beautified of the target. Specifically, the specific position and the occupied area of the makeup area in the target area to be beautified can be preset according to actual experience.
In practical application scenes, a user changes the colors of different areas of the face by using the cosmetic product so as to realize the beautifying effect. Therefore, beautification can be realized by changing the color of the makeup area in the step. Further, because the user often selects according to the actual needs of the user, the target color can be considered to be the color meeting the beautifying needs of the user, and accordingly, the color of the makeup area can be set to be the target color to increase the makeup for the target area to be beautified, so as to beautify the target area to be beautified and ensure that the beautifying effect meets the needs of the user to a certain extent.
In summary, the image processing method provided in the embodiment of the present invention may receive a first input for an area to be beautified in an image to be beautified, determine an area to be beautified of a target in response to the first input, and display color options, before displaying the color options, obtain a plurality of reference images, extract the top N colors most distributed in the reference images as candidate colors, and use at least one of the candidate colors as a preset makeup color. Then, a second input for the target color option is received, in response to the second input, the preset makeup color corresponding to the target color option is determined as the target color, and the color of the makeup area in the target area to be beautified is set as the target color. Compared with the mode of beautifying the human body area directly according to the fixed makeup template, the embodiment of the invention provides various preset makeup colors for users by extracting the color which is most distributed in the reference image as the preset makeup color, thereby improving the selectivity of the users to a certain extent and enriching the beautifying effect. Meanwhile, the preset makeup colors are the colors distributed most in the image, so that the beautifying effect can be ensured to be natural to a certain extent by the mode that the user selects the target color from the preset makeup colors to beautify the target area to be beautified selected by the user.
Fig. 2-1 is a flowchart of steps of another image processing method provided by an embodiment of the present invention, which may be applied to an electronic device, as shown in fig. 2-1, and the method may include:
step 201, acquiring a plurality of reference images.
Specifically, the implementation manner of this step may refer to the related description in step 102, which is not limited by the embodiment of the present invention.
Step 202, extracting the top N colors distributed most in the reference image as alternative colors, and taking at least one of the alternative colors as the preset makeup color.
In the embodiment of the present invention, the reference image may be first divided by a grid so that each grid includes only one color, then, the number of times of occurrence of each color is counted, the colors are sorted according to the number of times of occurrence, then, according to the sorting result, the first N colors in the sorting result are extracted, and the extracted colors are the candidate colors. The selecting process is implemented by a preset color blending index model, N is a positive integer, and a specific value of N may be preset according to an actual situation, for example, N may be 4, or N may also be 6, and the like. For example, fig. 2-2 is a schematic diagram of a reference image provided by an embodiment of the present invention, and as shown in fig. 2-2, the reference image is divided into a plurality of grids.
It should be noted that, in an actual application scenario, colors of cosmetic products used by a user for making up are often colors suitable for makeup, and colors used by cosmetic products are often colors in a popular classical color system, that is, a relative size relationship between color channel values of the colors is often in accordance with a preset size relationship. Therefore, when the reference image is an image of a cosmetic product, the color of the cosmetic product in the image may be directly extracted, and then the color may be directly determined as a preset makeup color and stored in a preset color library. Further, when the reference image is obtained, a crawler tool can be used for specially obtaining a new product image published by a specified makeup brand, or a makeup user image with recommendation times, approval times or comment times exceeding a preset threshold in social application is crawled. Thus, by acquiring a reference image of this type, the colors provided by the acquired reference image can be made more suitable for makeup, thereby increasing the number of colors that can be extracted. Accordingly, the color may be extracted from the reference image manually. For example, the reference images may be stored in a cloud album, and then the user may perform the album and select colors in the reference images in the album according to personal experience.
Further, when at least one color of the candidate colors is used as the preset makeup color, the value of each color channel of the candidate colors may be determined first, and the color channel value of the candidate color is obtained.
In the embodiment of the present invention, the value of each color channel of the candidate color may be determined by a preset color model, where the preset color model may be a three-dimensional color space composed of three preset colors, and the three-dimensional color space includes all the colors of the three preset color gamut. For example, taking a color model corresponding to RGB as an example, fig. 2 to 3 are schematic structural diagrams of a three-dimensional color space provided in an embodiment of the present invention, as shown in fig. 2 to 3, 3 coordinate axes of the three-dimensional color space respectively represent an R value, a G value, and a B value, and any color can be defined in the cubic structure.
Further, for the RGB color model composed of R, G, B, the principle of the equal-amount mixing method may be based, for example, R + G ═ Y, R + B ═ M, G + B ═ C, ranging from dark to light according to color: and 0-255, determining the value of each color channel of the alternative colors, namely the R value, the G value and the B value. For example, the RGB value of white may be represented as (255 ). Alternatively, in the embodiment of the present invention, a preset AI color extraction algorithm may also be used to extract colors in the candidate image, which is not limited in the embodiment of the present invention.
Then, the candidate color whose relative size relationship between the color channel values satisfies the preset size relationship may be determined as the preset makeup color, and stored in a preset color library. The preset color library can be a pre-established database for storing preset makeup colors, and the preset makeup colors can be colors with relative sizes among color channel values which are pre-selected to meet a preset size relationship. Each color channel value may be a channel value corresponding to each color channel in the color space. For example, in a Red-Green-Blue (RGB) color space, each color channel value may include a channel value of an R channel, a channel value of a G channel, and a channel value of a B channel. Further, the preset magnitude relation may be previously generated based on the relative magnitude of each color channel value among colors suitable for makeup. For example, the classical color systems popular in the network, such as the morandi color system, the classical color system, the spectrum color system, the high saturation color system, etc., may be obtained first, and then the relative magnitude relationship between the color channel values of the colors in these color systems may be counted and used as the preset magnitude relationship.
For example, the preset size relationship may be that the R value and the G value are both greater than the B value, and when the color channel value of the alternative color 1 is (225, 106, 96), the alternative color 1 is considered to satisfy the preset size relationship, and therefore, the alternative color 1 may be stored as the preset makeup color in the preset color library. When the color channel value of the alternative color 2 is (139, 225, 225), the alternative color 2 may be considered not to satisfy the preset size relationship, and accordingly, the alternative color 2 may be discarded. Alternatively, the preset magnitude relationship may be that both the R value and the B value are greater than the G value, which is not limited in the embodiment of the present invention. Compared with the mode of updating the fixed template by manpower, the method and the device have the advantages that the preset color library can be expanded by automatically acquiring the reference image and extracting the color, and the updating efficiency is high and the cost is low. Meanwhile, the continuously collected preset makeup colors can effectively save research and development time for subsequent research and development of related intelligent makeup projects, and the development of the intelligent makeup industry is accelerated.
Step 203, receiving a first input aiming at an area to be beautified in an image to be beautified.
Specifically, the step 101 may be referred to in an implementation manner of this step, which is not limited in this embodiment of the present invention.
And step 204, responding to the first input, determining the target area to be beautified, and displaying color options.
Specifically, the operation of displaying the color option may be implemented by the following substeps (1) to (2):
substep (1): and determining the preset makeup color corresponding to the target beautifying area according to the corresponding relation between the preset makeup color and the area to be beautified, so as to obtain the alternative makeup color.
In the embodiment of the invention, the corresponding relation between the preset makeup colors and the areas to be beautified can define the preset makeup colors corresponding to the areas to be beautified, wherein the preset makeup colors corresponding to the areas to be beautified can be colors frequently used when the areas to be beautified are beautified. For example, a cosmetic product corresponding to a preset cosmetic color may be determined, and then an area to be beautified corresponding to a use area of the cosmetic product may be determined as the area to be beautified corresponding to the preset cosmetic color.
Further, assuming that the preset makeup colors corresponding to the lip area are a, b, and c, and the preset makeup colors corresponding to the eyebrow area are d, e, and f, when the target area to be beautified is the lip area, the preset makeup colors may be: a, b and c are determined as alternative makeup colors.
Substep (2): and displaying color options corresponding to the alternative makeup colors.
For example, assuming that the candidate makeup colors are a, b, and c, the electronic device may display color options corresponding to the three colors a, b, and c. In the embodiment of the invention, only the color option corresponding to the alternative makeup color corresponding to the target beautifying area is displayed, so that the color option corresponding to the color which is not matched with the target area to be beautified can be prevented from being displayed for a user, and the waste of display resources is avoided.
Further, before displaying the color options corresponding to the alternative makeup colors, the method may further comprise: acquiring an image and a color number of a cosmetic product matched with the preset makeup color; associating the matched cosmetic product image with the color number to obtain a cosmetic product image associated with the color number; and establishing a corresponding relation between the preset makeup color and the cosmetic product image associated with the color number. Accordingly, when displaying the color option corresponding to the candidate makeup color, the image of the cosmetic product associated with the color number corresponding to the candidate makeup color may be displayed as the color option corresponding to the candidate makeup color. Wherein the makeup product image to which the preset makeup color is matched may be an image containing a makeup product having the same color as the preset makeup color.
For example, assuming that the preset makeup color is a positive red color, the matching cosmetic product image may be an image containing a positive red lipstick. Further, the color number may be a number of a cosmetic product contained in the image, the color number may be defined by a manufacturer of the cosmetic product, and the color number may be a lipstick number, for example. When obtaining the image and the color number of the cosmetic product matched with the preset makeup color, the color information of various cosmetic products can be obtained from the network, then the color information is compared with the preset makeup color, and then the image and the color number of the cosmetic product matched with the color are searched from the network. In associating the cosmetic product image with a color number, it may be that the color number is marked in the cosmetic product image. When the corresponding relationship between the preset makeup color and the makeup product image associated with the color number is established, the preset makeup color and the makeup product image associated with the color number can be associated in a one-to-one correspondence manner, and then the corresponding relationship is obtained.
It should be noted that, the electronic device may also receive a naming input from the user; setting the color name indicated by the name input as a preset makeup color indicated by the name input. Thus, the user can conveniently select the color subsequently through the self-naming.
When displaying the color option corresponding to the candidate makeup color, the image of the cosmetic product corresponding to the candidate makeup color and associated with the color number may be searched first, and then the image may be displayed as the color option. Therefore, the information of the actual cosmetic product corresponding to the color can be more clearly obtained by the user through directly displaying the image and the color number of the cosmetic product, so that the time for the user to select the color is reduced to a certain extent, and the selection efficiency is improved. For example, the preset makeup color is a color corresponding to lipstick number 500 of the X-card, and when the color option is displayed, the color option may be marked with a color number: the product image of the 500X-card 500 lipstick is displayed as a color option.
Step 205, a second input for the target color option is received.
Specifically, the step 103 may be referred to in an implementation manner of this step, and this is not limited in this embodiment of the present invention.
And step 206, responding to the second input, and determining the preset makeup color corresponding to the target color option as the target color.
Specifically, the step 104 may be referred to in the implementation manner of this step, which is not limited in this embodiment of the present invention.
And step 207, setting the color of the makeup area in the target area to be beautified as the target color.
Specifically, the electronic device may determine the makeup area in the target area to be beautified by the following steps:
and step C, detecting real feature points of the face in the image to be beautified according to a preset face feature point detection algorithm, marking, and marking standard feature points in the image to be beautified according to position information of the feature points in the preset standard face.
In the embodiment of the invention, the real feature points can be determined according to the face contained in the image to be beautified. The preset face feature point detection algorithm may be a face Recognition (face Recognition) algorithm. Specifically, the face feature point detection algorithm may generate a point location distribution map according with the face features in the image to be beautified based on feature information included in the image to be beautified, for example, singular value features of a face image matrix, where each feature point in the distribution map corresponds to feature information of a face in the image to be beautified, and the number of feature points included in the distribution map may be predefined, and for example, may be 102. And then, determining points of the corresponding positions of the feature points in the distribution map in the image to be beautified as real feature points. The distribution area of the face contour in the image to be beautified and the distribution area of the five sense organs in the face, such as the eyebrow area, the eye area, the nose area, the lip area and the like, can be delineated by the characteristic points.
Specifically, when the image to be beautified is a preview real-time image acquired by the camera, it may be determined whether a person is present in a view frame of the camera through biological judgment, and the face of the person is scanned and detected when the person is determined to be present. Specifically, during the detection, feature points on the outer contour of the face forming the face shape and feature points on the center line of the face may be detected first, and then feature points on each region to be beautified are detected in sequence, for example, feature points on the eyebrow region, the eye region, the nose region, and the lip region are detected in sequence. Further, when the depth information of the face is not acquired, each feature point may be detected only on the horizontal plane, that is, the X value and the Y value of the feature point are determined on the plane where the X axis and the Y axis are located. After the depth information can be acquired, for example, after the face moves and rotates, the Z axis is increased, and the Z value of each feature point is determined according to the depth information of the face.
It should be noted that, in the embodiment of the present invention, when the image to be beautified is a preview real-time screen, the following operations may be performed: and forming a mesh grid on the image to be beautified according to the real feature points. Specifically, the connection may be performed through real feature points, for example, the real feature points may be sequentially connected in the horizontal direction and the vertical direction at fixed intervals, so as to obtain a mesh. And then, when the human face in the preview real-time picture is detected to move, controlling the mesh to move synchronously. Wherein the mesh may be a three-dimensional (3D) mesh when the depth information is included in the preview live image, and a two-dimensional (2D) mesh when the depth information is not included in the preview live image. The movement of the face in the preview real-time picture may be caused by the movement of the face collected in the camera, and when the face moves out of the range of the camera, that is, when the face does not exist in the preview real-time picture, the mesh correspondingly disappears. In the embodiment of the invention, by generating the mesh grids and controlling the mesh grids to synchronously move, the real characteristic points can be ensured to be adapted to the changed face, so that the accuracy of the real characteristic points is ensured, and the accuracy of a makeup area determined according to the real characteristic points in the moving process is ensured, so that makeup in the makeup area can be fitted in real time.
Further, the electronic device may be synchronously moved according to a preset following algorithm. Thus, by moving synchronously, the real feature points can be moved synchronously. Since the user of the electronic device is often stationary, the embodiment of the present invention may further include: recording the moving track of the real feature points and the moving action of the human face in the process that the mesh grid moves along with the human face; and storing the moving track and the moving action of the face to a preset storage position. The preset storage location may be a preset database or may be local to the electronic device. Correspondingly, the data in the preset storage position can be read, and the preset following algorithm is optimized according to the data. Therefore, the accuracy of synchronous movement can be improved by continuously recording and continuously optimizing the preset following algorithm.
Further, the position information of the feature points in the standard face may be determined according to a preset standard face image, and the position information may represent the positions of the feature points in the standard face. The standard face image may be a face image synthesized in advance according to an aesthetic standard and conforming to the aesthetic standard, for example, the standard face may be a face image synthesized by a computer and bilaterally symmetrical and conforming to the standard of a Chinese face: the three-family five-eye standard human face has the advantages that the forehead area accounts for one third of the whole face, and the width of the human face is five times the distance of a single eye. In order to improve the universality degree of the standard face, a male standard face and a female standard face can be synthesized firstly, and then the male standard face and the female standard face are synthesized to further obtain the final standard face. Specifically, during synthesis, the five sense organ regions and the face size of the standard face can be determined by attaching a plurality of fine point positions of the trend of the five sense organs to the periphery of the face and the five sense organs through left-right symmetry. Because the standard face has certain similarity with each face type and five sense organs, the beautifying method can be more suitable for users with different types of people, different face types and different five sense organs to a certain extent by beautifying through combining the standard feature points of the standard face in the embodiment of the invention.
Specifically, the feature points in the standard face image may be determined by using a preset face feature point detection algorithm, or the feature points in the standard face image may be determined by manual marking. For example, fig. 2 to 4 are schematic diagrams of standard face feature points provided by an embodiment of the present invention, as shown in fig. 2 to 4, the face image in the diagrams is a preset standard face image, and it can be seen that the standard face feature points are distributed on the standard face. Then, position information can be generated from the positions of these feature points. The number of the determined feature points in the standard human face can be the same as the number of the real feature points, so that the two feature points are ensured to be the same, and the regional feature points can be conveniently adjusted based on the two sets of feature points in subsequent operation to a certain extent. Then, the electronic device can simulate a standard face on the face in the image to be beautified, and then mark the standard feature points in the image to be beautified according to the position information of the feature points in the standard face and the simulated standard face.
Fig. 2-5 are schematic diagrams of an image to be beautified according to an embodiment of the present invention, and as shown in fig. 2-5, real feature points and standard feature points are marked in the image to be beautified. Wherein the triangular mark represents a true feature point, and the circular mark represents a standard feature point. It should be noted that, when marking the feature points, the marking may be implemented in an invisible manner, so as to ensure that the viewing experience of the user is not affected.
Step D, marking regional characteristic points in the image to be beautified according to a preset relative position relation corresponding to the region to be beautified of the target; and the relative position relationship between the region characteristic point and the standard characteristic point meets the preset relative position relationship.
Specifically, when the relative relation of the preset positions is predetermined, the standard makeup area corresponding to each area to be beautified can be determined according to the optimal makeup range of each area to be beautified in the standard face image; then, a plurality of points are selected from the edge of the standard makeup area, then the relative position relationship between the points and the standard characteristic points corresponding to the area to be beautified in the standard face image is determined according to the positions of the points and the standard characteristic points, and finally the relative position relationship between the points and the standard characteristic points is used as a preset relative position relationship and stored. For example, a standard makeup area corresponding to a lip area in a standard face image may be determined, a plurality of points may be selected from an edge of the standard makeup area corresponding to the lip area, a relative position relationship between the two points may be determined according to positions of the points and a standard feature point corresponding to the lip area, a corresponding preset relative relationship between the lip area may be obtained, a standard makeup area corresponding to the eye area in the standard face image may be determined, a plurality of points may be selected from an edge of the standard makeup area corresponding to the eye area, a relative position relationship between the points and a standard feature point corresponding to the eye area may be determined according to positions of the points and the standard feature point corresponding to the eye area, a corresponding preset relative relationship between the eye area may be obtained, and so on, a preset relative relationship corresponding to each area to be beautified may be obtained.
Assuming that the target area to be beautified is a lip area, the area feature points in the image to be beautified can be marked according to the preset relative relationship corresponding to the lip area and the standard feature points marked in the image to be beautified. Wherein, the region formed by the region feature points is a standard makeup region relative to the lip region in the standard human face.
For example, fig. 2-6 are schematic diagrams of another image to be beautified provided by the embodiment of the invention, and as shown in fig. 2-6, cross marks are marked area feature points.
And E, adjusting the position of the region feature point according to the deviation degree between the real feature point and the standard feature point until the adjusted relative position relation between the region feature point and the real feature point meets the preset relative position relation.
In the embodiment of the invention, the area formed by the area feature points is a standard makeup area relative to a standard face, and the individuals have differences, so that the face of each person has different growth phases. Therefore, if makeup is performed directly on the basis of the area constituted by these area feature points, the makeup effect is not adapted to the face of the person in the image to be beautified, and the beautification effect is poor. Therefore, in this step, the regional feature points may be adjusted so that the relative position relationship between the adjusted regional feature points and the real feature points satisfies the preset relative position relationship, and thus, by adjusting the positions of the regional feature points, the angle and size of the region formed by the regional feature points may be adjusted, that is, the region formed by the adjusted regional feature points is a standard make-up region corresponding to the face in the image to be beautified. Therefore, when the area formed by the adjusted area characteristic points is used for makeup, the makeup effect can be more suitable for the face in the image to be beautified.
Further, since the stereoscopic degree of each human face also affects the visual effect of the face presentation, the operation of adjusting the position of the region feature point in the embodiment of the present invention may include: and adjusting the positions of the region characteristic points in the horizontal direction and the depth direction. Wherein the depth direction may be a direction perpendicular to a horizontal plane of the image to be beautified. For example, if an X axis and a Y axis are constructed on a horizontal plane of an image to be beautified, and a Z axis is constructed in a direction perpendicular to the X axis and the Y axis, the direction of the Z axis is a depth direction. Therefore, the positions of the regional characteristic points in the depth direction are adjusted simultaneously, so that the adjusted regional characteristic points can be matched with the face of a person in the image to be beautified in the depth direction, and the subsequent makeup effect can be improved to a certain extent. Of course, only the position of the region feature point in the horizontal direction may be adjusted, which is not limited in the embodiment of the present invention.
Specifically, when the adjustment is performed, the distance between the area feature point and the real feature point corresponding to the area to be beautified of the target and the distance between the area feature point and the standard feature point corresponding to the area to be beautified of the target may be determined, then, the difference between the two distances may be determined, and then, the area feature point may be moved according to the difference to change the position of the area feature point. Finally, if the difference between the two distances is 0, it can be considered that the relative positional relationship between the adjusted region feature point and the real feature point satisfies the preset relative positional relationship, and accordingly, the adjustment can be stopped.
And F, determining the area formed by the adjusted area characteristic points as the makeup area.
The area formed by the adjusted area characteristic points is a standard makeup area relative to the face in the image to be beautified. Thus, the area may be determined as a makeup area. Therefore, the area is determined as the makeup area, so that the makeup effect can be more adaptive to the face in the image to be beautified when makeup is performed based on the makeup area subsequently, and the beautification effect is further improved. Fig. 2 to 7 are schematic diagrams of a makeup area of a cheek area according to an embodiment of the present invention, and as shown in fig. 2 to 7, an area within a dotted line frame is the makeup area of the cheek area. Fig. 2 to 8 are schematic diagrams of a makeup area of a nose area according to an embodiment of the present invention, and as shown in fig. 2 to 8, an area within a dotted frame is the makeup area of the nose area.
In the embodiment of the invention, the area characteristic points are determined through the real characteristic points and the standard characteristic points, and the area characteristic points are adjusted based on the preset relative position relationship, so that the mode of the make-up area is determined. It should be noted that, in the embodiment of the present invention, it is also possible to: determining the deviation degree of the makeup area; and correcting the position information of the standard characteristic points according to the deviation degree. Therefore, the point location accuracy can be improved by continuously optimizing the standard characteristic points in the using process, the accuracy of the determined makeup area is further improved, and the subsequent makeup effect is more fit with the face.
Further, when the color of the makeup area is set as the target color, for each pixel in the makeup area, the color channel values of the color of the pixel may be adjusted until the color channel values of the color of the pixel are the same as the color channel values of the target color. Specifically, the difference between the R value, the G value, and the B value of the color of the pixel and the R value, the G value, and the B value of the target color may be calculated, and then the R value, the G value, and the B value of the color of the pixel may be adjusted according to the difference until the two values are the same. For example, assuming that the R, G, and B values of the target color are 205, 85, and 85, respectively, and the R, G, and B values of the color of the pixel are 255, 0, and 0, respectively, the R value may be decreased by 50, the G value may be increased by 85, and the B value may be increased by 85, respectively, i.e., the R, G, and B values of the color of the pixel may be adjusted to the R, G, and B values of the target color, i.e., 205, 85, and 85. In the embodiment of the invention, the user can automatically increase the makeup for beautifying only by manually selecting the area and the color to be beautified, the operation threshold is lower, and most users can beautify the makeup.
It should be noted that, in the embodiment of the present invention, it is also possible to: a third input is received. In the embodiment of the present invention, the third input may be a determination operation for saving the image to be beautified, and the determination operation may be a single click, a double click, a long press, or the like. The user may perform a third input when the image to be beautified needs to be saved, and accordingly, the electronic device may receive the third input.
And responding to the third input, and saving the image to be beautified. In the embodiment of the invention, when the image to be beautified is saved, the image to be beautified can be stored to a preset storage position, for example, to a folder specially used for storing the beautified image. Therefore, the image to be beautified is stored under the condition that the third input is received, so that the image which is disliked by the user can be prevented from being stored, and the storage space is prevented from being wasted.
Further, in the embodiment of the present invention, it is also possible to: receiving a fourth input; restoring the color of the makeup area to a pre-set color in response to the fourth input.
In the embodiment of the present invention, the fourth input may be an operation for restoring the color of the makeup area to the color before setting, and the operation may be a single click, a double click, a long press, or the like of a preset cancel button. The user may perform a fourth input when the color of the makeup area needs to be restored to the color before the setting, and accordingly, the electronic device may receive the fourth input. Further, the color before setting may be the color of the makeup area before performing step 207. Specifically, when the color of the makeup area is restored to the color before setting, the color before setting of the makeup area recorded in advance may be acquired. Wherein the pre-set color may be pre-recorded before performing step 207. And then, modifying the color of the makeup area according to the acquired color.
In summary, in the image processing method provided by the embodiment of the present invention, a plurality of reference images are obtained first, the top N colors distributed most in the reference images are extracted as candidate colors, and at least one color of the candidate colors is used as a preset makeup color. In this way, since the most distributed colors tend to be colors having stronger applicability, by using the most distributed colors as the preset makeup colors, the effect of making up the beauty based on these preset makeup colors in the subsequent steps can be ensured. Then, a first input aiming at the area to be beautified in the image to be beautified can be received, the area to be beautified is determined in response to the first input, the color option is displayed, a second input aiming at the target color option is received, the preset makeup color corresponding to the target color option is determined as the target color in response to the second input, and the color of the makeup area in the area to be beautified is set as the target color. Compared with the mode of beautifying the human body area directly according to the fixed makeup template, the embodiment of the invention provides various preset makeup colors for users by extracting the color which is most distributed in the reference image as the preset makeup color, thereby improving the selectivity of the users to a certain extent and enriching the beautifying effect. Meanwhile, the beautifying effect can be ensured to be natural to a certain extent by the mode that the user selects the target color from the preset makeup colors to beautify the target area to be beautified selected by the user.
Having described the image processing method according to the embodiment of the present invention, an electronic device according to the embodiment of the present invention will be described with reference to the drawings.
Referring to fig. 3, an embodiment of the present invention further provides a block diagram of an electronic device, as shown in fig. 3, the electronic device 30 may include:
the first receiving module 301 is configured to receive a first input for an area to be beautified in an image to be beautified.
A first determining module 302, configured to determine a target area to be beautified in response to the first input, and display color options, where different color options correspond to different preset makeup colors.
A second receiving module 303, configured to receive a second input for the target color option.
A second determining module 304, configured to determine, in response to the second input, a preset makeup color corresponding to the target color option as a target color.
A setting module 305, configured to set the color of the makeup area in the target area to be beautified as the target color.
Wherein the electronic device 30 further comprises:
a first obtaining module, configured to obtain a plurality of reference images before the first determining module performs displaying the color option;
and the extracting module is used for extracting the top N colors which are most distributed in the reference image as alternative colors, and taking at least one color in the alternative colors as the preset makeup color.
In summary, the electronic device provided in the embodiment of the present invention may receive a first input for an area to be beautified in an image to be beautified, determine an area to be beautified of a target in response to the first input, and display color options, before displaying the color options, obtain a plurality of reference images, extract the top N colors most distributed in the reference images as candidate colors, and use at least one of the candidate colors as a preset makeup color. Then, a second input for the target color option is received, in response to the second input, the preset makeup color corresponding to the target color option is determined as the target color, and the color of the makeup area in the target area to be beautified is set as the target color. Compared with the mode of beautifying the human body area directly according to the fixed makeup template, the embodiment of the invention provides various preset makeup colors for users by extracting the color which is most distributed in the reference image as the preset makeup color, thereby improving the selectivity of the users to a certain extent and enriching the beautifying effect. Meanwhile, the preset makeup colors are the colors distributed most in the image, so that the mode of selecting the target color from the preset makeup colors by the user to makeup the target area to be beautified selected by the user can ensure that the makeup effect is natural to a certain extent.
Optionally, the electronic device 30 further includes:
the first marking module is used for detecting real feature points of the face in the image to be beautified according to a preset face feature point detection algorithm, marking the real feature points, and marking standard feature points in the image to be beautified according to position information of the feature points in the preset standard face;
the second marking module is used for marking regional characteristic points in the image to be beautified according to a preset relative position relation corresponding to the region to be beautified of the target; the relative position relation between the region characteristic point and the standard characteristic point meets the preset relative position relation;
the adjusting module is used for adjusting the position of the region feature point according to the deviation degree between the real feature point and the standard feature point until the relative position relationship between the adjusted region feature point and the real feature point meets the preset relative position relationship;
and the third determining module is used for determining the region formed by the adjusted region characteristic points as the makeup region.
The image to be beautified is a preview real-time image acquired by a camera of the electronic equipment.
Optionally, the electronic device 30 further includes:
and the generating module is used for forming a mesh grid on the image to be beautified according to the real feature points.
And the control module is used for controlling the mesh grids to synchronously move when the face in the preview real-time image is detected to move.
Optionally, the first determining module 302 is further configured to:
determining a preset makeup color corresponding to the target beautification area according to the corresponding relation between the preset makeup color and the area to be beautified, and obtaining an alternative makeup color;
and displaying color options corresponding to the alternative makeup colors.
Optionally, the electronic device 30 further includes:
the second acquisition module is used for acquiring the image and the color number of the cosmetic product matched with the preset makeup color;
and the association module is used for associating the matched cosmetic product image with the color number to obtain the cosmetic product image associated with the color number.
And the establishing module is used for establishing the corresponding relation between the preset makeup color and the cosmetic product image associated with the color number.
Accordingly, the first determining module is further configured to:
and displaying the image of the cosmetic product which corresponds to the alternative makeup color and is associated with the color number as a color option corresponding to the alternative makeup color.
In summary, the electronic device provided in the embodiment of the present invention may first obtain a plurality of reference images, extract the top N colors most distributed in the reference images as candidate colors, and use at least one of the candidate colors as the preset makeup color. In this way, since the most distributed colors tend to be colors having stronger applicability, by using the most distributed colors as the preset makeup colors, the effect of making up the beauty based on these preset makeup colors in the subsequent steps can be ensured. Then, a first input aiming at the area to be beautified in the image to be beautified can be received, the area to be beautified is determined in response to the first input, the color option is displayed, a second input aiming at the target color option is received, the preset makeup color corresponding to the target color option is determined as the target color in response to the second input, and the color of the makeup area in the area to be beautified is set as the target color. Compared with the mode of beautifying the human body area directly according to the fixed makeup template, the embodiment of the invention provides various preset makeup colors for users by extracting the color which is most distributed in the reference image as the preset makeup color, thereby improving the selectivity of the users to a certain extent and enriching the beautifying effect. Meanwhile, the beautifying effect can be ensured to be natural to a certain extent by the mode that the user selects the target color from the preset makeup colors to beautify the target area to be beautified selected by the user.
FIG. 4 is a diagram illustrating a hardware configuration of an electronic device implementing various embodiments of the invention;
the electronic device 400 includes, but is not limited to: radio frequency unit 401, network module 402, audio output unit 403, input unit 404, sensor 405, display unit 406, user input unit 407, interface unit 408, memory 409, processor 410, and power supply 411. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 4 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 processor 410 is configured to receive a first input for an area to be beautified in an image to be beautified.
And the processor 410 is used for responding to the first input, determining the target area to be beautified, and displaying color options, wherein different color options correspond to different preset makeup colors.
A processor 410 for receiving a second input for the target color option.
A processor 410, configured to determine a preset makeup color corresponding to the target color option as a target color in response to the second input.
And the processor 410 is used for setting the color of the makeup area in the target area to be beautified as the target color.
Wherein, before the displaying the color option, the method further comprises:
acquiring a plurality of reference images;
and extracting the top N colors distributed most in the reference image as alternative colors, and taking at least one color in the alternative colors as the preset makeup color.
In summary, the image processing method provided in the embodiment of the present invention may receive a first input for an area to be beautified in an image to be beautified, determine an area to be beautified of a target in response to the first input, and display color options, before displaying the color options, obtain a plurality of reference images, extract the top N colors most distributed in the reference images as candidate colors, and use at least one of the candidate colors as a preset makeup color. Then, a second input for the target color option is received, in response to the second input, the preset makeup color corresponding to the target color option is determined as the target color, and the color of the makeup area in the target area to be beautified is set as the target color. Compared with the mode of beautifying the human body area directly according to the fixed makeup template, the embodiment of the invention provides various preset makeup colors for users by extracting the color which is most distributed in the reference image as the preset makeup color, thereby improving the selectivity of the users to a certain extent and enriching the beautifying effect. Meanwhile, the preset makeup colors are the colors distributed most in the image, so that the mode of selecting the target color from the preset makeup colors by the user to makeup the target area to be beautified selected by the user can ensure that the makeup effect is natural to a certain extent.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 401 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 410; in addition, the uplink data is transmitted to the base station. Typically, radio unit 401 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 unit 401 can 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 402, such as assisting the user in sending and receiving e-mails, browsing web pages, and accessing streaming media.
The audio output unit 403 may convert audio data received by the radio frequency unit 401 or the network module 402 or stored in the memory 409 into an audio signal and output as sound. Also, the audio output unit 403 may also provide audio output related to a specific function performed by the electronic apparatus 400 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 403 includes a speaker, a buzzer, a receiver, and the like.
The input unit 404 is used to receive audio or video signals. The input Unit 404 may include a Graphics Processing Unit (GPU) 4041 and a microphone 4042, and the Graphics processor 4041 processes image data of a still picture or video obtained by an image capturing apparatus (such as a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 406. The image frames processed by the graphic processor 4041 may be stored in the memory 409 (or other storage medium) or transmitted via the radio frequency unit 401 or the network module 402. The microphone 4042 may receive sound, and may be capable of processing 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 401 in case of the phone call mode.
The electronic device 400 also includes at least one sensor 405, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor includes an ambient light sensor that adjusts the brightness of the display panel 4061 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 4061 and/or the backlight when the electronic apparatus 400 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 405 may also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be described in detail herein.
The display unit 406 is used to display information input by the user or information provided to the user. The Display unit 606 may include a Display panel 4061, and the Display panel 4061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 407 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 407 includes a touch panel 4071 and other input devices 4072. Touch panel 4071, 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 4071 using a finger, a stylus, or any suitable object or attachment). The touch panel 4071 may include two parts, 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 410, receives a command from the processor 410, and executes the command. In addition, the touch panel 4071 can be implemented by using various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 4071, the user input unit 407 may include other input devices 4072. Specifically, the other input devices 4072 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 4071 can be overlaid on the display panel 4061, and when the touch panel 6071 detects a touch operation on or near the touch panel 4071, the touch operation is transmitted to the processor 410 to determine the type of the touch event, and then the processor 410 provides a corresponding visual output on the display panel 4061 according to the type of the touch event. Although in fig. 4, the touch panel 4071 and the display panel 4061 are two independent components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 4071 and the display panel 4061 may be integrated to implement the input and output functions of the electronic device, and the implementation is not limited herein.
The interface unit 408 is an interface for connecting an external device to the electronic apparatus 400. 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 408 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic apparatus 400 or may be used to transmit data between the electronic apparatus 400 and an external device.
The memory 409 may be used to store software programs as well as various data. The memory 409 may mainly include a storage program area and a storage data area, wherein the storage program 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 409 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 410 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, performs various functions of the electronic device and processes data by operating or executing software programs and/or modules stored in the memory 409 and calling data stored in the memory 409, thereby performing overall monitoring of the electronic device. Processor 410 may include one or more processing units; optionally, the processor 410 may integrate an application processor and a modem processor, wherein the application processor mainly handles operating systems, user interfaces, application programs, and the like, and the modem processor mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 410.
The electronic device 400 may further include a power supply 411 (e.g., a battery) for supplying power to various components, and optionally, the power supply 611 may be logically connected to the processor 410 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
In addition, the electronic device 400 includes some functional modules that are not shown, and are not described in detail herein.
Optionally, an embodiment of the present invention further provides an electronic device, which includes a processor 410, a memory 409, and an image processing program that is stored in the memory 409 and is executable on the processor 410, and when the image processing program is executed by the processor 410, the image processing program implements each process of the above-mentioned embodiment of the image processing method, and can achieve the same technical effect, and in order to avoid repetition, details are not described here again.
An embodiment of the present invention further provides a computer-readable storage medium, where an image processing program is stored on the computer-readable storage medium, and when the image processing program is executed by a processor, the image processing program implements the processes of the image processing embodiment, and can achieve the same technical effect, and in order to avoid repetition, the image processing program is not described herein again. 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:
receiving a first input aiming at an area to be beautified in an image to be beautified;
responding to the first input, determining a target area to be beautified, and displaying color options, wherein different color options correspond to different preset makeup colors;
receiving a second input for the target color option;
in response to the second input, determining a preset makeup color corresponding to the target color option as a target color;
setting the color of a makeup area in the target area to be beautified as the target color;
wherein, before the displaying the color option, the method further comprises:
acquiring a plurality of reference images;
and extracting the top N colors distributed most in the reference image as alternative colors, and taking at least one color in the alternative colors as the preset makeup color.
2. The method according to claim 1, wherein before the setting the color of the make-up area on the target area to be beautified to the target color, the method further comprises:
detecting real feature points of the face in the image to be beautified according to a preset face feature point detection algorithm, marking the real feature points, and marking standard feature points in the image to be beautified according to position information of the feature points in the preset standard face;
marking regional characteristic points in the image to be beautified according to a preset relative position relation corresponding to the region to be beautified of the target; the relative position relation between the region characteristic point and the standard characteristic point meets the preset relative position relation;
adjusting the position of the region feature point according to the deviation degree between the real feature point and the standard feature point until the adjusted relative position relationship between the region feature point and the real feature point meets the preset relative position relationship;
and determining the area formed by the adjusted area characteristic points as the makeup area.
3. The method according to claim 2, characterized in that the image to be beautified is a preview real-time image acquired by a camera of the electronic device;
after the real feature points of the face in the image to be beautified are detected according to a preset face feature point detection algorithm and marked, the method further comprises the following steps:
forming a mesh grid on the image to be beautified according to the real feature points;
and when the human face in the preview real-time image is detected to move, controlling the mesh to move synchronously.
4. The method of claim 1, wherein displaying the color option comprises:
determining a preset makeup color corresponding to the target beautification area according to the corresponding relation between the preset makeup color and the area to be beautified, and obtaining an alternative makeup color;
and displaying color options corresponding to the alternative makeup colors.
5. The method of claim 4, further comprising:
acquiring a makeup product image and a color number which are matched with the preset makeup color;
associating the matched cosmetic product image with the color number to obtain a cosmetic product image associated with the color number;
establishing a corresponding relation between the preset makeup colors and the makeup product images associated with the color numbers;
correspondingly, the displaying of the color options corresponding to the alternative makeup colors includes:
and displaying the cosmetic product image which corresponds to the alternative makeup color and is associated with the color number as a color option corresponding to the alternative makeup color.
6. An electronic device, characterized in that the electronic device comprises:
the first receiving module is used for receiving a first input aiming at an area to be beautified in an image to be beautified;
the first determining module is used for responding to the first input, determining a target area to be beautified and displaying color options, wherein different color options correspond to different preset makeup colors;
a second receiving module for receiving a second input for the target color option;
a second determination module, configured to determine, in response to the second input, a preset makeup color corresponding to the target color option as a target color;
the setting module is used for setting the color of the makeup area in the target area to be beautified as the target color;
wherein the electronic device further comprises:
a first obtaining module, configured to obtain a plurality of reference images before the first determining module performs displaying the color option;
and the extracting module is used for extracting the top N colors which are most distributed in the reference image as alternative colors, and taking at least one color in the alternative colors as the preset makeup color.
7. The electronic device of claim 6, further comprising:
the first marking module is used for detecting real feature points of the face in the image to be beautified according to a preset face feature point detection algorithm, marking the real feature points, and marking standard feature points in the image to be beautified according to position information of the feature points in the preset standard face;
the second marking module is used for marking regional characteristic points in the image to be beautified according to a preset relative position relation corresponding to the region to be beautified of the target; the relative position relation between the region characteristic point and the standard characteristic point meets the preset relative position relation;
the adjusting module is used for adjusting the position of the region feature point according to the deviation degree between the real feature point and the standard feature point until the relative position relationship between the adjusted region feature point and the real feature point meets the preset relative position relationship;
and the third determining module is used for determining the region formed by the adjusted region characteristic points as the makeup region.
8. The electronic device of claim 7, wherein the image to be beautified is a preview real-time image captured by a camera of the electronic device;
the electronic device further includes:
the generating module is used for forming a mesh grid on the image to be beautified according to the real feature points;
and the control module is used for controlling the mesh grids to synchronously move when the face in the preview real-time image is detected to move.
9. The electronic device of claim 6, wherein the first determining module is further configured to:
determining a preset makeup color corresponding to the target beautification area according to the corresponding relation between the preset makeup color and the area to be beautified, and obtaining an alternative makeup color;
and displaying color options corresponding to the alternative makeup colors.
10. The electronic device of claim 9, further comprising:
the second acquisition module is used for acquiring the image and the color number of the cosmetic product matched with the preset makeup color;
the association module is used for associating the matched cosmetic product image with the color number to obtain a cosmetic product image associated with the color number;
the establishing module is used for establishing the corresponding relation between the preset makeup colors and the makeup product images associated with the color numbers;
accordingly, the first determining module is further configured to:
and displaying the cosmetic product image which corresponds to the alternative makeup color and is associated with the color number as a color option corresponding to the alternative makeup color.
CN201911419698.XA 2019-12-31 2019-12-31 Image processing method and electronic equipment Pending CN111047511A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911419698.XA CN111047511A (en) 2019-12-31 2019-12-31 Image processing method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911419698.XA CN111047511A (en) 2019-12-31 2019-12-31 Image processing method and electronic equipment

Publications (1)

Publication Number Publication Date
CN111047511A true CN111047511A (en) 2020-04-21

Family

ID=70243112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911419698.XA Pending CN111047511A (en) 2019-12-31 2019-12-31 Image processing method and electronic equipment

Country Status (1)

Country Link
CN (1) CN111047511A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111953905A (en) * 2020-08-26 2020-11-17 维沃移动通信有限公司 Beautifying function starting method and device and electronic equipment
CN113344812A (en) * 2021-05-31 2021-09-03 维沃移动通信(杭州)有限公司 Image processing method and device and electronic equipment
CN113379856A (en) * 2021-06-30 2021-09-10 珠海必要工业科技股份有限公司 Embroidery effect graph generation method and device and storage medium
CN113781330A (en) * 2021-08-23 2021-12-10 北京旷视科技有限公司 Image processing method, device and electronic system
CN114095646A (en) * 2020-08-24 2022-02-25 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN114445554A (en) * 2021-12-24 2022-05-06 广东时谛智能科技有限公司 Special customization method and device for shoe body, electronic equipment and storage medium
CN114612608A (en) * 2022-02-11 2022-06-10 广东时谛智能科技有限公司 Image recognition-based shoe body exclusive customization method and device
WO2022179215A1 (en) * 2021-02-23 2022-09-01 北京市商汤科技开发有限公司 Image processing method and apparatus, electronic device, and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004094917A (en) * 2002-07-08 2004-03-25 Toshiba Corp Virtual makeup device and method therefor
CN104778712A (en) * 2015-04-27 2015-07-15 厦门美图之家科技有限公司 Method and system for pasting image to human face based on affine transformation
CN106709931A (en) * 2015-07-30 2017-05-24 中国艺术科技研究所 Method of mapping facial makeup to face, and facial makeup mapping device
CN107578371A (en) * 2017-09-29 2018-01-12 北京金山安全软件有限公司 Image processing method and device, electronic equipment and medium
CN108053365A (en) * 2017-12-29 2018-05-18 百度在线网络技术(北京)有限公司 For generating the method and apparatus of information
CN109191410A (en) * 2018-08-06 2019-01-11 腾讯科技(深圳)有限公司 A kind of facial image fusion method, device and storage medium
CN109410119A (en) * 2017-08-18 2019-03-01 北京凤凰都市互动科技有限公司 Mask image distortion method and its system
CN110400254A (en) * 2019-07-24 2019-11-01 深圳乐信软件技术有限公司 A kind of lipstick examination cosmetic method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004094917A (en) * 2002-07-08 2004-03-25 Toshiba Corp Virtual makeup device and method therefor
CN104778712A (en) * 2015-04-27 2015-07-15 厦门美图之家科技有限公司 Method and system for pasting image to human face based on affine transformation
CN106709931A (en) * 2015-07-30 2017-05-24 中国艺术科技研究所 Method of mapping facial makeup to face, and facial makeup mapping device
CN109410119A (en) * 2017-08-18 2019-03-01 北京凤凰都市互动科技有限公司 Mask image distortion method and its system
CN107578371A (en) * 2017-09-29 2018-01-12 北京金山安全软件有限公司 Image processing method and device, electronic equipment and medium
CN108053365A (en) * 2017-12-29 2018-05-18 百度在线网络技术(北京)有限公司 For generating the method and apparatus of information
CN109191410A (en) * 2018-08-06 2019-01-11 腾讯科技(深圳)有限公司 A kind of facial image fusion method, device and storage medium
CN110400254A (en) * 2019-07-24 2019-11-01 深圳乐信软件技术有限公司 A kind of lipstick examination cosmetic method and device

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114095646A (en) * 2020-08-24 2022-02-25 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN114095646B (en) * 2020-08-24 2022-08-26 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN111953905A (en) * 2020-08-26 2020-11-17 维沃移动通信有限公司 Beautifying function starting method and device and electronic equipment
CN111953905B (en) * 2020-08-26 2021-11-16 维沃移动通信有限公司 Beautifying function starting method and device, electronic equipment and readable storage medium
WO2022179215A1 (en) * 2021-02-23 2022-09-01 北京市商汤科技开发有限公司 Image processing method and apparatus, electronic device, and storage medium
CN113344812A (en) * 2021-05-31 2021-09-03 维沃移动通信(杭州)有限公司 Image processing method and device and electronic equipment
CN113379856A (en) * 2021-06-30 2021-09-10 珠海必要工业科技股份有限公司 Embroidery effect graph generation method and device and storage medium
CN113781330A (en) * 2021-08-23 2021-12-10 北京旷视科技有限公司 Image processing method, device and electronic system
CN114445554A (en) * 2021-12-24 2022-05-06 广东时谛智能科技有限公司 Special customization method and device for shoe body, electronic equipment and storage medium
CN114445554B (en) * 2021-12-24 2023-02-10 广东时谛智能科技有限公司 Special customization method and device for shoe body, electronic equipment and storage medium
CN114612608A (en) * 2022-02-11 2022-06-10 广东时谛智能科技有限公司 Image recognition-based shoe body exclusive customization method and device

Similar Documents

Publication Publication Date Title
CN111047511A (en) Image processing method and electronic equipment
CN108229415B (en) Information recommendation method and device, electronic equipment and computer-readable storage medium
CN109427083B (en) Method, device, terminal and storage medium for displaying three-dimensional virtual image
CN111355889B (en) Shooting method, shooting device, electronic equipment and storage medium
CN108184050B (en) Photographing method and mobile terminal
CN108712603B (en) Image processing method and mobile terminal
CN111541907B (en) Article display method, apparatus, device and storage medium
CN107835367A (en) A kind of image processing method, device and mobile terminal
CN110443769B (en) Image processing method, image processing device and terminal equipment
CN108062400A (en) Examination cosmetic method, smart mirror and storage medium based on smart mirror
CN107833177A (en) A kind of image processing method and mobile terminal
CN109819167B (en) Image processing method and device and mobile terminal
CN110263617B (en) Three-dimensional face model obtaining method and device
CN107644396B (en) Lip color adjusting method and device
CN108377339A (en) A kind of photographic method and camera arrangement
CN109671034B (en) Image processing method and terminal equipment
CN109272473B (en) Image processing method and mobile terminal
CN111641861B (en) Video playing method and electronic equipment
CN109544445B (en) Image processing method and device and mobile terminal
CN109167914A (en) A kind of image processing method and mobile terminal
CN109448069B (en) Template generation method and mobile terminal
CN111091519B (en) Image processing method and device
CN111080747B (en) Face image processing method and electronic equipment
CN110908517B (en) Image editing method, image editing device, electronic equipment and medium
CN107563353B (en) Image processing method and device 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