CN115187703A - Eyebrow dressing guidance method, device, equipment and medium - Google Patents

Eyebrow dressing guidance method, device, equipment and medium Download PDF

Info

Publication number
CN115187703A
CN115187703A CN202210718763.4A CN202210718763A CN115187703A CN 115187703 A CN115187703 A CN 115187703A CN 202210718763 A CN202210718763 A CN 202210718763A CN 115187703 A CN115187703 A CN 115187703A
Authority
CN
China
Prior art keywords
key point
face
makeup
distance
determining
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
CN202210718763.4A
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.)
Qingdao Hisense Smart Life Technology Co Ltd
Original Assignee
Qingdao Hisense Smart Life Technology 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 Qingdao Hisense Smart Life Technology Co Ltd filed Critical Qingdao Hisense Smart Life Technology Co Ltd
Priority to CN202210718763.4A priority Critical patent/CN115187703A/en
Publication of CN115187703A publication Critical patent/CN115187703A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • AHUMAN NECESSITIES
    • A45HAND OR TRAVELLING ARTICLES
    • A45DHAIRDRESSING OR SHAVING EQUIPMENT; EQUIPMENT FOR COSMETICS OR COSMETIC TREATMENTS, e.g. FOR MANICURING OR PEDICURING
    • A45D42/00Hand, pocket, or shaving mirrors
    • A45D42/08Shaving mirrors
    • AHUMAN NECESSITIES
    • A45HAND OR TRAVELLING ARTICLES
    • A45DHAIRDRESSING OR SHAVING EQUIPMENT; EQUIPMENT FOR COSMETICS OR COSMETIC TREATMENTS, e.g. FOR MANICURING OR PEDICURING
    • A45D44/00Other cosmetic or toiletry articles, e.g. for hairdressers' rooms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • G06V40/171Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/18Eye characteristics, e.g. of the iris
    • G06V40/193Preprocessing; Feature extraction

Abstract

The present disclosure relates to a eyebrow dressing guidance method, apparatus, device, and medium, the method comprising: collecting a face image in response to a face makeup instruction, and detecting key points of the face; responding to a face makeup instruction selected, and determining a makeup guidance model corresponding to eyebrows in the face according to face makeup parameters in the instruction, wherein the makeup guidance model comprises key points and a key point position relation; determining the length and the distance of eyes based on the key points of the human face, and determining the type of the distance of eyes according to the relationship between the difference between the distance of eyes and the length of eyes and a set threshold value; determining the positions of the boundaries at the two sides of the makeup guidance model in the face image based on the face key points, adjusting the key points at the boundaries at the two sides in the eye distance direction when the eye distance needs to be adjusted according to the eye distance type, determining the coordinates of each key point of the makeup guidance model based on the position relation of the key points after adjustment, and obtaining and displaying the face image with a makeup area. The problem that the user is difficult to put on the hands when making up the eyebrow is solved, and the user experience is improved.

Description

