WO2022042160A1 - Image processing method and apparatus - Google Patents

Image processing method and apparatus Download PDF

Info

Publication number
WO2022042160A1
WO2022042160A1 PCT/CN2021/108227 CN2021108227W WO2022042160A1 WO 2022042160 A1 WO2022042160 A1 WO 2022042160A1 CN 2021108227 W CN2021108227 W CN 2021108227W WO 2022042160 A1 WO2022042160 A1 WO 2022042160A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
type
triangle
coordinate value
point
Prior art date
Application number
PCT/CN2021/108227
Other languages
French (fr)
Chinese (zh)
Inventor
毕星
汪洋
杨浩
王剑
Original Assignee
北京达佳互联信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京达佳互联信息技术有限公司 filed Critical 北京达佳互联信息技术有限公司
Publication of WO2022042160A1 publication Critical patent/WO2022042160A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/04
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/18Eye characteristics, e.g. of the iris
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/64Computer-aided capture of images, e.g. transfer from script file into camera, check of taken image quality, advice or proposal for image composition or decision on when to take image

Definitions

  • the present disclosure relates to the field of computer technology, and in particular, to an image processing method and apparatus.
  • the center point of the part to be beauty makeup can be determined first, and then the center point of the part to be beauty makeup is positioned, and then the beauty treatment is performed. If the structure of the part to be beautified is complex, the found center point of the part to be beautified may be inaccurate, so that the cosmetic effect may be poor.
  • the present disclosure provides an image processing method, apparatus, electronic device and storage medium.
  • an image processing method comprising:
  • the grid structure of the target cosmetic part is obtained as the target grid structure
  • beauty makeup processing is performed on the beauty makeup part in the target image to obtain a beauty makeup image
  • the configuration file includes preset triangles in the mesh structure of the part to be beautified and coordinate values of vertices of the preset triangles, and the preset triangles include at least one first-type triangle, one first-type triangle
  • the vertex of the triangle includes two contour feature points of the part to be beautified and a first expansion point, and the first expansion point is a point set in advance according to the contour of the part to be beautified.
  • the grid structure of the target cosmetic part is obtained, including:
  • the coordinate value of the first type of extension point is calculated, wherein the first type of extension point is in the target mesh structure, and the point corresponding to the first extension point;
  • the target grid structure is obtained.
  • the target mesh structure includes at least one first target triangle, the first target triangle is in one-to-one correspondence with the first type of triangle, and the first type of triangle corresponds to the corresponding The first target triangles are similar; the first target triangles are in one-to-one correspondence with the first type extension points, and the first type extension points belong to the vertices of the corresponding first target triangles;
  • the coordinate value of the first-type extension point is calculated and obtained, including:
  • the coordinates of the first type of extension point are calculated and obtained value.
  • obtaining the target grid structure according to the target coordinate value and the coordinate value of the first type of extension point includes:
  • the coordinate value of the second type of extension point is calculated, wherein the second type of extension point is the target grid structure divided by the target Contour feature points of the part to be beautified and points other than the first type of extension points;
  • the target grid structure is obtained according to the target coordinate value, the coordinate value of the first type extension point and the coordinate value of the second type extension point.
  • the preset triangle further includes at least one triangle of the second type, wherein a vertex of a triangle of the second type includes a second extension point and two points in the target set, wherein the target set Including the contour feature point of the part to be beautified and the first expansion point, the second expansion point is a point set in advance according to the contour of the part to be beautified;
  • the target mesh structure also includes at least one second target triangle, the second target triangle is in one-to-one correspondence with the second type of triangle, and the second type of triangle is similar to its corresponding second target triangle , wherein the second target triangle is in one-to-one correspondence with the second type of extension point, and the second type of extension point belongs to the vertex of the corresponding second target triangle;
  • the calculation to obtain the coordinate value of the second type of expansion point including:
  • the coordinate value of the first type of extension point, the coordinate value of the vertex of the first type of triangle and The coordinate value of the vertex of the second type of triangle is calculated to obtain the coordinate value of the second type of extension point.
  • calculating the coordinate value of the second type of extension point according to the coordinate value of the first type of extension point and the target coordinate value including:
  • the coordinate value of the second type of expansion point is calculated according to the coordinate value of the first type of expansion point and the target coordinate value.
  • an image processing apparatus comprising:
  • an image acquisition module configured to acquire a target image including the target cosmetic part
  • a coordinate value acquisition module configured to acquire the coordinate value of the contour feature point of the target cosmetic part in the target image, as the target coordinate value
  • a grid structure acquisition module configured to obtain the grid structure of the target cosmetic part according to the target coordinate value and a predetermined configuration file, as the target grid structure
  • a drawing module configured to perform beauty makeup processing on the beautified part in the target image according to the target grid structure to obtain a beauty makeup image
  • the configuration file includes preset triangles in the mesh structure of the part to be makeup and coordinate values of vertices of the preset target triangles, and the preset triangles include at least one first-type triangle, one first-type triangle
  • the triangle-like vertex includes two contour feature points of the part to be beautified and a first extension point, and the first extension point is a point set in advance according to the contour of the part to be beautified.
  • the grid structure acquisition module includes:
  • the first extension point calculation sub-module is configured to calculate the coordinate value of the first type of extension point according to the target coordinate value and the coordinate value of the vertex of the first type of triangle, wherein the first type of extension point The point is the point corresponding to the first expansion point in the target grid structure;
  • the grid structure drawing sub-module is configured to obtain the target grid structure according to the target coordinate value and the coordinate value of the first-type extension point.
  • the target mesh structure includes at least one first target triangle, the first target triangle is in one-to-one correspondence with the first type of triangle, and the first type of triangle corresponds to the corresponding The first target triangles are similar; the first target triangles are in one-to-one correspondence with the first type extension points, and the first type extension points belong to the vertices of the corresponding first target triangles;
  • the first extension point calculation submodule is specifically configured as:
  • the coordinates of the first type of extension point are calculated and obtained value.
  • the grid structure drawing submodule includes:
  • the second extension point calculation unit is configured to calculate the coordinate value of the second type of extension point according to the coordinate value of the first type of extension point and the target coordinate value, wherein the second type of extension point is the Other points in the target grid structure except the contour feature points of the target beautified part and the first type of extension points;
  • the grid structure drawing unit is configured to obtain the target grid structure according to the target coordinate value, the coordinate value of the first type of extension point and the coordinate value of the second type of extension point.
  • the preset triangle further includes at least one triangle of the second type, wherein a vertex of a triangle of the second type includes a second extension point and two points in the target set, wherein the target set Including the contour feature point of the part to be beautified and the first expansion point, the second expansion point is a point set in advance according to the contour of the part to be beautified;
  • the target mesh structure also includes at least one second target triangle, the second target triangle is in one-to-one correspondence with the second type of triangle, and the second type of triangle is similar to its corresponding second target triangle , wherein the second target triangle is in one-to-one correspondence with the second type of extension point, and the second type of extension point belongs to the vertex of the corresponding second target triangle;
  • the second extension point calculation unit is specifically configured as:
  • the coordinate value of the first type of extension point, the coordinate value of the vertex of the first type of triangle and The coordinate value of the vertex of the second type of triangle is calculated to obtain the coordinate value of the second type of extension point.
  • the second extension point calculation submodule is specifically configured as:
  • the coordinate value of the second type of expansion point is calculated according to the coordinate value of the first type of expansion point and the target coordinate value.
  • an electronic device comprising:
  • a memory for storing the processor-executable instructions
  • processor is configured to execute the instructions to implement the following steps:
  • the grid structure of the target cosmetic part is obtained as the target grid structure
  • beauty makeup processing is performed on the beauty makeup part in the target image to obtain a beauty makeup image
  • the configuration file includes preset triangles in the mesh structure of the part to be beautified and coordinate values of vertices of the preset triangles, and the preset triangles include at least one first-type triangle, one first-type triangle
  • the vertex of the triangle includes two contour feature points of the part to be beautified and a first expansion point, and the first expansion point is a point set in advance according to the contour of the part to be beautified.
  • a storage medium is provided, and when the instructions in the storage medium are executed by a processor of an electronic device, the following steps are implemented:
  • the grid structure of the target cosmetic part is obtained as the target grid structure
  • beauty makeup processing is performed on the beauty makeup part in the target image to obtain a beauty makeup image
  • the configuration file includes preset triangles in the mesh structure of the part to be beautified and coordinate values of vertices of the preset triangles, and the preset triangles include at least one first-type triangle, one first-type triangle
  • the vertex of the triangle includes two contour feature points of the part to be beautified and a first expansion point, and the first expansion point is a point set in advance according to the contour of the part to be beautified.
  • a computer program product comprising instructions for implementing the following steps when the computer program product is run on a computer:
  • the grid structure of the target cosmetic part is obtained as the target grid structure
  • beauty makeup processing is performed on the beauty makeup part in the target image to obtain a beauty makeup image
  • the configuration file includes preset triangles in the mesh structure of the part to be beautified and coordinate values of vertices of the preset triangles, and the preset triangles include at least one first-type triangle, one first-type triangle
  • the vertex of the triangle includes two contour feature points of the part to be beautified and a first expansion point, and the first expansion point is a point set in advance according to the contour of the part to be beautified.
  • two contour feature points of the part to be beautified and a first extension point are used to form the first type of triangles, and they are used as the preset triangles in the mesh structure of the part to be beautified, so that these pre-made triangles are Set the coordinate value of the triangle to form a configuration file, and then use the configuration file and the coordinate value of the contour feature point of the target to be cosmetic part in the target image to calculate the target grid structure of the target to be cosmetic part, and then according to The target grid structure performs beauty processing on the target beauty makeup part to obtain a beauty makeup image.
  • the first extension points are manually set on the basis of the contour feature points of the part to be beautified, and the grid of the part to be beautified is constructed from these contour feature points and the first extension point.
  • Triangles in structure That is, in the embodiment of the present disclosure, based on the contour feature points of the cosmetic part, the grid structure of the cosmetic part is constructed in advance, that is, a grid structure matching the cosmetic part is constructed, that is, a configuration file is constructed, so that when the need arises, the grid structure is constructed.
  • the triangles in the configuration file can be directly used to generate a mesh structure matching the target cosmetic part.
  • the grid structure matching the part to be beautified can still be obtained according to the pre-determined configuration file. To a certain extent, it can improve the beauty effect of the target beautified part.
  • Fig. 1 is a schematic diagram of a beauty makeup process in the prior art
  • Fig. 2 is the process schematic diagram of creating extension point in the prior art
  • FIG. 3 is a schematic flowchart of generating a grid structure based on an original image in the prior art
  • Figure 4 is a schematic diagram of a texture material for eyelash effect
  • Fig. 5 is the Mesh structure corresponding to the texture material shown in Fig. 4;
  • FIG. 6 is a schematic diagram of the mapping between the texture material shown in FIG. 4 and the Mesh structure shown in FIG. 5;
  • FIG. 7 is a schematic diagram of the effect of drawing the texture material shown in FIG. 4 into the original camera image
  • FIG. 8 is a schematic flowchart of an image processing method provided by an embodiment of the present disclosure.
  • FIG. 9 is a schematic diagram of a first type of triangle included in a configuration file in an embodiment of the present disclosure.
  • FIG. 10 is a schematic diagram of the verification result of a first expansion point in the present disclosure when the eyes are in different states;
  • FIG. 11 is a schematic flowchart of another image processing method provided by an embodiment of the present disclosure.
  • Fig. 12 is the schematic diagram after adding the second expansion point in the first type triangle shown in Fig. 9;
  • FIG. 13 is a schematic flowchart of a specific implementation manner of an image processing method provided by an embodiment of the present disclosure
  • FIG. 14 is a schematic diagram of an AI recognition point of a face identified in the present disclosure.
  • Figure 15 is a schematic diagram of a grid structure constructed based on the AI recognition points shown in Figure 14;
  • 16 is a schematic diagram of the principle of checking an expansion point in the present disclosure.
  • FIG. 17 is a structural block diagram of an image processing apparatus provided by the present disclosure.
  • FIG. 19 is a structural block diagram of another electronic device provided by the present disclosure.
  • the so-called beauty special effects that is, the key points of the face are identified through the AI module, and then the pre-drawn beautification pictures are stretched according to the face structure, and then drawn to the original user's face.
  • beautifying the appearance of the face For example, draw eyelashes for users, modify lipstick color, etc.
  • the stretching rule has a great influence on the final effect of beauty makeup. It affects the authenticity and accuracy of beauty makeup, and is the most critical part of the entire function.
  • extension points which are then combined with AI points (ie, contour points of the part to be beautified) to form a complete set of detailed mesh structures (ie, Mesh structures).
  • AI points ie, contour points of the part to be beautified
  • mesh structures ie, Mesh structures
  • the above-mentioned extension point generation method is described.
  • a more conventional approach is to identify the AI point of the face for the original image; then, determine the center point of the face (or other specific organ); again, based on this center point, and then compare with the surrounding AI
  • the identification points are connected, and based on this connection, the extension points are extended outward for a certain distance or proportion, and then the expansion points are obtained; finally, after the AI identification points and the expansion points are connected into several adjacent triangles, the Mesh structure is obtained.
  • the center point can be calculated from multiple vertices.
  • the center point of the quadrilateral consisting of the top of the head, the chin, and the left and right ears can be used as the center point of the face, or the vertex representing the tip of the nose in the AI recognition points can be used as the center point of the face.
  • one is the raw image input from the camera.
  • the second is a pre-made placement image and its corresponding static triangular mesh.
  • the face in the image is first recognized by the AI module, and key points are marked in the key parts of the face.
  • key points can be called AI recognition points; and then based on AI recognition
  • a series of new extension key vertices are calculated through specific algorithm rules. In the case of having AI recognition points and extension points, they will be connected into several adjacent triangles, and these triangles will form a mesh structure.
  • the placement image contains the corresponding Mesh structure, which is pre-configured.
  • it is a texture material for eyelash effect.
  • it is the Mesh structure corresponding to the texture material shown in Figure 4.
  • the texture material will be drawn into the current camera input image according to the principle of one-to-one correspondence of triangles in the Mesh structure, that is, the image with the final effect shown in Figure 7 is obtained.
  • the image processing method in the embodiment of the present disclosure can be executed by the image processing apparatus provided in the embodiment of the present disclosure, and the apparatus can be configured in an electronic device.
  • an image processing method provided by an embodiment of the present disclosure is shown, and the image processing method may include the following steps:
  • Step 801 Acquire a target image including the target cosmetic part.
  • the target image may be a locally stored image, an image captured in real time by an electronic device, or one of the images in a locally stored video file, or one of the video files captured in real time by an electronic device. frame image.
  • Step 802 Acquire the coordinate values of the contour feature points of the target cosmetic part in the target image as the target coordinate values.
  • contour feature points are points located on the contour of the part to be beautified.
  • the image processing apparatus can first determine the coordinate value of the contour feature point located in the target beautified part in the target image, and then can use the coordinate value as the target coordinate value.
  • Step 803 According to the target coordinate value and the predetermined configuration file, obtain the grid structure of the target cosmetic part, which is used as the target grid structure.
  • the configuration file includes preset triangles in the mesh structure of the part to be beautified and coordinate values of vertices of the preset triangles, and the preset triangles include at least one first-type triangle, one first-type triangle
  • the vertex of the triangle includes two contour feature points of the part to be beautified and a first expansion point, and the first expansion point is a point set in advance according to the contour of the part to be beautified.
  • the configuration file includes multiple points, and the multiple points include contour feature points of the part to be beautified and manually set points (ie, extension points).
  • the first extension point in the configuration file for the eye may include points 91 to 910 as shown in FIG. 9
  • the contour feature points of the eye may include points 911 to 922 as shown in FIG. 9 .
  • the multiple points included in the configuration file form multiple triangles according to certain rules. The rules for forming triangles are predetermined. For example, the points 91 to 922 shown in FIG. 9 follow the rule that two contour feature points and an extension point form a triangle to obtain the triangle shown in FIG. 9 . That is, the triangle shown in FIG. 9 is the first type of triangle.
  • the configuration file is used as the basis for generating the grid structure in the process of beautifying the part to be beautified.
  • the image processing device first needs to acquire an image of the part to be beautified, and then detects the beauty of the part to be beautified in the image.
  • contour feature points and then select the points corresponding to the contour feature points included in the configuration file from these contour feature points as input parameters, and then use the input parameters and configuration files to calculate the extension points that constitute the grid structure, and then use the input parameters and configuration files. All contour feature points included in the parameters and all calculated expansion points are drawn into a grid structure.
  • the image processing device checks and calculates an extension point in the configuration file, which is Calculate the coordinates of the corresponding point in the target grid structure for this extension point in the configuration file.
  • the checking result of the first extension point is based on two contour feature points that belong to the same first type of triangle.
  • the contour feature points belong to the points on the part to be beautified, so the check result of the first expansion point is more matched with the part to be beautified, so that the final target grid result is more matched to the part to be beautified.
  • points A, B, and C are three points in the configuration file of the eyes, and these three points form a first-type triangle, where points A and B are two contour feature points respectively, Point C is the first extension point, A1 ⁇ and B1 ⁇ are two contour feature points in the image with the eyes open and inclined, C1 ⁇ is the check calculation of point C in the configuration file in the image with the eyes open and inclined Results; A2 ⁇ and B2 ⁇ are the two contour feature points in the image with the eyes closed and not tilted, C2 ⁇ is the check result of point C in the configuration file in the image with the eyes closed and not tilted.
  • a configuration file composed of a first-type triangle composed of two contour feature points and a first extension point can also be used to obtain a relatively stable grid under different states of the beautified part. structure.
  • Step 804 According to the target grid structure, perform beauty makeup processing on the beauty makeup part in the target image to obtain a beauty makeup image.
  • the image processing apparatus can use two contour feature points of the part to be beautified and a first extension point to form a first-type triangle, and use it as a triangle in the grid structure of the part to be beautified. Preset triangles, so that the coordinate values of these preset triangles form a configuration file, and then use the configuration file and the coordinate values of the contour feature points of the target cosmetic part in the target image to calculate and obtain the target cosmetic part.
  • the target grid structure is obtained, and then beauty makeup processing is performed on the target beauty makeup part to obtain a beauty makeup image.
  • the first extension points are manually set on the basis of the contour feature points of the part to be beautified, and the grid of the part to be beautified is constructed from these contour feature points and the first extension point.
  • Triangles in structure That is, in the embodiment of the present disclosure, based on the contour feature points of the cosmetic part, the grid structure of the cosmetic part is constructed in advance, that is, a grid structure matching the cosmetic part is constructed, that is, a configuration file is constructed, so that when the need arises, the grid structure is constructed.
  • the triangles in the configuration file can be directly used to generate a mesh structure matching the target cosmetic part.
  • the grid structure matching the part to be beautified can still be obtained according to the pre-determined configuration file. To a certain extent, it can improve the beauty effect of the target beautified part.
  • an image processing method provided by an embodiment of the present disclosure is shown, and the image processing method may include the following steps:
  • Step 1101 Acquire a target image including the target cosmetic part.
  • the target image may be a locally stored image, an image captured in real time by an electronic device, or one of the images in a locally stored video file, or one of the video files captured in real time by an electronic device. frame image.
  • Step 1102 Acquire the coordinate value of the contour feature point of the target cosmetic part in the target image as the target coordinate value.
  • contour feature points are points located on the contour of the part to be beautified.
  • Step 1103 Calculate the coordinate value of the first type of extension point according to the target coordinate value and the coordinate value of the vertex of the first type of triangle in the predetermined configuration file.
  • the first type of extension point is a point corresponding to the first extension point in the target grid structure
  • the target grid structure is the grid structure of the target cosmetic part.
  • Step 1104 Obtain the target grid structure according to the target coordinate value and the coordinate value of the first type of extension point.
  • a configuration file is pre-determined, and the configuration file includes a preset triangle in the mesh structure of the part to be beautified and the coordinate values of the vertices of the preset triangle, the preset triangle At least one triangle of the first type is included, and the vertex of a triangle of the first type includes two contour feature points of the part to be beautified and a first expansion point, and the first expansion point is pre-made according to the makeup. The point where the outline of the part is set.
  • the configuration file includes multiple points, and the multiple points include contour feature points of the part to be beautified and manually set points (ie, extension points).
  • the first extension point in the configuration file for the eye may include points 91 to 910 as shown in FIG. 9
  • the contour feature points of the eye may include points 911 to 922 as shown in FIG. 9 .
  • the multiple points included in the configuration file form multiple triangles according to certain rules. The rules for forming triangles are predetermined. For example, the points 91 to 922 shown in FIG. 9 follow the rule that two contour feature points and an extension point form a triangle to obtain the triangle shown in FIG. 9 . That is, the triangle shown in FIG. 9 is the first type of triangle.
  • the configuration file is used as the basis for generating the grid structure in the process of beautifying the part to be beautified.
  • the image processing device first needs to acquire the image of the part to be beautified, and then detects the part of the beautified part in the image. contour feature points, and then select the points corresponding to the contour feature points included in the configuration file from these contour feature points as input parameters, and then use the input parameters and configuration files to calculate the extension points that constitute the grid structure, and then use the input parameters and configuration files. All contour feature points included in the parameters and all calculated expansion points are drawn into a grid structure.
  • the points included in the configuration file have a one-to-one correspondence with the points in the target grid structure to be calculated, and then an extension point in the configuration file is checked and calculated, that is, the calculation configuration file The coordinates of the corresponding point in the target grid structure for this extension point in .
  • the verification result of the first extension point by the image processing apparatus is based on two contour feature points that belong to the same first type of triangle.
  • the contour feature points belong to the points on the part to be beautified, so the check result of the first expansion point is more matched with the part to be beautified, so that the final target grid result is more matched to the part to be beautified.
  • points A, B, and C are three points in the configuration file of the eyes, and these three points form a first-type triangle, where points A and B are two contour feature points respectively, Point C is the first extension point.
  • A1 ⁇ and B1 ⁇ are the two contour feature points in the open-eye and oblique image
  • C1 ⁇ is the verification result of point C in the configuration file in the open-eye and oblique image
  • A2 ⁇ and B2 ⁇ are Two contour feature points in an image with eyes closed and not tilted
  • C2' is the result of checking the point C in the configuration file in an image with eyes closed and not tilted.
  • a configuration file composed of a first-type triangle composed of two contour feature points and a first extension point can also be used to obtain a relatively stable grid under different states of the beautified part. structure.
  • the target mesh structure includes at least one first target triangle, the first target triangle is in one-to-one correspondence with the first type of triangle, and the first type of triangle corresponds to the corresponding The first target triangles are similar; the first target triangles are in one-to-one correspondence with the first type extension points, and the first type extension points belong to the vertices of the corresponding first target triangles;
  • the coordinate value of the first-type extension point is calculated and obtained, including:
  • the coordinates of the first type of extension point are calculated and obtained value.
  • the coordinate value of the unknown vertex of one triangle can be calculated.
  • the first type of triangle is similar to the first target triangle, and the vertices of the two are in one-to-one correspondence, that is, the two are similar and have a unique direction, so the calculated first expansion point is unique.
  • Step 1105 According to the target grid structure, perform beauty makeup processing on the beauty makeup part in the target image to obtain a beauty makeup image.
  • the image processing apparatus can manually set the first extension point on the basis of the contour feature points of the part to be beautified, and construct the beautified object from these contour feature points and the first extension point.
  • Triangles in the mesh structure of the site That is, in the embodiment of the present disclosure, based on the contour feature points of the cosmetic part, the grid structure of the cosmetic part is constructed in advance, that is, a grid structure matching the cosmetic part is constructed, that is, a configuration file is constructed, so that when the need arises, the grid structure is constructed.
  • the triangles in the configuration file can be directly used to generate a mesh structure matching the target cosmetic part.
  • the grid structure matching the part to be beautified can still be obtained according to the pre-determined configuration file. To a certain extent, it can improve the beauty effect of the target beautified part.
  • obtaining the target grid structure according to the target coordinate value and the coordinate value of the first type of extension point includes:
  • the coordinate value of the second type of extension point is calculated, wherein the second type of extension point is the target grid structure divided by the target The contour feature points of the part to be beautified and other points other than the first type of extension points;
  • the target grid structure is obtained according to the target coordinate value, the coordinate value of the first type extension point and the coordinate value of the second type extension point.
  • the image processing apparatus may continue to determine other extension points (ie, second extension points) after checking the first extension point in the configuration file, so that the obtained target grid The structure is closer to the shape and structure of the part to be beautified.
  • the preset triangle further includes at least one triangle of the second type, wherein a vertex of a triangle of the second type includes a second extension point and two points in the target set, wherein the target set Including the contour feature point of the part to be beautified and the first expansion point, the second expansion point is a point set in advance according to the contour of the part to be beautified;
  • the target mesh structure also includes at least one second target triangle, the second target triangle is in one-to-one correspondence with the second type of triangle, and the second type of triangle is similar to its corresponding second target triangle , wherein the second target triangle is in one-to-one correspondence with the second type of extension point, and the second type of extension point belongs to the vertex of the corresponding second target triangle;
  • the calculation to obtain the coordinate value of the second type of expansion point including:
  • the coordinate value of the first type of extension point, the coordinate value of the vertex of the first type of triangle and The coordinate value of the vertex of the second type of triangle is calculated to obtain the coordinate value of the second type of extension point.
  • the above configuration file may further include a second type of triangle formed by the contour feature point of the part to be beautified, two of the first extension points, and a second extension point. These second type of triangles are used to determine the second type of extension points in the target mesh structure described above.
  • the image processing device completes the checking and calculation of the first extension point in the configuration file and obtains the above-mentioned first type of extension point
  • the second type of triangle is similar to the second target triangle in the target mesh structure
  • the coordinate value of the unknown point can be obtained according to the coordinate value of the known point in the two triangles, that is, the coordinate value of the second type extension point can be calculated.
  • a second extension point may be further added.
  • a schematic diagram of each point included in the configuration file after adding the second extension point may be as shown in FIG. 12 .
  • the point 923 and the point 924 shown in FIG. 12 are two second extension points, then the points 924, 922, and 91 constitute a second-type triangle, and the points 923, 917, and 95 constitute a second-type triangle.
  • the grid structure formed by connecting the points in the configuration file shown in FIG. 12 can represent the open The grid structure of the image of the eye.
  • calculating the coordinate value of the second type of extension point according to the coordinate value of the first type of extension point and the target coordinate value including:
  • the coordinate value of the second type of expansion point is calculated according to the coordinate value of the first type of expansion point and the target coordinate value.
  • the image processing device can also obtain the first type of extension point in the target image according to the contour feature points of the part to be beautified in the target image, and
  • the first type of extension point uses smooth transition or differential interpolation to extend other points, thereby reducing the amount of computation and improving the processing speed.
  • the construction logic can be developed for a specific point through coding, the changes will be very flexible, and the performance of the performance is highly dependent on the code logic, which can achieve more peculiar and more natural effects.
  • this method has a large workload, and the effect is flexible but the production is not flexible.
  • this method can be mixed with the extension point generation scheme adopted in the embodiments of the present disclosure.
  • a configuration file is provided in advance, the configuration file and AI recognition points are used as input data, and extended point verification is performed through the similar triangle algorithm, and finally a complete face (or other specific organs) beauty makeup details structure is obtained picture.
  • This process needs to be calculated once for each frame of image.
  • the AI recognition points of the face are shown in Figure 14, and the grid structure of the face is shown in Figure 15.
  • the image processing device can define how many points exist in the final grid structure to be constructed in the entire face beauty makeup (or specific organ beauty makeup), wherein this step is based on the requirements of the usage scene, and there is no fixed rule;
  • the image processing apparatus can construct a configuration file, which contains the following three aspects of information: firstly, the relative position information of all points; secondly, a series of triangular structures composed of three points; thirdly, the The generation rule of the extension point of the grid structure.
  • This generation rule is determined by which triangle in the configuration file is matched with which two known points of the face (these two points are AI points or the extension points that have been calculated), you can An extension point of the grid structure to be constructed is calculated.
  • the image processing apparatus can perform operations by using the similar triangle algorithm according to the configuration file, and calculate the coordinate value of the extension point.
  • the algorithm will use 5 known points, three of which are the points in the aforementioned configuration file (usually two AI points, one extension point), here named A, B, C (that is, A and B are AI points, and C is an extension point).
  • the other two points are provided by the AI module, and their values are the values of screen coordinates, which are named A ⁇ and B ⁇ here.
  • a and A ⁇ , B and B ⁇ represent the same point.
  • the value of a point C ⁇ can be obtained through the knowledge of basic trigonometric functions, which satisfies ⁇ ABC ⁇ A ⁇ B ⁇ C ⁇ , where C ⁇ is an extension point of the grid structure to be constructed.
  • the image processing apparatus 170 may include:
  • the image acquisition module 1701 is configured to acquire a target image including the target cosmetic part
  • the coordinate value obtaining module 1702 is configured to obtain the coordinate value of the contour feature point of the target beautified part in the target image, as the target coordinate value;
  • the grid structure acquisition module 1703 is configured to obtain the grid structure of the target beautified part according to the target coordinate value and a predetermined configuration file, as the target grid structure;
  • the drawing module 1704 is configured to, according to the target grid structure, perform beauty makeup processing on the beautified part in the target image to obtain a beauty makeup image;
  • the configuration file includes preset triangles in the mesh structure of the part to be beautified and coordinate values of vertices of the preset triangles, and the preset triangles include at least one first-type triangle, one first-type triangle
  • the vertex of the triangle includes two contour feature points of the part to be beautified and a first expansion point, and the first expansion point is a point set in advance according to the contour of the part to be beautified.
  • the grid structure acquisition module 1703 includes:
  • the first expansion point calculation sub-module 17031 is configured to calculate the coordinate value of the first type of expansion point according to the target coordinate value and the coordinate value of the vertex of the first type of triangle, wherein the first type of expansion point
  • the expansion point is a point corresponding to the first expansion point in the target grid structure
  • the grid structure drawing sub-module 17032 is configured to obtain the target grid structure according to the target coordinate value and the coordinate value of the first-type extension point.
  • the target mesh structure includes at least one first target triangle, the first target triangle is in one-to-one correspondence with the first type of triangle, and the first type of triangle corresponds to the corresponding The first target triangles are similar; the first target triangles are in one-to-one correspondence with the first type extension points, and the first type extension points belong to the vertices of the corresponding first target triangles;
  • the first extension point calculation sub-module 17031 is specifically configured as:
  • the coordinates of the first type of extension point are calculated and obtained value.
  • the grid structure drawing sub-module 17032 includes:
  • the second extension point calculation unit 170321 is configured to calculate the coordinate value of the second type of extension point according to the coordinate value of the first type of extension point and the target coordinate value, wherein the second type of extension point is Other points in the target grid structure except the contour feature points of the part to be beautified in the target image and the extension points of the first type;
  • the grid structure drawing unit 170322 is configured to obtain the target grid structure according to the target coordinate value, the coordinate value of the first type of extension point and the coordinate value of the second type of extension point.
  • the preset triangle further includes at least one triangle of the second type, wherein a vertex of a triangle of the second type includes a second extension point and two points in the target set, wherein the target set Including the contour feature point of the part to be beautified and the first expansion point, the second expansion point is a point set in advance according to the contour of the part to be beautified;
  • the target mesh structure also includes at least one second target triangle, the second target triangle is in one-to-one correspondence with the second type of triangle, and the second type of triangle is similar to its corresponding second target triangle , wherein the second target triangle is in one-to-one correspondence with the second type of extension point, and the second type of extension point belongs to the vertex of the corresponding second target triangle;
  • the second extension point calculation unit 170321 is specifically configured as:
  • the coordinate value of the first type of extension point, the coordinate value of the vertex of the first type of triangle and The coordinate value of the vertex of the second type of triangle is calculated to obtain the coordinate value of the second type of extension point.
  • the second extension point calculation sub-module 17033 is specifically configured as:
  • the coordinate value of the second type of expansion point is calculated according to the coordinate value of the first type of expansion point and the target coordinate value.
  • two contour feature points of the part to be beautified and a first extension point are used to form the first type of triangle, and used as the target triangle in the mesh structure of the part to be beautified, so that The coordinate values of these target triangles are formed into a configuration file, and then the configuration file and the coordinate values of the contour feature points of the target beautified part in the target image are used to calculate the target grid structure of the target beautified part, Further, according to the target grid structure, beauty makeup processing is performed on the target beauty makeup part to obtain a beauty makeup image.
  • the first extension points are manually set on the basis of the contour feature points of the part to be beautified, and the grid of the part to be beautified is constructed from these contour feature points and the first extension point.
  • Triangles in structure That is, in the embodiment of the present disclosure, based on the contour feature points of the cosmetic part, the grid structure of the cosmetic part is constructed in advance, that is, a grid structure matching the cosmetic part is constructed, that is, a configuration file is constructed, so that when the need arises, the grid structure is constructed.
  • the triangles in the configuration file can be directly used to generate a mesh structure matching the target cosmetic part.
  • the grid structure matching the part to be beautified can still be obtained according to the pre-determined configuration file. To a certain extent, it can improve the beauty effect of the target beautified part.
  • Fig. 18 is a block diagram of an electronic device according to an exemplary embodiment. 18, the electronic device includes:
  • memory 1820 for storing instructions executable by the processor
  • the processor is configured to execute the instructions to implement the image processing method described above.
  • FIG. 19 is a block diagram of another electronic device 1900 according to an exemplary embodiment.
  • electronic device 1900 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, and the like.
  • an electronic device 1900 may include one or more of the following components: a processing component 1902, a memory 1904, a power supply component 1906, a multimedia component 1908, an audio component 1910, an input/output (I/O) interface 1912, a sensor component 1914 , and the communication component 1916.
  • the processing component 1902 generally controls the overall operation of the electronic device 1900, such as operations associated with display, phone calls, data communications, camera operations, and recording operations.
  • the processing component 1902 can include one or more processors 1920 to execute instructions to perform all or part of the steps of the methods described above.
  • processing component 1902 may include one or more modules that facilitate interaction between processing component 1902 and other components.
  • processing component 1902 may include a multimedia module to facilitate interaction between multimedia component 1908 and processing component 1902.
  • Memory 1904 is configured to store various types of data to support operation at electronic device 1900 . Examples of such data include instructions for any application or method operating on the electronic device 1900, contact data, phonebook data, messages, pictures, videos, and the like. Memory 1904 may be implemented by any type of volatile or non-volatile storage device or combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read only memory
  • EPROM erasable Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic or Optical Disk Magnetic Disk
  • Power supply assembly 1906 provides power to various components of electronic device 1900.
  • Power supply components 1906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 1900 .
  • Multimedia component 1908 includes a screen that provides an output interface between the electronic device 1900 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP).
  • the screen may be implemented as a touch screen to receive input signals from a user.
  • the touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action.
  • the multimedia component 1908 includes a front-facing camera and/or a rear-facing camera. When the electronic device 1900 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data.
  • Each of the front and rear cameras can be a fixed optical lens system or have focal length and optical zoom capability.
  • Audio component 1910 is configured to output and/or input audio signals.
  • audio component 1910 includes a microphone (MIC) that is configured to receive external audio signals when electronic device 1900 is in operational modes, such as call mode, recording mode, and voice recognition mode.
  • the received audio signal may be further stored in memory 1904 or transmitted via communication component 1916.
  • audio component 1910 also includes a speaker for outputting audio signals.
  • the I/O interface 1912 provides an interface between the processing component 1902 and peripheral interface modules, which may be keyboards, click wheels, buttons, and the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.
  • Sensor assembly 1914 includes one or more sensors for providing various aspects of status assessment for electronic device 1900 .
  • the sensor assembly 1914 can detect the on/off state of the electronic device 1900, the relative positioning of the components, such as the display and the keypad of the electronic device 1900, the sensor assembly 1914 can also detect the electronic device 1900 or one of the electronic device 1900 The location of components changes, the presence or absence of user contact with the electronic device 1900, the orientation or acceleration/deceleration of the electronic device 1900, and the temperature of the electronic device 1900 changes.
  • Sensor assembly 1914 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact.
  • Sensor assembly 1914 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor assembly 1914 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • Communication component 1916 is configured to facilitate wired or wireless communication between electronic device 1900 and other devices.
  • the electronic device 1900 may access wireless networks based on communication standards, such as WiFi, carrier networks (eg, 2G, 3G, 19G, or 5G), or a combination thereof.
  • the communication component 1916 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 1916 also includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • electronic device 1900 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A programmable gate array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components are implemented for performing the image processing method described above.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable A programmable gate array
  • controller a microcontroller, a microprocessor or other electronic components are implemented for performing the image processing method described above.
  • non-transitory computer-readable storage medium including instructions, such as memory 1904 including instructions, executable by the processor 1920 of the electronic device 1900 to accomplish the above method.
  • the storage medium may be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM , tapes, floppy disks and optical data storage devices.
  • an embodiment of the present disclosure further provides a storage medium, which enables the electronic device to execute the above-mentioned instructions when the instructions in the storage medium are executed by a processor of an electronic device. image processing method.
  • a computer program product including instructions, which enables the computer to implement the above-described image processing method when the computer program product runs on a computer.

