Image processing method and device, electronic equipment and storage medium
By detecting face key points, interpolation of dense surrounding key points and building a grid, the eye makeup materials in standard face images are integrated into the face images, solving the problem that virtual eye makeup test technology cannot follow the face deformation. , improves the authenticity and stability of virtual makeup.
Patent Information
- Application Number
- CN202410912593.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2025-01-14
AI Technical Summary
The existing virtual eye makeup test technology cannot effectively follow the deformation of the face, resulting in unnatural eye makeup effects, affecting the stability and authenticity of the makeup test.
By obtaining face images, detecting face key points, inserting dense surrounding key points, building an eye grid, and integrating eye makeup materials from standard face images into face images, using the same construction method to build The grid establishes mapping relationships to ensure that the eye makeup material is stable and follows the changes in the face posture.
The stable integration of eye makeup materials in the face images is achieved, the realism of virtual makeup is enhanced, and unnatural effects caused by posture changes such as opening, closing eyes, and side faces are avoided.
Smart Images

Figure CN119313778A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to an image processing method and device, an electronic device, and a storage medium. Background Art
[0002] In order to reduce the marketing cost of cosmetics, virtual makeup trials have been developed. The current virtual makeup trials for eye makeup are unnatural and are easily affected by changes in posture, such as opening and closing eyes and side faces. This makes it possible for eye makeup to not fit the eye shape better, resulting in poor and unstable eye makeup trials, reducing the realism of virtual makeup trials. Summary of the invention
[0003] The present disclosure proposes an image processing technology solution.
[0004] According to one aspect of the present disclosure, there is provided an image processing method, comprising: acquiring a facial image, and detecting facial key points in the facial image, the facial key points including target eye key points; interpolating the target eye key points to obtain a plurality of target peri-eye key points; constructing a first eye grid corresponding to the facial image according to the target eye key points and the plurality of target peri-eye key points; integrating eye makeup materials corresponding to the standard facial image into the facial image according to the first eye grid and a second eye grid corresponding to a standard facial image to obtain a target facial image; wherein the second eye grid is constructed in the same manner as the first eye grid, according to the standard eye key points detected in the standard facial image and the interpolated standard peri-eye key points.
[0005] In a possible implementation, the target eye key points are interpolated to obtain a plurality of target periorbital key points, including: interpolating the target eye key points according to a preset interpolation direction corresponding to the target eye key points to obtain at least one first periorbital key point in the preset interpolation direction; wherein the preset interpolation direction represents the direction in which the target eye key points are interpolated, and the plurality of target periorbital key points include: taking one or more of the target eye key points as interpolation starting points, and sequentially interpolating along the corresponding preset interpolation direction to obtain the first periorbital key points.
[0006] In a possible implementation, the target eye key points serving as the interpolation starting point include at least the inner eye corner vertex, the outer eye corner vertex, at least one upper eyelid key point and at least one lower eyelid key point; the preset interpolation direction corresponding to the inner eye corner vertex includes from the inner eye corner vertex to the nasal root key point, and / or from the inner eye corner vertex to the nasal dorsum key point; the preset interpolation direction corresponding to the outer eye corner vertex is from the nasal root side key point to the pupil key point; the preset interpolation direction corresponding to the upper eyelid key point is from the nose tip key point to the nasal root key point; the preset interpolation direction corresponding to the lower eyelid key point is from the nasal root key point to the nose tip key point.
[0007] In a possible implementation, the number of first periorbital key points interpolated from a single target eye key point is N, where N is a positive integer, wherein after obtaining N first periorbital key points interpolated along respective corresponding preset interpolation directions using one or more target eye key points as interpolation starting points, interpolating the target eye key points to obtain a plurality of target periorbital key points further includes: determining an nth upper periorbital curve formed by connecting the nth first periorbital key point interpolated along the corresponding preset interpolation direction using the inner eye corner vertex as the interpolation starting point, the nth first periorbital key point interpolated along the corresponding preset interpolation direction using the outer eye corner vertex as the interpolation starting point, and the nth first periorbital key point interpolated along the corresponding preset interpolation direction using the upper eyelid key point as the interpolation starting point, Based on the nth upper periorbital curve, a plurality of upper periorbital key points are interpolated; an nth lower periorbital curve is determined, which is formed by connecting the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the inner canthus vertex as the interpolation starting point, the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the outer canthus vertex as the interpolation starting point, and the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the lower eyelid key point as the interpolation starting point, and based on the nth lower periorbital curve, a plurality of lower periorbital key points are interpolated; wherein n=1, 2, ..., N, and the plurality of target periorbital key points also include: a plurality of upper periorbital key points interpolated based on at least one upper periorbital curve, and a plurality of lower periorbital key points interpolated based on at least one lower periorbital curve.
[0008] In a possible implementation, the number of first periorbital key points interpolated from a single target eye key point is N, where N is a positive integer. After obtaining N first periorbital key points interpolated from one or more target eye key points as interpolation starting points along their respective corresponding preset interpolation directions, interpolating the target eye key points to obtain a plurality of target periorbital key points further includes: determining an nth first periorbital key point interpolated from an inner eye corner vertex as an interpolation starting point along the corresponding preset interpolation direction, and an nth first periorbital key point interpolated from an outer eye corner vertex as an interpolation starting point along the corresponding preset interpolation direction. Suppose an nth periorbital curve is formed by connecting the nth first periorbital key point interpolated in the interpolation direction, the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the upper eyelid key point as the interpolation starting point, and the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the lower eyelid key point as the interpolation starting point, and interpolate multiple second periorbital key points based on the nth periorbital curve; wherein n=1, 2, …, N, and the multiple target periorbital key points also include: multiple second periorbital key points interpolated based on at least one periorbital curve.
[0009] In a possible implementation, the method of fusing the eye makeup material corresponding to the standard facial image into the facial image based on the first eye grid and the second eye grid corresponding to the standard facial image to obtain a target facial image includes: determining a second sub-grid in the second eye grid that covers the eye makeup material, and extracting a second pixel color corresponding to the second sub-grid in the eye makeup material; determining a first sub-grid in the first eye grid that matches the second sub-grid based on a sub-grid matching relationship between the first eye grid and the second eye grid, and determining a first pixel color corresponding to the first sub-grid in the facial image; and fusing the eye makeup material into the facial image based on a first pixel color corresponding to the first sub-grid and a second pixel color corresponding to the second sub-grid to obtain a target facial image.
[0010] In a possible implementation, the eye makeup material is integrated into the facial image according to the first pixel color corresponding to the first sub-grid and the second pixel color corresponding to the second sub-grid to obtain a target facial image, including: integrating the first pixel color corresponding to the first sub-grid and the second pixel color corresponding to the second sub-grid to obtain a target color corresponding to the first sub-grid; integrating the target color into the eye area indicated by the first sub-grid in the facial image to obtain a target facial image.
[0011] In a possible implementation, the target color is fused into the eye area indicated by the first sub-grid in the facial image to obtain the target facial image, including: according to the transparency corresponding to the eye makeup material, and / or a preset color fusion strength, the target color is fused into the eye area indicated by the first sub-grid in the facial image to obtain the target facial image.
[0012] According to one aspect of the present disclosure, an image processing device is provided, comprising: an image acquisition module, for acquiring a face image and detecting face key points in the face image, wherein the face key points include target eye key points; a key point interpolation module, for interpolating the target eye key points to obtain a plurality of target peri-eye key points; a grid construction module, for constructing a first eye grid corresponding to the face image according to the target eye key points and the plurality of target peri-eye key points; a material fusion module, for fusing eye makeup materials corresponding to the standard face image into the face image according to the first eye grid and a second eye grid corresponding to the standard face image to obtain the target face image; wherein the second eye grid is constructed in the same manner as the first eye grid, according to the standard eye key points detected in the standard face image and the interpolated standard peri-eye key points.
[0013] In a possible implementation, the target eye key points are interpolated to obtain a plurality of target periorbital key points, including: interpolating the target eye key points according to a preset interpolation direction corresponding to the target eye key points to obtain at least one first periorbital key point in the preset interpolation direction; wherein the preset interpolation direction represents the direction in which the target eye key points are interpolated, and the plurality of target periorbital key points include: taking one or more of the target eye key points as interpolation starting points, and sequentially interpolating along the corresponding preset interpolation direction to obtain the first periorbital key points.
[0014] In a possible implementation, the target eye key points serving as the interpolation starting point include at least the inner eye corner vertex, the outer eye corner vertex, at least one upper eyelid key point and at least one lower eyelid key point; the preset interpolation direction corresponding to the inner eye corner vertex includes from the inner eye corner vertex to the nasal root key point, and / or from the inner eye corner vertex to the nasal dorsum key point; the preset interpolation direction corresponding to the outer eye corner vertex is from the nasal root side key point to the pupil key point; the preset interpolation direction corresponding to the upper eyelid key point is from the nose tip key point to the nasal root key point; the preset interpolation direction corresponding to the lower eyelid key point is from the nasal root key point to the nose tip key point.
[0015] In a possible implementation, the number of first periorbital key points interpolated from a single target eye key point is N, where N is a positive integer, wherein after obtaining N first periorbital key points interpolated along respective corresponding preset interpolation directions using one or more target eye key points as interpolation starting points, interpolating the target eye key points to obtain a plurality of target periorbital key points further includes: determining an nth upper periorbital curve formed by connecting the nth first periorbital key point interpolated along the corresponding preset interpolation direction using the inner eye corner vertex as the interpolation starting point, the nth first periorbital key point interpolated along the corresponding preset interpolation direction using the outer eye corner vertex as the interpolation starting point, and the nth first periorbital key point interpolated along the corresponding preset interpolation direction using the upper eyelid key point as the interpolation starting point, Based on the nth upper periorbital curve, a plurality of upper periorbital key points are interpolated; an nth lower periorbital curve is determined, which is formed by connecting the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the inner canthus vertex as the interpolation starting point, the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the outer canthus vertex as the interpolation starting point, and the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the lower eyelid key point as the interpolation starting point, and based on the nth lower periorbital curve, a plurality of lower periorbital key points are interpolated; wherein n=1, 2, ..., N, and the plurality of target periorbital key points also include: a plurality of upper periorbital key points interpolated based on at least one upper periorbital curve, and a plurality of lower periorbital key points interpolated based on at least one lower periorbital curve.
[0016] In a possible implementation, the number of first periorbital key points interpolated from a single target eye key point is N, where N is a positive integer. After obtaining N first periorbital key points interpolated from one or more target eye key points as interpolation starting points along their respective corresponding preset interpolation directions, interpolating the target eye key points to obtain a plurality of target periorbital key points further includes: determining an nth first periorbital key point interpolated from an inner eye corner vertex as an interpolation starting point along the corresponding preset interpolation direction, and an nth first periorbital key point interpolated from an outer eye corner vertex as an interpolation starting point along the corresponding preset interpolation direction. Suppose an nth periorbital curve is formed by connecting the nth first periorbital key point interpolated in the interpolation direction, the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the upper eyelid key point as the interpolation starting point, and the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the lower eyelid key point as the interpolation starting point, and interpolate multiple second periorbital key points based on the nth periorbital curve; wherein n=1, 2, …, N, and the multiple target periorbital key points also include: multiple second periorbital key points interpolated based on at least one periorbital curve.
[0017] In a possible implementation, the method of fusing the eye makeup material corresponding to the standard facial image into the facial image based on the first eye grid and the second eye grid corresponding to the standard facial image to obtain a target facial image includes: determining a second sub-grid in the second eye grid that covers the eye makeup material, and extracting a second pixel color corresponding to the second sub-grid in the eye makeup material; determining a first sub-grid in the first eye grid that matches the second sub-grid based on a sub-grid matching relationship between the first eye grid and the second eye grid, and determining a first pixel color corresponding to the first sub-grid in the facial image; and fusing the eye makeup material into the facial image based on a first pixel color corresponding to the first sub-grid and a second pixel color corresponding to the second sub-grid to obtain a target facial image.
[0018] In a possible implementation, the eye makeup material is integrated into the facial image according to the first pixel color corresponding to the first sub-grid and the second pixel color corresponding to the second sub-grid to obtain a target facial image, including: integrating the first pixel color corresponding to the first sub-grid and the second pixel color corresponding to the second sub-grid to obtain a target color corresponding to the first sub-grid; integrating the target color into the eye area indicated by the first sub-grid in the facial image to obtain a target facial image.
[0019] In a possible implementation, the target color is fused into the eye area indicated by the first sub-grid in the facial image to obtain the target facial image, including: according to the transparency corresponding to the eye makeup material, and / or a preset color fusion strength, the target color is fused into the eye area indicated by the first sub-grid in the facial image to obtain the target facial image.
[0020] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to call the instructions stored in the memory to execute the above method.
[0021] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor.
[0022] In the disclosed embodiment, a plurality of target peri-eye key points are obtained by interpolating the detected target eye key points, which is equivalent to interpolating and filling in the eye key points, so that the key points around the eyes are denser, and then the eye makeup material corresponding to the standard face image is fused to the eye of the face image through a first eye grid constructed by the dense target peri-eye key points and the target eye key points and a second eye grid corresponding to the standard face image. Since the second eye grid is constructed in the same manner as the first eye grid, a mapping relationship can be established between the eye makeup material and the eye of the face image. In this way, when the eye makeup material is fused to the eye of the face image, not only can the eye makeup material stably follow the eye posture in the face image, that is, it is not affected by posture changes such as opening eyes, closing eyes, and side faces, but the virtual makeup effect of the eye makeup material can also be made more realistic.
[0023] It should be understood that the above general description and the following detailed description are exemplary and explanatory only and do not limit the present disclosure. Other features and aspects of the present disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.
[0025] Figure 1 A flowchart of an image processing method according to an embodiment of the present disclosure is shown.
[0026] Figure 2 A schematic diagram showing key points of a human face according to an embodiment of the present disclosure is shown.
[0027] Figure 3 A schematic diagram showing an eye makeup material according to an embodiment of the present disclosure.
[0028] Figure 4 A schematic diagram of a local area of a face image according to an embodiment of the present disclosure is shown.
[0029] Figure 5 A schematic diagram of a local area of a target face image according to an embodiment of the present disclosure is shown.
[0030] Figure 6 A schematic diagram showing the first periocular key points corresponding to a single eye according to an embodiment of the present disclosure.
[0031] Figure 7 A schematic diagram showing target periorbital key points corresponding to a single eye according to an embodiment of the present disclosure.
[0032] Figure 8A schematic diagram showing a first eye grid corresponding to a single eye according to an embodiment of the present disclosure.
[0033] Fig. 9 A block diagram of an image processing apparatus according to an embodiment of the present disclosure is shown.
[0034] Fig.10 A block diagram of an electronic device 1900 according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0035] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0036] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0037] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0038] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0039] Figure 1 The flowchart of the image processing method according to the embodiment of the present disclosure is shown. The image processing method can be executed by an electronic device such as a terminal device or a server. The terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The method can be implemented by a processor calling a computer-readable instruction stored in a memory, or the method can be executed by a server. Figure 1 As shown, the image processing method includes:
[0040] In step S11, a face image is acquired, and face key points in the face image are detected, where the face key points include target eye key points.
[0041] In practical applications, the face image can be a face image collected by an image acquisition device, or a face image transmitted by other electronic devices, or a face image locally stored in a terminal device. The embodiment of the present disclosure does not limit the source of the face image. The face image can be image data collected by an image acquisition device (such as a camera, etc.), or an image frame extracted from video data collected in real time by an image acquisition device. The embodiment of the present disclosure does not limit this.
[0042] It should be understood that the image acquisition device can be arranged as a component in the above-mentioned electronic device, such as a camera on a mobile phone. Of course, it can also be a camera independent of the electronic device, such as a camera connected to the outside of the electronic device. This embodiment of the present disclosure is not limited to this.
[0043] Among them, the facial key point detection technology known in the art can be used to detect the facial key points in the face image, and the embodiments of the present disclosure are not limited to this. It is understandable that the target eye key points can include all the key points on the eye contour of the facial key points, and can also include some of the key points on the eye contour of the facial key points.
[0044] Figure 2 A schematic diagram of a facial key point according to an embodiment of the present disclosure is shown as follows: Figure 2 As shown, the target eye key points may include the vertices of the inner corners of the eye (such as 55 and 58), the vertices of the outer corners of the eye (such as 52 and 61), the highest key point of the upper eyelid (such as 72 and 75) and the key points on both sides of the key point (such as 53 and 54, 59 and 60), the lowest key point of the lower eyelid (73 and 76) and the key points on both sides of the key point (such as 56 and 57, 62 and 63), etc.; or, some key points may be selected from the key points on the above-mentioned eye contour as the target eye key points.
[0045] In a possible implementation, the target eye key points may include at least an inner eye corner vertex, an outer eye corner vertex, at least one upper eyelid key point and at least one lower eyelid key point; Figure 2Taking the facial key points as an example, the target eye key points of the right eye may include, for example, the inner corner vertex 58, the outer corner vertex 61, the upper eyelid key point 75, and the lower eyelid key point 76; or, it may also include the inner corner vertex 58, the outer corner vertex 61, the upper eyelid key points 59 and 60, the lower eyelid key points 63 and 62, etc.; the target eye key points of the left eye may include, for example, the inner corner vertex 55, the outer corner vertex 52, the upper eyelid key point 72, and the lower eyelid key point 73; or, it may also include the inner corner vertex 55, the outer corner vertex 52, the upper eyelid key points 53 and 54, the lower eyelid key points 57 and 56, etc.
[0046] It should be understood that the target eye key points may include the inner corner vertices, outer corner vertices, at least one upper eyelid key point and at least one lower eyelid key point of a single eye, or the inner corner vertices, outer corner vertices, at least one upper eyelid key point and at least one lower eyelid key point of both eyes.
[0047] The target eye key points of a single eye or both eyes can be determined according to whether the eye makeup material to be fused is single eye makeup or double eye makeup, and the disclosed embodiment does not limit this. The eye makeup material can include eye shadow, eyeliner, stickers and other eye dressing materials, and the disclosed embodiment does not limit the content of the eye makeup material.
[0048] In step S12, the target eye key points are interpolated to obtain a plurality of target peri-ocular key points.
[0049] It is known that eye makeup is usually distributed in the area around the eyes. Therefore, the target eye key points can be interpolated from the inside (i.e. close to the eyes) to the outside (away from the eyes) to obtain multiple target peri-eye key points, so that the eye area surrounded by the multiple target peri-eye key points can completely cover the area around the eyes in the two images, that is, can completely cover the area around the eyes where the eye makeup material is to be fused.
[0050] Among them, the interpolation algorithm known in the art, such as a linear interpolation algorithm, a curve interpolation algorithm, etc., can be used to interpolate the target eye key points to obtain multiple target periorbital key points, and the embodiments of the present disclosure are not limited to this. It should be understood that each target eye key point can interpolate at least one target periorbital key point, and the user can customize the number of target periorbital key points interpolated from each target eye key point. The number of target periorbital key points interpolated from each target eye key point can be the same or different. For example, the outer corner of the eye vertex can be set to interpolate 4 periorbital key points, and the other inner corner of the eye vertices, upper eyelid key points, and lower eyelid key points can each interpolate 3 periorbital key points, and the embodiments of the present disclosure are not limited to this.
[0051] In step S13, a first eye grid corresponding to the face image is constructed according to the target eye key point and a plurality of target eye peri-key points.
[0052] Among them, each key point can be connected with the surrounding key points, that is, two adjacent key points are connected, so as to construct a first eye grid corresponding to the face image according to the target eye key point and multiple target eye peri-key points. The first eye grid can be, for example, a triangular grid, or a quadrilateral grid, etc., which is not limited to the embodiments of the present disclosure.
[0053] In step S14, based on the first eye grid and the second eye grid corresponding to the standard face image, the eye makeup material corresponding to the standard face image is merged into the face image to obtain the target face image.
[0054] Among them, the standard face image can be understood as an image containing a standard face. The second eye grid corresponding to the standard face image is constructed in the same way as the first eye grid, based on the standard eye key points detected in the standard face image and the interpolated standard eye periorbital key points. The construction method of the second eye grid is not repeated. It should be understood that there can be multiple eye makeup materials, and the standard face image can be one. This makes it easy to merge different eye makeup materials into the face image based on the second eye grid of the same standard face image, so as to achieve virtual makeup of different eye makeup materials.
[0055] Among them, the eye makeup material corresponding to the standard face image can be understood as the material generated based on the eyes in the standard face image. Figure 3 A schematic diagram of an eye makeup material according to an embodiment of the present disclosure is shown, wherein the eye makeup material can be matched with eyes in a standard face image. Figure 4 A schematic diagram of a local area of a face image according to an embodiment of the present disclosure is shown. Figure 5 A schematic diagram of a local area of a target face image according to an embodiment of the present disclosure is shown. Figure 3 The eye material shown is fused to Figure 4 In the face image shown, we can get Figure 5 The target face image is shown.
[0056] In a possible implementation, based on a first eye grid and a second eye grid corresponding to a standard facial image, eye makeup materials corresponding to a standard facial image are merged into a facial image to obtain a target facial image, which may include: extracting a first pixel color corresponding to the first eye grid in the facial image; extracting a second pixel color corresponding to the second eye grid in the eye makeup material; merging the first pixel color with the second pixel color to obtain a target color; and merging the target color into an eye area indicated by the first eye grid in the facial image to obtain a target facial image.
[0057] The pixel color can be expressed as an RGB color or an HSV (a color model consisting of hue H, saturation S, and brightness V) color, which is not limited in the embodiments of the present disclosure. It should be understood that the RGB color can be extracted based on the pixel value of each pixel point in the eye grid, and the RGB color can be converted to the HSV color based on the conversion relationship between RGB and HSV.
[0058] Among them, image processing techniques known in the art, such as overlay, color filtering, color mixing, etc., can be used to achieve the fusion of the first pixel color and the second pixel color, and the fusion of the target color into the face image, which is not limited to the embodiments of the present disclosure.
[0059] In the disclosed embodiment, a plurality of target peri-eye key points are obtained by interpolating the detected target eye key points, which is equivalent to interpolating and filling in the eye key points, so that the key points around the eyes are denser, and then the eye makeup material corresponding to the standard face image is fused to the eye of the face image through a first eye grid constructed by the dense target peri-eye key points and the target eye key points and a second eye grid corresponding to the standard face image. Since the second eye grid is constructed in the same manner as the first eye grid, a mapping relationship can be established between the eye makeup material and the eye of the face image. In this way, when the eye makeup material is fused to the eye of the face image, not only can the eye makeup material stably follow the eye posture in the face image, that is, it is not affected by posture changes such as opening eyes, closing eyes, and side faces, but the virtual makeup effect of the eye makeup material can also be made more realistic.
[0060] As described above, the target eye key points may be interpolated in an interpolation direction from inside (i.e., close to the eyes) to outside (away from the eyes) to obtain a plurality of target peri-ocular key points. In order to make the target peri-ocular key points more accurately and completely cover the surrounding area of the eyes in the face image, in a possible implementation, in step S12, the target eye key points are interpolated to obtain a plurality of target peri-ocular key points, including:
[0061] According to the preset interpolation direction corresponding to the target eye key point, the target eye key point is interpolated to obtain at least one first eye periphery key point in the preset interpolation direction; wherein the preset interpolation direction represents the direction in which the target eye key point is interpolated, and the multiple target eye periphery key points include: one or more of the target eye key points are each used as the interpolation starting point, and the first eye periphery key point is obtained by sequentially interpolating along the corresponding preset interpolation direction. In this way, the eye area surrounded by the target eye periphery key points interpolated according to the preset interpolation direction can completely cover the area around the eye in the face image.
[0062] Among them, a linear interpolation algorithm known in the art, such as a bilinear interpolation algorithm, a nearest neighbor interpolation algorithm, etc., can be used to interpolate the target eye key points according to the preset interpolation direction corresponding to the target eye key points, and obtain at least one first peri-ocular key point in the preset interpolation direction. The embodiments of the present disclosure are not limited to this.
[0063] It should be understood that each target eye key point can interpolate at least one first periorbital key point, and the user can customize the number of first periorbital key points interpolated from each target eye key point. The number of first periorbital key points interpolated from each target eye key point can be the same or different. For example, the outer corner of the eye vertices can be set to interpolate 4 first periorbital key points, and the other inner corner of the eye vertices, upper eyelid key points and lower eyelid key points can each interpolate 3 first periorbital key points. The embodiments of the present disclosure are not limited to this.
[0064] As described above, the target eye key points as the interpolation starting point may include at least the inner eye corner vertex, the outer eye corner vertex, at least one upper eyelid key point and at least one lower eyelid key point; in a possible implementation, the preset interpolation direction corresponding to the inner eye corner vertex includes pointing from the inner eye corner vertex to the root of the nose key point, and / or from the inner eye corner vertex to the nasal dorsum key point, for example, Figure 2 The middle inner canthus vertex 58 points to the nasal root key point 43, and / or the inner canthus vertex 58 points to the nasal dorsum key point 44; the preset interpolation direction corresponding to the outer canthus vertex is from the nasal root side key point to the pupil key point, for example, Figure 2 The right side key point 79 of the middle nasal root points to the right pupil key point 77; the preset interpolation direction corresponding to the upper eyelid key point is from the nose tip key point to the nasal root key point, for example, Figure 2 The middle nose tip key point 46 (equivalent to key point 49) points to the root of the nose key point 43; the preset interpolation direction corresponding to the lower eyelid key point is from the root of the nose key point to the tip of the nose key point, for example, Figure 2The middle nasal root key point 43 points to the nose tip key point 46 (equivalent to the key point 49). It should be understood that the preset interpolation directions corresponding to the inner canthus vertex, outer canthus vertex, upper eyelid key point and lower eyelid key point can be understood as the interpolation direction from the inside (i.e., close to the eye) to the outside (away from the eye).
[0065] It should be understood that the preset interpolation direction of each of the above target eye key points is an implementation method provided in the embodiment of the present disclosure. In fact, the present disclosure should not be limited to this. Those skilled in the art can customize the preset interpolation direction corresponding to each target eye key point, and the embodiment of the present disclosure is not limited to this.
[0066] Figure 6 A schematic diagram showing target eye periorbital key points corresponding to a single eye according to an embodiment of the present disclosure is shown as follows: Figure 6 As shown, the key points "A1, A2, A3" can be the eye periphery key points interpolated from the inner canthus vertex as the interpolation starting point according to the preset interpolation direction from the inner canthus vertex to the nose dorsum key point, the key points "G1, G2, G3" can be the eye periphery key points interpolated from the inner canthus vertex as the interpolation starting point according to the preset interpolation direction from the inner canthus vertex to the nose root key point, and "B1, B2, B3, C1, C2, C3" can be the eye periphery key points interpolated from the two lower eyelid key points as the interpolation starting point according to the preset interpolation direction from the inner canthus vertex to the nose root key point. The eye periocular key points interpolated in the preset interpolation direction from the nose tip key point to the nose root key point, "E1, E2, E3, F1, F2, F3" can be the eye periocular key points interpolated with the two upper eyelid key points as the interpolation starting points and according to the preset interpolation direction from the nose root key point to the nose tip key point, "D1, D2, D3, D4" can be the eye periocular key points interpolated with the outer corner of the eye vertex as the interpolation starting point and according to the preset interpolation direction from the nose root side key point to the pupil key point.
[0067] It should be understood that Figure 6 The first eye periphery key point shown is an implementation provided by the embodiment of the present disclosure. In fact, the embodiment of the present disclosure does not limit the number of target eye key points, that is, a larger number of target eye key points can be used to interpolate the ratio. Figure 6 The first periocular key points with higher density are used to construct a uniform and reasonable eye network.
[0068] Considering that the first peri-eye key points obtained by interpolating the target eye key points according to the preset interpolation direction may not be dense enough, so that the meshes in the constructed first eye mesh are large and uneven, affecting the fusion of the eye makeup material, in a possible implementation, the number of first peri-eye key points interpolated from a single target eye key point is N, where N is a positive integer, wherein after obtaining N first peri-eye key points interpolated along the respective corresponding preset interpolation directions with one or more target eye key points as interpolation starting points, in step S12, the target eye key points are interpolated to obtain multiple target peri-eye key points, further comprising:
[0069] Determine an nth periorbital curve formed by connecting the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the inner canthus vertex as the interpolation starting point, the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the outer canthus vertex as the interpolation starting point, the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the upper eyelid key point as the interpolation starting point, and the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the lower eyelid key point as the interpolation starting point, and interpolate a plurality of second periorbital key points based on the nth periorbital curve;
[0070] Wherein, n=1, 2, ..., N, the plurality of target periorbital key points further include: a plurality of second periorbital key points interpolated based on at least one periorbital curve.
[0071] As described above, the first periocular key point may be a key point interpolated from the target periocular key point as the interpolation starting point according to a preset interpolation direction from inside (close to the eye) to outside (far away from the eye). Then, the first periocular key point closest to the eye may be considered to be the first interpolated first periocular key point, and the first periocular key point farthest from the eye may be considered to be the Nth interpolated first periocular key point. Figure 6Taking the first periorbital key points shown as an example, the first periorbital key points "A1, G1, B1, C1, D1, E1, F1" are respectively the first first periorbital key points interpolated from the inner canthus vertices, two lower eyelid key points, the outer canthus vertices and the two upper eyelid key points. The first periorbital curve connected by these first periorbital key points "A1, G1, B1, C1, D1, E1, F1" can be determined, and then a plurality of second periorbital key points can be interpolated based on the first periorbital curve, that is, a plurality of second periorbital key points can be interpolated on the first periorbital curve; and so on, the second periorbital key points can be interpolated based on the inner canthus vertices. The second periorbital curve is determined based on the second first periorbital key points "A2, G2, B2, C2, D2, E2, F2" interpolated from the inner corner of the eye vertex, two lower eyelid key points, the outer corner of the eye vertex and the two upper eyelid key points, and multiple second periorbital key points are interpolated on the second periorbital curve. The third periorbital curve can be determined based on the third first periorbital key points "A3, G3, B3, C3, D3, E3, F3" interpolated from the inner corner of the eye vertex, two lower eyelid key points, the outer corner of the eye vertex and the two upper eyelid key points, and multiple second periorbital key points are interpolated on the third periorbital curve.
[0072] It should be understood that, since the number of first periocular key points interpolated from different target eye key points may be different, N may be the minimum value of the number of first periocular key points interpolated from multiple target eye key points. Figure 6 The first periocular key point interpolated in the above example, N=3, can obtain the second periocular key point interpolated on three periocular curves, and the target periocular key point can include the second periocular key point interpolated on at least one periocular curve. In this way, more dense target periocular key points can be effectively interpolated, which is conducive to constructing a more uniform and reasonable first eye mesh.
[0073] In practical applications, a curve interpolation algorithm known in the art, such as polynomial curve interpolation, double arc segment curve interpolation, sine function curve interpolation, B-spline curve interpolation, etc., can be used to determine the nth periorbital curve and interpolate multiple second periorbital key points based on the nth periorbital curve, and the embodiments of the present disclosure are not limited to this. It should be understood that the number of second periorbital key points interpolated on each periorbital curve can be the same or different, and the user can customize the number of second periorbital key points interpolated on each periorbital curve, and the embodiments of the present disclosure are not limited to this.
[0074] Figure 7 A schematic diagram showing target eye periorbital key points corresponding to a single eye according to an embodiment of the present disclosure is shown as follows: Figure 7As shown, the solid circle represents the first periorbital key point, and the hollow circle may represent the second periorbital key point. The first periorbital key point and the second periorbital key point may cover the area around the eye as completely as possible; Figure 8 A schematic diagram showing a first eye grid corresponding to a single eye according to an embodiment of the present disclosure is shown as follows: Figure 8 As shown, a uniform and reasonable first eye grid can be constructed according to the target eye key points, the first eye periorbital key points and the second eye periorbital key points corresponding to one eye. It should be understood that the first eye grid corresponding to the right eye is symmetrical to the first eye grid corresponding to the left eye.
[0075] In a possible implementation, in step S12, interpolating the target eye key points to obtain a plurality of target eye periorbital key points may further include:
[0076] Determine an nth upper periorbital curve formed by connecting the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the inner canthus vertex as the interpolation starting point, the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the outer canthus vertex as the interpolation starting point, and the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the upper eyelid key point as the interpolation starting point, and interpolate multiple upper periorbital key points based on the nth upper periorbital curve;
[0077] Determine an nth lower periorbital curve formed by connecting the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the inner canthus vertex as the interpolation starting point, the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the outer canthus vertex as the interpolation starting point, and the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the lower eyelid key point as the interpolation starting point, and interpolate multiple lower periorbital key points based on the nth lower periorbital curve;
[0078] Wherein, n=1, 2, ..., N, the plurality of target periorbital key points further include: a plurality of upper periorbital key points interpolated based on at least one upper periorbital curve, and a plurality of lower periorbital key points interpolated based on at least one lower periorbital curve.
[0079] The above method can be understood as performing curve interpolation on the first periocular key point of the lower eye (that is, the first periocular key point interpolated from the inner canthus vertex, the lower eyelid key point and the outer canthus vertex) to obtain the lower periocular key point, and performing curve interpolation on the first periocular key point of the upper eye (that is, the first periocular key point interpolated from the inner canthus vertex, the upper eyelid key point and the outer canthus vertex) to obtain the upper periocular key point.
[0080] by Figure 6Taking the first periorbital key point shown as an example, for the lower part of the eye, the first lower periorbital curve formed by connecting the first first periorbital key point "A1, B1, C1, D1" interpolated from the inner corner of the eye vertex, two lower eyelid key points, and the outer corner of the eye vertex can be determined, and then multiple lower periorbital key points can be interpolated based on the first lower periorbital curve, that is, multiple lower periorbital key points can be interpolated on the first lower periorbital curve, and so on, the second lower periorbital curve can be determined based on the second first periorbital key point "A2, B2, C2, D2" interpolated from the inner corner of the eye vertex, two lower eyelid key points, and the outer corner of the eye vertex, and multiple lower periorbital key points can be interpolated on the second lower periorbital curve, and the third lower periorbital curve can be determined based on the third first periorbital key point "A3, B3, C3, D3" interpolated from the inner corner of the eye vertex, two lower eyelid key points, and the outer corner of the eye vertex, and Multiple lower eyelid key points are interpolated from the three lower eyelid curves; for the upper part of the eye, the first upper eyelid key point "D1, E1, F1, G1" interpolated from the inner corner of the eye vertex, the two upper eyelid key points, and the outer corner of the eye vertex can be determined to form the first upper eyelid curve, and then multiple upper eyelid key points can be interpolated from the first upper eyelid curve. The interpolated second first periorbital key point "D2, E2, F2, G2" determines the second upper periorbital curve, and multiple upper periorbital key points are interpolated on the second upper periorbital curve. In addition, the third first periorbital key point "D3, E3, F3, G3" interpolated from the inner corner of the eye vertex, two upper eyelid key points, and outer corner of the eye vertex can be used to determine the third upper periorbital curve, and multiple upper periorbital key points are interpolated on the third upper periorbital curve.
[0081] It is understandable that the multiple upper periorbital key points interpolated from the nth upper periorbital curve and the multiple lower periorbital key points interpolated from the nth lower periorbital curve are equivalent to the multiple second periorbital key points interpolated from the nth periorbital curve. Therefore, by separately determining the upper periorbital key points and the lower periorbital key points, the following can also be obtained: Figure 7 The target eye key points shown are then connected to form Figure 8 The first eye mesh is shown.
[0082] In practical applications, curve interpolation algorithms known in the art, such as polynomial curve interpolation, double arc segment curve interpolation, sine function curve interpolation, B-spline curve interpolation, etc., can be used to determine the nth upper periorbital curve and interpolate multiple upper periorbital key points based on the nth upper periorbital curve, and determine the nth lower periorbital curve and interpolate multiple lower periorbital key points based on the nth lower periorbital curve, which is not limited in the embodiments of the present disclosure. Among them, the user can customize the number of interpolated periorbital key points on each upper periorbital curve and each lower periorbital curve, which is not limited in the embodiments of the present disclosure.
[0083] In the embodiment of the present disclosure, by performing curve interpolation on the first periocular key point of the upper part of the eye and the first periocular key point of the lower part of the eye respectively, more accurate and dense upper periocular key points and lower periocular key points can be obtained, that is, more accurate and dense target periocular key points can be obtained.
[0084] As described above, in step 14, the target face image can be obtained by extracting the first pixel color of the first eye grid in the face image and extracting the second pixel color corresponding to the second eye grid in the eye makeup material, and then fusing the target color obtained by fusing the first pixel color and the second pixel color into the face image. However, considering that not all of the second eye grids may cover the eye makeup material, that is, not all of the eye areas indicated by the first eye grid may be fused with the eye makeup material, if the first pixel color corresponding to the entire first eye grid and the second pixel color corresponding to the entire second eye grid are extracted, computing resources may be wasted and image processing efficiency may be reduced.
[0085] In a possible implementation, in step S14, according to the first eye grid and the second eye grid corresponding to the standard face image, the eye makeup material corresponding to the standard face image is merged into the face image to obtain the target face image, including:
[0086] Determine a second sub-grid in the second eye grid that covers the eye makeup material, and extract a second pixel color corresponding to the second sub-grid in the eye makeup material;
[0087] Determine, according to a sub-grid matching relationship between the first eye grid and the second eye grid, a first sub-grid in the first eye grid that matches the second sub-grid, and determine a first pixel color corresponding to the first sub-grid in the face image;
[0088] According to the first pixel color corresponding to the first sub-grid and the second pixel color corresponding to the second sub-grid, the eye makeup material is merged into the face image to obtain the target face image.
[0089] As described above, the eye makeup material corresponding to the standard facial image can be understood as material generated based on the eyes in the standard facial image. Therefore, based on the correspondence between the eye makeup material and the standard facial image, the second sub-grid in the second eye grid that can cover the eye makeup material can be determined. It should be understood that the second eye grid can include multiple second sub-grids that can cover the eye makeup material.
[0090] As described above, the second eye grid can be constructed in the same way as the first eye grid, so each sub-grid in the second eye grid can be matched with each sub-grid in the first eye grid, and the sub-grid matching relationship can be used to indicate the matching sub-grid pairs in the first eye grid and the second eye grid, wherein the matching sub-grid pairs can indicate the same eye area, for example, a certain matching sub-grid pair both indicate the same eye tail area.
[0091] It should be understood that since the first sub-grid is a sub-grid that can cover the eye makeup material, the first sub-grid that matches the second sub-grid can be understood as being able to indicate the eye area in the face image that needs to be integrated with the eye makeup material. Extracting the first pixel color corresponding to the first sub-grid in the face image is equivalent to extracting the first pixel color in the eye area in the face image that needs to be integrated with the eye makeup material, thereby reducing the waste of computing resources and improving image processing efficiency.
[0092] In a possible implementation, according to the first pixel color corresponding to the first subgrid and the second pixel color corresponding to the second subgrid, the eye makeup material is fused into the face image to obtain the target face image, including: fusion of the first pixel color corresponding to the first subgrid and the second pixel color corresponding to the second subgrid to obtain the target color corresponding to the first subgrid; fusion of the target color to the eye area indicated by the first subgrid in the face image to obtain the target face image. In this way, the eye makeup material can be effectively fused into the face image, so that the eye makeup in the target face image after the fusion of the eye makeup material has a sense of reality.
[0093] As described above, image processing techniques known in the art, such as overlay, color filtering, color mixing, etc., can be used to merge the first pixel color with the second pixel color and merge the target color into the face image, and the embodiments of the present disclosure are not limited to this.
[0094] Considering that the eye makeup material in actual application may have different transparency in addition to color, and the user may also have setting requirements for the fusion strength of the eye makeup material, in a possible implementation, fusion of the target color to the eye area indicated by the first eye grid in the face image to obtain the target face image may include:
[0095] According to the transparency corresponding to the eye makeup material and / or the preset color fusion strength, the target color is fused to the eye area indicated by the first sub-grid in the face image to obtain the target face image. In this way, various fusion requirements of the user for the eye makeup material can be met, and the realism of the eye makeup in the target face image can be improved.
[0096] Among them, according to the transparency corresponding to the eye makeup material, the target color is merged into the eye area indicated by the first sub-grid in the face image. It can be understood that, according to the transparency corresponding to the eye makeup material, the target color with the transparency is merged into the eye area indicated by the first sub-grid in the face image, so that the eye area merged with the target color not only has the color corresponding to the eye makeup material, but also has the transparency corresponding to the eye makeup material, which is beneficial to enhance the realism of the eye makeup in the target face image.
[0097] Among them, the color fusion intensity can be understood as the fusion intensity of fusing the target color into the eye area in the face image. The higher the color fusion intensity, the more obvious the fusion effect of the eye makeup in the target face image, or the closer it is to the color of the eye makeup material; on the contrary, the lower the color fusion intensity, the less obvious the fusion effect of the eye makeup in the target face image, or the closer it is to the original skin color around the eyes.
[0098] It can be understood that fusing the target color into the eye area indicated by the first sub-grid in the face image is equivalent to fusing the target color with the first pixel color in the eye area in the face image, and the above-mentioned color fusion strength can be equivalent to the fusion weight between the target color and the first pixel color; according to the preset color fusion strength, fusing the target color into the eye area indicated by the first sub-grid in the face image can be understood as weighted fusion of the target color and the first pixel color according to the fusion weight between the target color and the first pixel color, thereby realizing control of the color fusion strength and meeting users' needs for different fusion strengths of eye makeup materials.
[0099] In the disclosed embodiment, the eye makeup material can be efficiently integrated into the face image, and the realism of the eye makeup in the target face image after the integration of the eye makeup material can be improved.
[0100] According to the embodiments of the present disclosure, it can be applied to various beauty cameras, virtual beauty applications, and social applications, and can enhance the realism of eye makeup in virtual makeup.
[0101] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.
[0102] In addition, the present disclosure also provides an image processing device, an electronic device, a computer-readable storage medium, and a program, all of which can be used to implement any image processing method provided by the present disclosure. The corresponding technical solutions and descriptions are referred to the corresponding records in the method part and will not be repeated here.
[0103] Fig. 9 FIG. 1 is a block diagram of an image processing apparatus according to an embodiment of the present disclosure. Fig. 9 As shown, the device comprises:
[0104] An image acquisition module 901 is used to acquire a face image and detect key points of the face in the face image, wherein the key points of the face include target eye key points;
[0105] A key point interpolation module 902 is used to interpolate the target eye key points to obtain a plurality of target peri-ocular key points; a grid construction module is used to construct a first eye grid corresponding to the face image according to the target eye key points and the plurality of target peri-ocular key points;
[0106] The material fusion module 903 is used to fuse the eye makeup material corresponding to the standard facial image into the facial image according to the first eye grid and the second eye grid corresponding to the standard facial image, so as to obtain a target facial image; wherein the second eye grid is constructed in the same manner as the first eye grid, based on the standard eye key points detected in the standard facial image and the interpolated standard eye periorbital key points.
[0107] In a possible implementation, the target eye key points are interpolated to obtain a plurality of target periorbital key points, including: interpolating the target eye key points according to a preset interpolation direction corresponding to the target eye key points to obtain at least one first periorbital key point in the preset interpolation direction; wherein the preset interpolation direction represents the direction in which the target eye key points are interpolated, and the plurality of target periorbital key points include: taking one or more of the target eye key points as interpolation starting points, and sequentially interpolating along the corresponding preset interpolation direction to obtain the first periorbital key points.
[0108] In a possible implementation, the target eye key points serving as the interpolation starting point include at least the inner eye corner vertex, the outer eye corner vertex, at least one upper eyelid key point and at least one lower eyelid key point; the preset interpolation direction corresponding to the inner eye corner vertex includes from the inner eye corner vertex to the nasal root key point, and / or from the inner eye corner vertex to the nasal dorsum key point; the preset interpolation direction corresponding to the outer eye corner vertex is from the nasal root side key point to the pupil key point; the preset interpolation direction corresponding to the upper eyelid key point is from the nose tip key point to the nasal root key point; the preset interpolation direction corresponding to the lower eyelid key point is from the nasal root key point to the nose tip key point.
[0109] In a possible implementation, the number of first periorbital key points interpolated from a single target eye key point is N, where N is a positive integer, wherein after obtaining N first periorbital key points interpolated along respective corresponding preset interpolation directions using one or more target eye key points as interpolation starting points, interpolating the target eye key points to obtain a plurality of target periorbital key points further includes: determining an nth upper periorbital curve formed by connecting the nth first periorbital key point interpolated along the corresponding preset interpolation direction using the inner eye corner vertex as the interpolation starting point, the nth first periorbital key point interpolated along the corresponding preset interpolation direction using the outer eye corner vertex as the interpolation starting point, and the nth first periorbital key point interpolated along the corresponding preset interpolation direction using the upper eyelid key point as the interpolation starting point, Based on the nth upper periorbital curve, a plurality of upper periorbital key points are interpolated; an nth lower periorbital curve is determined, which is formed by connecting the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the inner canthus vertex as the interpolation starting point, the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the outer canthus vertex as the interpolation starting point, and the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the lower eyelid key point as the interpolation starting point, and based on the nth lower periorbital curve, a plurality of lower periorbital key points are interpolated; wherein n=1, 2, ..., N, and the plurality of target periorbital key points also include: a plurality of upper periorbital key points interpolated based on at least one upper periorbital curve, and a plurality of lower periorbital key points interpolated based on at least one lower periorbital curve.
[0110] In a possible implementation, the number of first periorbital key points interpolated from a single target eye key point is N, where N is a positive integer. After obtaining N first periorbital key points interpolated from one or more target eye key points as interpolation starting points along their respective corresponding preset interpolation directions, interpolating the target eye key points to obtain a plurality of target periorbital key points further includes: determining an nth first periorbital key point interpolated from an inner eye corner vertex as an interpolation starting point along the corresponding preset interpolation direction, and an nth first periorbital key point interpolated from an outer eye corner vertex as an interpolation starting point along the corresponding preset interpolation direction. Suppose an nth periorbital curve is formed by connecting the nth first periorbital key point interpolated in the interpolation direction, the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the upper eyelid key point as the interpolation starting point, and the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the lower eyelid key point as the interpolation starting point, and interpolate multiple second periorbital key points based on the nth periorbital curve; wherein n=1, 2, …, N, and the multiple target periorbital key points also include: multiple second periorbital key points interpolated based on at least one periorbital curve.
[0111] In a possible implementation, the method of fusing the eye makeup material corresponding to the standard facial image into the facial image based on the first eye grid and the second eye grid corresponding to the standard facial image to obtain a target facial image includes: determining a second sub-grid in the second eye grid that covers the eye makeup material, and extracting a second pixel color corresponding to the second sub-grid in the eye makeup material; determining a first sub-grid in the first eye grid that matches the second sub-grid based on a sub-grid matching relationship between the first eye grid and the second eye grid, and determining a first pixel color corresponding to the first sub-grid in the facial image; and fusing the eye makeup material into the facial image based on a first pixel color corresponding to the first sub-grid and a second pixel color corresponding to the second sub-grid to obtain a target facial image.
[0112] In a possible implementation, the eye makeup material is integrated into the facial image according to the first pixel color corresponding to the first sub-grid and the second pixel color corresponding to the second sub-grid to obtain a target facial image, including: integrating the first pixel color corresponding to the first sub-grid and the second pixel color corresponding to the second sub-grid to obtain a target color corresponding to the first sub-grid; integrating the target color into the eye area indicated by the first sub-grid in the facial image to obtain a target facial image.
[0113] In a possible implementation, the target color is fused into the eye area indicated by the first sub-grid in the facial image to obtain the target facial image, including: according to the transparency corresponding to the eye makeup material, and / or a preset color fusion strength, the target color is fused into the eye area indicated by the first sub-grid in the facial image to obtain the target facial image.
[0114] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0115] The embodiment of the present disclosure also provides a computer-readable storage medium on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.
[0116] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to call the instructions stored in the memory to execute the above method.
[0117] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.
[0118] The electronic device may be provided as a terminal, a server, or a device in other forms.
[0119] Fig.10 1 is a block diagram of an electronic device 1900 according to an embodiment of the present disclosure. For example, the electronic device 1900 may be provided as a server or a terminal device. Fig.10 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
[0120] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output (I / O) interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as a Microsoft Server operating system (Windows Server 2003). TM ), a graphical user interface operating system launched by Apple (Mac OSX TM ), a multi-user, multi-process computer operating system (Unix TM ), a free and open source Unix-like operating system (Linux TM ), an open source Unix-like operating system (FreeBSD TM ) or similar.
[0121] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.
[0122] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0123] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, (but not limited to) an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer readable storage medium used here is not interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated by a waveguide or other transmission medium (for example, a light pulse by an optical fiber cable), or an electrical signal transmitted by a wire.
[0124] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0125] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0126] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0127] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0128] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0129] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0130] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK) and the like.
[0131] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0132] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0133] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.
[0134] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. An image processing method, characterized in that: include: Acquire a face image, and detect face key points in the face image, wherein the face key points include target eye key points; Interpolating the target eye key points to obtain a plurality of target eye periorbital key points; Constructing a first eye grid corresponding to the face image according to the target eye key point and the multiple target eye periorbital key points; According to the first eye grid and the second eye grid corresponding to the standard facial image, the eye makeup material corresponding to the standard facial image is integrated into the facial image to obtain a target facial image; wherein the second eye grid is constructed in the same manner as the first eye grid, based on the standard eye key points detected in the standard facial image and the interpolated standard eye periorbital key points.
2. The method according to claim 1, characterized in that Interpolate the target eye key points to obtain multiple target eye periorbital key points, including: Interpolating the target eye key point according to the preset interpolation direction corresponding to the target eye key point to obtain at least one first peri-ocular key point in the preset interpolation direction; Among them, the preset interpolation direction represents the direction of interpolation of the target eye key points, and the multiple target periorbital key points include: taking one or more of the target eye key points as interpolation starting points, and obtaining the first periorbital key points by sequentially interpolating along the corresponding preset interpolation direction.
3. The method according to claim 2, characterized in that The target eye key points as the interpolation starting point include at least the inner eye corner vertex, the outer eye corner vertex, at least one upper eyelid key point and at least one lower eyelid key point; The preset interpolation direction corresponding to the inner canthus vertex includes pointing from the inner canthus vertex to the nasal root key point, and / or from the inner canthus vertex to the nasal dorsum key point; The preset interpolation direction corresponding to the outer corner vertex is from the nasal root side key point to the pupil key point; the preset interpolation direction corresponding to the upper eyelid key point is from the nose tip key point to the nasal root key point; the preset interpolation direction corresponding to the lower eyelid key point is from the nose root key point to the nose tip key point.
4. The method according to claim 2 or 3, characterized in that: The number of first periorbital key points interpolated from a single target eye key point is N, where N is a positive integer. After obtaining N first periorbital key points interpolated from one or more target eye key points along respective corresponding preset interpolation directions, the target eye key points are interpolated to obtain a plurality of target periorbital key points, and further includes: Determine an nth upper periorbital curve formed by connecting the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the inner canthus vertex as the interpolation starting point, the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the outer canthus vertex as the interpolation starting point, and the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the upper eyelid key point as the interpolation starting point, and interpolate a plurality of upper periorbital key points based on the nth upper periorbital curve; Determine an nth lower periorbital curve formed by connecting the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the inner canthus vertex as the interpolation starting point, the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the outer canthus vertex as the interpolation starting point, and the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the lower eyelid key point as the interpolation starting point, and interpolate a plurality of lower periorbital key points based on the nth lower periorbital curve; Wherein, n=1, 2, ..., N, and the plurality of target periorbital key points further include: a plurality of upper periorbital key points interpolated based on at least one upper periorbital curve, and a plurality of lower periorbital key points interpolated based on at least one lower periorbital curve.
5. The method according to claim 2 or 3, characterized in that: The number of first periorbital key points interpolated from a single target eye key point is N, where N is a positive integer. After obtaining N first periorbital key points interpolated from one or more target eye key points along respective corresponding preset interpolation directions, the target eye key points are interpolated to obtain a plurality of target periorbital key points, and further includes: Determine an nth periorbital curve formed by connecting the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the inner canthus vertex as the interpolation starting point, the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the outer canthus vertex as the interpolation starting point, the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the upper eyelid key point as the interpolation starting point, and the nth first periorbital key point interpolated along the corresponding preset interpolation direction with the lower eyelid key point as the interpolation starting point, and interpolate a plurality of second periorbital key points based on the nth periorbital curve; Wherein, n=1, 2, ..., N, and the plurality of target periorbital key points further include: a plurality of second periorbital key points interpolated based on at least one periorbital curve.
6. The method according to any one of claims 1 to 5, characterized in that: The step of fusing the eye makeup material corresponding to the standard face image into the face image according to the first eye grid and the second eye grid corresponding to the standard face image to obtain a target face image includes: Determine a second sub-grid in the second eye grid that covers the eye makeup material, and extract a second pixel color corresponding to the second sub-grid in the eye makeup material; Determine, according to a sub-grid matching relationship between the first eye grid and the second eye grid, a first sub-grid in the first eye grid that matches the second sub-grid, and determine a first pixel color corresponding to the first sub-grid in the face image; The eye makeup material is merged into the face image according to a first pixel color corresponding to the first subgrid and a second pixel color corresponding to the second subgrid to obtain a target face image.
7. The method according to claim 6, characterized in that The step of fusing the eye makeup material into the face image according to the first pixel color corresponding to the first subgrid and the second pixel color corresponding to the second subgrid to obtain a target face image includes: Merging a first pixel color corresponding to the first sub-grid with a second pixel color corresponding to the second sub-grid to obtain a target color corresponding to the first sub-grid; The target color is merged into the eye region indicated by the first subgrid in the face image to obtain a target face image.
8. The method according to claim 7, characterized in that The step of fusing the target color to the eye region indicated by the first subgrid in the face image to obtain a target face image includes: According to the transparency corresponding to the eye makeup material, and / or a preset color fusion strength, the target color is fused to the eye area indicated by the first sub-grid in the face image to obtain a target face image.
9. An image processing device, characterized in that: include: An image acquisition module, used to acquire a face image and detect key points of the face in the face image, wherein the key points of the face include target eye key points; A key point interpolation module, used to interpolate the target eye key points to obtain a plurality of target peri-ocular key points; A grid construction module, used to construct a first eye grid corresponding to the face image according to the target eye key point and the plurality of target eye periorbital key points; A material fusion module is used to fuse the eye makeup material corresponding to the standard face image into the face image according to the first eye grid and the second eye grid corresponding to the standard face image, so as to obtain a target face image; wherein the second eye grid is constructed in the same way as the first eye grid, based on the standard eye key points detected in the standard face image and the interpolated standard eye periorbital key points.
10. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method described in any one of claims 1 to 8.
11. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.