Eyebrow dressing guidance method, device, equipment and medium
Technical Field
The disclosure relates to the technical field of data processing, in particular to a eyebrow dressing guidance method, device, equipment and medium.
Background
For users who cannot make up or have difficulty in putting up hands, specific makeup steps of some makeup are not clear, and appropriate area positions of the makeup are not known, so that corresponding makeup guidance needs to be performed by using intelligent cosmetic mirrors.
In the aspect of guiding makeup of a user, the existing intelligent cosmetic mirror determines a face image with makeup guidance information corresponding to the face makeup selected by the user according to a preset corresponding relationship between the face makeup and the corresponding face image with the makeup guidance information and displays the face image to the user, and possibly displays some text descriptions for guiding the user to makeup. The intelligent cosmetic mirror adopting the image-text mode can only provide simple guidance for a user, and the image-text guidance effect is difficult to realize due to some complicated makeup, so that the problem that the user is difficult to use is solved.
In addition, in the use process of the intelligent cosmetic mirror, due to the difference of the eye distances of users, the distance between the left cosmetic area and the right cosmetic area of the eyebrow cosmetic is too far or too close, for example, the eye distance is too wide, so that five sense organs are loose and unconscious, and the eye distance is too narrow, so that the crowding of the five sense organs is very violent, thereby causing the problem of poor user experience.
Disclosure of Invention
The present disclosure provides a eyebrow dressing guidance method, device, apparatus, and medium, which solves the problem that a user is difficult to put on his/her hands when dressing eyebrows, and improves the user experience.
According to a first aspect of embodiments of the present disclosure, there is provided a eyebrow dressing guidance method, including:
collecting a face image in response to a face makeup instruction, and detecting face key points corresponding to the face in the face image;
in response to a face makeup selection instruction, determining a makeup guidance model corresponding to an eyebrow part in a face according to face makeup parameters in the face makeup selection instruction, wherein the makeup guidance model comprises key points corresponding to the eyebrow part and a key point position relation;
determining the length and the distance of eyes based on the key points of the face, and determining the type of the distance of the eyes corresponding to the face according to the relation between the difference value of the distance of the eyes and the length of the eyes and a set threshold value;
and determining the positions of the boundaries at the two sides of the makeup guidance model in the face image based on the face key points, adjusting the key points at the boundaries at the two sides in the eye distance direction when the eye distance needs to be adjusted according to the eye distance type, determining the coordinates of the makeup guidance model at each key point of the face image based on the position relation of the key points after adjustment, and obtaining the face image with a makeup area and displaying the face image in a display area.
In one possible implementation, the determining the eye length and the eye distance based on the face key points includes:
establishing a coordinate system by taking any vertex in the face image as an origin, and determining a face central line of the face based on the face key point;
determining a first actual key point coordinate and a second actual key point coordinate of the inner canthus and the outer canthus of the left eye, and a third actual key point coordinate and a fourth actual key point coordinate of the inner canthus and the outer canthus of the right eye in the face image;
determining a first actual distance from the first actual key point to a face central line according to the first actual key point coordinates and the face central line;
determining a second actual distance from the second actual key point to the face central line according to the second actual key point coordinate and the face central line;
determining a third actual distance from the third actual key point to the face central line according to the third actual key point coordinates and the face central line;
determining a fourth actual distance from the fourth actual key point to the face central line according to the fourth actual key point coordinate and the face central line;
obtaining the eye length according to the difference value between the second actual distance and the first actual distance and the average value of the sum of the difference values between the fourth actual distance and the third actual distance;
and obtaining the eye distance according to the sum of the first actual distance and the third actual distance.
In a possible implementation manner, the determining, according to a relationship between a difference between the eye distance and the eye length and a set threshold, an eye distance type corresponding to the face includes:
if the difference value between the eye distance and the eye length is larger than a set threshold value, determining that the eye distance type corresponding to the human face is a first eye distance type;
if the absolute value of the difference value between the eye distance and the eye length is smaller than or equal to a set threshold value, determining that the eye distance type corresponding to the human face is a second eye distance type;
and if the difference value between the eye distance and the eye length is smaller than the negative value of the set threshold, determining that the eye distance type corresponding to the face is a third eye distance type.
In a possible implementation manner, when the eye distance type is the first eye distance type, the determining positions of the boundaries on the two sides of the makeup guidance model in the face image based on the key points of the face, and when the eye distance needs to be adjusted according to the eye distance type, adjusting the key points of the boundaries on the two sides in the eye distance direction, and determining the coordinates of the key points of the makeup guidance model in the face image based on the position relation of the key points after the adjustment includes:
positioning a first key point and a second key point which are respectively positioned at the boundaries of two sides of the makeup guidance model, and positioning the first key point coordinate and the second key point coordinate corresponding to the face image;
making a perpendicular line from the first key point to a center line of the face, and determining an included angle between the perpendicular line and a transverse axis of a coordinate system as an adjustment angle;
determining a first adjusting direction corresponding to the makeup guidance model according to the first eye distance type, and determining an adjusting distance adjusted according to the first adjusting direction according to the difference value between the eye distance and the eye length;
adjusting the first key point coordinate according to the adjustment angle, and then adjusting the adjustment distance in the first adjustment direction to obtain an adjusted first key point coordinate;
adjusting the second key point coordinate according to the adjustment angle, and then adjusting the adjustment distance in the first adjustment direction to obtain an adjusted second key point coordinate;
determining the coordinates of each key point of the makeup guidance model in the face image according to the adjusted first key point coordinates/adjusted second key point coordinates and the position relation of the key points;
wherein, the first adjusting direction is a direction moving the coordinates of each key point of the makeup guidance model in the face image to the centerline of the face.
In a possible implementation manner, when the eye distance type is a third eye distance type, the determining positions of the boundaries on the two sides of the makeup guidance model in the face image based on the key points of the face, and when the eye distance needs to be adjusted according to the eye distance type, adjusting the key points of the boundaries on the two sides in the eye distance direction, and determining the coordinates of the key points of the makeup guidance model in the face image based on the position relation of the key points after the adjustment includes:
positioning a first key point and a second key point which are respectively positioned at the boundaries of two sides of the makeup guidance model, and positioning the first key point coordinate and the second key point coordinate corresponding to the face image;
determining an adjusting distance according to the difference value between the eye distance and the eye length;
making a perpendicular line from the first key point to a center line of the face, and determining an included angle between the perpendicular line and a transverse axis of a coordinate system as an adjustment angle;
determining a second adjustment direction corresponding to the makeup guidance model according to the third eye distance type;
determining the adjusted first key point coordinate according to the adjustment angle, the second adjustment direction, the adjustment distance and the first key point coordinate;
determining the adjusted second key point coordinate according to the adjustment angle, the second adjustment direction, the adjustment distance and the second key point coordinate;
determining the coordinates of each key point of the makeup guidance model in the face image according to the adjusted first key point coordinates/adjusted second key point coordinates and the position relation of the key points;
and the second moving direction is a direction of moving each key point coordinate of the makeup guidance model in the face image back to the midline of the face.
In a possible implementation manner, the determining, according to the adjusted first key point coordinate/adjusted second key point coordinate and the key point position relationship, the coordinates of each key point of the makeup guidance model in the face image includes:
calculating a first distance between the adjusted first key point and the adjusted second key point according to the adjusted first key point coordinate and the adjusted second key point coordinate, and determining a second distance between any adjacent key point in the makeup guidance model in the horizontal direction between two corresponding adjacent key points in the face image based on the key point position relation in the makeup guidance model and the first distance;
determining the coordinates of each key point of the makeup guidance model in the face image according to the adjusted first key point coordinates/adjusted second key point coordinates, the second distance and the corresponding angle of each key point in the key point position relation;
the angle corresponding to each key point in the key point position relation is determined by the included angle between the first auxiliary line and the second auxiliary line; the first auxiliary line is obtained by connecting the first key point and the second key point, and the second auxiliary line is obtained by respectively connecting the first key point and each key point in the makeup guidance model, or respectively connecting the second key point and each key point in the makeup guidance model.
In a possible implementation manner, after determining the position of the boundary on both sides of the makeup guidance model in the face image, the method further includes:
when the eye distance does not need to be adjusted according to the eye distance type, calculating a third distance between a first key point and a second key point according to the coordinate of the first key point of the boundary on one side of the makeup guidance model in the face image and the coordinate of the second key point of the boundary on the other side in the face image, and determining a fourth distance in the horizontal direction between two adjacent key points corresponding to any adjacent key points in the makeup guidance model in the face image based on the key point position relation and the third distance in the makeup guidance model;
determining the coordinates of each key point of the makeup guidance model in the face image according to the first key point coordinate/the second key point coordinate, the fourth distance and the corresponding angle of each key point in the key point position relation;
the angle corresponding to each key point in the key point position relation is determined by the included angle between the first auxiliary line and the second auxiliary line; the first auxiliary line is obtained by connecting the first key point and the second key point, and the second auxiliary line is obtained by connecting the first key point and each key point in the makeup guidance model, respectively, or connecting the second key point and each key point in the makeup guidance model, respectively.
According to a second aspect of the embodiments of the present disclosure, there is provided a eyebrow dressing guide device including:
the key point detection module is used for responding to a face makeup display instruction, collecting a face image and detecting a face key point corresponding to a face in the face image;
the model determining module is used for responding to a face makeup selecting instruction and determining a makeup guidance model corresponding to the eyebrow part in the face according to face makeup parameters in the face makeup selecting instruction, wherein the makeup guidance model comprises key points corresponding to the eyebrow part and a key point position relation;
the eye distance type determining module is used for determining the eye length and the eye distance based on the key points of the face, and determining the eye distance type corresponding to the face according to the relation between the difference value of the eye distance and the eye length and a set threshold value;
and the coordinate adjusting module is used for determining the positions of the boundaries at the two sides of the makeup guide model in the face image based on the face key points, adjusting the key points of the boundaries at the two sides in the eye distance direction when the eye distance needs to be adjusted according to the eye distance type, determining the coordinates of each key point of the makeup guide model in the face image based on the position relation of the key points after adjustment, obtaining the face image with a makeup area, and displaying the face image in a display area.
According to a third aspect of embodiments of the present disclosure, there is provided an intelligent mirror comprising: the camera device is used for acquiring a face image; the display screen is used for displaying face makeup and a face image with a makeup area and acquiring an operation instruction triggered by a user; a memory for storing processor-executable instructions; a processor; the method is used for realizing the steps of the eyebrow dressing guiding method by executing the executable instructions in the memory.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the above-described eyebrow makeup guidance method.
In addition, for technical effects brought by any one implementation manner of the second aspect to the fourth aspect, reference may be made to technical effects brought by different implementation manners of the first aspect, and details are not described here.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the method and the device can detect the face key points corresponding to the face in the face image; determining a makeup guidance model corresponding to the eyebrow part in the face according to face makeup parameters corresponding to the face makeup selected by a user; determining the length and the distance of eyes based on the key points of the face, and determining the type of the distance of the eyes corresponding to the face according to the relation between the difference value of the distance of the eyes and the length of the eyes and a set threshold value; and adjusting the positions of the boundaries at the two sides of the makeup guidance model on the face image according to the adjustment directions corresponding to different eye distance types, and further adjusting the coordinates of the makeup guidance model at each key point of the face image to obtain the face image with a makeup area and display the face image in a display area. Therefore, the cosmetic area of eyebrow makeup can be presented in this disclosure, so that the user can follow the study with reference to the cosmetic area, and the makeup appearance of the user is improved, thereby solving the problem that the user is difficult to get on the hands. And the position of the makeup guidance model in the face image can be adjusted according to different eye distance types, so that the five sense organs of the user are more attractive through the makeup decoration, and the experience of the user is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required to be used in the description of the embodiments will be briefly introduced below, and it is apparent that the drawings in the description below are only some embodiments of the present disclosure, and it is obvious for those skilled in the art that other drawings may be obtained according to the drawings without inventive labor.
FIG. 1 is a schematic diagram illustrating an application scenario in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a eyebrow makeup guidance method according to an exemplary embodiment;
FIG. 3 is a schematic diagram illustrating a display of a face image in a presentation area according to an exemplary embodiment;
FIG. 4 is a schematic diagram illustrating another display of a face image on a presentation area in accordance with an exemplary embodiment;
FIG. 5 is a detailed flow diagram illustrating a eyebrow makeup guidance method according to an exemplary embodiment;
FIG. 6 is a schematic diagram illustrating face keypoints in a face according to an exemplary embodiment;
FIG. 7 is a presentation interface diagram shown in accordance with an exemplary embodiment;
FIG. 8 is a diagram illustrating a cosmetic guidance model for generating an eyebrow shape in accordance with an exemplary embodiment;
FIG. 9 is a schematic diagram illustrating a standard scale face width in accordance with an exemplary embodiment;
FIG. 10 is a schematic diagram illustrating the determination of eye length and eye distance in accordance with an exemplary embodiment;
FIG. 11 is a diagram illustrating adjustment of coordinates of key points of a makeup guidance model in a face image for a wide eye distance case, according to an exemplary embodiment;
FIG. 12 is a diagram illustrating adjustment of coordinates of key points of a makeup guidance model in a face image for a wide eye distance case, according to an exemplary embodiment;
FIG. 13 is a diagram illustrating the coordinates of key points of a cosmetic guidance model in a face image with a wide eye distance, according to an exemplary embodiment;
FIG. 14 is a diagram illustrating adjustment of coordinates of key points of a makeup guidance model in a face image for a wide eye distance case, according to an exemplary embodiment;
FIG. 15 is a diagram illustrating adjustment of coordinates of key points of a makeup guidance model in a face image for a standard eye distance case, according to an exemplary embodiment;
FIG. 16 is a diagram illustrating adjustment of coordinates of key points of a makeup guidance model in a face image for a standard eye distance case, according to an exemplary embodiment;
FIG. 17 is a diagram illustrating adjustment of coordinates of key points of a makeup guidance model in a face image for a standard eye distance case, according to an exemplary embodiment;
FIG. 18 is a diagram illustrating adjustment of coordinates of key points of a makeup guidance model in a face image for a narrow eye distance case, according to an exemplary embodiment;
FIG. 19 is a diagram illustrating adjustment of coordinates of key points of a makeup guidance model in a face image for a narrow eye distance case, according to an exemplary embodiment;
FIG. 20 is a diagram illustrating adjustment of coordinates of key points of a makeup guidance model in a face image for a narrow eye distance case, according to an exemplary embodiment;
FIG. 21 is a presentation interface diagram shown in accordance with an exemplary embodiment;
FIG. 22 is a schematic view of a eyebrow dressing guide apparatus shown in accordance with an exemplary embodiment;
FIG. 23 is a schematic view of an intelligent mirror shown in accordance with an exemplary embodiment;
FIG. 24 is a program product diagram illustrating a eyebrow makeup guidance method according to an exemplary embodiment.
Detailed Description
To make the objects, technical solutions and advantages of the present disclosure more apparent, the present disclosure will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present disclosure, not all embodiments. All other embodiments, which can be derived by one of ordinary skill in the art from the embodiments disclosed herein without making any creative effort, shall fall within the scope of protection of the present disclosure.
In the aspect of guiding makeup of a user, the existing intelligent cosmetic mirror determines a face image with makeup guide information corresponding to the face makeup selected by the user according to a preset corresponding relationship between the face makeup and the corresponding face image with the makeup guide information and displays the face image to the user, and possibly displays some text descriptions for guiding the user to makeup. The intelligent cosmetic mirror adopting the image-text mode can only provide a simple guidance for a user, and the image-text guidance effect is difficult to realize due to complex makeup, so that the problem that the user is difficult to use is solved. In addition, in the use process of the intelligent cosmetic mirror, due to the difference of the eye distances of users, the distance between the left cosmetic area and the right cosmetic area of the eyebrow cosmetic is too far or too close, for example, the eye distance is too wide, so that five sense organs are loose and unconscious, and the eye distance is too narrow, so that the crowding of the five sense organs is very violent, thereby causing the problem of poor user experience.
Therefore, in order to solve the above problems, the present disclosure provides a eyebrow dressing guidance method, device, apparatus, and medium, which solve the problem that a user is difficult to apply his/her hands when dressing eyebrows, and improve the user experience.
Reference is first made to fig. 1, which is a schematic view of an application scenario of the present disclosure, and includes a camera 11, a display 12, and a server 13. The camera device 11 may be a camera, a mobile phone, a camera of a computer, etc. and is used for acquiring a face image; the server 13 is used for processing the face image collected by the camera device 11, and the display screen 12 is used for displaying the face makeup and the face image with a makeup area, and acquiring an operation instruction triggered by a user.
In the embodiment of the present disclosure, one implementation manner of the embodiment of the present disclosure is to collect a face image in response to a face makeup instruction for displaying, and detect a face key point corresponding to a face in the face image; in response to a face makeup selection instruction, determining a makeup guidance model corresponding to an eyebrow part in a face according to face makeup parameters in the face makeup selection instruction, wherein the makeup guidance model comprises key points corresponding to the eyebrow part and a key point position relation; determining the length and the distance of eyes based on the key points of the face, and determining the type of the distance of the eyes corresponding to the face according to the relation between the difference value of the distance of the eyes and the length of the eyes and a set threshold value; and determining the positions of the boundaries at the two sides of the makeup guidance model in the face image based on the face key points, adjusting the key points of the boundaries at the two sides in the eye distance direction when the eye distance needs to be adjusted according to the eye distance type, determining the coordinates of the makeup guidance model at each key point of the face image based on the position relation of the key points after adjustment, obtaining the face image with a makeup area, and displaying the face image in a display area.
The embodiment of the disclosure provides a eyebrow dressing guiding method, and the eyebrow dressing guiding device, the intelligent mirror and a computer readable storage medium are further provided based on the same conception.
In some embodiments, the following describes a eyebrow dressing guidance method provided by the present disclosure by way of specific examples, as shown in fig. 2, including:
step 201, in response to a face makeup instruction, acquiring a face image, and detecting face key points corresponding to a face in the face image;
step 202, responding to a face makeup instruction, and determining a makeup guidance model corresponding to an eyebrow part in a face according to face makeup parameters in the face makeup instruction, wherein the makeup guidance model comprises key points corresponding to the eyebrow part and a key point position relation;
the face makeup parameters comprise the type of makeup, face parts corresponding to the makeup and the like. The makeup guidance model is established in advance.
Step 203, determining the length and the distance of the eyes based on the key points of the face, and determining the type of the distance of the eyes corresponding to the face according to the relationship between the difference value of the distance of the eyes and the length of the eyes and a set threshold value;
the eye distance types include a first eye distance type (wide eye distance), a second eye distance type (standard eye distance), and a third eye distance type (narrow eye distance).
And 204, determining the positions of the boundaries at the two sides of the makeup guidance model in the face image based on the face key points, adjusting the key points of the boundaries at the two sides in the eye distance direction when the eye distance needs to be adjusted according to the eye distance type, determining the coordinates of the makeup guidance model at each key point of the face image based on the position relation of the key points after adjustment, obtaining the face image with a makeup area, and displaying the face image in a display area.
Coordinates can be established by utilizing any vertex in the face image, the positions of the boundaries at the two sides of the makeup guidance model in the face image are determined, corresponding adjustment is carried out according to the eye distance type, and then the coordinates of each key point of the makeup guidance model in the face image are determined based on the adjusted coordinates of the boundaries at the two sides and the position relation of the key points.
The face image with the makeup area may be a face image with a makeup area formed by key points displayed in the face image according to coordinates of the adjusted makeup guide model at the key points of the face image, as shown in fig. 3; or connecting adjacent key points according to the coordinates of each key point of the face image of the adjusted makeup guidance model, and displaying the face image with a makeup area formed by connecting the adjacent key points in the face image, as shown in fig. 4.
The cosmetic area that this openly can present eyebrow and make up makes up, makes up the area with learning according to making up, perfects oneself and looks to solve the problem of user's hand difficulty. And the position of the makeup guidance model in the face image can be adjusted according to different eye distance types, so that the five sense organs of the user are more attractive through makeup modification, and the experience of the user is improved.
The present disclosure provides a eyebrow dressing guidance method, the specific process of which is shown in fig. 5:
step 501, in response to a face makeup displaying instruction, acquiring a face image, and detecting face key points corresponding to a face in the face image;
the face key point detection method is divided into two steps, firstly face detection is carried out on face images by adopting BlazeFace, and then the face images only containing face information are input into a face key point detector to be detected for 468 face key points. This process is prior art and will not be described in detail here. As shown in fig. 6, 468 individual face keypoints are at various locations in the face. MediaPipe is a graphics-based cross-platform framework for building machine learning pipelines for multimodal (video, audio, and sensor) applications. MediaPipe can run cross-platform on mobile devices, workstations, and servers and support mobile GPU (graphics Processing Unit) acceleration. The machine learning pipeline of an application can be built as a graph of modular components using MediaPipe. The platform also supports many common AI (Artificial Intelligence) algorithms, such as portrait segmentation, gesture tracking, human posture estimation, and the like.
Step 502, responding to a face makeup instruction, and determining a makeup guidance model corresponding to an eyebrow part in a face according to face makeup parameters in the face makeup instruction, wherein the makeup guidance model comprises key points corresponding to the eyebrow part and a key point position relation;
FIG. 7 is an illustration of a presentation interface, according to an example embodiment. The display interface comprises a display interface for displaying the collected face image and various face makeup, wherein the face makeup can comprise various eyebrow shapes, eye shadows and the like. And displaying an eyebrow type selection menu and each eyebrow type button in a display interface in response to the button for selecting the eyebrow clicked by the user, and also displaying pictures corresponding to various eyebrows, so that the user can conveniently select. And after the user clicks a button of type 1 in the eyebrow shape, determining a makeup guidance model corresponding to eyebrows in the face according to the face makeup parameters corresponding to the type 1.
The makeup guidance model is pre-established, and the specific establishment process comprises the following steps:
determining the shape of the makeup guidance model and corresponding key points based on the corresponding eyebrow makeup of the makeup guidance model;
establishing a coordinate system by taking the first key point or the second key point of the boundary at the two sides of the makeup guidance model as an origin, and determining the coordinates of each key point in the makeup guidance model;
and determining the position relation of key points based on the coordinates of the key points in the makeup guidance model.
The method for determining the position relation of the key points based on the coordinates of the key points in the makeup guidance model comprises the following steps:
connecting the first key point and the second key point to serve as a first auxiliary line;
and respectively connecting the first key point with each key point in the makeup guidance model, or respectively connecting the second key point with each key point in the makeup guidance model as a second auxiliary line, and determining the angle corresponding to each key point based on the included angle between the first auxiliary line and the second auxiliary line.
For example, fig. 8 is a schematic diagram of a makeup guidance model for generating an eyebrow shape, and the process of establishing the makeup guidance model for the right eyebrow shape is as follows: taking a 28-point model as an example, establishing a coordinate system by taking the brow point A of the brow shape as an origin, determining the brow point B, and connecting the brow point A and the brow point B as a second pointIf the coordinate of point a is (0,0) and the coordinate of point C is (a, b) on one auxiliary line L1, i.e., the X axis, and point a and point C are connected as a second auxiliary line L2, the angle between L1 and L2, i.e., tan (α) = b/a, is determined, and the angle α corresponding to point C is determined. The angle alpha corresponding to the D point can be calculated according to the coordinate of the A point and the coordinate of the D point 1 The angle corresponding to each key point in the makeup guidance model of the right eyebrow shape can be calculated by using the same method.
Wherein, alpha 1 The parameters adjusted based on the characteristics of the right eyebrow shape represent the trend of the right eyebrow shape. And (4) constructing a makeup guidance model, namely adjusting the angles corresponding to the key points in the makeup guidance model. The dressing guidance model can be adaptively adjusted based on a corresponding actual starting point and length in the actual face image, for example, the dressing guidance model of the right eyebrow shape can be adaptively adjusted based on the length between the eyebrow point and the eyebrow tail point of the right eyebrow shape in the actual face image.
Step 503, determining the length and the distance of eyes based on the key points of the human face;
as shown in fig. 9, the length of the left eye from the left side of the left eye to the leftmost side of the face contour in the horizontal direction, the length of the left eye from the horizontal direction between the two internal angles of the eyes, the length of the right eye from the horizontal direction, and the length of the right eye from the right side of the right eye to the rightmost side of the face contour in the horizontal direction satisfy the proportional relationship 1:1:1:1:1, based on the feature relationship, the length and the distance of the eyes can be determined based on the key points of the human face, and the position relationship between the eyes can be found, so that the features of the distance of the eyes can be obtained.
The specific method for determining the length and the distance of the eyes based on the key points of the human face comprises the following steps:
establishing a coordinate system by taking any vertex in the face image as an origin, and determining a face central line of the face based on the face key point;
determining first actual key point coordinates and second actual key point coordinates of the inner canthus and the outer canthus of the left eye, and third actual key point coordinates and fourth actual key point coordinates of the inner canthus and the outer canthus of the right eye in the face image;
determining a first actual distance from the first actual key point to a face central line according to the first actual key point coordinates and the face central line;
determining a second actual distance from the second actual key point to the face central line according to the second actual key point coordinates and the face central line;
determining a third actual distance from the third actual key point to the face central line according to the third actual key point coordinates and the face central line;
determining a fourth actual distance from the fourth actual key point to the face central line according to the fourth actual key point coordinate and the face central line;
obtaining the eye length according to the difference value between the second actual distance and the first actual distance and the average value of the sum of the difference values between the fourth actual distance and the third actual distance;
and obtaining the eye distance according to the sum of the first actual distance and the third actual distance.
The method for determining the straight line L where the center line of the face is located based on the key points of the face comprises the following steps: in the detection of the key points of the human face, 8 points, 168 points, 6 points, 197 points, 195 points, 5 points and 4 points in the bridge of the nose of the face are distributed on the straight line L as much as possible or are uniformly distributed on two sides of the straight line L, and the straight line L is assumed to be: mx + ny + q =0. The main key point positions of the eye are determined as follows: the two canthi of the left eye respectively adopt a point 130 positioned in the inner canthus as a second actual key point, and a point 133 positioned in the outer canthus as a first actual key point. The two canthi of the right eye respectively adopt a point 362 positioned in the inner canthus as a third actual key point and a point 359 positioned in the outer canthus as a fourth actual key point. As shown in fig. 10, E (Xe, ye), F (Xf, yf), G (Xg, yg), I (Xi, yi) represent the corner key point coordinates of the two eyes, respectively. The horizontal distance S1 between point E and the straight line L is calculated as follows:
S1=|m*Xe+n*Ye+q|/(m 2 +n 2 );
similarly, the distance S2 from point F to the straight line L, the distance S3 from point G to the straight line L, and the distance S4 from point I to the straight line L can be calculated. Since the lengths of the two eyes of the same person in the horizontal direction are close and cannot be completely equal, the average of the lengths of the two eyes in the horizontal direction is adopted as the eye length S for the length of the eyes: s = ((S1-S2) + (S4-S3))/2, eye distance SS: SS = S2+ S3.
Step 504, judging the eye distance type corresponding to the face according to the relation between the difference value of the eye distance and the eye length and a set threshold, executing steps 505-506 when the eye distance type is determined to be a first eye distance type, executing steps 507-508 when the eye distance type is determined to be a second eye distance type, and executing steps 509-510 when the eye distance type is determined to be a third eye distance type;
the set threshold may be set based on the actual application scenario. The eye distance types include a first eye distance type (wide eye distance), a second eye distance type (standard eye distance), and a third eye distance type (narrow eye distance).
Step 505, determining that the eye distance type corresponding to the face is a first eye distance type;
and if the difference value between the eye distance and the eye length is larger than a set threshold value, determining that the eye distance type corresponding to the human face is a first eye distance type. That is, when SS-S > t (t >0,t value can be set based on the actual application scene), the face can be determined to be a wide eye distance.
Step 506, determining positions of boundaries at two sides of the makeup guidance model in the face image, adjusting key points of the boundaries at the two sides in a first adjustment direction, and determining coordinates of each key point of the makeup guidance model in the face image based on the position relation of the key points after adjustment;
in the face with a wide eye distance, the five sense organs are relatively scattered in vision, which is easy to look like without spirit, and the five sense organs need to be drawn close to the middle visually. Therefore, the makeup guidance model for the eyebrow makeup with wide eye distance needs to extend towards the middle integrally, needs to extend the position of the eyebrow head and the position of the eyebrow tail towards the middle of the face, and visually draws near five sense organs to modify the defects of the face.
Therefore, the specific process of the method is as follows:
positioning a first key point and a second key point which are respectively positioned at the boundaries of two sides of the makeup guidance model, and positioning the first key point coordinate and the second key point coordinate corresponding to the face image;
making a perpendicular line from the first key point to a center line of the face, and determining an included angle between the perpendicular line and a transverse axis of a coordinate system as an adjustment angle;
determining a first adjusting direction corresponding to the makeup guidance model according to the first eye distance type, and determining an adjusting distance adjusted according to the first adjusting direction according to the difference value between the eye distance and the eye length;
adjusting the first key point coordinate according to the adjustment angle, and then adjusting the adjustment distance in the first adjustment direction to obtain an adjusted first key point coordinate;
adjusting the second key point coordinate according to the adjustment angle, and then adjusting the adjustment distance in the first adjustment direction to obtain an adjusted second key point coordinate;
determining the coordinates of each key point of the makeup guidance model in the face image according to the adjusted first key point coordinates/adjusted second key point coordinates and the position relation of the key points;
wherein, the first adjusting direction is a direction moving the coordinates of each key point of the makeup guidance model in the face image to the centerline of the face.
As shown in fig. 11, when the face in the face image is not inclined, a makeup guidance model of a right eyebrow shape with 28 points is taken as an example in a coordinate system established by taking the upper left vertex of the face image as an origin. And determining that the first key point of the makeup guidance model is an eyebrow point A and the second key point is an eyebrow point B, and determining that the first key point and the second key point respectively correspond to a first key point coordinate A (X1, Y1) and a second key point coordinate B (X2, Y2) at 300 and 383 in the face image. Calculating the horizontal distance W that the points A and B need to move according to the length SS of the eyes and the distance between the eyes, wherein the horizontal distance is the horizontal distance which is vertically related to the straight line L: w = (SS-S)/2;
then, the point a needs to get closer to the distance W in the horizontal direction perpendicular to the line L to get the point a ', and the coordinates (X1', Y1 ') of the point a' are:
X1′=X1-W;
Y1′=Y1;
according to the method, the distance of the point B closing to the W in the horizontal direction perpendicular to the L straight line can be obtained to obtain the coordinates (X2 ', Y2 ') of the point B '.
The determining the coordinates of each key point of the makeup guidance model in the face image according to the adjusted first key point coordinates/adjusted second key point coordinates and the key point position relationship comprises:
calculating a first distance between the adjusted first key point and the adjusted second key point according to the adjusted first key point coordinate and the adjusted second key point coordinate, and determining a second distance between any adjacent key point in the makeup guidance model in the horizontal direction between two corresponding adjacent key points in the face image based on the key point position relation in the makeup guidance model and the first distance;
and determining the coordinates of each key point of the makeup guidance model in the face image according to the adjusted first key point coordinates/adjusted second key point coordinates, the second distance and the corresponding angle of each key point in the key point position relation.
The method for determining the coordinates of each key point of the makeup guidance model in the face image comprises the following two modes:
in the first mode, adjacent key points of the adjusted first key points are determined, and the abscissa of the adjacent key points is determined according to the angle corresponding to the adjacent key points, the abscissa of the adjusted first key points and the second distance; determining the vertical coordinate of the adjacent key point according to the angle corresponding to the adjacent key point, the adjusted vertical coordinate of the first key point and the second distance;
as shown in fig. 11, the first distance between the a 'point and the B' point is l = ((X1 '-X2') 2 +(Y1′-Y2′) 2 ) 1/2 Assuming that the number of the recorded points A 'and B' in the key point position relation in the eyebrow guidance model is 14, the second distance in the horizontal direction between any two adjacent key points in the face imageFor d = l/14, the angle θ corresponding to the C' point is determined. The coordinates (X3 ', Y3 ') of the C ' point are obtained by the following formula:
X3’=X1’+d;
Y3’=Y1’-tan(θ)*d;
the D 'point coordinates (X4', Y4 ') may be further obtained based on the coordinates of the C' point:
X4’=X3’+d;
Y4’=Y3’-tan(θ 1 )*d;
wherein, theta 1 The angle corresponding to the D point.
In a second mode, determining adjacent key points of the adjusted second key points, and determining the abscissa of the adjacent key points according to the angle corresponding to the adjacent key points, the abscissa of the adjusted second key points and a second distance; and determining the vertical coordinate of the adjacent key point according to the angle corresponding to the adjacent key point, the adjusted vertical coordinate of the second key point and the second distance.
As shown in fig. 12, in a coordinate system established with the top left vertex of the face image as the origin, a first distance between the a 'point and the B' point is l = ((X1 '-X2') 2 +(Y1’-Y2’) 2 ) 1/2 And assuming that the recorded points A ' and B ' in the key point position relation in the makeup guidance model are equally divided into 14 parts, the second distance is d = l/14, and the angle theta corresponding to the point C ' is determined. The coordinates (X3 ', Y3 ') of point C ' are shown by the following equations:
X3’=X2’-d;
Y3’=Y2’-tan(θ)*d;
the coordinates (X4 ', Y4') of the D point may be further obtained based on the coordinates of the C point:
X4’=X3’-d;
Y4’=Y3’-tan(θ 1 )*d;
wherein, theta 1 The angle corresponding to the D point.
As shown in fig. 13, when the face in the face image inclines to the right, a makeup guidance model of a right eyebrow shape with 28 points is taken as an example under a coordinate system established by taking the upper left vertex of the face image as an origin. And determining that the first key point of the makeup guidance model is an eyebrow point A and the second key point is an eyebrow point B, and determining that the first key point and the second key point respectively correspond to a first key point coordinate A (X1, Y1) and a second key point coordinate B (X2, Y2) at 300 and 383 in the face image. Calculating the horizontal distance W that the points A and B need to move according to the length SS of the eyes and the distance between the eyes, wherein the horizontal distance is the horizontal distance which is vertically related to the straight line L: w = (SS-S)/2;
then, the point a needs to get closer to the distance W in the horizontal direction perpendicular to the line L to obtain the point a', i.e. to make the perpendicular line from the point a to the line L. Assuming that the vertical line is at an angle ψ from the horizontal, ψ can be obtained from the slope of a known straight line L. The coordinates of point a ' (X1 ', Y1 ') are then:
X1′=X1-cos(ψ)*W;
Y1′=Y1-sin(ψ)*W;
according to the method, the distance of the point B approaching to the W in the horizontal direction perpendicular to the L straight line can be obtained to obtain the coordinates (X2 ', Y2 ') of the point B '.
The coordinates of each key point of the makeup guidance model in the face image can be determined according to the relationship between the coordinates of the point a' and the positions of the key points, as shown in fig. 13, specifically:
the first distance between the points A 'and B' is l = ((X1 '-X2') 2 +(Y1′-Y2′) 2 ) 1/2 And assuming that the recorded points A ' and B ' in the key point position relation in the eyebrow guidance model are equally divided into 14 parts, the second distance is d = l/14, and the angle theta corresponding to the point C ' is determined.
When the angle θ corresponding to the point C 'is greater than ψ, the coordinates (X3', Y3 ') of the point C' are obtained by the following formula:
calculating the distance between A 'and C': r = d/cos (θ);
X3′=X1′+cos(θ-ψ)*r;
Y3′=Y1′-sin(θ-ψ)*r;
the coordinates of other key points of the makeup guidance model in the face image can be determined according to the method.
When the angle θ corresponding to the C 'point is smaller than or equal to ψ, the coordinates (X3', Y3 ') of the C' point are obtained by the following formula:
calculating the distance between A 'and C': r = d/cos (θ);
X3′=X1′+cos(ψ-θ)*r;
Y3′=Y1′+sin(ψ-θ)*r;
the coordinates of other key points of the makeup guidance model in the face image can be adjusted according to the method.
Or determining the coordinates of each key point of the makeup guidance model in the face image according to the position relation between the B' point coordinates and the key point, specifically:
the first distance between the points A 'and B' is l = ((X1 '-X2') 2 +(Y1′-Y2′) 2 ) 1/2 And assuming that the recorded points A ' and B ' in the key point position relation in the eyebrow guidance model are equally divided into 14 parts, determining a point C ' adjacent to the point B ' and determining an angle theta corresponding to the point C ' with a second distance d = l/14. When the angle θ corresponding to the point C 'is greater than ψ, the coordinates (X3', Y3 ') of the point C' are obtained by the following formula:
calculating the distance between B 'and C': r = d/cos (θ);
X3′=X2′-cos(θ+ψ)*r;
Y3′=Y2′-sin(θ+ψ)*r;
the coordinates of other key points of the makeup guidance model in the face image can be adjusted according to the method.
As shown in fig. 14, when the face in the face image is tilted to the left, a 28-point makeup guidance model of the right eyebrow shape is taken as an example in a coordinate system established with the upper left vertex of the face image as the origin. And determining that the first key point of the makeup guidance model is an eyebrow point A and the second key point is an eyebrow point B, and determining that the first key point and the second key point respectively correspond to a first key point coordinate A (X1, Y1) and a second key point coordinate B (X2, Y2) at 300 and 383 in the face image. Calculating the horizontal distance W that the points A and B need to move according to the length SS of the eyes and the distance between the eyes, wherein the horizontal distance is the horizontal distance which is vertically related to the straight line L: w = (SS-S)/2;
then, the point a needs to get closer to the distance W in the horizontal direction perpendicular to the line L to obtain the point a', i.e. to make the perpendicular line from the point a to the line L. Assuming that the vertical line is at an angle ψ from the horizontal, ψ can be obtained from the slope of a known straight line L. The coordinates of point a ' (X1 ', Y1 ') are then:
X1′=X1-cos(ψ)*W;
Y1′=Y1+sin(ψ)*W;
according to the method, the distance of the point B closing to the W in the horizontal direction perpendicular to the L straight line can be obtained to obtain the coordinates (X2 ', Y2 ') of the point B '.
Coordinates of each key point of the makeup guidance model in the face image can be determined according to the relationship between the coordinates of the point a' and the positions of the key points, as shown in fig. 14, specifically:
the first distance between the points A 'and B' is l = ((X1 '-X2') 2 +(Y1′-Y2′) 2 ) 1/2 And assuming that the recorded points A ' and B ' in the key point position relation in the eyebrow guidance model are equally divided into 14 parts, the second distance is d = l/14, and the angle theta corresponding to the point C ' is determined. The coordinates (X3 ', Y3 ') of the C ' point are obtained by the following formula:
calculating the distance between A 'and C': r = d/cos (θ);
X3′=X1′+cos(θ+ψ)*r;
Y3′=Y1′-sin(θ+ψ)*r;
the coordinates of other key points of the makeup guidance model in the face image can be determined according to the method.
The coordinates of each key point of the makeup guidance model in the face image can be determined according to the position relation between the B' point coordinates and the key point, and the method specifically comprises the following steps:
the first distance between the points A 'and B' is l = ((X1 '-X2') 2 +(Y1′-Y2′) 2 ) 1/2 And if the recorded points A ' and B ' in the relationship of the positions of the key points in the eyebrow guidance model are equally divided into 14 parts, determining the angle theta corresponding to the point C ' with the second distance d = l/14.
When the angle θ corresponding to the point C 'is greater than ψ, the coordinates (X3', Y3 ') of the point C' are obtained by the following formula:
calculating the distance between B 'and C': r = d/cos (θ);
X3′=X2′-cos(θ-ψ)*r;
Y3′=Y2′-sin(θ-ψ)*r;
the coordinates of other key points of the makeup guidance model in the face image can be determined according to the method.
When the angle θ corresponding to the C 'point is smaller than or equal to ψ, the coordinates (X3', Y3 ') of the C' point are obtained by the following formula:
calculating the distance between A 'and C': r = d/cos (θ);
X3′=X2′-cos(ψ-θ)*r;
Y3′=Y2′+sin(ψ-θ)*r;
the coordinates of other key points of the makeup guidance model in the face image can be adjusted according to the method.
Step 507, determining the eye distance type corresponding to the face as a second eye distance type;
and if the absolute value of the difference value between the eye distance and the eye length is smaller than or equal to a set threshold value, determining that the eye distance type corresponding to the human face is a second eye distance type. That is, when | SS-S | < = t, the eye distance comparison criterion of the face may be determined.
Step 508, determining the positions of the boundaries at the two sides of the makeup guide model in the face image, and determining the coordinates of each key point of the makeup guide model in the face image based on the position relation of the key points;
when determining that the eye distance does not need to be adjusted, determining the coordinates of each key point of the makeup guidance model in the face image by the following method:
calculating a third distance between a first key point and a second key point according to a first key point coordinate of a first side boundary of the makeup guidance model in the face image and a second key point coordinate of a second side boundary of the makeup guidance model in the face image, and determining a fourth distance in the horizontal direction between two adjacent key points corresponding to any adjacent key point in the makeup guidance model in the face image based on the key point position relation and the third distance in the makeup guidance model;
determining the coordinates of each key point of the makeup guidance model in the face image according to the coordinates of the first key point/the second key point, the fourth distance and the angle corresponding to each key point in the key point position relation;
the angle corresponding to each key point in the key point position relation is determined by the included angle between the first auxiliary line and the second auxiliary line; the first auxiliary line is obtained by connecting the first key point and the second key point, and the second auxiliary line is obtained by respectively connecting the first key point and each key point in the makeup guidance model, or respectively connecting the second key point and each key point in the makeup guidance model.
As shown in fig. 15, when the face in the face image is not tilted, a 28-point right eyebrow shape makeup guidance model is taken as an example in a coordinate system established with the upper left vertex of the face image as the origin. And determining that the first key point of the makeup guidance model is an eyebrow point A, the second key point is an eyebrow point B, and the first key point coordinate A (X1, Y1) and the second key point coordinate B (X2, Y2) correspond to each other. The first distance between the points A and B is l = ((X1-X2) 2 +(Y1-Y2) 2 ) 1/2 And if the recorded positions of the point A and the point B in the key point position relation in the eyebrow guidance model are divided into 14 parts, the third distance is d = l/14, and the angle theta corresponding to the point C is determined.
The coordinates of each key point of the makeup guidance model in the face image can be determined according to the relationship between the coordinates of the point A and the positions of the key points, and then the coordinates (X3, Y3) of the point C are obtained through the following formula:
X3=X1+d;
Y3=Y1-tan(θ)*d;
the coordinates of the D point (X4, Y4) may be further obtained based on the coordinates of the C point:
X4=X3+d;
Y4=Y3-tan(θ 1 )*d;
wherein, θ 1 is the angle corresponding to the D point.
Or determining the coordinates of each key point of the makeup guidance model in the face image according to the coordinates of the point B and the position relation of the key point, and obtaining the coordinates (X3, Y3) of the point C adjacent to the point B through the following formula:
X3=X2-d;
Y3=Y2-tan(θ)*d;
the coordinates of the D point (X4, Y4) may be further obtained based on the coordinates of the C point:
X4=X3-d;
Y4=Y3-tan(θ 1 )*d;
wherein, θ 1 is the angle corresponding to the D point.
As shown in fig. 16, when the face in the face image is tilted to the right, a 28-point makeup guidance model of the right eyebrow shape is taken as an example in a coordinate system established with the upper left vertex of the face image as the origin. And determining that the first key point of the makeup guidance model is an eyebrow point A, and the second key point of the makeup guidance model is an eyebrow point B, and respectively corresponding to a first key point coordinate A (X1, Y1) and a second key point coordinate B (X2, Y2). The third distance between the points A and B is l = ((X1-X2) 2 +(Y1-Y2) 2 ) 1/2 The inclination angle σ is tan (σ) = (Y2-Y1)/(X2-X1).
The coordinates of each key point of the makeup guidance model in the face image can be determined according to the relationship between the coordinates of the point a and the positions of the key points, as shown in fig. 16, specifically:
and assuming that the recorded part between the point A and the point B is 14 parts in the key point position relation in the makeup guidance model, determining the angle theta corresponding to the point C, wherein the fourth distance is d = l/14.
When the angle θ corresponding to the point C is larger than σ, the coordinates (X3, Y3) of the point C are obtained by the following formula:
calculating the distance between A and C: r = d/cos (θ);
X3=X1+cos(θ-σ)*r;
Y3=Y1-sin(θ-σ)*r;
the coordinates of other key points of the makeup guidance model in the face image can be determined according to the method.
When the angle θ corresponding to the point C is smaller than or equal to σ, the coordinates (X3, Y3) of the point C are obtained by the following formula:
calculating the distance between A and C: r = d/cos (θ);
X3=X1+cos(σ-θ)*r;
Y3=Y1+sin(σ-θ)*r;
the coordinates of other key points of the makeup guidance model in the face image can be determined according to the method.
Or determining the coordinates of each key point of the makeup guidance model in the face image according to the relation between the coordinates of the point B and the positions of the key points, specifically:
assuming that the distance between the points a and B is divided into 14 parts, the fourth distance is d = l/14, the point C adjacent to the point B is determined, and the angle θ corresponding to the point C is determined. The coordinates (X3, Y3) of the point C are obtained by the following formula:
calculating the distance between B and C: r = d/cos (θ);
X3=X2-cos(θ+σ)*r;
Y3=Y2-sin(θ+σ)*r;
the coordinates of other key points of the makeup guidance model in the face image can be determined according to the method.
As shown in fig. 17, when the face in the face image inclines to the left, a 28-point makeup guidance model of the right eyebrow shape is taken as an example in a coordinate system established with the upper left vertex of the face image as the origin. And determining a first key point of the makeup guidance model as an eyebrow point A and a second key point of the makeup guidance model as an eyebrow point B, wherein the first key point and the second key point respectively correspond to a first key point coordinate A (X1, Y1) and a second key point coordinate B (X2, Y2). The third distance between the points A and B is l = ((X1-X2) 2 +(Y1-Y2) 2 ) 1/2 The inclination angle σ is tan (σ) = (Y2-Y1)/(X2-X1).
The coordinates of each key point of the makeup guidance model in the face image can be determined according to the relationship between the coordinates of the point a and the positions of the key points, as shown in fig. 17, specifically:
and assuming that the recorded part between the point A and the point B in the key point position relation in the makeup guidance model is 14 parts, the fourth distance is d = l/14, and the angle theta corresponding to the point C is determined. The coordinates (X3, Y3) of the point C are obtained by the following formula:
calculating the distance between A and C: r = d/cos (θ);
X3=X1+cos(θ+σ)*r;
Y3=Y1-sin(θ+σ)*r;
the coordinates of other key points of the makeup guidance model in the face image can be determined according to the method.
Or determining the coordinates of each key point of the makeup guidance model in the face image according to the relationship between the coordinates of the point B and the positions of the key points, specifically:
assuming that the distance between the points a and B is divided into 14 parts, the fourth distance is d = l/14, the point C adjacent to the point B is determined, and the angle θ corresponding to the point C is determined.
When the angle θ corresponding to the point C is larger than σ, the coordinates (X3, Y3) of the point C are obtained by the following formula:
calculating the distance between B and C: r = d/cos (θ);
X3=X2-cos(θ-σ)*r;
Y3=Y2-sin(θ-σ)*r;
the coordinates of other key points of the makeup guidance model in the face image can be determined according to the method.
When the angle θ corresponding to the point C is smaller than or equal to σ, the coordinates (X3, Y3) of the point C are obtained by the following formula:
calculating the distance between B and C: r = d/cos (θ);
X3=X2-cos(σ-θ)*r;
Y3=Y2+sin(σ-θ)*r;
the coordinates of other key points of the makeup guidance model in the face image can be adjusted according to the method.
Step 509, determining that the eye distance type corresponding to the face is a third eye distance type;
and if the difference value between the eye distance and the eye length is smaller than the negative value of the set threshold, determining that the eye distance type corresponding to the face is a third eye distance type. I.e. when SS-S < -t, the face can be determined to be at a narrow eye distance.
Step 510, determining positions of boundaries on two sides of the makeup guidance model in the face image, adjusting key points of the boundaries on the two sides in a second adjustment direction, and determining coordinates of each key point of the makeup guidance model in the face image based on the position relation of the key points after adjustment;
the narrow eye distance of the face makes the five sense organs more concentrated, which is easy to give the impression of fierce eyes to other people, and the five sense organs need to be spread outwards visually to reduce the uncomfortable feeling. Therefore, the dressing guidance model for the narrow-eye-distance eyebrow dressing needs to extend outwards integrally, needs to extend the positions of the eyebrows and the eyebrows to the two sides of the face, and visually spreads the five sense organs to modify the defects of the face.
Therefore, the specific process of the method is as follows:
positioning a first key point and a second key point which are respectively positioned at the boundaries of two sides of the makeup guidance model, and positioning the first key point coordinate and the second key point coordinate corresponding to the face image;
determining an adjusting distance according to the difference value between the eye distance and the eye length;
making a perpendicular line from the first key point to a center line of the face, and determining an included angle between the perpendicular line and a transverse axis of a coordinate system as an adjustment angle;
determining a second adjustment direction corresponding to the makeup guidance model according to the third eye distance type;
determining the adjusted first key point coordinate according to the adjustment angle, the second adjustment direction, the adjustment distance and the first key point coordinate;
determining the adjusted second key point coordinate according to the adjustment angle, the second adjustment direction, the adjustment distance and the second key point coordinate;
determining the coordinates of each key point of the makeup guidance model in the face image according to the adjusted first key point coordinates/adjusted second key point coordinates and the position relation of the key points;
and the second adjustment direction is a direction of moving each key point coordinate of the makeup guidance model in the face image back to a face midline.
As shown in fig. 18, when the face in the face image is not tilted, a 28-point makeup guidance model of the right eyebrow shape is taken as an example in a coordinate system established with the upper left vertex of the face image as the origin. And determining that the first key point of the makeup guidance model is an eyebrow point A, and the second key point of the makeup guidance model is an eyebrow point B, and respectively corresponding to a first key point coordinate A (X1, Y1) and a second key point coordinate B (X2, Y2). Calculating the horizontal distance W that the points A and B need to move according to the length SS of the eyes and the distance between the eyes, wherein the horizontal distance is the horizontal distance which is vertically related to the straight line L: w = (SS-S)/2;
then, the point a needs to be away from W in the horizontal direction perpendicular to the line L to obtain the point a ', and the coordinates (X1', Y1 ') of the point a' are:
X1′=X1+W;
Y1′=Y1;
according to the method, the distance from the point B to the W in the horizontal direction perpendicular to the L straight line can be obtained to obtain the coordinates (X2 ', Y2 ') of the point B '.
As shown in fig. 18, the first distance between the a 'point and the B' point is l = ((X1 '-X2') 2 +(Y1′-Y2′) 2 ) 1/2 And assuming that the recorded points A ' and B ' in the key point position relation in the eyebrow guidance model are equally divided into 14 parts, the second distance is d = l/14, and the angle theta corresponding to the point C ' is determined.
The coordinates of each key point of the makeup guidance model in the face image can be determined according to the relation between the coordinates of the point A 'and the positions of the key points, and the coordinates (X3', Y3 ') of the point C' are obtained by the following formula:
X3’=X1’+d;
Y3’=Y1’-tan(θ)*d;
the D 'point coordinates (X4', Y4 ') may be further obtained based on the coordinates of the C' point:
X4’=X3’+d;
Y4’=Y3’-tan(θ 1 )*d;
wherein, theta 1 The angle corresponding to the D point.
Or determining the coordinates of each key point of the makeup guidance model in the face image according to the coordinates of the B ' point and the position relation of the key point, wherein the coordinates (X3 ', Y3 ') of the C ' point adjacent to the B ' point are obtained by the following formula:
X3’=X2’-d;
Y3’=Y2’-tan(θ)*d;
the D 'point coordinates (X4', Y4 ') may be further obtained based on the coordinates of the C' point:
X4’=X3’-d;
Y4’=Y3’-tan(θ 1 )*d;
wherein, theta 1 The angle corresponding to the D point.
As shown in fig. 19, when the face in the face image is tilted to the right, a 28-point makeup guidance model of the right eyebrow shape is taken as an example in a coordinate system established with the upper left vertex of the face image as the origin. And determining that the first key point of the makeup guidance model is an eyebrow point A and the second key point is an eyebrow point B, and determining that the first key point and the second key point respectively correspond to a first key point coordinate A (X1, Y1) and a second key point coordinate B (X2, Y2) at 300 and 383 in the face image. Calculating the horizontal distance W that the points A and B need to move according to the length SS of the eyes and the distance between the eyes, wherein the horizontal distance is the horizontal distance which is vertically related to the straight line L: w = (SS-S)/2;
then, the point a needs to get closer to the distance W in the horizontal direction perpendicular to the line L to obtain the point a', i.e. to make the perpendicular line from the point a to the line L. Assuming that the vertical line is at an angle ψ from the horizontal, ψ can be obtained from the slope of a known straight line L. The coordinates of point a ' (X1 ', Y1 ') are then:
X1′=X1+cos(ψ)*W;
Y1′=Y1-sin(ψ)*W;
according to the method, the distance of the point B closing to the W in the horizontal direction perpendicular to the L straight line can be obtained to obtain the coordinates (X2 ', Y2 ') of the point B '.
The coordinates of each key point of the makeup guidance model in the face image can be determined according to the relationship between the coordinates of the point a' and the positions of the key points, as shown in fig. 19, specifically:
the first distance between the points A 'and B' is l = ((X1 '-X2') 2 +(Y1′-Y2′) 2 ) 1/2 In the hypothesis of the position relation of the key points in the eyebrow shape guidance model, the positions of the key points are recordedAnd recording 14 parts between the points A ' and B ', wherein the second distance is d = l/14, and determining the angle theta corresponding to the point C '. The coordinates (X3 ', Y3 ') of the C ' point are obtained by the following formula:
calculating the distance between A 'and C': r = d/cos (θ);
X3′=X1′+cos(θ+ψ)*r;
Y3′=Y1′-sin(θ+ψ)*r;
the coordinates of other key points of the makeup guidance model in the face image can be determined according to the method.
Or determining the coordinates of each key point of the makeup guidance model in the face image according to the position relation between the B' point coordinates and the key point, specifically:
the first distance between the points A 'and B' is l = ((X1 '-X2') 2 +(Y1′-Y2′) 2 ) 1/2 And assuming that the recorded points A ' and B ' in the key point position relation in the eyebrow guidance model are equally divided into 14 parts, determining a point C ' adjacent to the point B ' and determining an angle theta corresponding to the point C ' with a second distance d = l/14.
When the angle θ corresponding to the point C 'is greater than ψ, the coordinates (X3', Y3 ') of the point C' are obtained by the following formula:
calculating the distance between B 'and C': r = d/cos (θ);
X3′=X2′-cos(θ-ψ)*r;
Y3′=X2′-sin(θ-ψ)*r;
the coordinates of other key points of the makeup guidance model in the face image can be determined according to the method.
When the angle θ corresponding to the C 'point is smaller than or equal to ψ, the coordinates (X3', Y3 ') of the C' point are obtained by the following formula:
calculating the distance between A 'and C': r = d/cos (θ);
X3′=X2′-cos(ψ-θ)*r;
Y3′=X2′+sin(ψ-θ)*r;
the coordinates of other key points of the makeup guidance model in the face image can be adjusted according to the method.
As shown in fig. 20, when the face in the face image inclines to the right, a cosmetic guidance model of a right eyebrow shape with 28 points is taken as an example under a coordinate system established with the upper left vertex of the face image as an origin. And determining that a first key point of the makeup guidance model is an eyebrow point A, a second key point of the makeup guidance model is an eyebrow tail point B, and determining that 300 points and 383 points of the first key point and the second key point in the face image respectively correspond to a first key point coordinate A (X1, Y1) and a second key point coordinate B (X2, Y2). Calculating the horizontal distance W that the points A and B need to move according to the length SS of the eyes and the distance between the eyes, wherein the horizontal distance is the horizontal distance which is vertically related to the straight line L: w = (SS-S)/2;
then, the point a needs to get closer to the distance W in the horizontal direction perpendicular to the line L to obtain a' point, i.e. a perpendicular line from the point a to the line L is made. Assuming that the vertical line is at an angle ψ from the horizontal, ψ can be determined from the slope of a known straight line L. The coordinates of point a ' (X1 ', Y1 ') are then:
X1′=X1+cos(ψ)*W;
Y1′=Y1+sin(ψ)*W;
according to the method, the distance of the point B closing to the W in the horizontal direction perpendicular to the L straight line can be obtained to obtain the coordinates (X2 ', Y2 ') of the point B '.
Coordinates of each key point of the makeup guidance model in the face image can be determined according to the relationship between the coordinates of the point a' and the positions of the key points, as shown in fig. 20, specifically:
the first distance between the points A 'and B' is l = ((X1 '-X2') 2 +(Y1′-Y2′) 2 ) 1/2 And assuming that the recorded points A ' and B ' in the key point position relation in the eyebrow guidance model are equally divided into 14 parts, the second distance is d = l/14, and the angle theta corresponding to the point C ' is determined.
When the angle θ corresponding to the point C 'is greater than ψ, the coordinates (X3', Y3 ') of the point C' are obtained by the following formula:
calculating the distance between A 'and C': r = d/cos (θ);
X3′=X1′+cos(θ-ψ)*r;
Y3′=Y1′-sin(θ-ψ)*r;
the coordinates of other key points of the makeup guidance model in the face image can be determined according to the method.
When the angle θ corresponding to the C 'point is smaller than or equal to ψ, the coordinates (X3', Y3 ') of the C' point are obtained by the following formula:
calculating the distance between A 'and C': r = d/cos (θ);
X3′=X1′+cos(ψ-θ)*r;
Y3′=Y1′+sin(ψ-θ)*r;
the coordinates of other key points of the makeup guidance model in the face image can be adjusted according to the method.
The coordinates of each key point of the makeup guidance model in the face image can be determined according to the relation between the coordinates of the point B' and the positions of the key points, and the method specifically comprises the following steps:
the first distance between the points A 'and B' is l = ((X1 '-X2') 2 +(Y1′-Y2′) 2 ) 1/2 And assuming that the recorded points A ' and B ' in the key point position relation in the eyebrow guidance model are equally divided into 14 parts, the second distance is d = l/14, and the angle theta corresponding to the point C ' is determined. The coordinates (X3 ', Y3 ') of the C ' point are obtained by the following formula:
calculating the distance between B 'and C': r = d/cos (θ);
X3′=X2′-cos(θ+ψ)*r;
Y3′=Y2′-sin(θ+ψ)*r;
the coordinates of other key points of the makeup guidance model in the face image can be determined according to the method.
And 511, obtaining a face image with a makeup area and displaying the face image in a display area.
According to the pre-constructed makeup guidance models with different makeup styles, the makeup guidance models are cooperated with a professional makeup institution, a makeup painting gallery containing different styles and different popular makeup is constructed, and corresponding color coloring schemes are displayed according to different paintings. In order to facilitate the step-by-step learning of the user, the makeup color and the makeup sequence can be marked in the corresponding makeup area of the face image displayed in the display area, and in addition, detailed description of each step of the makeup sequence can be displayed in the display area, so that the user can conveniently learn the makeup method step by step. The face image of the makeup area with the eyebrow makeup is displayed in the display area, the colors in the color disc are displayed on the right side of the display area, and the corresponding makeup areas of the face image displayed in the display area are marked with makeup colors and a makeup sequence.
FIG. 21 illustrates a presentation interface, according to an exemplary embodiment. The display interface comprises an interface for displaying the collected face image to display the makeup area and an auxiliary information display area. If the user clicks the button of type 1 in the eyebrow shape, the face image with the makeup area corresponding to the eyebrow shape is displayed in the display interface, and the makeup area in the face image is labeled with a makeup sequence and a makeup color, for example, the makeup area of the left eyebrow makeup corresponds to step 1, the corresponding color A, and the makeup area of the right eyebrow makeup corresponds to step 2 and the corresponding color A. And the display area can also display the text information related to makeup and can also display each color of the color disc, so that the user can conveniently select the corresponding makeup color. After the user finishes making up, the end makeup guide button may be clicked to end the makeup guide.
In some embodiments, based on the same inventive concept, the disclosed embodiments further provide a eyebrow dressing guidance device, and since the device is the device in the method in the disclosed embodiments, and the principle of the device to solve the problem is similar to that of the method, the implementation of the device may refer to the implementation of the method, and repeated details are omitted.
As shown in fig. 22, the above apparatus includes the following modules:
the key point detection module 221 is configured to collect a face image in response to a face makeup instruction, and detect a face key point corresponding to a face in the face image;
the model determining module 222 is configured to determine, in response to a face makeup selection instruction, a makeup guidance model corresponding to an eyebrow portion in a face according to face makeup parameters in the face makeup selection instruction, where the makeup guidance model includes key points corresponding to the eyebrow portion and a key point position relationship;
the eye distance type determining module 223 is configured to determine the length of an eye and the eye distance based on the key point of the face, and determine the eye distance type corresponding to the face according to the relationship between the difference between the eye distance and the eye length and a set threshold;
and a coordinate adjusting module 224, configured to determine positions of boundaries on two sides of the makeup guide model in the face image based on the face key points, adjust key points of the boundaries on two sides in the eye distance direction when the eye distance needs to be adjusted according to the eye distance type, determine coordinates of each key point of the makeup guide model in the face image based on the position relationship of the key points after adjustment, obtain a face image with a makeup area, and display the face image in a display area.
As an optional implementation, the eye distance type determining module is configured to:
establishing a coordinate system by taking any vertex in the face image as an origin, and determining a face central line of the face based on the face key point;
determining a first actual key point coordinate and a second actual key point coordinate of the inner canthus and the outer canthus of the left eye, and a third actual key point coordinate and a fourth actual key point coordinate of the inner canthus and the outer canthus of the right eye in the face image;
determining a first actual distance from the first actual key point to a face central line according to the first actual key point coordinates and the face central line;
determining a second actual distance from the second actual key point to the face central line according to the second actual key point coordinates and the face central line;
determining a third actual distance from the third actual key point to the face central line according to the third actual key point coordinate and the face central line;
determining a fourth actual distance from the fourth actual key point to the face central line according to the fourth actual key point coordinate and the face central line;
obtaining the eye length according to the difference value between the second actual distance and the first actual distance and the average value of the sum of the difference values between the fourth actual distance and the third actual distance;
and obtaining the eye distance according to the sum of the first actual distance and the third actual distance.
As an optional implementation, the eye distance type determining module is configured to:
if the difference value between the eye distance and the eye length is larger than a set threshold value, determining that the eye distance type corresponding to the human face is a first eye distance type;
if the absolute value of the difference value between the eye distance and the eye length is smaller than or equal to a set threshold value, determining that the eye distance type corresponding to the human face is a second eye distance type;
and if the difference value between the eye distance and the eye length is smaller than the negative value of the set threshold, determining that the eye distance type corresponding to the face is a third eye distance type.
As an optional implementation manner, when the eye distance type is the first eye distance type, the coordinate adjusting module is configured to:
positioning a first key point and a second key point which are respectively positioned at the boundaries of two sides of the makeup guidance model, and positioning the first key point coordinate and the second key point coordinate corresponding to the face image;
making a perpendicular line from the first key point to a center line of the face, and determining an included angle between the perpendicular line and a transverse axis of a coordinate system as an adjustment angle;
determining a first adjusting direction corresponding to the makeup guidance model according to the first eye distance type, and determining an adjusting distance adjusted according to the first adjusting direction according to the difference value between the eye distance and the eye length;
adjusting the first key point coordinate according to the adjustment angle, and then adjusting the adjustment distance in the first adjustment direction to obtain an adjusted first key point coordinate;
adjusting the second key point coordinate according to the adjustment angle, and then adjusting the adjustment distance in the first adjustment direction to obtain an adjusted second key point coordinate;
determining the coordinates of each key point of the makeup guidance model in the face image according to the adjusted first key point coordinates/adjusted second key point coordinates and the position relation of the key points;
wherein, the first adjusting direction is a direction moving the coordinates of each key point of the makeup guidance model in the face image to the centerline of the face.
As an optional implementation manner, when the eye distance type is a third eye distance type, the coordinate adjusting module is configured to:
positioning a first key point and a second key point which are respectively positioned at the boundaries of two sides of the makeup guidance model, and positioning the first key point coordinate and the second key point coordinate corresponding to the face image;
determining an adjusting distance according to the difference value between the eye distance and the eye length;
making a perpendicular line from the first key point to a center line of the face, and determining an included angle between the perpendicular line and a transverse axis of a coordinate system as an adjustment angle;
determining a second adjusting direction corresponding to the makeup guidance model according to the third eye distance type;
determining the adjusted first key point coordinate according to the adjustment angle, the second adjustment direction, the adjustment distance and the first key point coordinate;
determining the adjusted second key point coordinate according to the adjustment angle, the second adjustment direction, the adjustment distance and the second key point coordinate;
determining the coordinates of each key point of the makeup guidance model in the face image according to the adjusted first key point coordinates/adjusted second key point coordinates and the position relation of the key points;
and the second moving direction is a direction of moving each key point coordinate of the makeup guidance model in the face image back to the midline of the face.
As an optional implementation manner, the coordinate adjusting module is configured to:
calculating a first distance between the adjusted first key point and the second key point according to the adjusted first key point coordinate and the adjusted second key point coordinate, and determining a second distance in the horizontal direction between any adjacent key point in the makeup guidance model and two corresponding adjacent key points in the face image based on the key point position relation in the makeup guidance model and the first distance;
determining the coordinates of each key point of the makeup guidance model in the face image according to the adjusted first key point coordinates/adjusted second key point coordinates, the second distance and the corresponding angle of each key point in the key point position relation;
the angle corresponding to each key point in the key point position relation is determined by the included angle between the first auxiliary line and the second auxiliary line; the first auxiliary line is obtained by connecting the first key point and the second key point, and the second auxiliary line is obtained by connecting the first key point and each key point in the makeup guidance model, respectively, or connecting the second key point and each key point in the makeup guidance model, respectively.
As an optional implementation manner, the coordinate adjusting module is further configured to:
when the eye distance does not need to be adjusted according to the eye distance type, calculating a third distance between a first key point and a second key point according to the coordinate of the first key point of the boundary on one side of the makeup guidance model in the face image and the coordinate of the second key point of the boundary on the other side in the face image, and determining a fourth distance in the horizontal direction between two adjacent key points corresponding to any adjacent key points in the makeup guidance model in the face image based on the key point position relation and the third distance in the makeup guidance model;
determining the coordinates of each key point of the makeup guidance model in the face image according to the coordinates of the first key point/the second key point, the fourth distance and the angle corresponding to each key point in the key point position relation;
the angle corresponding to each key point in the key point position relation is determined by an included angle between the first auxiliary line and the second auxiliary line; the first auxiliary line is obtained by connecting the first key point and the second key point, and the second auxiliary line is obtained by respectively connecting the first key point and each key point in the makeup guidance model, or respectively connecting the second key point and each key point in the makeup guidance model.
In some embodiments, based on the same inventive concept, the disclosed embodiments further provide an intelligent mirror, and the apparatus can implement the eyebrow makeup guidance function discussed above, please refer to fig. 23, the apparatus includes a camera 231, a display screen 232, a processor 233 and a memory 234, wherein the camera 231 is used for acquiring a face image; the display screen 232 is used for displaying face makeup and face images with makeup areas and acquiring operation instructions triggered by users; the memory 234 is used to store program instructions;
the processor 233 invokes the program instructions stored in the memory to implement the eyebrow makeup guidance method as discussed above by executing the program instructions. Because the principle of solving the problems of the intelligent mirror is similar to the eyebrow dressing guidance method, the implementation of the intelligent mirror can be referred to the implementation of the method, and repeated parts are not repeated.
In some possible embodiments, various aspects of the disclosure may also be implemented in the form of a program product, as shown in fig. 24, the computer program product 240 comprising computer program code which, when run on a computer, causes the computer to perform any of the eyebrow makeup guidance methods as previously discussed. Because the principle of solving the problems of the computer program product is similar to the eyebrow dressing guidance method, the implementation of the computer program product can be referred to the implementation of the method, and repeated details are not repeated.
As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the disclosure. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method for guiding eyebrow dressing, which is characterized by comprising the following steps:
collecting a face image in response to a face makeup instruction, and detecting face key points corresponding to the face in the face image;
in response to a face makeup selection instruction, determining a makeup guidance model corresponding to an eyebrow part in a face according to face makeup parameters in the face makeup selection instruction, wherein the makeup guidance model comprises key points corresponding to the eyebrow part and a key point position relation;
determining the length and the distance of eyes based on the key points of the face, and determining the type of the distance of the eyes corresponding to the face according to the relationship between the difference value of the distance of the eyes and the length of the eyes and a set threshold value;
and determining the positions of the boundaries at the two sides of the makeup guidance model in the face image based on the face key points, adjusting the key points at the boundaries at the two sides in the eye distance direction when the eye distance needs to be adjusted according to the eye distance type, determining the coordinates of the makeup guidance model at each key point of the face image based on the position relation of the key points after adjustment, and obtaining the face image with a makeup area and displaying the face image in a display area.
2. The method of claim 1, wherein determining the eye length and the eye distance based on the face keypoints comprises:
establishing a coordinate system by taking any vertex in the face image as an origin, and determining a face central line of the face based on the face key point;
determining first actual key point coordinates and second actual key point coordinates of the inner canthus and the outer canthus of the left eye, and third actual key point coordinates and fourth actual key point coordinates of the inner canthus and the outer canthus of the right eye in the face image;
determining a first actual distance from the first actual key point to a face central line according to the first actual key point coordinate and the face central line;
determining a second actual distance from the second actual key point to the face central line according to the second actual key point coordinate and the face central line;
determining a third actual distance from the third actual key point to the face central line according to the third actual key point coordinates and the face central line;
determining a fourth actual distance from the fourth actual key point to the face central line according to the fourth actual key point coordinate and the face central line;
obtaining the eye length according to the difference value between the second actual distance and the first actual distance and the average value of the sum of the difference values between the fourth actual distance and the third actual distance;
and obtaining the eye distance according to the sum of the first actual distance and the third actual distance.
3. The method according to claim 1, wherein the determining the type of the eye distance corresponding to the human face according to the relationship between the difference between the eye distance and the eye length and a set threshold value comprises:
if the difference value between the eye distance and the eye length is larger than a set threshold value, determining that the eye distance type corresponding to the human face is a first eye distance type;
if the absolute value of the difference value between the eye distance and the eye length is smaller than or equal to a set threshold value, determining that the eye distance type corresponding to the human face is a second eye distance type;
and if the difference value between the eye distance and the eye length is smaller than the negative value of the set threshold, determining that the eye distance type corresponding to the face is a third eye distance type.
4. The method according to claim 3, wherein when the eye distance type is a first eye distance type, the determining positions of the borders at both sides of the makeup guidance model in the face image based on the key points of the face, and when the eye distance type determines that the eye distance needs to be adjusted, adjusting the key points of the borders at both sides in the eye distance direction, and determining the coordinates of the key points of the makeup guidance model in the face image based on the position relation of the key points after the adjustment, comprises:
positioning a first key point and a second key point which are respectively positioned at the boundaries of two sides of the makeup guidance model, and positioning the first key point coordinate and the second key point coordinate corresponding to the face image;
making a perpendicular line from the first key point to a center line of the face, and determining an included angle between the perpendicular line and a transverse axis of a coordinate system as an adjustment angle;
determining a first adjusting direction corresponding to the makeup guidance model according to the first eye distance type, and determining an adjusting distance adjusted according to the first adjusting direction according to the difference value between the eye distance and the eye length;
adjusting the first key point coordinate according to the adjustment angle, and then adjusting the adjustment distance in the first adjustment direction to obtain an adjusted first key point coordinate;
adjusting the second key point coordinate according to the adjustment angle, and then adjusting the adjustment distance in the first adjustment direction to obtain an adjusted second key point coordinate;
determining the coordinates of each key point of the makeup guidance model in the face image according to the adjusted first key point coordinates/adjusted second key point coordinates and the position relation of the key points;
the first adjusting direction is a direction of moving the coordinates of each key point of the makeup guidance model in the face image to the midline of the face.
5. The method according to claim 3, wherein when the eye distance type is a third eye distance type, the determining positions of the borders at both sides of the makeup guidance model on the face image based on the key points of the face, and when the eye distance type determines that the eye distance needs to be adjusted, adjusting the key points of the borders at both sides in the eye distance direction, and determining the coordinates of the key points of the makeup guidance model on the face image based on the position relation of the key points after the adjustment, comprises:
positioning a first key point and a second key point which are respectively positioned at the boundaries of two sides of the makeup guidance model, and positioning the first key point coordinate and the second key point coordinate corresponding to the face image;
determining an adjusting distance according to the difference value between the eye distance and the eye length;
making a perpendicular line from the first key point to a center line of the face, and determining an included angle between the perpendicular line and a transverse axis of a coordinate system as an adjustment angle;
determining a second adjustment direction corresponding to the makeup guidance model according to the third eye distance type;
determining the adjusted first key point coordinate according to the adjusting angle, the second adjusting direction, the adjusting distance and the first key point coordinate;
determining the adjusted second key point coordinate according to the adjustment angle, the second adjustment direction, the adjustment distance and the second key point coordinate;
determining the coordinates of each key point of the makeup guidance model in the face image according to the adjusted first key point coordinates/adjusted second key point coordinates and the position relation of the key points;
and the second moving direction is a direction of moving each key point coordinate of the makeup guidance model in the face image back to the midline of the face.
6. The method according to claim 4 or 5, wherein the determining the coordinates of the makeup guidance model at each key point of the face image according to the adjusted first key point coordinates/adjusted second key point coordinates and the key point position relationship comprises:
calculating a first distance between the adjusted first key point and the second key point according to the adjusted first key point coordinate and the adjusted second key point coordinate, and determining a second distance in the horizontal direction between any adjacent key point in the makeup guidance model and two corresponding adjacent key points in the face image based on the key point position relation in the makeup guidance model and the first distance;
determining the coordinates of each key point of the makeup guidance model in the face image according to the adjusted first key point coordinates/adjusted second key point coordinates, the second distance and the corresponding angle of each key point in the key point position relation;
the angle corresponding to each key point in the key point position relation is determined by the included angle between the first auxiliary line and the second auxiliary line; the first auxiliary line is obtained by connecting the first key point and the second key point, and the second auxiliary line is obtained by connecting the first key point and each key point in the makeup guidance model, respectively, or connecting the second key point and each key point in the makeup guidance model, respectively.
7. The method of claim 3, wherein the determining the position of the boundaries on both sides of the makeup guidance model in the face image further comprises:
when the eye distance does not need to be adjusted according to the eye distance type, calculating a third distance between a first key point and a second key point according to a first key point coordinate of the first key point of the boundary on one side of the makeup guidance model in the face image and a second key point coordinate of the second key point of the boundary on the other side in the face image, and determining a fourth distance in the horizontal direction between two adjacent key points of any adjacent key point in the makeup guidance model in the face image on the basis of the key point position relation and the third distance in the makeup guidance model;
determining the coordinates of each key point of the makeup guidance model in the face image according to the first key point coordinate/the second key point coordinate, the fourth distance and the corresponding angle of each key point in the key point position relation;
the angle corresponding to each key point in the key point position relation is determined by the included angle between the first auxiliary line and the second auxiliary line; the first auxiliary line is obtained by connecting the first key point and the second key point, and the second auxiliary line is obtained by connecting the first key point and each key point in the makeup guidance model, respectively, or connecting the second key point and each key point in the makeup guidance model, respectively.
8. A eyebrow dressing guide device, characterized in that it comprises:
the key point detection module is used for responding to a face makeup display instruction, collecting a face image and detecting face key points corresponding to the face in the face image;
the model determining module is used for responding to a face makeup instruction selected and determining a makeup guide model corresponding to eyebrow parts in the face according to face makeup parameters in the face makeup instruction selected, wherein the makeup guide model comprises key points corresponding to the eyebrow parts and the position relation of the key points;
the eye distance type determining module is used for determining the eye length and the eye distance based on the key points of the human face, and determining the eye distance type corresponding to the human face according to the relation between the difference value of the eye distance and the eye length and a set threshold value;
and the coordinate adjusting module is used for determining the positions of the boundaries at the two sides of the makeup guide model in the face image based on the face key points, adjusting the key points of the boundaries at the two sides in the eye distance direction when the eye distance needs to be adjusted according to the eye distance type, determining the coordinates of each key point of the makeup guide model in the face image based on the position relation of the key points after adjustment, obtaining the face image with a makeup area, and displaying the face image in a display area.
9. A smart mirror, comprising:
the camera device is used for acquiring a face image;
the display screen is used for displaying face makeup and a face image with a makeup area and acquiring an operation instruction triggered by a user;
a memory for storing processor-executable instructions;
a processor; for implementing the steps of the method of any one of claims 1 to 7 by executing executable instructions in said memory.
10. A computer readable and writable storage medium, on which computer instructions are stored, which instructions, when executed by a processor, carry out the steps of the method according to any one of claims 1 to 7.
CN202210718763.4A 2022-06-23 2022-06-23 Eyebrow dressing guidance method, device, equipment and medium Pending CN115187703A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210718763.4A CN115187703A (en) 2022-06-23 2022-06-23 Eyebrow dressing guidance method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210718763.4A CN115187703A (en) 2022-06-23 2022-06-23 Eyebrow dressing guidance method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115187703A true CN115187703A (en) 2022-10-14