Abstract

Embodiments of the present application provide an image processing method and apparatus, an electronic device, and a storage medium. The method comprises: obtaining a target image comprising a target part to be beautified; obtaining coordinate values, in the target image, of contour feature points of the target part to be beautified as target coordinate values; according to the target coordinate values and a predetermined configuration file, obtaining a grid structure of the target part to be beautified as a target grid structure; and according to the target grid structure, beautifying the target part to be beautified to obtain a beautified image.

Description

图像处理方法及装置Image processing method and device
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本公开要求2020年08月24日提交的,申请号为“202010859989.7”的中国专利申请的优先权。This disclosure claims the priority of the Chinese patent application with the application number "202010859989.7" filed on August 24, 2020.
技术领域technical field
本公开涉及计算机技术领域,尤其涉及一种图像处理方法及装置。The present disclosure relates to the field of computer technology, and in particular, to an image processing method and apparatus.
背景技术Background technique
伴随智能手机发展,手机运算拍照性能大幅提升。尤其是近年更先进的AI处理功能,使得手机终端可以进行实时运算,从而诞生了大批带有特效功能的摄像录像应用程序,进而可以实现多种特效功能,比如美妆特效等等。With the development of smart phones, the performance of mobile phone computing and photography has been greatly improved. Especially in recent years, the more advanced AI processing functions have enabled mobile terminals to perform real-time operations, resulting in the birth of a large number of camera and video recording applications with special effects functions, which can realize various special effects functions, such as beauty special effects and so on.
在相关技术中,为了实现美妆效果,可以先确定被美妆部位的中心点,之后对被美妆部位的中心点进行定位,进而再进行美妆处理。若被美妆部位的结构比较复杂,则寻找到的被美妆部位的中心点可能不准确,从而使得美妆效果可能不佳。In the related art, in order to achieve the beauty effect, the center point of the part to be beauty makeup can be determined first, and then the center point of the part to be beauty makeup is positioned, and then the beauty treatment is performed. If the structure of the part to be beautified is complex, the found center point of the part to be beautified may be inaccurate, so that the cosmetic effect may be poor.
由此,如何提高被美妆部位的美妆效果,成为目前亟待解决的问题。Therefore, how to improve the cosmetic effect of the part to be beautified has become an urgent problem to be solved at present.
发明内容SUMMARY OF THE INVENTION
本公开提供一种图像处理方法、装置、电子设备及存储介质。The present disclosure provides an image processing method, apparatus, electronic device and storage medium.
在一些实施例中,提供一种图像处理方法,包括:In some embodiments, an image processing method is provided, comprising:
获取包含目标被美妆部位的目标图像;Obtain the target image containing the target cosmetic part;
获取所述目标被美妆部位的轮廓特征点在所述目标图像中的坐标值,以作为目标坐标值;Obtain the coordinate value of the contour feature point of the target cosmetic part in the target image, as the target coordinate value;
根据所述目标坐标值,以及预先确定的配置文件,得到所述目标被美妆部位的网格结构,以作为目标网格结构;According to the target coordinate value and the predetermined configuration file, the grid structure of the target cosmetic part is obtained as the target grid structure;
根据所述目标网格结构,对所述目标图像中的被美妆部位进行美妆处理,得到美妆图像;According to the target grid structure, beauty makeup processing is performed on the beauty makeup part in the target image to obtain a beauty makeup image;
其中,所述配置文件中包括被美妆部位的网格结构中的预设三角形以及所述预设三角形的顶点的坐标值,所述预设三角形包括至少一个第一类三角形,一个第一类三角形的顶点包括两个所述被美妆部位的轮廓特征点和一个第一扩展点,所述第一扩展点为预先根据所述被美妆部位的轮廓设置的点。Wherein, the configuration file includes preset triangles in the mesh structure of the part to be beautified and coordinate values of vertices of the preset triangles, and the preset triangles include at least one first-type triangle, one first-type triangle The vertex of the triangle includes two contour feature points of the part to be beautified and a first expansion point, and the first expansion point is a point set in advance according to the contour of the part to be beautified.
在一些实施例中,所述根据所述目标坐标值,以及预先确定的配置文件,得到所述目标被美妆部位的网格结构,包括:In some embodiments, according to the target coordinate value and a predetermined configuration file, the grid structure of the target cosmetic part is obtained, including:
根据所述目标坐标值,以及所述第一类三角形的顶点的坐标值,计算得到第一类扩展点的坐标值,其中,所述第一类扩展点为所述目标网格结构中,与所述第一扩展点对应的点;According to the target coordinate value and the coordinate value of the vertex of the first type of triangle, the coordinate value of the first type of extension point is calculated, wherein the first type of extension point is in the target mesh structure, and the point corresponding to the first extension point;
根据所述目标坐标值和所述第一类扩展点的坐标值,得到所述目标网格结构。According to the target coordinate value and the coordinate value of the first type of extension point, the target grid structure is obtained.
在一些实施例中,所述目标网格结构中包括至少一个第一目标三角形,所述第一目标三角形与所述第一类三角形一一对应,且所述第一类三角形与其对应的所述第一目标三角形相似;所述第一目标三角形与所述第一类扩展点一一对应,且所述第一类扩展点属于与其对应的第一目标三角形的顶点;In some embodiments, the target mesh structure includes at least one first target triangle, the first target triangle is in one-to-one correspondence with the first type of triangle, and the first type of triangle corresponds to the corresponding The first target triangles are similar; the first target triangles are in one-to-one correspondence with the first type extension points, and the first type extension points belong to the vertices of the corresponding first target triangles;
所述根据所述目标坐标值,以及所述第一类三角形的顶点的坐标值,计算得到第一类扩展点的坐标值,包括:According to the target coordinate value and the coordinate value of the vertex of the first-type triangle, the coordinate value of the first-type extension point is calculated and obtained, including:
根据所述第一类三角形与其对应的所述第一目标三角形的相似关系,以及所述目标坐标值和所述第一类三角形的顶点的坐标值,计算得到所述第一类扩展点的坐标值。According to the similarity relationship between the first type of triangle and its corresponding first target triangle, as well as the target coordinate value and the coordinate value of the vertex of the first type of triangle, the coordinates of the first type of extension point are calculated and obtained value.
在一些实施例中,所述根据所述目标坐标值和所述第一类扩展点的坐标值,得到所述目标网格结构,包括:In some embodiments, obtaining the target grid structure according to the target coordinate value and the coordinate value of the first type of extension point includes:
根据所述第一类扩展点的坐标值和所述目标坐标值,计算得到第二类扩展点的坐标值,其中,所 述第二类扩展点为所述目标网格结构中除所述目标被美妆部位的轮廓特征点以及所述第一类扩展点之外的其他点;According to the coordinate value of the first type of extension point and the target coordinate value, the coordinate value of the second type of extension point is calculated, wherein the second type of extension point is the target grid structure divided by the target Contour feature points of the part to be beautified and points other than the first type of extension points;
根据所述目标坐标值、所述第一类扩展点的坐标值和所述第二类扩展点的坐标值,得到所述目标网格结构。The target grid structure is obtained according to the target coordinate value, the coordinate value of the first type extension point and the coordinate value of the second type extension point.
在一些实施例中,所述预设三角形还包括至少一个第二类三角形,其中,一个第二类三角形的顶点包括一个第二扩展点和目标集合中的其中两个点,所述目标集合中包括所述被美妆部位的轮廓特征点以及所述第一扩展点,所述第二扩展点为预先根据所述被美妆部位的轮廓设置的点;In some embodiments, the preset triangle further includes at least one triangle of the second type, wherein a vertex of a triangle of the second type includes a second extension point and two points in the target set, wherein the target set Including the contour feature point of the part to be beautified and the first expansion point, the second expansion point is a point set in advance according to the contour of the part to be beautified;
所述目标网格结构中还包括至少一个第二目标三角形,所述第二目标三角形与所述第二类三角形一一对应,且所述第二类三角形与其对应的所述第二目标三角形相似,其中,所述第二目标三角形与所述第二类扩展点一一对应,且所述第二类扩展点属于与其对应的第二目标三角形的顶点;The target mesh structure also includes at least one second target triangle, the second target triangle is in one-to-one correspondence with the second type of triangle, and the second type of triangle is similar to its corresponding second target triangle , wherein the second target triangle is in one-to-one correspondence with the second type of extension point, and the second type of extension point belongs to the vertex of the corresponding second target triangle;
所述根据所述第一类扩展点的坐标值和所述目标坐标值,计算得到第二类扩展点的坐标值,包括:According to the coordinate value of the first type of expansion point and the target coordinate value, the calculation to obtain the coordinate value of the second type of expansion point, including:
根据所述第二类三角形与其对应的所述第二目标三角形的相似关系,以及所述目标坐标值、所述第一类扩展点的坐标值、所述第一类三角形的顶点的坐标值以及所述第二类三角形的顶点的坐标值,计算得到所述第二类扩展点的坐标值。According to the similarity relationship between the second type of triangle and its corresponding second target triangle, and the target coordinate value, the coordinate value of the first type of extension point, the coordinate value of the vertex of the first type of triangle and The coordinate value of the vertex of the second type of triangle is calculated to obtain the coordinate value of the second type of extension point.
在一些实施例中,所述根据所述第一类扩展点的坐标值和所述目标坐标值,计算得到第二类扩展点的坐标值,包括:In some embodiments, calculating the coordinate value of the second type of extension point according to the coordinate value of the first type of extension point and the target coordinate value, including:
采用平滑过渡或插值方法,根据所述第一类扩展点的坐标值和所述目标坐标值,计算得到第二类扩展点的坐标值。Using a smooth transition or interpolation method, the coordinate value of the second type of expansion point is calculated according to the coordinate value of the first type of expansion point and the target coordinate value.
在一些实施例中,提供一种图像处理装置,包括:In some embodiments, an image processing apparatus is provided, comprising:
图像获取模块,被配置为获取包含目标被美妆部位的目标图像;an image acquisition module, configured to acquire a target image including the target cosmetic part;
坐标值获取模块,被配置为获取所述目标被美妆部位的轮廓特征点在所述目标图像中的坐标值,以作为目标坐标值;A coordinate value acquisition module, configured to acquire the coordinate value of the contour feature point of the target cosmetic part in the target image, as the target coordinate value;
网格结构获取模块,被配置为根据所述目标坐标值,以及预先确定的配置文件,得到所述目标被美妆部位的网格结构,以作为目标网格结构;a grid structure acquisition module, configured to obtain the grid structure of the target cosmetic part according to the target coordinate value and a predetermined configuration file, as the target grid structure;
绘制模块,被配置为根据所述目标网格结构,对所述目标图像中的被美妆部位进行美妆处理,得到美妆图像;a drawing module, configured to perform beauty makeup processing on the beautified part in the target image according to the target grid structure to obtain a beauty makeup image;
其中,所述配置文件中包括被美妆部位的网格结构中的预设三角形以及所述预设标三角形的顶点的坐标值,所述预设三角形包括至少一个第一类三角形,一个第一类三角形的顶点包括两个所述被美妆部位的轮廓特征点和一个第一扩展点,所述第一扩展点为预先根据所述被美妆部位的轮廓设置的点。Wherein, the configuration file includes preset triangles in the mesh structure of the part to be makeup and coordinate values of vertices of the preset target triangles, and the preset triangles include at least one first-type triangle, one first-type triangle The triangle-like vertex includes two contour feature points of the part to be beautified and a first extension point, and the first extension point is a point set in advance according to the contour of the part to be beautified.
在一些实施例中,所述网格结构获取模块包括:In some embodiments, the grid structure acquisition module includes:
第一扩展点计算子模块,被配置为根据所述目标坐标值,以及所述第一类三角形的顶点的坐标值,计算得到第一类扩展点的坐标值,其中,所述第一类扩展点为所述目标网格结构中,与所述第一扩展点对应的点;The first extension point calculation sub-module is configured to calculate the coordinate value of the first type of extension point according to the target coordinate value and the coordinate value of the vertex of the first type of triangle, wherein the first type of extension point The point is the point corresponding to the first expansion point in the target grid structure;
网格结构绘制子模块,被配置为根据所述目标坐标值和所述第一类扩展点的坐标值,得到所述目标网格结构。The grid structure drawing sub-module is configured to obtain the target grid structure according to the target coordinate value and the coordinate value of the first-type extension point.
在一些实施例中,所述目标网格结构中包括至少一个第一目标三角形,所述第一目标三角形与所述第一类三角形一一对应,且所述第一类三角形与其对应的所述第一目标三角形相似;所述第一目标三角形与所述第一类扩展点一一对应,且所述第一类扩展点属于与其对应的第一目标三角形的顶点;In some embodiments, the target mesh structure includes at least one first target triangle, the first target triangle is in one-to-one correspondence with the first type of triangle, and the first type of triangle corresponds to the corresponding The first target triangles are similar; the first target triangles are in one-to-one correspondence with the first type extension points, and the first type extension points belong to the vertices of the corresponding first target triangles;
所述第一扩展点计算子模块具体被配置为:The first extension point calculation submodule is specifically configured as:
根据所述第一类三角形与其对应的所述第一目标三角形的相似关系,以及所述目标坐标值和所述第一类三角形的顶点的坐标值,计算得到所述第一类扩展点的坐标值。According to the similarity relationship between the first type of triangle and its corresponding first target triangle, as well as the target coordinate value and the coordinate value of the vertex of the first type of triangle, the coordinates of the first type of extension point are calculated and obtained value.
在一些实施例中,所述网格结构绘制子模块包括:In some embodiments, the grid structure drawing submodule includes:
第二扩展点计算单元,被配置为根据所述第一类扩展点的坐标值和所述目标坐标值,计算得到第二类扩展点的坐标值,其中,所述第二类扩展点为所述目标网格结构中除所述目标被美妆部位的轮廓特征点以及所述第一类扩展点之外的其他点;The second extension point calculation unit is configured to calculate the coordinate value of the second type of extension point according to the coordinate value of the first type of extension point and the target coordinate value, wherein the second type of extension point is the Other points in the target grid structure except the contour feature points of the target beautified part and the first type of extension points;
网格结构绘制单元,被配置为根据所述目标坐标值、所述第一类扩展点的坐标值和所述第二类扩展点的坐标值,得到所述目标网格结构。The grid structure drawing unit is configured to obtain the target grid structure according to the target coordinate value, the coordinate value of the first type of extension point and the coordinate value of the second type of extension point.
在一些实施例中,所述预设三角形还包括至少一个第二类三角形,其中,一个第二类三角形的顶点包括一个第二扩展点和目标集合中的其中两个点,所述目标集合中包括所述被美妆部位的轮廓特征点以及所述第一扩展点,所述第二扩展点为预先根据所述被美妆部位的轮廓设置的点;In some embodiments, the preset triangle further includes at least one triangle of the second type, wherein a vertex of a triangle of the second type includes a second extension point and two points in the target set, wherein the target set Including the contour feature point of the part to be beautified and the first expansion point, the second expansion point is a point set in advance according to the contour of the part to be beautified;
所述目标网格结构中还包括至少一个第二目标三角形,所述第二目标三角形与所述第二类三角形一一对应,且所述第二类三角形与其对应的所述第二目标三角形相似,其中,所述第二目标三角形与所述第二类扩展点一一对应,且所述第二类扩展点属于与其对应的第二目标三角形的顶点;The target mesh structure also includes at least one second target triangle, the second target triangle is in one-to-one correspondence with the second type of triangle, and the second type of triangle is similar to its corresponding second target triangle , wherein the second target triangle is in one-to-one correspondence with the second type of extension point, and the second type of extension point belongs to the vertex of the corresponding second target triangle;
所述第二扩展点计算单元具体被配置为:The second extension point calculation unit is specifically configured as:
根据所述第二类三角形与其对应的所述第二目标三角形的相似关系,以及所述目标坐标值、所述第一类扩展点的坐标值、所述第一类三角形的顶点的坐标值以及所述第二类三角形的顶点的坐标值,计算得到所述第二类扩展点的坐标值。According to the similarity relationship between the second type of triangle and its corresponding second target triangle, and the target coordinate value, the coordinate value of the first type of extension point, the coordinate value of the vertex of the first type of triangle and The coordinate value of the vertex of the second type of triangle is calculated to obtain the coordinate value of the second type of extension point.
在一些实施例中,所述第二扩展点计算子模块具体被配置为:In some embodiments, the second extension point calculation submodule is specifically configured as:
采用平滑过渡或插值方法,根据所述第一类扩展点的坐标值和所述目标坐标值,计算得到第二类扩展点的坐标值。Using a smooth transition or interpolation method, the coordinate value of the second type of expansion point is calculated according to the coordinate value of the first type of expansion point and the target coordinate value.
在一些实施例中,提供了一种电子设备,包括:In some embodiments, an electronic device is provided, comprising:
处理器;processor;
用于存储所述处理器可执行指令的存储器;a memory for storing the processor-executable instructions;
其中,所述处理器被配置为执行所述指令,实现以下步骤:Wherein, the processor is configured to execute the instructions to implement the following steps:
获取包含目标被美妆部位的目标图像;Obtain the target image containing the target cosmetic part;
获取所述目标被美妆部位的轮廓特征点在所述目标图像中的坐标值,以作为目标坐标值;Obtain the coordinate value of the contour feature point of the target cosmetic part in the target image, as the target coordinate value;
根据所述目标坐标值,以及预先确定的配置文件,得到所述目标被美妆部位的网格结构,以作为目标网格结构;According to the target coordinate value and the predetermined configuration file, the grid structure of the target cosmetic part is obtained as the target grid structure;
根据所述目标网格结构,对所述目标图像中的被美妆部位进行美妆处理,得到美妆图像;According to the target grid structure, beauty makeup processing is performed on the beauty makeup part in the target image to obtain a beauty makeup image;
其中,所述配置文件中包括被美妆部位的网格结构中的预设三角形以及所述预设三角形的顶点的坐标值,所述预设三角形包括至少一个第一类三角形,一个第一类三角形的顶点包括两个所述被美妆部位的轮廓特征点和一个第一扩展点,所述第一扩展点为预先根据所述被美妆部位的轮廓设置的点。Wherein, the configuration file includes preset triangles in the mesh structure of the part to be beautified and coordinate values of vertices of the preset triangles, and the preset triangles include at least one first-type triangle, one first-type triangle The vertex of the triangle includes two contour feature points of the part to be beautified and a first expansion point, and the first expansion point is a point set in advance according to the contour of the part to be beautified.
在一些实施例中,提供一种存储介质,在所述存储介质中的指令由电子设备的处理器执行的情况下,实现以下步骤:In some embodiments, a storage medium is provided, and when the instructions in the storage medium are executed by a processor of an electronic device, the following steps are implemented:
获取包含目标被美妆部位的目标图像;Obtain the target image containing the target cosmetic part;
获取所述目标被美妆部位的轮廓特征点在所述目标图像中的坐标值,以作为目标坐标值;Obtain the coordinate value of the contour feature point of the target cosmetic part in the target image, as the target coordinate value;
根据所述目标坐标值,以及预先确定的配置文件,得到所述目标被美妆部位的网格结构,以作为目标网格结构;According to the target coordinate value and the predetermined configuration file, the grid structure of the target cosmetic part is obtained as the target grid structure;
根据所述目标网格结构,对所述目标图像中的被美妆部位进行美妆处理,得到美妆图像;According to the target grid structure, beauty makeup processing is performed on the beauty makeup part in the target image to obtain a beauty makeup image;
其中,所述配置文件中包括被美妆部位的网格结构中的预设三角形以及所述预设三角形的顶点的坐标值,所述预设三角形包括至少一个第一类三角形,一个第一类三角形的顶点包括两个所述被美妆部位的轮廓特征点和一个第一扩展点,所述第一扩展点为预先根据所述被美妆部位的轮廓设置的点。Wherein, the configuration file includes preset triangles in the mesh structure of the part to be beautified and coordinate values of vertices of the preset triangles, and the preset triangles include at least one first-type triangle, one first-type triangle The vertex of the triangle includes two contour feature points of the part to be beautified and a first expansion point, and the first expansion point is a point set in advance according to the contour of the part to be beautified.
在一些实施例中,提供了一种包含指令的计算机程序产品,在所述计算机程序产品在计算机上运行的情况下,实现以下步骤:In some embodiments, there is provided a computer program product comprising instructions for implementing the following steps when the computer program product is run on a computer:
获取包含目标被美妆部位的目标图像;Obtain the target image containing the target cosmetic part;
获取所述目标被美妆部位的轮廓特征点在所述目标图像中的坐标值,以作为目标坐标值;Obtain the coordinate value of the contour feature point of the target cosmetic part in the target image, as the target coordinate value;
根据所述目标坐标值,以及预先确定的配置文件,得到所述目标被美妆部位的网格结构,以作为目标网格结构;According to the target coordinate value and the predetermined configuration file, the grid structure of the target cosmetic part is obtained as the target grid structure;
根据所述目标网格结构,对所述目标图像中的被美妆部位进行美妆处理,得到美妆图像;According to the target grid structure, beauty makeup processing is performed on the beauty makeup part in the target image to obtain a beauty makeup image;
其中,所述配置文件中包括被美妆部位的网格结构中的预设三角形以及所述预设三角形的顶点的 坐标值,所述预设三角形包括至少一个第一类三角形,一个第一类三角形的顶点包括两个所述被美妆部位的轮廓特征点和一个第一扩展点,所述第一扩展点为预先根据所述被美妆部位的轮廓设置的点。Wherein, the configuration file includes preset triangles in the mesh structure of the part to be beautified and coordinate values of vertices of the preset triangles, and the preset triangles include at least one first-type triangle, one first-type triangle The vertex of the triangle includes two contour feature points of the part to be beautified and a first expansion point, and the first expansion point is a point set in advance according to the contour of the part to be beautified.
本公开的实施例,预先采用两个被美妆部位的轮廓特征点和一个第一扩展点组成第一类三角形,并作为被美妆部位的网格结构中的预设三角形,从而将这些预设三角形的坐标值构成一个配置文件,进而利用该配置文件,以及目标被美妆部位的轮廓特征点在目标图像中的坐标值,计算获得该目标被美妆部位的目标网格结构,进而根据该目标网格结构对目标被美妆部位进行美妆处理,得到美妆图像。In the embodiment of the present disclosure, two contour feature points of the part to be beautified and a first extension point are used to form the first type of triangles, and they are used as the preset triangles in the mesh structure of the part to be beautified, so that these pre-made triangles are Set the coordinate value of the triangle to form a configuration file, and then use the configuration file and the coordinate value of the contour feature point of the target to be cosmetic part in the target image to calculate the target grid structure of the target to be cosmetic part, and then according to The target grid structure performs beauty processing on the target beauty makeup part to obtain a beauty makeup image.
由此可知,本公开的实施例,预先在被美妆部位的轮廓特征点的基础上,人工设置第一扩展点,并由这些轮廓特征点和第一扩展点构建被美妆部位的网格结构中的三角形。即本公开的实施例会预先基于被美妆部位的轮廓特征点,构建被美妆部位的网格结构,即构建一个与被美妆部位匹配的网格结构,亦即构建配置文件,从而在需要对包含目标被美妆部位的目标图像进行处理时,可以直接利用该配置文件中的三角形,来生成与目标被美妆部位匹配的网格结构。而不需要定位被美妆部位的中心点,所以即使目标被美妆部位的AI点未呈放射,仍然能够根据预先确定的配置文件,得到与目标被美妆部位匹配的网格结构,从而在一定程度上提升对目标被美妆部位的美妆效果。It can be seen from this that in the embodiment of the present disclosure, the first extension points are manually set on the basis of the contour feature points of the part to be beautified, and the grid of the part to be beautified is constructed from these contour feature points and the first extension point. Triangles in structure. That is, in the embodiment of the present disclosure, based on the contour feature points of the cosmetic part, the grid structure of the cosmetic part is constructed in advance, that is, a grid structure matching the cosmetic part is constructed, that is, a configuration file is constructed, so that when the need arises, the grid structure is constructed. When processing the target image including the target cosmetic part, the triangles in the configuration file can be directly used to generate a mesh structure matching the target cosmetic part. There is no need to locate the center point of the part to be beautified, so even if the AI point of the part to be beautified is not radiated, the grid structure matching the part to be beautified can still be obtained according to the pre-determined configuration file. To a certain extent, it can improve the beauty effect of the target beautified part.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.
附图说明Description of drawings
图1是现有技术中的美妆流程示意图;Fig. 1 is a schematic diagram of a beauty makeup process in the prior art;
图2是现有技术中创建扩展点的过程示意图;Fig. 2 is the process schematic diagram of creating extension point in the prior art;
图3是现有技术中基于原始图像生成网格结构的流程示意图;3 is a schematic flowchart of generating a grid structure based on an original image in the prior art;
图4是眼部睫毛效果的贴图素材示意图;Figure 4 is a schematic diagram of a texture material for eyelash effect;
图5是图4所示的贴图素材对应的Mesh结构;Fig. 5 is the Mesh structure corresponding to the texture material shown in Fig. 4;
图6是图4所示的贴图素材与图5所示的Mesh结构映射示意图;FIG. 6 is a schematic diagram of the mapping between the texture material shown in FIG. 4 and the Mesh structure shown in FIG. 5;
图7是将图4所示的贴图素材绘制到原始相机图像中的效果示意图;FIG. 7 is a schematic diagram of the effect of drawing the texture material shown in FIG. 4 into the original camera image;
图8是本公开实施例提供的一种图像处理方法的流程示意图;8 is a schematic flowchart of an image processing method provided by an embodiment of the present disclosure;
图9是本公开实施例中配置文件中包括的第一类三角形的示意图;9 is a schematic diagram of a first type of triangle included in a configuration file in an embodiment of the present disclosure;
图10是本公开中一个第一扩展点在眼睛处于不同状态下的验算结果示意图;10 is a schematic diagram of the verification result of a first expansion point in the present disclosure when the eyes are in different states;
图11是本公开实施例提供的另一种图像处理方法的流程示意图;11 is a schematic flowchart of another image processing method provided by an embodiment of the present disclosure;
图12是在图9所示的第一类三角形中增加第二扩展点后的示意图;Fig. 12 is the schematic diagram after adding the second expansion point in the first type triangle shown in Fig. 9;
图13是本公开实施例提供的图像处理方法的具体实施方式的流程示意图;13 is a schematic flowchart of a specific implementation manner of an image processing method provided by an embodiment of the present disclosure;
图14是本公开中识别出的人脸的AI识别点的示意图;14 is a schematic diagram of an AI recognition point of a face identified in the present disclosure;
图15是基于图14所示的AI识别点构建的网格结构示意图;Figure 15 is a schematic diagram of a grid structure constructed based on the AI recognition points shown in Figure 14;
图16是本公开中验算一个扩展点的原理示意图;16 is a schematic diagram of the principle of checking an expansion point in the present disclosure;
图17是本公开提供的一种图像处理装置的结构框图;17 is a structural block diagram of an image processing apparatus provided by the present disclosure;
图18是本公开提供的一种电子设备的结构框图;18 is a structural block diagram of an electronic device provided by the present disclosure;
图19是本公开提供的另一种电子设备的结构框图。FIG. 19 is a structural block diagram of another electronic device provided by the present disclosure.
具体实施方式detailed description
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. Where the following description refers to the drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the illustrative examples below are not intended to represent all implementations consistent with this disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as recited in the appended claims.
如图1所示,所谓美妆特效,即通过AI模块识别人脸关键点,再将预先绘制好的美化图片按人脸结构进行相应幅度的拉伸,进而绘制到原有的用户的脸部,以达到美化人脸外观的目的。例如为用户绘制睫毛,修改口红颜色等。其中拉伸规则对美妆的最终效果表现影响极大,它影响了美妆的真实感和准确性,是整个功能中最关键的一环。As shown in Figure 1, the so-called beauty special effects, that is, the key points of the face are identified through the AI module, and then the pre-drawn beautification pictures are stretched according to the face structure, and then drawn to the original user's face. , in order to achieve the purpose of beautifying the appearance of the face. For example, draw eyelashes for users, modify lipstick color, etc. Among them, the stretching rule has a great influence on the final effect of beauty makeup. It affects the authenticity and accuracy of beauty makeup, and is the most critical part of the entire function.
其中,关于构建拉伸规则,通常采用的是创建扩展点,使其再与AI点(即被美妆部位的轮廓点)组合形成一整套详细网格结构(即Mesh结构)。Among them, regarding the construction of stretching rules, it is usually used to create extension points, which are then combined with AI points (ie, contour points of the part to be beautified) to form a complete set of detailed mesh structures (ie, Mesh structures).
在现有技术中,关于上述扩展点的生成方法。如图2所示,比较常规的做法是:针对原始图像识别脸部的AI点;然后,确定脸部(或其他特定一个器官)的中心点;再次,基于此中心点,再与四周的AI识别点进行连线,基于此连线向外延伸一段距离或比例,进而得到扩展点;最后,再将AI识别点与扩展点后,连接为若干个相邻的三角形,从而得到Mesh结构。其中,中心点可以通过多个顶点计算得到。例如可以采用头顶、下巴、左右耳朵组成的四边形的中心点作为脸部的中心点,也可以使用AI识别点中表示鼻尖的顶点作为脸部的中心点。In the prior art, the above-mentioned extension point generation method is described. As shown in Figure 2, a more conventional approach is to identify the AI point of the face for the original image; then, determine the center point of the face (or other specific organ); again, based on this center point, and then compare with the surrounding AI The identification points are connected, and based on this connection, the extension points are extended outward for a certain distance or proportion, and then the expansion points are obtained; finally, after the AI identification points and the expansion points are connected into several adjacent triangles, the Mesh structure is obtained. Among them, the center point can be calculated from multiple vertices. For example, the center point of the quadrilateral consisting of the top of the head, the chin, and the left and right ears can be used as the center point of the face, or the vertex representing the tip of the nose in the AI recognition points can be used as the center point of the face.
然而,对于复杂器官,所有的扩展点不一定呈现出放射状,此时寻找中心点比较困难。虽然可以通过选取多个中心点进行分别扩展,但是又可能导致Mesh网格重叠等问题,弊端比较多。However, for complex organs, all extension points do not necessarily appear radial, and it is difficult to find the center point at this time. Although it can be expanded separately by selecting multiple center points, it may cause problems such as overlapping of Mesh meshes, and there are many disadvantages.
由此可见,在被美妆部位的结构比较复杂的情况下,并不是所有AI点都呈现放射状,使得寻找到的被美妆部位的中心点不准确,导致得到的Mesh结构与被美妆部位不匹配,从而使得美妆效果不佳。It can be seen that when the structure of the part to be beautified is complex, not all AI points are radial, which makes the center point of the part to be beautified inaccurate, resulting in the obtained mesh structure and the part to be beautified. mismatch, resulting in poor cosmetic results.
为了更加便于理解本公开实施例的图像处理方法及装置,首先对进行美妆的流程进行如下说明:In order to make it easier to understand the image processing method and device of the embodiments of the present disclosure, the process of performing beauty makeup is first described as follows:
要完成美妆功能,需要两部分输入数据:其一是相机输入原始图像。其二预先制作好的贴装图片以及其对应的静态三角形网格。To complete the beauty function, two parts of input data are required: one is the raw image input from the camera. The second is a pre-made placement image and its corresponding static triangular mesh.
如图3所示,针对相机输入图像,首先通过AI模块识别出图像中的人脸,并在人脸关键部位标记出关键点,此种关键点可称为AI识别点;而后再基于AI识别点,通过特定的算法规则,计算出一系列新的扩展关键顶点(即为扩展点)。在拥有AI识别点与扩展点的情况下,会将其连接为若干个相邻的三角形,这些三角形则组成网格(Mesh)结构。As shown in Figure 3, for the input image of the camera, the face in the image is first recognized by the AI module, and key points are marked in the key parts of the face. Such key points can be called AI recognition points; and then based on AI recognition A series of new extension key vertices (that is, extension points) are calculated through specific algorithm rules. In the case of having AI recognition points and extension points, they will be connected into several adjacent triangles, and these triangles will form a mesh structure.
对于贴装图片,其包含了对应的Mesh结构,此Mesh结构是预先配置的。如图4所示,是一个眼部睫毛效果的贴图素材,如图5所示,为图4所示的贴图素材对应的Mesh结构。其中,如图6所示,会将贴图素材,按照Mesh结构中的三角形一一对应的原则,绘制到当前相机输入图像中,即得到如图7中所示的最终效果的图像。For the placement image, it contains the corresponding Mesh structure, which is pre-configured. As shown in Figure 4, it is a texture material for eyelash effect. As shown in Figure 5, it is the Mesh structure corresponding to the texture material shown in Figure 4. Among them, as shown in Figure 6, the texture material will be drawn into the current camera input image according to the principle of one-to-one correspondence of triangles in the Mesh structure, that is, the image with the final effect shown in Figure 7 is obtained.
可以理解的是,本公开实施例的图像处理方法,可由本公开实施例提供的图像处理装置执行,该装置可配置于电子设备中。It can be understood that, the image processing method in the embodiment of the present disclosure can be executed by the image processing apparatus provided in the embodiment of the present disclosure, and the apparatus can be configured in an electronic device.
参照图8,示出了本公开实施例提供的一种图像处理方法,该图像处理方法可以包括以下步骤:Referring to FIG. 8, an image processing method provided by an embodiment of the present disclosure is shown, and the image processing method may include the following steps:
步骤801:获取包含目标被美妆部位的目标图像。Step 801: Acquire a target image including the target cosmetic part.
其中,目标图像可以为本地存储的图像,也可以为电子设备实时拍摄的图像,也可以为本地存储的视频文件中的其中一帧图像,也可以为电子设备实时拍摄的视频文件中的其中一帧图像。The target image may be a locally stored image, an image captured in real time by an electronic device, or one of the images in a locally stored video file, or one of the video files captured in real time by an electronic device. frame image.
步骤802:获取所述目标被美妆部位的轮廓特征点在所述目标图像中的坐标值,以作为目标坐标值。Step 802: Acquire the coordinate values of the contour feature points of the target cosmetic part in the target image as the target coordinate values.
其中,上述轮廓特征点为位于被美妆部位的轮廓上的点。Wherein, the above-mentioned contour feature points are points located on the contour of the part to be beautified.
从而,本公开实施例中,图像处理装置,可以先确定出位于目标被美妆部位的轮廓特征点在目标图像中的坐标值,之后可以将该坐标值作为目标坐标值。Therefore, in the embodiment of the present disclosure, the image processing apparatus can first determine the coordinate value of the contour feature point located in the target beautified part in the target image, and then can use the coordinate value as the target coordinate value.
步骤803:根据所述目标坐标值,以及预先确定的配置文件,得到所述目标被美妆部位的网格结构,以作为目标网格结构。Step 803 : According to the target coordinate value and the predetermined configuration file, obtain the grid structure of the target cosmetic part, which is used as the target grid structure.
其中,所述配置文件中包括被美妆部位的网格结构中的预设三角形以及所述预设三角形的顶点的坐标值,所述预设三角形包括至少一个第一类三角形,一个第一类三角形的顶点包括两个所述被美妆部位的轮廓特征点和一个第一扩展点,所述第一扩展点为预先根据所述被美妆部位的轮廓设置的点。Wherein, the configuration file includes preset triangles in the mesh structure of the part to be beautified and coordinate values of vertices of the preset triangles, and the preset triangles include at least one first-type triangle, one first-type triangle The vertex of the triangle includes two contour feature points of the part to be beautified and a first expansion point, and the first expansion point is a point set in advance according to the contour of the part to be beautified.
由此可知,本公开的实施例中,配置文件中包括多个点,这多个点中包括被美妆部位的轮廓特征点,以及人工设置的点(即为扩展点)。例如,针对眼睛的配置文件中的第一扩展点可包括如图9中所示的点91~910,眼睛的轮廓特征点可包括如图9中所示的点911~922。其中,配置文件中包括的多个点按照一定的规则组成多个三角形。而组成三角形的规则,是预先确定的。例如,图9中所示点91~922按照两个轮廓特征点和一个扩展点组成一个三角形的规则,得到如图9所示的三角形。即如图9所示的三角形即为第一类三角形。It can be seen from this that, in the embodiment of the present disclosure, the configuration file includes multiple points, and the multiple points include contour feature points of the part to be beautified and manually set points (ie, extension points). For example, the first extension point in the configuration file for the eye may include points 91 to 910 as shown in FIG. 9 , and the contour feature points of the eye may include points 911 to 922 as shown in FIG. 9 . The multiple points included in the configuration file form multiple triangles according to certain rules. The rules for forming triangles are predetermined. For example, the points 91 to 922 shown in FIG. 9 follow the rule that two contour feature points and an extension point form a triangle to obtain the triangle shown in FIG. 9 . That is, the triangle shown in FIG. 9 is the first type of triangle.
其中,配置文件在对被美妆部位进行美妆的过程中,作为生成网格结构的依据。在一些实施例中, 利用一个已知的配置文件,在对被美妆部位进行美妆的情况下,首先图像处理装置需要获取被美妆部位的图像,然后检测该图像中被美妆部位的轮廓特征点,然后从这些轮廓特征点中选取与配置文件中包括的轮廓特征点对应的点,作为输入参数,进而利用该输入参数和配置文件,计算构成网格结构的扩展点,进而由输入参数所包括的所有轮廓特征点以及计算出的所有扩展点,绘制成网格结构。Among them, the configuration file is used as the basis for generating the grid structure in the process of beautifying the part to be beautified. In some embodiments, using a known configuration file, in the case of beautifying the part to be beautified, the image processing device first needs to acquire an image of the part to be beautified, and then detects the beauty of the part to be beautified in the image. contour feature points, and then select the points corresponding to the contour feature points included in the configuration file from these contour feature points as input parameters, and then use the input parameters and configuration files to calculate the extension points that constitute the grid structure, and then use the input parameters and configuration files. All contour feature points included in the parameters and all calculated expansion points are drawn into a grid structure.
另外,需要说明的是,配置文件中包括的点,与所要计算的上述目标网格结构中的点是一一对应的关系,则图像处理装置对配置文件中的一个扩展点进行验算,即为计算配置文件中的这个扩展点在目标网格结构中对应的点的坐标。In addition, it should be noted that there is a one-to-one correspondence between the points included in the configuration file and the points in the target grid structure to be calculated, and the image processing device checks and calculates an extension point in the configuration file, which is Calculate the coordinates of the corresponding point in the target grid structure for this extension point in the configuration file.
在本公开实施例中,对第一扩展点的验算结果,依据的是与其属于同一个第一类三角形的两个轮廓特征点。而轮廓特征点属于被美妆部位上的点,因而第一扩展点的验算结果与被美妆部位更加匹配,从而使得最终得到的目标网格结果与被美妆部位更加匹配。In the embodiment of the present disclosure, the checking result of the first extension point is based on two contour feature points that belong to the same first type of triangle. The contour feature points belong to the points on the part to be beautified, so the check result of the first expansion point is more matched with the part to be beautified, so that the final target grid result is more matched to the part to be beautified.
此外,如图10所示,点A、B、C为眼睛的配置文件中的三个点,且这三点组成一个第一类三角形,其中,点A、B分别为两个轮廓特征点,点C为第一扩展点,A1`和B1`为眼睛睁开且倾斜的图像中的两个轮廓特征点,C1`为在眼睛睁开且倾斜的图像中,对配置文件中点C的验算结果;A2`和B2`为眼睛闭合且未倾斜的图像中的两个轮廓特征点,C2`为在眼睛闭合且未倾斜的图像中,对配置文件中点C的验算结果。由此可见,针对配置文件中一个第一扩展点,在睁眼且眼睛倾斜,以及闭眼且眼睛未倾斜的不同情况下,对该第一扩展点的验算结果(即图10中C1`与C2`的坐标值)相差不大。因而,本公开的实施例中,采用两个轮廓特征点和一个第一扩展点组成的第一类三角形构成的配置文件,还能够在被美妆部位在不同状态下,得到比较稳定的网格结构。In addition, as shown in Figure 10, points A, B, and C are three points in the configuration file of the eyes, and these three points form a first-type triangle, where points A and B are two contour feature points respectively, Point C is the first extension point, A1` and B1` are two contour feature points in the image with the eyes open and inclined, C1` is the check calculation of point C in the configuration file in the image with the eyes open and inclined Results; A2` and B2` are the two contour feature points in the image with the eyes closed and not tilted, C2` is the check result of point C in the configuration file in the image with the eyes closed and not tilted. It can be seen from this that, for a first extension point in the configuration file, under the different conditions of open eyes and tilted eyes, and closed eyes without tilted eyes, the verification results of the first extension point (that is, C1' and C1' in Fig. 10 and The coordinate value of C2`) is not much different. Therefore, in the embodiment of the present disclosure, a configuration file composed of a first-type triangle composed of two contour feature points and a first extension point can also be used to obtain a relatively stable grid under different states of the beautified part. structure.
步骤804:根据所述目标网格结构,对所述目标图像中的被美妆部位进行美妆处理,得到美妆图像。Step 804: According to the target grid structure, perform beauty makeup processing on the beauty makeup part in the target image to obtain a beauty makeup image.
由上述可知,本公开的实施例,图像处理装置可以预先采用两个被美妆部位的轮廓特征点和一个第一扩展点组成第一类三角形,并作为被美妆部位的网格结构中的预设三角形,从而将这些预设三角形的坐标值构成一个配置文件,进而利用该配置文件,以及目标被美妆部位的轮廓特征点在目标图像中的坐标值,计算获得该目标被美妆部位的目标网格结构,进而对目标被美妆部位进行美妆处理,得到美妆图像。It can be seen from the above that, in the embodiment of the present disclosure, the image processing apparatus can use two contour feature points of the part to be beautified and a first extension point to form a first-type triangle, and use it as a triangle in the grid structure of the part to be beautified. Preset triangles, so that the coordinate values of these preset triangles form a configuration file, and then use the configuration file and the coordinate values of the contour feature points of the target cosmetic part in the target image to calculate and obtain the target cosmetic part. The target grid structure is obtained, and then beauty makeup processing is performed on the target beauty makeup part to obtain a beauty makeup image.
由此可知,本公开的实施例,预先在被美妆部位的轮廓特征点的基础上,人工设置第一扩展点,并由这些轮廓特征点和第一扩展点构建被美妆部位的网格结构中的三角形。即本公开的实施例会预先基于被美妆部位的轮廓特征点,构建被美妆部位的网格结构,即构建一个与被美妆部位匹配的网格结构,亦即构建配置文件,从而在需要对包含目标被美妆部位的目标图像进行处理的情况下,可以直接利用该配置文件中的三角形,来生成与目标被美妆部位匹配的网格结构。而不需要定位被美妆部位的中心点,所以即使目标被美妆部位的AI点未呈放射,仍然能够根据预先确定的配置文件,得到与目标被美妆部位匹配的网格结构,从而在一定程度上提升对目标被美妆部位的美妆效果。It can be seen from this that in the embodiment of the present disclosure, the first extension points are manually set on the basis of the contour feature points of the part to be beautified, and the grid of the part to be beautified is constructed from these contour feature points and the first extension point. Triangles in structure. That is, in the embodiment of the present disclosure, based on the contour feature points of the cosmetic part, the grid structure of the cosmetic part is constructed in advance, that is, a grid structure matching the cosmetic part is constructed, that is, a configuration file is constructed, so that when the need arises, the grid structure is constructed. In the case of processing the target image including the target cosmetic part, the triangles in the configuration file can be directly used to generate a mesh structure matching the target cosmetic part. There is no need to locate the center point of the part to be beautified, so even if the AI point of the part to be beautified is not radiated, the grid structure matching the part to be beautified can still be obtained according to the pre-determined configuration file. To a certain extent, it can improve the beauty effect of the target beautified part.
参照图11,示出了本公开实施例提供的一种图像处理方法,该图像处理方法可以包括以下步骤:Referring to FIG. 11, an image processing method provided by an embodiment of the present disclosure is shown, and the image processing method may include the following steps:
步骤1101:获取包含目标被美妆部位的目标图像。Step 1101: Acquire a target image including the target cosmetic part.
其中,目标图像可以为本地存储的图像,也可以为电子设备实时拍摄的图像,也可以为本地存储的视频文件中的其中一帧图像,也可以为电子设备实时拍摄的视频文件中的其中一帧图像。The target image may be a locally stored image, an image captured in real time by an electronic device, or one of the images in a locally stored video file, or one of the video files captured in real time by an electronic device. frame image.
步骤1102:获取所述目标被美妆部位的轮廓特征点在所述目标图像中的坐标值,以作为目标坐标值。Step 1102: Acquire the coordinate value of the contour feature point of the target cosmetic part in the target image as the target coordinate value.
其中,上述轮廓特征点为位于被美妆部位的轮廓上的点。Wherein, the above-mentioned contour feature points are points located on the contour of the part to be beautified.
步骤1103:根据所述目标坐标值,以及预先确定的配置文件中的第一类三角形的顶点的坐标值,计算得到第一类扩展点的坐标值。Step 1103: Calculate the coordinate value of the first type of extension point according to the target coordinate value and the coordinate value of the vertex of the first type of triangle in the predetermined configuration file.
其中,所述第一类扩展点为目标网格结构中,与所述第一扩展点对应的点,所述目标网格结构为所述目标被美妆部位的网格结构。The first type of extension point is a point corresponding to the first extension point in the target grid structure, and the target grid structure is the grid structure of the target cosmetic part.
步骤1104:根据所述目标坐标值和所述第一类扩展点的坐标值,得到所述目标网格结构。Step 1104: Obtain the target grid structure according to the target coordinate value and the coordinate value of the first type of extension point.
其中,本公开的实施例中,预先确定有配置文件,该配置文件中包括被美妆部位的网格结构中的预设三角形以及所述预设三角形的顶点的坐标值,所述预设三角形包括至少一个上述第一类三角形,一个 第一类三角形的顶点包括两个所述被美妆部位的轮廓特征点和一个第一扩展点,所述第一扩展点为预先根据所述被美妆部位的轮廓设置的点。Wherein, in the embodiment of the present disclosure, a configuration file is pre-determined, and the configuration file includes a preset triangle in the mesh structure of the part to be beautified and the coordinate values of the vertices of the preset triangle, the preset triangle At least one triangle of the first type is included, and the vertex of a triangle of the first type includes two contour feature points of the part to be beautified and a first expansion point, and the first expansion point is pre-made according to the makeup. The point where the outline of the part is set.
由此可知,本公开的实施例中,配置文件中包括多个点,这多个点中包括被美妆部位的轮廓特征点,以及人工设置的点(即为扩展点)。例如,针对眼睛的配置文件中的第一扩展点可包括如图9中所示的点91~910,眼睛的轮廓特征点可包括如图9中所示的点911~922。其中,配置文件中包括的多个点按照一定的规则组成多个三角形。而组成三角形的规则,是预先确定的。例如,图9中所示点91~922按照两个轮廓特征点和一个扩展点组成一个三角形的规则,得到如图9所示的三角形。即如图9所示的三角形即为第一类三角形。It can be seen from this that, in the embodiment of the present disclosure, the configuration file includes multiple points, and the multiple points include contour feature points of the part to be beautified and manually set points (ie, extension points). For example, the first extension point in the configuration file for the eye may include points 91 to 910 as shown in FIG. 9 , and the contour feature points of the eye may include points 911 to 922 as shown in FIG. 9 . The multiple points included in the configuration file form multiple triangles according to certain rules. The rules for forming triangles are predetermined. For example, the points 91 to 922 shown in FIG. 9 follow the rule that two contour feature points and an extension point form a triangle to obtain the triangle shown in FIG. 9 . That is, the triangle shown in FIG. 9 is the first type of triangle.
其中,配置文件,在对被美妆部位进行美妆的过程中,作为生成网格结构的依据。在一些实施例中,利用一个已知的配置文件,在对被美妆部位进行美妆的情况下,首先图像处理装置需要获取被美妆部位的图像,然后检测该图像中被美妆部位的轮廓特征点,然后从这些轮廓特征点中选取与配置文件中包括的轮廓特征点对应的点,作为输入参数,进而利用该输入参数和配置文件,计算构成网格结构的扩展点,进而由输入参数所包括的所有轮廓特征点以及计算出的所有扩展点,绘制成网格结构。Among them, the configuration file is used as the basis for generating the grid structure in the process of beautifying the part to be beautified. In some embodiments, using a known configuration file, in the case of beautifying the part to be beautified, the image processing device first needs to acquire the image of the part to be beautified, and then detects the part of the beautified part in the image. contour feature points, and then select the points corresponding to the contour feature points included in the configuration file from these contour feature points as input parameters, and then use the input parameters and configuration files to calculate the extension points that constitute the grid structure, and then use the input parameters and configuration files. All contour feature points included in the parameters and all calculated expansion points are drawn into a grid structure.
另外,需要说明的是,配置文件中包括的点,与所要计算的上述目标网格结构中的点是一一对应的关系,则对配置文件中的一个扩展点进行验算,即为计算配置文件中的这个扩展点在目标网格结构中对应的点的坐标。In addition, it should be noted that the points included in the configuration file have a one-to-one correspondence with the points in the target grid structure to be calculated, and then an extension point in the configuration file is checked and calculated, that is, the calculation configuration file The coordinates of the corresponding point in the target grid structure for this extension point in .
在本公开实施例中,图像处理装置对第一扩展点的验算结果,依据的是与其属于同一个第一类三角形的两个轮廓特征点。而轮廓特征点属于被美妆部位上的点,因而第一扩展点的验算结果与被美妆部位更加匹配,从而使得最终得到的目标网格结果与被美妆部位更加匹配。In the embodiment of the present disclosure, the verification result of the first extension point by the image processing apparatus is based on two contour feature points that belong to the same first type of triangle. The contour feature points belong to the points on the part to be beautified, so the check result of the first expansion point is more matched with the part to be beautified, so that the final target grid result is more matched to the part to be beautified.
此外,如图10所示,点A、B、C为眼睛的配置文件中的三个点,且这三点组成一个第一类三角形,其中,点A、B分别为两个轮廓特征点,点C为第一扩展点。A1`和B1`为眼睛睁开且倾斜的图像中的两个轮廓特征点,C1`为在眼睛睁开且倾斜的图像中,对配置文件中点C的验算结果;A2`和B2`为眼睛闭合且未倾斜的图像中的两个轮廓特征点,C2`为在眼睛闭合且未倾斜的图像中,对配置文件中点C的验算结果。由此可见,针对上述配置文件中一个第一扩展点,在睁眼且眼睛倾斜,以及闭眼且眼睛未倾斜的不同情况下,对该第扩展点的验算结果(即图10中C1`与C2`的坐标值)相差不大。因而,本公开的实施例中,采用两个轮廓特征点和一个第一扩展点组成的第一类三角形构成的配置文件,还能够在被美妆部位在不同状态下,得到比较稳定的网格结构。In addition, as shown in Figure 10, points A, B, and C are three points in the configuration file of the eyes, and these three points form a first-type triangle, where points A and B are two contour feature points respectively, Point C is the first extension point. A1` and B1` are the two contour feature points in the open-eye and oblique image, C1` is the verification result of point C in the configuration file in the open-eye and oblique image; A2` and B2` are Two contour feature points in an image with eyes closed and not tilted, C2' is the result of checking the point C in the configuration file in an image with eyes closed and not tilted. It can be seen from this that, for a first extension point in the above configuration file, under different conditions of open eyes and tilted eyes, and closed eyes without tilted eyes, the verification results of the first extension point (that is, C1' and C1' in Fig. 10 and The coordinate value of C2`) is not much different. Therefore, in the embodiment of the present disclosure, a configuration file composed of a first-type triangle composed of two contour feature points and a first extension point can also be used to obtain a relatively stable grid under different states of the beautified part. structure.
在一些实施例中,所述目标网格结构中包括至少一个第一目标三角形,所述第一目标三角形与所述第一类三角形一一对应,且所述第一类三角形与其对应的所述第一目标三角形相似;所述第一目标三角形与所述第一类扩展点一一对应,且所述第一类扩展点属于与其对应的第一目标三角形的顶点;In some embodiments, the target mesh structure includes at least one first target triangle, the first target triangle is in one-to-one correspondence with the first type of triangle, and the first type of triangle corresponds to the corresponding The first target triangles are similar; the first target triangles are in one-to-one correspondence with the first type extension points, and the first type extension points belong to the vertices of the corresponding first target triangles;
所述根据所述目标坐标值,以及所述第一类三角形的顶点的坐标值,计算得到第一类扩展点的坐标值,包括:According to the target coordinate value and the coordinate value of the vertex of the first-type triangle, the coordinate value of the first-type extension point is calculated and obtained, including:
根据所述第一类三角形与其对应的所述第一目标三角形的相似关系,以及所述目标坐标值和所述第一类三角形的顶点的坐标值,计算得到所述第一类扩展点的坐标值。According to the similarity relationship between the first type of triangle and its corresponding first target triangle, as well as the target coordinate value and the coordinate value of the vertex of the first type of triangle, the coordinates of the first type of extension point are calculated and obtained value.
其中,在已知两个三角形相似,以及其中一个三角形的顶点的坐标值和另一个三角形的两个顶点的坐标值的情况下,则可以计算其中未知的一个三角形顶点的坐标值。Wherein, when two triangles are known to be similar, and the coordinate value of the vertex of one triangle and the coordinate value of the two vertices of the other triangle are known, the coordinate value of the unknown vertex of one triangle can be calculated.
另外,本公开的实施例中,第一类三角形与第一目标三角形相似,二者顶点一一对应,即二者相似存在唯一的方向,因而计算得到的第一扩展点是唯一的。In addition, in the embodiment of the present disclosure, the first type of triangle is similar to the first target triangle, and the vertices of the two are in one-to-one correspondence, that is, the two are similar and have a unique direction, so the calculated first expansion point is unique.
步骤1105:根据所述目标网格结构,对所述目标图像中的被美妆部位进行美妆处理,得到美妆图像。Step 1105: According to the target grid structure, perform beauty makeup processing on the beauty makeup part in the target image to obtain a beauty makeup image.
由上述可知,本公开的实施例,图像处理装置可以预先在被美妆部位的轮廓特征点的基础上,人工设置第一扩展点,并由这些轮廓特征点和第一扩展点构建被美妆部位的网格结构中的三角形。即本公开的实施例会预先基于被美妆部位的轮廓特征点,构建被美妆部位的网格结构,即构建一个与被美妆部位匹配的网格结构,亦即构建配置文件,从而在需要对包含目标被美妆部位的目标图像进行处理的情况下,可以直接利用该配置文件中的三角形,来生成与目标被美妆部位匹配的网格结构。而不需要定位被美妆 部位的中心点,所以即使目标被美妆部位的AI点未呈放射,仍然能够根据预先确定的配置文件,得到与目标被美妆部位匹配的网格结构,从而在一定程度上提升对目标被美妆部位的美妆效果。It can be seen from the above that, in the embodiment of the present disclosure, the image processing apparatus can manually set the first extension point on the basis of the contour feature points of the part to be beautified, and construct the beautified object from these contour feature points and the first extension point. Triangles in the mesh structure of the site. That is, in the embodiment of the present disclosure, based on the contour feature points of the cosmetic part, the grid structure of the cosmetic part is constructed in advance, that is, a grid structure matching the cosmetic part is constructed, that is, a configuration file is constructed, so that when the need arises, the grid structure is constructed. In the case of processing the target image including the target cosmetic part, the triangles in the configuration file can be directly used to generate a mesh structure matching the target cosmetic part. There is no need to locate the center point of the part to be beautified, so even if the AI point of the part to be beautified is not radiated, the grid structure matching the part to be beautified can still be obtained according to the pre-determined configuration file. To a certain extent, it can improve the beauty effect of the target beautified part.
在一些实施例中,所述根据所述目标坐标值和所述第一类扩展点的坐标值,得到所述目标网格结构,包括:In some embodiments, obtaining the target grid structure according to the target coordinate value and the coordinate value of the first type of extension point includes:
根据所述第一类扩展点的坐标值和所述目标坐标值,计算得到第二类扩展点的坐标值,其中,所述第二类扩展点为所述目标网格结构中除所述目标的被美妆部位的轮廓特征点以及所述第一类扩展点之外的其他点;According to the coordinate value of the first type of extension point and the target coordinate value, the coordinate value of the second type of extension point is calculated, wherein the second type of extension point is the target grid structure divided by the target The contour feature points of the part to be beautified and other points other than the first type of extension points;
根据所述目标坐标值、所述第一类扩展点的坐标值和所述第二类扩展点的坐标值,得到所述目标网格结构。The target grid structure is obtained according to the target coordinate value, the coordinate value of the first type extension point and the coordinate value of the second type extension point.
由此可知,在本公开的实施例中,图像处理装置可以在对配置文件中的第一扩展点验算完毕后,继续确定其他的扩展点(即第二扩展点),使得得到的目标网格结构更加贴近被美妆部位的形状及结构。It can be seen that, in the embodiment of the present disclosure, the image processing apparatus may continue to determine other extension points (ie, second extension points) after checking the first extension point in the configuration file, so that the obtained target grid The structure is closer to the shape and structure of the part to be beautified.
在一些实施例中,所述预设三角形还包括至少一个第二类三角形,其中,一个第二类三角形的顶点包括一个第二扩展点和目标集合中的其中两个点,所述目标集合中包括所述被美妆部位的轮廓特征点以及所述第一扩展点,所述第二扩展点为预先根据所述被美妆部位的轮廓设置的点;In some embodiments, the preset triangle further includes at least one triangle of the second type, wherein a vertex of a triangle of the second type includes a second extension point and two points in the target set, wherein the target set Including the contour feature point of the part to be beautified and the first expansion point, the second expansion point is a point set in advance according to the contour of the part to be beautified;
所述目标网格结构中还包括至少一个第二目标三角形,所述第二目标三角形与所述第二类三角形一一对应,且所述第二类三角形与其对应的所述第二目标三角形相似,其中,所述第二目标三角形与所述第二类扩展点一一对应,且所述第二类扩展点属于与其对应的第二目标三角形的顶点;The target mesh structure also includes at least one second target triangle, the second target triangle is in one-to-one correspondence with the second type of triangle, and the second type of triangle is similar to its corresponding second target triangle , wherein the second target triangle is in one-to-one correspondence with the second type of extension point, and the second type of extension point belongs to the vertex of the corresponding second target triangle;
所述根据所述第一类扩展点的坐标值和所述目标坐标值,计算得到第二类扩展点的坐标值,包括:According to the coordinate value of the first type of expansion point and the target coordinate value, the calculation to obtain the coordinate value of the second type of expansion point, including:
根据所述第二类三角形与其对应的所述第二目标三角形的相似关系,以及所述目标坐标值、所述第一类扩展点的坐标值、所述第一类三角形的顶点的坐标值以及所述第二类三角形的顶点的坐标值,计算得到所述第二类扩展点的坐标值。According to the similarity relationship between the second type of triangle and its corresponding second target triangle, and the target coordinate value, the coordinate value of the first type of extension point, the coordinate value of the vertex of the first type of triangle and The coordinate value of the vertex of the second type of triangle is calculated to obtain the coordinate value of the second type of extension point.
由此可知,上述配置文件中还可包括由被美妆部位的轮廓特征点和第一扩展点中的其中两个点,以及一个第二扩展点组成的第二类三角形。这些第二类三角形用于确定上述目标网格结构中的第二类扩展点。From this, it can be seen that the above configuration file may further include a second type of triangle formed by the contour feature point of the part to be beautified, two of the first extension points, and a second extension point. These second type of triangles are used to determine the second type of extension points in the target mesh structure described above.
其中,图像处理装置在对配置文件中的第一扩展点验算完毕,得到上述第一类扩展点之后,则在已知第二类三角形与目标网格结构中的第二目标三角形相似的情况下,例如针对一个第二类三角形与一个第二目标三角形,则可以根据这两个三角形中已知点的坐标值,求得未知点的坐标值,即计算得到第二类扩展点的坐标值。Wherein, after the image processing device completes the checking and calculation of the first extension point in the configuration file and obtains the above-mentioned first type of extension point, in the case where it is known that the second type of triangle is similar to the second target triangle in the target mesh structure For example, for a second type triangle and a second target triangle, the coordinate value of the unknown point can be obtained according to the coordinate value of the known point in the two triangles, that is, the coordinate value of the second type extension point can be calculated.
例如在图9所示的配置文件中,还可进一步增加第二扩展点,例如增加第二扩展点后的配置文件中包括的各个点的示意图,可如图12所示。其中,图12中所示的点923和点924为两个第二扩展点,则点924、922、91组成的一个第二类三角形,点923、917、95组成一个第二类三角形。For example, in the configuration file shown in FIG. 9 , a second extension point may be further added. For example, a schematic diagram of each point included in the configuration file after adding the second extension point may be as shown in FIG. 12 . Wherein, the point 923 and the point 924 shown in FIG. 12 are two second extension points, then the points 924, 922, and 91 constitute a second-type triangle, and the points 923, 917, and 95 constitute a second-type triangle.
此外,由于配置文件中的点与上述目标网格结构中的点是一一对应的关系,所以,例如图12所示的配置文件中的各个点连接而成的网格结构,可以表示睁开眼睛的图像的网格结构。In addition, since the points in the configuration file are in a one-to-one correspondence with the points in the target grid structure, for example, the grid structure formed by connecting the points in the configuration file shown in FIG. 12 can represent the open The grid structure of the image of the eye.
在一些实施例中,所述根据所述第一类扩展点的坐标值和所述目标坐标值,计算得到第二类扩展点的坐标值,包括:In some embodiments, calculating the coordinate value of the second type of extension point according to the coordinate value of the first type of extension point and the target coordinate value, including:
采用平滑过渡或插值方法,根据所述第一类扩展点的坐标值和所述目标坐标值,计算得到第二类扩展点的坐标值。Using a smooth transition or interpolation method, the coordinate value of the second type of expansion point is calculated according to the coordinate value of the first type of expansion point and the target coordinate value.
其中,图像处理装置在对配置文件中的第一扩展点验算完毕之后,即得到目标网格结构中的第一类扩展点之后,还可根据目标图像中被美妆部位的轮廓特征点,以及第一类扩展点,利用平滑过渡或差插值的方式扩展其他点,从而可以减少运算量,进而提升处理速度。Wherein, after the image processing device completes the checking and calculation of the first extension point in the configuration file, that is, after obtaining the first type of extension point in the target grid structure, the image processing device can also obtain the first type of extension point in the target image according to the contour feature points of the part to be beautified in the target image, and The first type of extension point uses smooth transition or differential interpolation to extend other points, thereby reducing the amount of computation and improving the processing speed.
此外,针对扩展点的设置,可以通过编码方式为特定的点开发构建逻辑,变化会非常灵活,且能效果表现高度依赖代码逻辑,可以得到更奇特、更自然的效果。但此种方式工作量较大,效果灵活但制作不灵活。但此种方式可以与本公开实施例中所采用的扩展点的生成方案混合使用。In addition, for the setting of extension points, the construction logic can be developed for a specific point through coding, the changes will be very flexible, and the performance of the performance is highly dependent on the code logic, which can achieve more peculiar and more natural effects. However, this method has a large workload, and the effect is flexible but the production is not flexible. However, this method can be mixed with the extension point generation scheme adopted in the embodiments of the present disclosure.
综上所述,本公开实施例提供的图像处理方法的具体实施方式可如下所述:To sum up, the specific implementation manner of the image processing method provided by the embodiments of the present disclosure may be as follows:
如图13所示,预先提供配置文件,该配置文件与AI识别点为作为输入数据,通过相似三角形算 法进行扩展点验算,最终得到一个完整的脸部(或其他特定器官)的美妆细节结构图。该流程在每一帧图像都需要计算一遍。其中,人脸的AI识别点如图14所示,该人脸的网格结构如图15所示。As shown in Figure 13, a configuration file is provided in advance, the configuration file and AI recognition points are used as input data, and extended point verification is performed through the similar triangle algorithm, and finally a complete face (or other specific organs) beauty makeup details structure is obtained picture. This process needs to be calculated once for each frame of image. Among them, the AI recognition points of the face are shown in Figure 14, and the grid structure of the face is shown in Figure 15.
其中,上述通过相似三角形算法进行扩展点验算的过程如下所述:Wherein, the above-mentioned process of performing extended point verification by the similar triangle algorithm is as follows:
首先,图像处理装置可以定义好整个人脸美妆中(或特定器官美妆),最终所要构建的网格结构存在多少个点,其中,该步骤基于使用场景的需求,没有固定规则;First of all, the image processing device can define how many points exist in the final grid structure to be constructed in the entire face beauty makeup (or specific organ beauty makeup), wherein this step is based on the requirements of the usage scene, and there is no fixed rule;
其次,图像处理装置可以构建配置文件,其中包含如下三方面信息:第一方面,所有点的相对位置信息;第二方面,由三个点组成的一系列三角形结构;第三方面,所要构建的网格结构的扩展点的生成规则,这个生成规则是由配置文件中的哪个三角形,配合人脸的哪两个已知点(这两个点是AI点或者已经计算出来的扩展点),可以计算得出所要构建的网格结构的一个扩展点。Secondly, the image processing apparatus can construct a configuration file, which contains the following three aspects of information: firstly, the relative position information of all points; secondly, a series of triangular structures composed of three points; thirdly, the The generation rule of the extension point of the grid structure. This generation rule is determined by which triangle in the configuration file is matched with which two known points of the face (these two points are AI points or the extension points that have been calculated), you can An extension point of the grid structure to be constructed is calculated.
再次,图像处理装置可以根据配置文件,利用相似三角形算法进行运算,算出扩展点的坐标值。如图16所示,此处该算法将使用5个已知点,其中三个点是前述配置文件中的点(通常是两个AI点,一个扩展点),此处将其命名为A、B,C(即A、B为AI点,C为扩展点)。另外两个点是由AI模块提供,其值为屏幕坐标的值,此处将其命名A`、B`。A与A`、B与B`在网格结构中,表示同一个点。通过基本三角函数相关知识即可求出一点C`的值,满足△ABC∽△A`B`C`,其中,C`即为所要构建的网格结构的一个扩展点。Thirdly, the image processing apparatus can perform operations by using the similar triangle algorithm according to the configuration file, and calculate the coordinate value of the extension point. As shown in Figure 16, here the algorithm will use 5 known points, three of which are the points in the aforementioned configuration file (usually two AI points, one extension point), here named A, B, C (that is, A and B are AI points, and C is an extension point). The other two points are provided by the AI module, and their values are the values of screen coordinates, which are named A` and B` here. In the grid structure, A and A`, B and B` represent the same point. The value of a point C` can be obtained through the knowledge of basic trigonometric functions, which satisfies △ABC∽△A`B`C`, where C` is an extension point of the grid structure to be constructed.
最后,通过反复多次调用相似三角形算法,就可以得到被美妆部位的整个网格结构的所有的点位信息。Finally, by repeatedly calling the similar triangle algorithm many times, all the point information of the entire grid structure of the part to be beautified can be obtained.
参照图17,示出了本公开实施例提供的一种图像处理装置,该图像处理装置170可以包括:Referring to FIG. 17 , an image processing apparatus provided by an embodiment of the present disclosure is shown. The image processing apparatus 170 may include:
图像获取模块1701,被配置为获取包含目标被美妆部位的目标图像;The image acquisition module 1701 is configured to acquire a target image including the target cosmetic part;
坐标值获取模块1702,被配置为获取所述目标被美妆部位的轮廓特征点在所述目标图像中的坐标值,以作为目标坐标值;The coordinate value obtaining module 1702 is configured to obtain the coordinate value of the contour feature point of the target beautified part in the target image, as the target coordinate value;
网格结构获取模块1703,被配置为根据所述目标坐标值,以及预先确定的配置文件,得到所述目标被美妆部位的网格结构,以作为目标网格结构;The grid structure acquisition module 1703 is configured to obtain the grid structure of the target beautified part according to the target coordinate value and a predetermined configuration file, as the target grid structure;
绘制模块1704,被配置为根据所述目标网格结构,对所述目标图像中的被美妆部位进行美妆处理,得到美妆图像;The drawing module 1704 is configured to, according to the target grid structure, perform beauty makeup processing on the beautified part in the target image to obtain a beauty makeup image;
其中,所述配置文件中包括被美妆部位的网格结构中的预设三角形以及所述预设三角形的顶点的坐标值,所述预设三角形包括至少一个第一类三角形,一个第一类三角形的顶点包括两个所述被美妆部位的轮廓特征点和一个第一扩展点,所述第一扩展点为预先根据所述被美妆部位的轮廓设置的点。Wherein, the configuration file includes preset triangles in the mesh structure of the part to be beautified and coordinate values of vertices of the preset triangles, and the preset triangles include at least one first-type triangle, one first-type triangle The vertex of the triangle includes two contour feature points of the part to be beautified and a first expansion point, and the first expansion point is a point set in advance according to the contour of the part to be beautified.
在一些实施例中,所述网格结构获取模块1703包括:In some embodiments, the grid structure acquisition module 1703 includes:
第一扩展点计算子模块17031,被配置为根据所述目标坐标值,以及所述第一类三角形的顶点的坐标值,计算得到第一类扩展点的坐标值,其中,所述第一类扩展点为所述目标网格结构中,与所述第一扩展点对应的点;The first expansion point calculation sub-module 17031 is configured to calculate the coordinate value of the first type of expansion point according to the target coordinate value and the coordinate value of the vertex of the first type of triangle, wherein the first type of expansion point The expansion point is a point corresponding to the first expansion point in the target grid structure;
网格结构绘制子模块17032,被配置为根据所述目标坐标值和所述第一类扩展点的坐标值,得到所述目标网格结构。The grid structure drawing sub-module 17032 is configured to obtain the target grid structure according to the target coordinate value and the coordinate value of the first-type extension point.
在一些实施例中,所述目标网格结构中包括至少一个第一目标三角形,所述第一目标三角形与所述第一类三角形一一对应,且所述第一类三角形与其对应的所述第一目标三角形相似;所述第一目标三角形与所述第一类扩展点一一对应,且所述第一类扩展点属于与其对应的第一目标三角形的顶点;In some embodiments, the target mesh structure includes at least one first target triangle, the first target triangle is in one-to-one correspondence with the first type of triangle, and the first type of triangle corresponds to the corresponding The first target triangles are similar; the first target triangles are in one-to-one correspondence with the first type extension points, and the first type extension points belong to the vertices of the corresponding first target triangles;
所述第一扩展点计算子模块17031具体被配置为:The first extension point calculation sub-module 17031 is specifically configured as:
根据所述第一类三角形与其对应的所述第一目标三角形的相似关系,以及所述目标坐标值和所述第一类三角形的顶点的坐标值,计算得到所述第一类扩展点的坐标值。According to the similarity relationship between the first type of triangle and its corresponding first target triangle, as well as the target coordinate value and the coordinate value of the vertex of the first type of triangle, the coordinates of the first type of extension point are calculated and obtained value.
在一些实施例中,所述网格结构绘制子模块17032包括:In some embodiments, the grid structure drawing sub-module 17032 includes:
第二扩展点计算单元170321,被配置为根据所述第一类扩展点的坐标值和所述目标坐标值,计算得到第二类扩展点的坐标值,其中,所述第二类扩展点为所述目标网格结构中除所述目标图像中的被美妆部位的轮廓特征点以及所述第一类扩展点之外的其他点;The second extension point calculation unit 170321 is configured to calculate the coordinate value of the second type of extension point according to the coordinate value of the first type of extension point and the target coordinate value, wherein the second type of extension point is Other points in the target grid structure except the contour feature points of the part to be beautified in the target image and the extension points of the first type;
网格结构绘制单元170322,被配置为根据所述目标坐标值、所述第一类扩展点的坐标值和所述第 二类扩展点的坐标值,得到所述目标网格结构。The grid structure drawing unit 170322 is configured to obtain the target grid structure according to the target coordinate value, the coordinate value of the first type of extension point and the coordinate value of the second type of extension point.
在一些实施例中,所述预设三角形还包括至少一个第二类三角形,其中,一个第二类三角形的顶点包括一个第二扩展点和目标集合中的其中两个点,所述目标集合中包括所述被美妆部位的轮廓特征点以及所述第一扩展点,所述第二扩展点为预先根据所述被美妆部位的轮廓设置的点;In some embodiments, the preset triangle further includes at least one triangle of the second type, wherein a vertex of a triangle of the second type includes a second extension point and two points in the target set, wherein the target set Including the contour feature point of the part to be beautified and the first expansion point, the second expansion point is a point set in advance according to the contour of the part to be beautified;
所述目标网格结构中还包括至少一个第二目标三角形,所述第二目标三角形与所述第二类三角形一一对应,且所述第二类三角形与其对应的所述第二目标三角形相似,其中,所述第二目标三角形与所述第二类扩展点一一对应,且所述第二类扩展点属于与其对应的第二目标三角形的顶点;The target mesh structure also includes at least one second target triangle, the second target triangle is in one-to-one correspondence with the second type of triangle, and the second type of triangle is similar to its corresponding second target triangle , wherein the second target triangle is in one-to-one correspondence with the second type of extension point, and the second type of extension point belongs to the vertex of the corresponding second target triangle;
所述第二扩展点计算单元170321具体被配置为:The second extension point calculation unit 170321 is specifically configured as:
根据所述第二类三角形与其对应的所述第二目标三角形的相似关系,以及所述目标坐标值、所述第一类扩展点的坐标值、所述第一类三角形的顶点的坐标值以及所述第二类三角形的顶点的坐标值,计算得到所述第二类扩展点的坐标值。According to the similarity relationship between the second type of triangle and its corresponding second target triangle, and the target coordinate value, the coordinate value of the first type of extension point, the coordinate value of the vertex of the first type of triangle and The coordinate value of the vertex of the second type of triangle is calculated to obtain the coordinate value of the second type of extension point.
在一些实施例中,所述第二扩展点计算子模块17033具体被配置为:In some embodiments, the second extension point calculation sub-module 17033 is specifically configured as:
采用平滑过渡或插值方法,根据所述第一类扩展点的坐标值和所述目标坐标值,计算得到第二类扩展点的坐标值。Using a smooth transition or interpolation method, the coordinate value of the second type of expansion point is calculated according to the coordinate value of the first type of expansion point and the target coordinate value.
由上述可知,本公开的实施例,预先采用两个被美妆部位的轮廓特征点和一个第一扩展点组成第一类三角形,并作为被美妆部位的网格结构中的目标三角形,从而将这些目标三角形的坐标值构成一个配置文件,进而利用该配置文件,以及目标被美妆部位的轮廓特征点在目标图像中的坐标值,计算获得该目标被美妆部位的目标网格结构,进而根据该目标网格结构对目标被美妆部位进行美妆处理,得到美妆图像。It can be seen from the above that in the embodiment of the present disclosure, two contour feature points of the part to be beautified and a first extension point are used to form the first type of triangle, and used as the target triangle in the mesh structure of the part to be beautified, so that The coordinate values of these target triangles are formed into a configuration file, and then the configuration file and the coordinate values of the contour feature points of the target beautified part in the target image are used to calculate the target grid structure of the target beautified part, Further, according to the target grid structure, beauty makeup processing is performed on the target beauty makeup part to obtain a beauty makeup image.
由此可知,本公开的实施例,预先在被美妆部位的轮廓特征点的基础上,人工设置第一扩展点,并由这些轮廓特征点和第一扩展点构建被美妆部位的网格结构中的三角形。即本公开的实施例会预先基于被美妆部位的轮廓特征点,构建被美妆部位的网格结构,即构建一个与被美妆部位匹配的网格结构,亦即构建配置文件,从而在需要对包含目标被美妆部位的目标图像进行处理的情况下,可以直接利用该配置文件中的三角形,来生成与目标被美妆部位匹配的网格结构。而不需要定位被美妆部位的中心点,所以即使目标被美妆部位的AI点未呈放射,仍然能够根据预先确定的配置文件,得到与目标被美妆部位匹配的网格结构,从而在一定程度上提升对目标被美妆部位的美妆效果。It can be seen from this that in the embodiment of the present disclosure, the first extension points are manually set on the basis of the contour feature points of the part to be beautified, and the grid of the part to be beautified is constructed from these contour feature points and the first extension point. Triangles in structure. That is, in the embodiment of the present disclosure, based on the contour feature points of the cosmetic part, the grid structure of the cosmetic part is constructed in advance, that is, a grid structure matching the cosmetic part is constructed, that is, a configuration file is constructed, so that when the need arises, the grid structure is constructed. In the case of processing the target image including the target cosmetic part, the triangles in the configuration file can be directly used to generate a mesh structure matching the target cosmetic part. There is no need to locate the center point of the part to be beautified, so even if the AI point of the part to be beautified is not radiated, the grid structure matching the part to be beautified can still be obtained according to the pre-determined configuration file. To a certain extent, it can improve the beauty effect of the target beautified part.
图18是根据一示例性实施例示出的一种电子设备框图。参照图18,该电子设备包括:Fig. 18 is a block diagram of an electronic device according to an exemplary embodiment. 18, the electronic device includes:
处理器1810; processor 1810;
用于存储所述处理器可执行指令的存储器1820; memory 1820 for storing instructions executable by the processor;
其中,所述处理器被配置为执行所述指令,以实现上述所述的图像处理方法。Wherein, the processor is configured to execute the instructions to implement the image processing method described above.
图19是根据一示例性实施例示出的另一种电子设备1900的框图。例如,电子设备1900可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。FIG. 19 is a block diagram of another electronic device 1900 according to an exemplary embodiment. For example, electronic device 1900 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, and the like.
参照图19,电子设备1900可以包括以下一个或多个组件:处理组件1902,存储器1904,电源组件1906,多媒体组件1908,音频组件1910,输入/输出(I/O)的接口1912,传感器组件1914,以及通信组件1916。19, an electronic device 1900 may include one or more of the following components: a processing component 1902, a memory 1904, a power supply component 1906, a multimedia component 1908, an audio component 1910, an input/output (I/O) interface 1912, a sensor component 1914 , and the communication component 1916.
处理组件1902通常控制电子设备1900的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件1902可以包括一个或多个处理器1920来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件1902可以包括一个或多个模块,便于处理组件1902和其他组件之间的交互。例如,处理组件1902可以包括多媒体模块,以方便多媒体组件1908和处理组件1902之间的交互。The processing component 1902 generally controls the overall operation of the electronic device 1900, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1902 can include one or more processors 1920 to execute instructions to perform all or part of the steps of the methods described above. Additionally, processing component 1902 may include one or more modules that facilitate interaction between processing component 1902 and other components. For example, processing component 1902 may include a multimedia module to facilitate interaction between multimedia component 1908 and processing component 1902.
存储器1904被配置为存储各种类型的数据以支持在电子设备1900的操作。这些数据的示例包括用于在电子设备1900上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器1904可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编 程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。 Memory 1904 is configured to store various types of data to support operation at electronic device 1900 . Examples of such data include instructions for any application or method operating on the electronic device 1900, contact data, phonebook data, messages, pictures, videos, and the like. Memory 1904 may be implemented by any type of volatile or non-volatile storage device or combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
电源组件1906为电子设备1900的各种组件提供电力。电源组件1906可以包括电源管理系统,一个或多个电源,及其他与为电子设备1900生成、管理和分配电力相关联的组件。 Power supply assembly 1906 provides power to various components of electronic device 1900. Power supply components 1906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 1900 .
多媒体组件1908包括在所述电子设备1900和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。在屏幕包括触摸面板的情况下,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件1908包括一个前置摄像头和/或后置摄像头。在电子设备1900处于操作模式的情况下,如拍摄模式或视频模式,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。 Multimedia component 1908 includes a screen that provides an output interface between the electronic device 1900 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). In the case where the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action. In some embodiments, the multimedia component 1908 includes a front-facing camera and/or a rear-facing camera. When the electronic device 1900 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each of the front and rear cameras can be a fixed optical lens system or have focal length and optical zoom capability.
音频组件1910被配置为输出和/或输入音频信号。例如,音频组件1910包括一个麦克风(MIC),在电子设备1900处于操作模式的情况下,如呼叫模式、记录模式和语音识别模式,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器1904或经由通信组件1916发送。在一些实施例中,音频组件1910还包括一个扬声器,用于输出音频信号。 Audio component 1910 is configured to output and/or input audio signals. For example, audio component 1910 includes a microphone (MIC) that is configured to receive external audio signals when electronic device 1900 is in operational modes, such as call mode, recording mode, and voice recognition mode. The received audio signal may be further stored in memory 1904 or transmitted via communication component 1916. In some embodiments, audio component 1910 also includes a speaker for outputting audio signals.
I/O接口1912为处理组件1902和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 1912 provides an interface between the processing component 1902 and peripheral interface modules, which may be keyboards, click wheels, buttons, and the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.
传感器组件1914包括一个或多个传感器,用于为电子设备1900提供各个方面的状态评估。例如,传感器组件1914可以检测到电子设备1900的打开/关闭状态,组件的相对定位,例如所述组件为电子设备1900的显示器和小键盘,传感器组件1914还可以检测电子设备1900或电子设备1900一个组件的位置改变,用户与电子设备1900接触的存在或不存在,电子设备1900方位或加速/减速和电子设备1900的温度变化。传感器组件1914可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件1914还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件1914还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。 Sensor assembly 1914 includes one or more sensors for providing various aspects of status assessment for electronic device 1900 . For example, the sensor assembly 1914 can detect the on/off state of the electronic device 1900, the relative positioning of the components, such as the display and the keypad of the electronic device 1900, the sensor assembly 1914 can also detect the electronic device 1900 or one of the electronic device 1900 The location of components changes, the presence or absence of user contact with the electronic device 1900, the orientation or acceleration/deceleration of the electronic device 1900, and the temperature of the electronic device 1900 changes. Sensor assembly 1914 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. Sensor assembly 1914 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1914 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
通信组件1916被配置为便于电子设备1900和其他设备之间有线或无线方式的通信。电子设备1900可以接入基于通信标准的无线网络,如WiFi,运营商网络(如2G、3G、19G或5G),或它们的组合。在一个示例性实施例中,通信组件1916经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件1916还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。 Communication component 1916 is configured to facilitate wired or wireless communication between electronic device 1900 and other devices. The electronic device 1900 may access wireless networks based on communication standards, such as WiFi, carrier networks (eg, 2G, 3G, 19G, or 5G), or a combination thereof. In one exemplary embodiment, the communication component 1916 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1916 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
在示例性实施例中,电子设备1900可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述所述的图像处理方法。In an exemplary embodiment, electronic device 1900 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A programmable gate array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components are implemented for performing the image processing method described above.
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器1904,上述指令可由电子设备1900的处理器1920执行以完成上述方法。可选地,例如,存储介质可以是非临时性计算机可读存储介质,例如,所述非临时性计算机可读存储介质计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium including instructions, such as memory 1904 including instructions, executable by the processor 1920 of the electronic device 1900 to accomplish the above method. Alternatively, for example, the storage medium may be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM , tapes, floppy disks and optical data storage devices.
在本公开实施的又一方面,本公开实施例还提供了一种存储介质,在所述存储介质中的指令由电子设备的处理器执行的情况下,使得所述电子设备能够执行上述所述的图像处理方法。In yet another aspect of the implementation of the present disclosure, an embodiment of the present disclosure further provides a storage medium, which enables the electronic device to execute the above-mentioned instructions when the instructions in the storage medium are executed by a processor of an electronic device. image processing method.
根据本公开实施例的又一方面,提供了一种包含指令的计算机程序产品,在所述计算机程序产品在计算机上运行的情况下,使得计算机实现上述所述的图像处理方法。According to yet another aspect of the embodiments of the present disclosure, there is provided a computer program product including instructions, which enables the computer to implement the above-described image processing method when the computer program product runs on a computer.
本公开所有实施例均可以单独被执行,也可以与其他实施例相结合被执行,均视为本公开要求的保护范围。All the embodiments of the present disclosure can be implemented independently or in combination with other embodiments, which are all regarded as the protection scope required by the present disclosure.
本领域技术人员在考虑说明书本公开后,将容易想到本公开的其它实施方案。本申请旨在涵盖本 公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the present disclosure will readily occur to those skilled in the art upon consideration of the specification for the present disclosure. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or techniques in the technical field not disclosed by the present disclosure . The specification and examples are to be regarded as exemplary only, with the true scope and spirit of the disclosure being indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (14)

  1. 一种图像处理方法,包括:An image processing method, comprising:
    获取包含目标被美妆部位的目标图像;Obtain the target image containing the target cosmetic part;
    获取所述目标被美妆部位的轮廓特征点在所述目标图像中的坐标值,以作为目标坐标值;Obtain the coordinate value of the contour feature point of the target cosmetic part in the target image, as the target coordinate value;
    根据所述目标坐标值,以及预先确定的配置文件,得到所述目标被美妆部位的网格结构,以作为目标网格结构;According to the target coordinate value and the predetermined configuration file, the grid structure of the target cosmetic part is obtained as the target grid structure;
    根据所述目标网格结构,对所述目标被美妆部位进行美妆处理,得到美妆图像;According to the target grid structure, beauty makeup processing is performed on the target beauty makeup part to obtain a beauty makeup image;
    其中,所述配置文件中包括被美妆部位的网格结构中的预设三角形以及所述预设三角形的顶点的坐标值,所述预设三角形包括至少一个第一类三角形,一个第一类三角形的顶点包括两个所述被美妆部位的轮廓特征点和一个第一扩展点,所述第一扩展点为预先根据所述被美妆部位的轮廓设置的点。Wherein, the configuration file includes preset triangles in the mesh structure of the part to be beautified and coordinate values of vertices of the preset triangles, and the preset triangles include at least one first-type triangle, one first-type triangle The vertex of the triangle includes two contour feature points of the part to be beautified and a first expansion point, and the first expansion point is a point set in advance according to the contour of the part to be beautified.
  2. 根据权利要求1所述的图像处理方法,其中,所述根据所述目标坐标值,以及预先确定的配置文件,得到所述目标被美妆部位的网格结构,包括:The image processing method according to claim 1, wherein, according to the target coordinate value and a predetermined configuration file, the grid structure of the target cosmetic part is obtained, comprising:
    根据所述目标坐标值,以及所述第一类三角形的顶点的坐标值,计算得到第一类扩展点的坐标值,其中,所述第一类扩展点为所述目标网格结构中,与所述第一扩展点对应的点;According to the target coordinate value and the coordinate value of the vertex of the first type of triangle, the coordinate value of the first type of extension point is calculated, wherein the first type of extension point is in the target mesh structure, and the point corresponding to the first extension point;
    根据所述目标坐标值和所述第一类扩展点的坐标值,得到所述目标网格结构。According to the target coordinate value and the coordinate value of the first type of extension point, the target grid structure is obtained.
  3. 根据权利要求2所述的图像处理方法,其中,所述目标网格结构中包括至少一个第一目标三角形,所述第一目标三角形与所述第一类三角形一一对应,且所述第一类三角形与其对应的所述第一目标三角形相似;所述第一目标三角形与所述第一类扩展点一一对应,且所述第一类扩展点属于与其对应的第一目标三角形的顶点;The image processing method according to claim 2, wherein the target mesh structure includes at least one first target triangle, the first target triangle is in a one-to-one correspondence with the first type of triangle, and the first The class triangle is similar to its corresponding first target triangle; the first target triangle is in one-to-one correspondence with the first class extension point, and the first class extension point belongs to the vertex of the corresponding first target triangle;
    所述根据所述目标坐标值,以及所述第一类三角形的顶点的坐标值,计算得到第一类扩展点的坐标值,包括:According to the target coordinate value and the coordinate value of the vertex of the first-type triangle, the coordinate value of the first-type extension point is calculated and obtained, including:
    根据所述第一类三角形与其对应的所述第一目标三角形的相似关系,以及所述目标坐标值和所述第一类三角形的顶点的坐标值,计算得到所述第一类扩展点的坐标值。According to the similarity relationship between the first type of triangle and its corresponding first target triangle, as well as the target coordinate value and the coordinate value of the vertex of the first type of triangle, the coordinates of the first type of extension point are calculated and obtained value.
  4. 根据权利要求2所述的图像处理方法,其中,所述根据所述目标坐标值和所述第一类扩展点的坐标值,得到所述目标网格结构,包括:The image processing method according to claim 2, wherein the obtaining the target grid structure according to the target coordinate value and the coordinate value of the first type of extension point comprises:
    根据所述第一类扩展点的坐标值和所述目标坐标值,计算得到第二类扩展点的坐标值,其中,所述第二类扩展点为所述目标网格结构中除所述目标被美妆部位的轮廓特征点以及所述第一类扩展点之外的其他点;According to the coordinate value of the first type of extension point and the target coordinate value, the coordinate value of the second type of extension point is calculated, wherein the second type of extension point is the target grid structure divided by the target Contour feature points of the part to be beautified and points other than the first type of extension points;
    根据所述目标坐标值、所述第一类扩展点的坐标值和所述第二类扩展点的坐标值,得到所述目标网格结构。The target grid structure is obtained according to the target coordinate value, the coordinate value of the first type extension point and the coordinate value of the second type extension point.
  5. 根据权利要求4所述的图像处理方法,其中,所述预设三角形还包括至少一个第二类三角形,其中,一个第二类三角形的顶点包括一个第二扩展点和目标集合中的其中两个点,所述目标集合中包括所述被美妆部位的轮廓特征点以及所述第一扩展点,所述第二扩展点为预先根据所述被美妆部位的轮廓设置的点;The image processing method according to claim 4, wherein the preset triangle further comprises at least one triangle of the second type, wherein a vertex of a triangle of the second type comprises a second extension point and two of the target set point, the target set includes the contour feature points of the part to be beautified and the first expansion point, and the second expansion point is a point set in advance according to the contour of the part to be beautified;
    所述目标网格结构中还包括至少一个第二目标三角形,所述第二目标三角形与所述第二类三角形一一对应,且所述第二类三角形与其对应的所述第二目标三角形相似,其中,所述第二目标三角形与所述第二类扩展点一一对应,且所述第二类扩展点属于与其对应的第二目标三角形的顶点;The target mesh structure also includes at least one second target triangle, the second target triangle is in one-to-one correspondence with the second type of triangle, and the second type of triangle is similar to its corresponding second target triangle , wherein the second target triangle is in one-to-one correspondence with the second type of extension point, and the second type of extension point belongs to the vertex of the corresponding second target triangle;
    所述根据所述第一类扩展点的坐标值和所述目标坐标值,计算得到第二类扩展点的坐标值,包括:According to the coordinate value of the first type of expansion point and the target coordinate value, the calculation to obtain the coordinate value of the second type of expansion point, including:
    根据所述第二类三角形与其对应的所述第二目标三角形的相似关系,以及所述目标坐标值、所述第一类扩展点的坐标值、所述第一类三角形的顶点的坐标值以及所述第二类三角形的顶点的坐标值,计算得到所述第二类扩展点的坐标值。According to the similarity relationship between the second type of triangle and its corresponding second target triangle, and the target coordinate value, the coordinate value of the first type of extension point, the coordinate value of the vertex of the first type of triangle and The coordinate value of the vertex of the second type of triangle is calculated to obtain the coordinate value of the second type of extension point.
  6. 根据权利要求4所述的图像处理方法,其中,所述根据所述第一类扩展点的坐标值和所述目标坐标值,计算得到第二类扩展点的坐标值,包括:The image processing method according to claim 4, wherein the calculating and obtaining the coordinate value of the second type extension point according to the coordinate value of the first type extension point and the target coordinate value comprises:
    采用平滑过渡或插值方法,根据所述第一类扩展点的坐标值和所述目标坐标值,计算得到第二类扩 展点的坐标值。Using a smooth transition or interpolation method, the coordinate value of the second type of extension point is calculated according to the coordinate value of the first type of extension point and the target coordinate value.
  7. 一种图像处理装置,包括:An image processing device, comprising:
    图像获取模块,被配置为获取包含目标被美妆部位的目标图像;an image acquisition module, configured to acquire a target image containing the target cosmetic part;
    坐标值获取模块,被配置为获取所述目标被美妆部位的轮廓特征点在所述目标图像中的坐标值,以作为目标坐标值;A coordinate value acquisition module, configured to acquire the coordinate value of the contour feature point of the target cosmetic part in the target image, as the target coordinate value;
    网格结构获取模块,被配置为根据所述目标坐标值,以及预先确定的配置文件,得到所述目标被美妆部位的网格结构,以作为目标网格结构;a grid structure acquisition module, configured to obtain the grid structure of the target cosmetic part according to the target coordinate value and a predetermined configuration file, as the target grid structure;
    绘制模块,被配置为根据所述目标网格结构,对所述目标图像中的被美妆部位进行美妆处理,得到美妆图像;a drawing module, configured to perform beauty makeup processing on the beautified part in the target image according to the target grid structure to obtain a beauty makeup image;
    其中,所述配置文件中包括被美妆部位的网格结构中的预设三角形以及所述预设三角形的顶点的坐标值,所述预设三角形包括至少一个第一类三角形,一个第一类三角形的顶点包括两个所述被美妆部位的轮廓特征点和一个第一扩展点,所述第一扩展点为预先根据所述被美妆部位的轮廓设置的点。Wherein, the configuration file includes preset triangles in the mesh structure of the part to be beautified and coordinate values of vertices of the preset triangles, and the preset triangles include at least one first-type triangle, one first-type triangle The vertex of the triangle includes two contour feature points of the part to be beautified and a first expansion point, and the first expansion point is a point set in advance according to the contour of the part to be beautified.
  8. 根据权利要求7所述的图像处理装置,其中,所述网格结构获取模块包括:The image processing apparatus according to claim 7, wherein the grid structure acquisition module comprises:
    第一扩展点计算子模块,被配置为根据所述目标坐标值,以及所述第一类三角形的顶点的坐标值,计算得到第一类扩展点的坐标值,其中,所述第一类扩展点为所述目标网格结构中,与所述第一扩展点对应的点;The first extension point calculation sub-module is configured to calculate the coordinate value of the first type of extension point according to the target coordinate value and the coordinate value of the vertex of the first type of triangle, wherein the first type of extension point The point is the point corresponding to the first expansion point in the target grid structure;
    网格结构绘制子模块,被配置为根据所述目标坐标值和所述第一类扩展点的坐标值,得到所述目标网格结构。The grid structure drawing sub-module is configured to obtain the target grid structure according to the target coordinate value and the coordinate value of the first-type extension point.
  9. 根据权利要求8所述的图像处理装置,其中,所述目标网格结构中包括至少一个第一目标三角形,所述第一目标三角形与所述第一类三角形一一对应,且所述第一类三角形与其对应的所述第一目标三角形相似;所述第一目标三角形与所述第一类扩展点一一对应,且所述第一类扩展点属于与其对应的第一目标三角形的顶点;The image processing apparatus according to claim 8, wherein the target mesh structure includes at least one first target triangle, the first target triangle is in one-to-one correspondence with the first type of triangle, and the first target triangle is in a one-to-one correspondence. The class triangle is similar to its corresponding first target triangle; the first target triangle is in one-to-one correspondence with the first class extension point, and the first class extension point belongs to the vertex of the corresponding first target triangle;
    所述第一扩展点计算子模块具体被配置为:The first extension point calculation submodule is specifically configured as:
    根据所述第一类三角形与其对应的所述第一目标三角形的相似关系,以及所述目标坐标值和所述第一类三角形的顶点的坐标值,计算得到所述第一类扩展点的坐标值。According to the similarity relationship between the first type of triangle and its corresponding first target triangle, as well as the target coordinate value and the coordinate value of the vertex of the first type of triangle, the coordinates of the first type of extension point are calculated and obtained value.
  10. 根据权利要求8所述的图像处理装置,其中,所述网格结构绘制子模块包括:The image processing apparatus according to claim 8, wherein the grid structure drawing sub-module comprises:
    第二扩展点计算单元,被配置为根据所述第一类扩展点的坐标值和所述目标坐标值,计算得到第二类扩展点的坐标值,其中,所述第二类扩展点为所述目标网格结构中除所述目标被美妆部位的轮廓特征点以及所述第一类扩展点之外的其他点;The second extension point calculation unit is configured to calculate the coordinate value of the second type of extension point according to the coordinate value of the first type of extension point and the target coordinate value, wherein the second type of extension point is the Other points in the target grid structure except the contour feature points of the target beautified part and the first type of extension points;
    网格结构绘制单元,被配置为根据所述目标坐标值、所述第一类扩展点的坐标值和所述第二类扩展点的坐标值,得到所述目标网格结构。The grid structure drawing unit is configured to obtain the target grid structure according to the target coordinate value, the coordinate value of the first type of extension point and the coordinate value of the second type of extension point.
  11. 根据权利要求10所述的图像处理装置,其中,所述预设三角形还包括至少一个第二类三角形,其中,一个第二类三角形的顶点包括一个第二扩展点和目标集合中的其中两个点,所述目标集合中包括所述被美妆部位的轮廓特征点以及所述第一扩展点,所述第二扩展点为预先根据所述被美妆部位的轮廓设置的点;The image processing apparatus according to claim 10, wherein the preset triangle further includes at least one second type triangle, wherein a vertex of one second type triangle includes a second extension point and two of the target set point, the target set includes the contour feature points of the part to be beautified and the first expansion point, and the second expansion point is a point set in advance according to the contour of the part to be beautified;
    所述目标网格结构中还包括至少一个第二目标三角形,所述第二目标三角形与所述第二类三角形一一对应,且所述第二类三角形与其对应的所述第二目标三角形相似,其中,所述第二目标三角形与所述第二类扩展点一一对应,且所述第二类扩展点属于与其对应的第二目标三角形的顶点;The target mesh structure also includes at least one second target triangle, the second target triangle is in one-to-one correspondence with the second type of triangle, and the second type of triangle is similar to its corresponding second target triangle , wherein the second target triangle is in one-to-one correspondence with the second type of extension point, and the second type of extension point belongs to the vertex of the second target triangle corresponding to it;
    所述第二扩展点计算单元具体被配置为:The second extension point calculation unit is specifically configured as:
    根据所述第二类三角形与其对应的所述第二目标三角形的相似关系,以及所述目标坐标值、所述第一类扩展点的坐标值、所述第一类三角形的顶点的坐标值以及所述第二类三角形的顶点的坐标值,计算得到所述第二类扩展点的坐标值。According to the similarity relationship between the second type of triangle and its corresponding second target triangle, and the target coordinate value, the coordinate value of the first type of extension point, the coordinate value of the vertex of the first type of triangle and The coordinate value of the vertex of the second type of triangle is calculated to obtain the coordinate value of the second type of extension point.
  12. 根据权利要求10所述的图像处理装置,其中,所述第二扩展点计算子模块具体被配置为:The image processing apparatus according to claim 10, wherein the second extension point calculation submodule is specifically configured as:
    采用平滑过渡或插值方法,根据所述第一类扩展点的坐标值和所述目标坐标值,计算得到第二类扩展点的坐标值。Using a smooth transition or interpolation method, the coordinate value of the second type of expansion point is calculated according to the coordinate value of the first type of expansion point and the target coordinate value.
  13. 一种电子设备,其中,包括:An electronic device comprising:
    处理器;processor;
    用于存储所述处理器可执行指令的存储器;memory for storing instructions executable by the processor;
    其中,所述处理器被配置为执行所述指令,实现以下步骤:Wherein, the processor is configured to execute the instructions to implement the following steps:
    获取包含目标被美妆部位的目标图像;Obtain the target image containing the target cosmetic part;
    获取所述目标被美妆部位的轮廓特征点在所述目标图像中的坐标值,以作为目标坐标值;Obtain the coordinate value of the contour feature point of the target cosmetic part in the target image, as the target coordinate value;
    根据所述目标坐标值,以及预先确定的配置文件,得到所述目标被美妆部位的网格结构,以作为目标网格结构;According to the target coordinate value and the predetermined configuration file, the grid structure of the target cosmetic part is obtained as the target grid structure;
    根据所述目标网格结构,对所述目标被美妆部位进行美妆处理,得到美妆图像;According to the target grid structure, beauty makeup processing is performed on the target beauty makeup part to obtain a beauty makeup image;
    其中,所述配置文件中包括被美妆部位的网格结构中的预设三角形以及所述预设三角形的顶点的坐标值,所述预设三角形包括至少一个第一类三角形,一个第一类三角形的顶点包括两个所述被美妆部位的轮廓特征点和一个第一扩展点,所述第一扩展点为预先根据所述被美妆部位的轮廓设置的点。Wherein, the configuration file includes preset triangles in the mesh structure of the part to be beautified and coordinate values of vertices of the preset triangles, and the preset triangles include at least one first-type triangle, one first-type triangle The vertex of the triangle includes two contour feature points of the part to be beautified and a first extension point, and the first extension point is a point set in advance according to the contour of the part to be beautified.
  14. 一种非易失性存储介质,其中,在所述存储介质中的指令由电子设备的处理器执行的情况下,实现以下步骤:A non-volatile storage medium, wherein, when the instructions in the storage medium are executed by a processor of an electronic device, the following steps are implemented:
    获取包含目标被美妆部位的目标图像;Obtain the target image containing the target cosmetic part;
    获取所述目标被美妆部位的轮廓特征点在所述目标图像中的坐标值,以作为目标坐标值;Obtain the coordinate value of the contour feature point of the target cosmetic part in the target image, as the target coordinate value;
    根据所述目标坐标值,以及预先确定的配置文件,得到所述目标被美妆部位的网格结构,以作为目标网格结构;According to the target coordinate value and the predetermined configuration file, the grid structure of the target cosmetic part is obtained as the target grid structure;
    根据所述目标网格结构,对所述目标被美妆部位进行美妆处理,得到美妆图像;According to the target grid structure, beauty makeup processing is performed on the target beauty makeup part to obtain a beauty makeup image;
    其中,所述配置文件中包括被美妆部位的网格结构中的预设三角形以及所述预设三角形的顶点的坐标值,所述预设三角形包括至少一个第一类三角形,一个第一类三角形的顶点包括两个所述被美妆部位的轮廓特征点和一个第一扩展点,所述第一扩展点为预先根据所述被美妆部位的轮廓设置的点。Wherein, the configuration file includes preset triangles in the mesh structure of the part to be beautified and coordinate values of vertices of the preset triangles, and the preset triangles include at least one first-type triangle, one first-type triangle The vertex of the triangle includes two contour feature points of the part to be beautified and a first extension point, and the first extension point is a point set in advance according to the contour of the part to be beautified.
PCT/CN2021/108227 2020-08-24 2021-07-23 Image processing method and apparatus WO2022042160A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010859989.7A CN114095647A (en) 2020-08-24 2020-08-24 Image processing method, image processing device, electronic equipment and storage medium
CN202010859989.7 2020-08-24

Publications (1)

Publication Number Publication Date
WO2022042160A1 true WO2022042160A1 (en) 2022-03-03

Family

ID=80295684

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/108227 WO2022042160A1 (en) 2020-08-24 2021-07-23 Image processing method and apparatus

Country Status (2)

Country Link
CN (1) CN114095647A (en)
WO (1) WO2022042160A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070019882A1 (en) * 2004-01-30 2007-01-25 Shoji Tanaka Makeup simulation program, makeup simulation device, and makeup simulation method
CN108986016A (en) * 2018-06-28 2018-12-11 北京微播视界科技有限公司 Image beautification method, device and electronic equipment
CN109063560A (en) * 2018-06-28 2018-12-21 北京微播视界科技有限公司 Image processing method, device, computer readable storage medium and terminal
CN109165571A (en) * 2018-08-03 2019-01-08 北京字节跳动网络技术有限公司 Method and apparatus for being inserted into image
US20190035149A1 (en) * 2015-08-14 2019-01-31 Metail Limited Methods of generating personalized 3d head models or 3d body models
CN109859134A (en) * 2019-01-30 2019-06-07 珠海天燕科技有限公司 A kind of processing method and terminal of makeups material

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102509823B1 (en) * 2017-12-27 2023-03-14 삼성전자주식회사 Method and apparatus for estimating plane based on grids

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070019882A1 (en) * 2004-01-30 2007-01-25 Shoji Tanaka Makeup simulation program, makeup simulation device, and makeup simulation method
US20190035149A1 (en) * 2015-08-14 2019-01-31 Metail Limited Methods of generating personalized 3d head models or 3d body models
CN108986016A (en) * 2018-06-28 2018-12-11 北京微播视界科技有限公司 Image beautification method, device and electronic equipment
CN109063560A (en) * 2018-06-28 2018-12-21 北京微播视界科技有限公司 Image processing method, device, computer readable storage medium and terminal
CN109165571A (en) * 2018-08-03 2019-01-08 北京字节跳动网络技术有限公司 Method and apparatus for being inserted into image
CN109859134A (en) * 2019-01-30 2019-06-07 珠海天燕科技有限公司 A kind of processing method and terminal of makeups material