Family

ID=83515919

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210718763.4A Pending CN115187703A (en) 2022-06-23 2022-06-23 Eyebrow dressing guidance method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115187703A (en)

Similar Documents

Publication Publication Date Title
AU2018214005B2 (en) Systems and methods for generating a 3-D model of a virtual try-on product
US20210287386A1 (en) Methods and Systems to Modify a Two Dimensional Facial Image to Increase Dimensional Depth and Generate a Facial Image That Appears Three Dimensional
US9639914B2 (en) Portrait deformation method and apparatus
US9990780B2 (en) Using computed facial feature points to position a product model relative to a model of a face
CN101779218B (en) Makeup simulation system, makeup simulation apparatus, makeup simulation method, and makeup simulation program
JP2018170005A (en) Virtual reality-based apparatus and method to generate three-dimensional (3d) human face model using image and depth data
JP4435809B2 (en) Virtual makeup apparatus and method
US11900557B2 (en) Three-dimensional face model generation method and apparatus, device, and medium
JP2019510297A (en) Virtual try-on to the user&#39;s true human body model
US20130169827A1 (en) Method and system for make-up simulation on portable devices having digital cameras
JP2004094917A (en) Virtual makeup device and method therefor
JP2012181688A (en) Information processing device, information processing method, information processing system, and program
CN104899563A (en) Two-dimensional face key feature point positioning method and system
US20180075665A1 (en) Applying facial masks to faces in live video
JP2005242567A (en) Movement evaluation device and method
CN110926334A (en) Measuring method, measuring device, electronic device and storage medium
KR20210113948A (en) Method and apparatus for generating virtual avatar
CN115917474A (en) Rendering avatars in three-dimensional environments
WO2004023395A1 (en) Head-mounted object image combining method, makeup image combining method, head-mounted object image combining device, makeup image composition device, and program
KR20170002100A (en) Method for providng smart learning education based on sensitivity avatar emoticon, and smart learning education device for the same
JP2021527252A (en) Augmented Reality Viewer with Automated Surface Selective Installation and Content Orientation Installation
JP6294054B2 (en) Video display device, video presentation method, and program
CN106570747A (en) Glasses online adaption method and system combining hand gesture recognition
CN115187703A (en) Eyebrow dressing guidance method, device, equipment and medium
CN107103646B (en) Expression synthesis method and device

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