Also Published As

Publication number Publication date
CN114095647A (en) 2022-02-25

Similar Documents

Publication Publication Date Title
CN110675310B (en) Video processing method and device, electronic equipment and storage medium
WO2019223421A1 (en) Method and device for generating cartoon face image, and computer storage medium
WO2022179025A1 (en) Image processing method and apparatus, electronic device, and storage medium
KR101649596B1 (en) Method, apparatus, program, and recording medium for skin color adjustment
US20210256672A1 (en) Method, electronic device and storage medium for processing image
CN107680033B (en) Picture processing method and device
WO2020007241A1 (en) Image processing method and apparatus, electronic device, and computer-readable storage medium
US11308692B2 (en) Method and device for processing image, and storage medium
CN107977934B (en) Image processing method and device
CN107341777B (en) Picture processing method and device
CN107330868A (en) image processing method and device
CN107657590B (en) Picture processing method and device and storage medium
WO2022077970A1 (en) Method and apparatus for adding special effects
WO2022088750A1 (en) Image generation method and electronic device
WO2022193466A1 (en) Image processing method and apparatus, and electronic device and storage medium
WO2021098107A1 (en) Image processing method and apparatus, electronic device, and storage medium
WO2022110837A1 (en) Image processing method and device
TW202013316A (en) Method, device and electronic apparatus for face image processing and storage medium thereof
WO2022095860A1 (en) Fingernail special effect adding method and device
CN110782532A (en) Image generation method, image generation device, electronic device, and storage medium
CN109934168B (en) Face image mapping method and device
WO2023142645A1 (en) Image processing method and apparatus, and electronic device, storage medium and computer program product
WO2022042160A1 (en) Image processing method and apparatus
CN111373409B (en) Method and terminal for obtaining color value change
CN112614228B (en) Method, device, electronic equipment and storage medium for simplifying three-dimensional grid

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21860000

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 27.06.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21860000

Country of ref document: EP

Kind code of ref document: A1