WO2022179215A1 - 图像处理方法及装置、电子设备和存储介质 - Google Patents

图像处理方法及装置、电子设备和存储介质 Download PDF

Info

Publication number
WO2022179215A1
WO2022179215A1 PCT/CN2021/133045 CN2021133045W WO2022179215A1 WO 2022179215 A1 WO2022179215 A1 WO 2022179215A1 CN 2021133045 W CN2021133045 W CN 2021133045W WO 2022179215 A1 WO2022179215 A1 WO 2022179215A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
color
pixel
face image
face
Prior art date
Application number
PCT/CN2021/133045
Other languages
English (en)
French (fr)
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 WO2022179215A1 publication Critical patent/WO2022179215A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/94Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • 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
    • G06V10/46Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
    • G06V10/462Salient features, e.g. scale invariant feature transforms [SIFT]
    • 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
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • G06V40/171Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Definitions

  • the present disclosure relates to the field of computer vision, and in particular, to an image processing method and apparatus, an electronic device and a storage medium.
  • Foundation beauty can render people's faces, adjust skin tone, and cover up skin defects, so that the skin looks smoother and beautifies the visual experience.
  • foundation processing on face images has been more and more widely used in people's lives.
  • an image processing method comprising:
  • an image processing apparatus including:
  • the original color extraction module is used for extracting the original color of at least one pixel point in the target object of the face image in response to the beauty operation for the target object of the face image;
  • the target color determination module is used for according to the beauty
  • the color selected in the makeup operation and the original color of at least one pixel in the target object determine the target color of at least one pixel in the target object;
  • the fusion module is used to combine at least one pixel in the target object.
  • the original color and the target color are fused to obtain a fused face image.
  • a computer-readable storage medium having computer program instructions stored thereon, the computer program instructions implementing the above-mentioned image processing method when executed by a processor.
  • a computer program product comprising computer readable code, when the computer readable code is executed in an electronic device, a processor in the electronic device performs the above method.
  • the target face area to be subjected to the foundation processing operation can be located more accurately from the face image, and the accuracy of the foundation processing operation can be improved;
  • the target colors of the obtained multiple pixels are corresponding to their original colors, so that the color excess in the fusion face image that combines the original color and the target color is more realistic and natural, and the natural effect of the fusion face image is improved.
  • FIG. 1 shows a flowchart of an image processing method according to an embodiment of the present disclosure.
  • FIG. 2 shows a schematic diagram of a preset face material according to an embodiment of the present disclosure.
  • FIG. 4 shows a schematic diagram of a constructed triangular mesh according to an embodiment of the present disclosure.
  • FIG. 5 shows a schematic diagram of a target material according to an embodiment of the present disclosure.
  • FIG. 6 shows a schematic diagram of a color lookup table according to an embodiment of the present disclosure.
  • FIG. 7 shows a schematic diagram of a face image according to an embodiment of the present disclosure.
  • FIG. 8 shows a schematic diagram of fusing face images according to an embodiment of the present disclosure.
  • FIG. 9 shows a schematic diagram of fusing face images according to an embodiment of the present disclosure.
  • FIG. 10 shows a schematic diagram of fusing face images according to an embodiment of the present disclosure.
  • FIG. 12 shows a block diagram of an image processing apparatus according to an embodiment of the present disclosure.
  • FIG. 13 shows a schematic diagram of an application example according to the present disclosure.
  • FIG. 14 shows a schematic diagram of an application example according to the present disclosure.
  • the method can be applied to an image processing apparatus or an image processing system, and the image processing apparatus can be a terminal device, a server, or other processing devices.
  • the terminal device may be User Equipment (UE), mobile device, user terminal, terminal, cellular phone, cordless phone, Personal Digital Assistant (PDA), handheld device, computing device, vehicle-mounted device, wearable devices, etc.
  • UE User Equipment
  • PDA Personal Digital Assistant
  • the image processing method may be applied to a cloud server or a local server
  • the cloud server may be a public cloud server or a private cloud server, which can be flexibly selected according to actual conditions.
  • the image processing method can also be implemented by the processor calling computer-readable instructions stored in the memory.
  • the image processing method may include:
  • Step S11 in response to the cosmetic operation on the target object of the face image, extract the original color of at least one pixel in the target object of the face image.
  • the face image may be any image including a face, and the face image may include one face or multiple faces, and its implementation form can be flexibly determined according to the actual situation, which is not limited in the embodiments of the present disclosure .
  • the operation content included in the operation can be flexibly determined according to the actual situation, and is not limited to the following disclosed embodiments.
  • the beauty makeup operation may include an operation of instructing to perform beauty makeup processing on the face image; in a possible implementation manner, the beauty makeup operation may further include selecting a beauty makeup operation Color, etc.; in a possible implementation manner, the beauty makeup operation may further include an operation indicating a treatment type of beauty makeup, and the like.
  • the target object can be any object in the face image that needs beauty makeup.
  • the target object can be one or more target parts in the face image, and which parts are included in the target part, the implementation form is the same It can be flexibly determined according to the actual situation of the beauty makeup operation.
  • the target part may include the lip region.
  • the target object may also be a target face area in the face image
  • the target face area may be any area in the face image to be performed a beauty operation
  • the target face area may include a human face
  • One or more part areas in the face the implementation form of which can be flexibly determined according to the actual situation, for example, it can include the cheek area, the bridge of the nose, the chin area, the forehead area, and the area around the eyes. one or more, etc.
  • the makeup operation may include any one or more makeup operations of multiple makeup types, for example, may include makeup operations on a target area of the face, such as foundation operations, highlight operations , grooming operations, etc.
  • the target area can be understood as the area on the face to be applied, and it can also include cosmetic operations on the target parts of the face, such as lip makeup operations, eye makeup operations, eye shadow operations, etc.
  • the target area It can be understood as the organ part of the face to be applied with makeup.
  • the types of processing included in the beauty operations can also be flexibly changed.
  • the beauty operations can include one type of processing.
  • Makeup operations can also include multiple treatment types at the same time.
  • the treatment type may include natural treatment and/or metallic light effect treatment.
  • the natural treatment may include natural modification of the color of the lips to retain the original glossy effect of the lips;
  • the metallic light treatment may include modification of the color of the lips and change of the light effect, so as to obtain a lip makeup effect with metallic luster.
  • the original color may be the unprocessed color of the target object in the face image.
  • the method of extracting the original color of at least one pixel point from the target object of the face image is not limited in the embodiments of the present disclosure, and can be based on actual conditions. Flexible decision.
  • the area where the target object is located in the face image may be determined, and the color of one or more pixels contained in the area may be extracted to obtain at least one pixel in the target object of the face image The original color of the point.
  • Step S12 Determine the target color of at least one pixel in the target object according to the color selected in the beauty makeup operation and the original color of at least one pixel in the target object.
  • the target color of at least one pixel in the target object can be determined respectively, wherein the target color can be related to the selected color and is related to the selected color.
  • the original color corresponds.
  • the selected color can be fused with the original color of at least one pixel to obtain the target color. Find the target color corresponding to the original color in a certain color range where the selected color is located. Specifically how to obtain the target color of at least one pixel in the target object according to the selected color and the original color, the processing method can be flexibly determined according to the actual situation, see the following disclosed embodiments for details, and will not be expanded here.
  • Step S13 fuse the original color of at least one pixel in the target object with the target color to obtain a fused face image.
  • the fusion of the original color of at least one pixel in the target object with the target color may be to perform fusion processing on a plurality of pixels in the target object respectively.
  • the pixel point is fused with the original color of the pixel point based on the target color determined by the original color to obtain the fused color of the pixel point, and then the fused face image is obtained.
  • step S13 The manner of fusion in step S13 can be flexibly changed according to the actual situation.
  • the target color of at least one pixel in the target object is determined, so that the original color of at least one pixel in the target object and the target color are fused to obtain a fused face image.
  • the obtained target colors of multiple pixels can be made to correspond to their respective original colors, so that the color excess in the fusion face image that combines the original color and the target color is more realistic and natural, and the fusion effect is improved. Effects and realism of face images.
  • the target object may include the target face area to be subjected to the foundation processing operation.
  • step S11 may include:
  • the original color of at least one pixel in the target face region of the face image is extracted.
  • the preset face material may be a relevant material used to perform foundation processing on the face image, and the preset face material may indicate the area and/or part included in the target face area through the preset pixel color
  • the color type of the preset pixel color can be flexibly set according to the actual situation, and can include one color or multiple colors.
  • the preset pixel color may be a color that is clearly different from the color contained in the face image, such as red, green, blue or It is a rarer color in other people's faces, etc.
  • FIG. 2 shows a schematic diagram of a preset face material according to an embodiment of the present disclosure.
  • the preset face material may be a face mask, and the face mask passes through red pixels.
  • the color (not shown in the image after grayscale processing) indicates that the target face area includes other face areas except eyes, eyebrows, and lips.
  • the preset face material can also be a preset material, which is automatically called when the foundation processing operation is selected; in a possible implementation, the preset face material can also be It is the material selected by the user together in the foundation processing operation.
  • the preset face material can indicate the area and/or part included in the target face region by the preset pixel color, it can be determined that the target face region is in the face image based on the pixel color of the preset face material s position.
  • the determination process can be flexibly determined according to the actual situation. For example, after the preset face material can be directly fused with the face image, the position of the target face area in the face image can be determined according to the color of the pixels in the fused image; The preset face material is fused with the standard preset face image, and then the position of the target face area in the face image is determined according to the correspondence between the fused image and the face image, as well as the color of the pixels in the fused image. etc., the specific determination method is detailed in the following disclosed embodiments, which will not be expanded here.
  • the method of extracting the original color of at least one pixel in the target face region of the face image is not limited in the embodiments of the present disclosure, and can be flexibly determined according to the actual situation.
  • the color of one or more pixels contained in the target face region may be extracted according to the position of the target face region in the face image, so as to obtain at least one pixel in the target face region of the face image.
  • the original color of a pixel is not limited in the embodiments of the present disclosure, and can be flexibly determined according to the actual situation.
  • the color of one or more pixels contained in the target face region may be extracted according to the position of the target face region in the face image, so as to obtain at least one pixel in the target face region of the face image.
  • the position of the target face region in the face image where the foundation processing operation is to be performed is determined based on the pixel color of the preset face material, so that according to the position of the target face region in the face image, Extract the original color of at least one pixel in the target face region of the face image.
  • determining the position of the target face region in the face image based on the pixel color of the preset face material may include:
  • the preset face material and the preset face image are fused to obtain a standard material image, wherein the pixel color of the target face area in the standard material image matches the preset face material.
  • the position of the target face region in the face image is determined.
  • the preset face image may be a standard face image template, which may include complete and comprehensive face parts, and the positions of each face part in the preset face image are standard.
  • the realization form of the preset face image can be flexibly determined according to the actual situation, and any standard face used in the field of face image processing can be used as the realization form of the preset face image.
  • 3 shows a schematic diagram of a preset face image according to an embodiment of the present disclosure (in order to protect objects in the image, part of the face in the figure is subjected to mosaic processing). It can be seen from the figure that in a In the example, the face positions included in the preset face image are clear, complete and consistent with the objective distribution of the face positions of each person in the face.
  • the preset face material can be directly fused with the preset face image to obtain a standard material image.
  • the manner in which the preset face material and the preset face image are fused is not limited in the embodiments of the present disclosure.
  • the preset face material corresponding to the preset face image may be directly The pixel points are superimposed to obtain a standard material image; in some possible implementations, the preset face material and the preset face image may also be superimposed and fused according to a preset weight.
  • the preset face material can use preset pixel colors to indicate the area and/or part included in the target face area. Therefore, in some possible implementations, the fused annotation In the material image, the color of the pixels located in the target face area can also match the preset pixel color in the preset face material, so that the position of the target face area in the standard material image can be determined according to the pixel color. In some possible implementations, the color matching may be the same or similar, etc.
  • the pixel color of the target face area in the standard material image may be consistent with the preset pixel color in the preset face material, for example, both are red; in an example, in the preset face material and the preset
  • the pixel color of the target face area in the standard material image can belong to the same color category as the preset pixel color in the preset face material, but there are certain differences, such as the preset face.
  • the preset pixel color in the partial material can be dark red, and the pixel color of the target face area in the fused standard material image can be light red, etc.
  • the position mapping relationship between the standard material image and the face image can be further obtained, wherein the position mapping relationship can indicate the position mapping of the same pixel between the standard material image and the face image.
  • the determination method can be flexibly selected according to the actual situation. to calculate the position mapping relationship, or determine the position mapping relationship according to the image size and vertex coordinates of the standard material image and the face image.
  • the position of the target face region in the face image can be determined according to the pixel color and position mapping relationship of the standard material image.
  • the realization method of determining the position of the target face region in the face image can be flexibly determined according to the actual situation.
  • the position of the target face region in the standard material image can be determined according to the pixel color of the standard material image, and then the position mapping relationship can be used to determine the position of the target face region in the standard material image.
  • the location of the region in the face image, etc. please refer to the following disclosed embodiments, which will not be expanded here.
  • the pixel colors in the preset face material can be first fused to the standard preset face image, and then the target can be determined by using the positional mapping relationship between the fused standard material image and the face image.
  • the position of the face area in the face image, through the above process, the standard preset face image can be used as an intermediate medium, and the pixel color in the preset face material can be used to more accurately target the target in the face image.
  • the face area is positioned to further improve the accuracy of foundation processing operations.
  • acquiring the position mapping relationship between the standard material image and the face image may include:
  • the position mapping relationship between the standard material image and the face image is determined according to the positional correspondence between the same key point in the first key point identification result and the second key point identification result.
  • the first key point recognition result may be the result obtained by performing key point recognition on a preset face image or standard material image
  • the second key point recognition result may be the result obtained by performing key point recognition on a face image.
  • “One” and “Second” are only used to distinguish the objects identified by key points, and do not limit the sequence or method of identification.
  • the first key point recognition result may be obtained by performing key point recognition on a preset face image, or the first key point recognition result may be obtained by performing key point recognition on a standard material image.
  • the first key point identification result may include the identified key points, and may also include interpolation key points obtained by performing interpolation based on the identified key points, and the like.
  • the second key point identification result is the same, and will not be repeated here.
  • the identified key points may be related key points for locating the positions of key regions in the face, such as eye key points, mouth key points, eyebrow key points or nose key points.
  • the identified key points specifically include which key points and the number of included key points are not limited in the embodiments of the present disclosure, and can be flexibly selected according to actual conditions.
  • all relevant key points in the face image can be identified, such as 106 whole-face key points (Face106) of the face, etc.; in some possible implementations, the face image can also be obtained Some key points, such as the key points related to the target face area, such as the relevant key points of the cheeks, chin or forehead, etc.
  • the method for identifying key points is not limited in the embodiments of the present disclosure, and any method that can identify key points in an image can be used as an implementation method for identifying key points.
  • the method of performing key point recognition on the preset face image or the standard material image and the face image may be the same or different, which is also not limited in the embodiment of the present disclosure.
  • a neural network with a key point recognition function can be used to perform key point recognition on a preset face image or a standard material image and a face image, respectively.
  • the position transformation relationship in the face image, and the position transformation relationship can be used as the position mapping relationship between the standard material image and the face image.
  • a triangular mesh may be constructed in the standard material image and the face image, respectively, based on the first key point identification result and the second key point identification result.
  • the manner of constructing the triangular mesh is not limited in the embodiments of the present disclosure. Taking the triangular mesh in the standard material image as an example, in a possible implementation manner, a plurality of In keypoints and/or interpolated keypoints, every three adjacent points are connected to obtain multiple triangular meshes.
  • the constructed triangular mesh can be used for subsequent fusion or rendering, and the positional mapping relationship between the standard material image and the face image can also be determined through the vertex coordinates of the triangular mesh.
  • FIG. 4 shows a schematic diagram of a triangular mesh constructed according to an embodiment of the present disclosure (same as above, in order to protect objects in the image, part of the face in the figure is subjected to mosaic processing).
  • a triangular mesh constructed according to an embodiment of the present disclosure (same as above, in order to protect objects in the image, part of the face in the figure is subjected to mosaic processing).
  • multiple triangular meshes can be obtained.
  • the first key point recognition result is obtained by performing key point recognition on a preset face image or a standard material image
  • the second key point recognition result is obtained by performing key point recognition on the face image, so that according to The first key point recognition result and the second key point recognition result determine the position mapping relationship between the standard material image and the face image.
  • the position of the target face region in the face image is determined based on the pixel color and position mapping relationship of the standard material image, including:
  • the position of the target face region in the standard material image is mapped to the face image, and the position of the target face region in the face image is determined.
  • the pixel color of the target face area in the fused standard material image matches the preset face material. Therefore, in a possible implementation manner, the pixel color in the standard material image may be matched with the preset face material. Pixels of the color matching the preset pixel color in the preset face material are confirmed as pixels belonging to the target face area. For example, in one example, the preset pixel color in the preset face material is red, and after the preset face material is fused with the preset face image, the pixel points fused with the preset face material are The color is also red.
  • the pixels whose pixel color is red in the standard material image can be confirmed as belonging to the target face area, so as to obtain the position of the target face area in the standard material image; in an example, The preset pixel color in the preset face material is dark red, and after the preset face material is fused with the preset face image, the color of the pixels fused with the preset face material is light matching the dark red. Red, in this case, the pixels whose pixel color is light red in the standard material image can be confirmed as belonging to the target face area, so as to obtain the position of the target face area in the standard material image, etc.
  • the position of the target face region in the standard material image can be mapped to the face image according to the position mapping relationship.
  • the mapping method is different in the embodiments of the present disclosure. As a limitation, it can be flexibly determined according to the realization form of the position mapping relationship.
  • the position coordinates of the target face region in the standard material image can be transformed through the position mapping relationship to obtain the target face region in the face. Position coordinates in the image.
  • the position of the target face region in the standard material image can be determined based on the pixel color of the standard material image, and the position of the target face region in the face image can be further determined based on the positional relationship.
  • pixel screening and position transformation can be used to locate the target face area in the face image simply and quickly, which improves the speed and convenience of image processing.
  • the makeup operation may include a beautification operation on a target part of the human face, and the target object may include a target part to be beautified;
  • step S11 may include:
  • the original color of at least one pixel in the target part of the face image is extracted.
  • the implementation of the beautification operation may refer to various implementation forms of the cosmetic operation in the above disclosed embodiments, and the implementation forms of the target parts may also refer to the implementation forms of the target parts in the above disclosed embodiments, which will not be repeated here.
  • the target material can be a related material used to realize beauty makeup on the face image, and the realization form of the target material can be flexibly determined according to the actual situation of the beauty operation.
  • the target material may be a lip makeup material, such as a lip mask.
  • the target material may also be the preset face material mentioned in the above disclosed embodiments.
  • the target material may be a material selected by the user in the beauty operation; in some possible implementations, the target material may also be a preset material, which is selected in the beauty operation is called automatically. In some possible implementation manners, the target material may also be a material obtained by processing the original target material based on a face image. How to obtain the target material, and the implementation method thereof, can be found in the following disclosed embodiments, which will not be expanded here.
  • the original color of at least one pixel in the target part of the face image can be extracted according to the transparency of at least one pixel in the target material.
  • the extraction method can be flexibly determined according to the actual situation.
  • the position of the pixel points in the face image and the pixel points can be compared.
  • the corresponding area is taken as the image area where the target part is located, and the original colors of multiple pixels in the image area are extracted.
  • the specific range of the preset transparency range can be flexibly determined according to the actual situation.
  • the preset transparency range can be set to be lower than 100%, that is, the transparency of the pixels in the target material is low.
  • 100% not fully transparent
  • the area corresponding to the position of the pixel in the face image can be used as the image area where the target part is located, and the original color of the pixel in the image area can be extracted;
  • the preset transparency range may also be set to be lower than other transparency values, or within a certain transparency range, etc.
  • the embodiment of the present disclosure does not limit the range value of the preset transparency range.
  • the value of the preset transparency range can be set, and more Targetedly determine the image area where the target part that meets the requirements is located, so as to extract the more accurate original color of the target part from the face image, and then improve the reliability and authenticity of the subsequent fusion face image.
  • the target material may be a lip mask, and the transparency of different pixels in the lip mask is different , which can better represent the natural and real lip shape, so the original color in the face image extracted based on the lip mask is also more accurate and reliable.
  • the method proposed by the embodiment of the present disclosure may further include: recognizing the target part in the face image to obtain the initial position of the target part in the face image.
  • the initial position may be determined according to the face image, and the approximate position of the target part in the face image.
  • the method for determining the initial position of the target part is not limited in the embodiments of the present disclosure, and can be flexibly selected according to the actual situation, and is not limited to the following disclosed embodiments.
  • the initial position of the target part can be determined by identifying the key points of the target part.
  • the initial position of the target part can be determined according to the coordinates of the identified key points of the target part in the face image. Or determine the range of the target part in the face image according to the key points of the recognized target part, so as to obtain the initial position of the target part, etc.
  • the target part in the face image is identified to obtain the initial position of the target part in the face image, which may include:
  • the initial position of the target part in the face image is determined.
  • the face key points may be relevant key points for locating the positions of key regions in the face, such as eye key points, mouth key points, eyebrow key points or nose key points.
  • the acquired face key points specifically include which key points and the number of key points included are not limited in the embodiments of the present disclosure, and can be flexibly selected according to the actual situation.
  • all relevant key points in the face image can be obtained, such as 106 whole face key points (Face106) of the face, etc.; in some possible implementations, the face image can also be obtained.
  • the manner of obtaining the key points of the face is not limited in the embodiments of the present disclosure, and any method that can identify the key points of the face in the image can be used as an implementation manner of obtaining the key points of the face.
  • the key points of the face and the method of obtaining the key points of the face may all refer to the methods of identifying the key points in the above disclosed embodiments, which will not be repeated here.
  • a triangular mesh After acquiring at least one face key point, a triangular mesh can be constructed in the face image according to the face key point.
  • the manner of constructing the triangular mesh is not limited in the embodiments of the present disclosure, and reference may also be made to the above disclosed embodiments, which will not be repeated here.
  • a triangular mesh corresponding to the target part can also be constructed in the face image according to the key points of the face.
  • the difference is that The face key points and interpolation points related to the target part can be obtained to construct a triangular mesh corresponding to the target part, and the construction of the triangular meshes of other parts in the face image is omitted.
  • the initial position of the target part in the face image can be determined according to the position coordinates of the triangular mesh in the face image.
  • the expression form of the initial position is not limited in the embodiment of the present disclosure.
  • the position of the center point of one or more triangular meshes corresponding to the target part may be used as the initial position of the target part;
  • the coordinates of each vertex of one or more triangular meshes corresponding to the target part can also be used as the initial position of the target part, etc., which can be flexibly selected according to the actual situation.
  • a triangular mesh corresponding to the target part is constructed in the face image, so as to determine the position coordinates of the triangular mesh in the face image.
  • the initial position of the target site Through the above process, the initial positioning of the target part in the face image can be efficiently and accurately performed by means of key point recognition and grid construction, so as to facilitate the subsequent acquisition of target materials matching the target part, thereby improving image processing. accuracy and authenticity.
  • acquiring the target material corresponding to the target part may include:
  • the target part obtain the original target material corresponding to the target part
  • the standard material image is extracted to obtain the target material.
  • the original target material may be a preset material bound to the beauty makeup operation, for example, the original lip mask corresponding to the lip makeup operation may be used as the original target material.
  • the manner of obtaining the original target material is not limited in the embodiments of the present disclosure.
  • the material selected in the beauty makeup operation may be used as the original target material, or the corresponding original target material may be automatically read according to the beauty makeup operation.
  • the original target material can be directly fused with the position corresponding to the target part in the preset face image to obtain a standard material image.
  • the manner in which the original target material and the target part in the preset face image are fused is not limited in the embodiments of the present disclosure.
  • the original target material and the target part in the preset face image can be directly merged
  • the corresponding pixels in the face image are added to obtain the standard material image; in some possible implementations, the original target material and the target part in the preset face image can also be added and fused according to the preset weight.
  • a standard material image By fusing the original target material with the target part in the preset face image, a standard material image can be obtained.
  • the target material may be extracted from the standard material image based on the initial position in the above disclosed embodiments.
  • the method of extracting the target material based on the initial position may include: acquiring the color value and transparency of each pixel in the range corresponding to the initial position in the standard material image, The image composed of pixels is used as the target material.
  • the target material By fusing the original target material with the target part in the preset face image, a standard material image is obtained, and based on the initial position, the target material is extracted from the standard material image, because the initial position is based on the target part in the face image. Therefore, through the above process, the obtained target material can be more corresponding to the position of the target part in the face image, so that the original color of at least one pixel in the extracted target part can be more realistic and reliable.
  • step S12 may include:
  • a corresponding color search is performed on the original color of at least one pixel in the target object of the face image, and the target color of at least one pixel in the target object is obtained.
  • the target color may be a color determined by performing a corresponding search based on the original color in the range of the selected colors, and the target color belongs to the selected color range and corresponds to the original color.
  • the search method can be flexibly determined according to the actual situation. For details, please refer to the following disclosed embodiments. Do not expand at this time.
  • the target color of at least one pixel point in the target object is obtained.
  • color search can be used to obtain the target color that belongs to the range of the selected color and corresponds to the original color, so that the color of the target color is more realistic, and the color transition between different pixels is more natural.
  • the naturalness of the fusion face image also enhances the beauty effect.
  • a corresponding color search is performed on the original color of at least one pixel in the target object of the face image, and the target color of at least one pixel in the target object is obtained.
  • a corresponding color search is performed on the original color of at least one pixel in the target object of the face image, and the target color of at least one pixel in the target object is obtained.
  • the output color corresponding to the original color of at least one pixel in the target object of the face image is respectively searched in the color lookup table, as the target color of at least one pixel in the target object.
  • the color lookup table may include a plurality of correspondences between input colors and output colors, wherein the input color may be the color searched in the color lookup table, and the output color may be the color found in the color lookup table. For example, for example, searching in the color lookup table according to the input color A, the output color B corresponding to A can be found.
  • the corresponding relationship between the colors in the color lookup table can be flexibly set according to the actual situation, which is not limited in this embodiment of the present disclosure.
  • the output colors in the color lookup table may be arranged in a gradient form, and the specific arrangement manner is not limited in the embodiments of the present disclosure, and is not limited to the following disclosed embodiments.
  • the color lookup table corresponding to the selected color can be obtained according to the color selected in the beauty operation.
  • the output color in the color lookup table belongs to the corresponding selected color. Therefore, the target color found according to the color lookup table can be within the corresponding range of the selected color and correspond to the original color.
  • the output color corresponding to each pixel can be searched from the color lookup table according to the original colors of the pixels in the target object, and used as the target color of the pixels in the target object.
  • the search method can be flexibly determined according to the form of the color look-up table, which is not limited in this embodiment of the present disclosure.
  • FIG. 6 shows a schematic diagram of a color lookup table according to an embodiment of the present disclosure.
  • the color lookup table includes a plurality of gradient colors with natural transitions as output colors (due to the grayscale image display The color with different shades in the picture is actually a gradient color with color difference), after obtaining the original colors of multiple pixels in the target face area, you can look up these multiple pixels from the color lookup table respectively.
  • the output color is used as the target color.
  • the color lookup table containing the gradient output color can be used to obtain the target color with natural color transition, so that the target color obtained later can be Color transitions are also more natural, improving the naturalness and beauty of the resulting fused face image.
  • the target object may include the target part mentioned in the above disclosed embodiments, and the target color of at least one pixel of the target object obtained through color search may be the initial target color, in this case , step S12 may also include:
  • the target color of at least one pixel in the target part is determined according to the initial target color of at least one pixel in the target part.
  • the initial target color may be the target color mentioned in the above-mentioned disclosed embodiments, that is, in the range of the selected colors, the color determined by performing the corresponding search based on the original color, the initial target color belongs to the selected color range , and corresponds to the original color.
  • step S12 may further determine the target color based on the initial target color.
  • the initial target color can be directly used as the target color; in some possible implementations, some processing can also be performed on the initial target color, such as adjustment or fusion with other colors, etc., to Obtain the target color; in some possible implementations, it is also possible to select how to process the initial target color to obtain the target color according to the processing type corresponding to the beauty operation. How to further determine the target color according to the initial target color, the implementation method thereof can also refer to the following disclosed embodiments, which will not be expanded here.
  • the target color of at least one pixel in the target part is determined according to the initial target color.
  • determining the target color of at least one pixel in the target part according to the initial target color of at least one pixel in the target part may include:
  • the initial target color of at least one pixel in the target part is used as the target color of at least one pixel in the target part.
  • the processing type corresponding to the beauty operation includes metal light effect processing
  • the initial target color of at least one pixel in the target part is adjusted based on the randomly obtained noise value, and the target color of at least one pixel in the target part is obtained.
  • the noise value may be the noise value or information added to each pixel in the image, and the method of randomly obtaining the noise value may be to obtain the randomly obtained noise value by generating random data, and the method of generating the random data is implemented in this disclosure.
  • the examples are not limited. For details, please refer to the following disclosed embodiments, which will not be expanded here.
  • the initial target color may be directly used as the target color.
  • the initial target color of at least one pixel point in the target part may be adjusted based on the randomly obtained noise value to change different pixel points
  • the color makes the target area appear metallic light effect.
  • different methods can be selected to adjust the initial target color to determine the target color, which improves the flexibility of the beauty operation; value to adjust the initial target color of at least one pixel in the target part.
  • the color can be adjusted based on random data to obtain a more natural metallic light effect.
  • the initial target color of at least one pixel in the target part is adjusted to obtain the target color of at least one pixel in the target part, which may include:
  • the initial target color of the pixel is adjusted according to the brightness information of the pixel to obtain the target color of the pixel.
  • the noise value of each pixel can be obtained separately, wherein, the noise value of each pixel can be obtained in a random way, and the obtaining method can be based on the actual situation.
  • the noise value of each pixel point may be obtained by generating a random number within a certain numerical range.
  • separately acquiring the noise value corresponding to the pixel point may include:
  • sampling is performed at the corresponding position of the preset noise texture to obtain the noise value corresponding to the pixel point.
  • the preset noise texture may be an image whose shape matches the target part, and the noise value of each point in the image may be randomly generated in advance.
  • the corresponding noise value of each pixel in the target part in the preset noise texture may be determined according to the positional correspondence between the target part and the preset noise texture.
  • the corresponding noise values of a plurality of pixel points can be obtained more conveniently, so that the obtained While the noise value is a random value, the efficiency of acquiring the noise value is improved, thereby improving the efficiency of image processing.
  • the processing modes corresponding to different pixel points can be determined by comparing the noise value with the preset noise range.
  • the value of the preset noise range can be flexibly set according to the actual situation, and is not limited to the following disclosed embodiments. 0.78 ⁇ 0.8, etc.
  • the initial target color of the pixel can be adjusted according to the noise value corresponding to the pixel and the transparency of the pixel corresponding to the pixel in the target material. Adjust to get the target color of the pixel.
  • the specific adjustment mode can be flexibly selected according to the actual situation, and is not limited to the following disclosed embodiments.
  • the initial target color of the pixel is adjusted to obtain the target color of the pixel, which may include:
  • the initial target color of the pixel is adjusted to obtain the target color of the pixel.
  • the adjustment coefficient may be a relevant parameter in the process of adjusting the initial target color.
  • the calculation method of the adjustment coefficient determined according to the noise value and transparency can be flexibly determined according to the actual situation, and is not limited to the following disclosed embodiments.
  • the method of determining the adjustment coefficient according to the noise value and transparency can be determined by the following formula (1) to express:
  • Adjustment coefficient noise value ⁇ pow (transparency, 4.0) (1)
  • pow(x, y) indicates the result of calculating the power of y of x, so pow(transparency, 4.0) is the value of calculating the power of 4 of transparency.
  • the target color of the pixel can be determined according to the adjustment coefficient and the preset light source value. There is no limitation in the embodiments of the present disclosure.
  • the method of adjusting the initial target color based on the adjustment coefficient and the preset light source value can also be flexibly set according to the actual situation, and is not limited to the following disclosed embodiments.
  • the method is determined according to the adjustment coefficient and the preset light source value
  • the way of the target color can be expressed by the following formula (2):
  • Target color initial target color + adjustment factor ⁇ preset light source value (2)
  • the target color of at least one pixel in the target part can be obtained when the noise value is within the preset noise range.
  • the noise value may also be outside the preset noise range.
  • the initial target color of the pixel can be adjusted according to the brightness information of the pixel to obtain the pixel's initial target color. target color.
  • the brightness information may be related information determined according to the color of the pixel in the target part of the face image, etc., and the content of the information may be flexibly determined according to the actual situation. How to determine the brightness information of a pixel point and how to adjust the initial target color according to the brightness information can be implemented in detail in the following disclosed embodiments, which will not be expanded here.
  • the noise value corresponding to the pixel point is obtained separately for at least one pixel point in the target part, and when the noise value falls within the preset noise range, the initial value of the pixel point is determined according to the noise value.
  • the target color is adjusted.
  • the noise value falls outside the preset noise range, the initial target color is adjusted according to the brightness information of the pixel point.
  • the brightness information may include the first brightness, the second brightness and the third brightness, and the initial target color of the pixel is adjusted according to the brightness information of the pixel to obtain the target color of the pixel, which can be include:
  • the first brightness of the pixel is determined according to the original color of the pixel.
  • the second brightness of the pixel point with the target brightness in the preset processing range is determined.
  • the pixel points are filtered through a preset convolution kernel, and the third brightness of the pixel points is determined according to the intermediate color obtained by the filtering of the pixel points, wherein the filtering range of the preset convolution kernel is consistent with the preset processing range .
  • the initial target color of the pixel is adjusted to obtain the target color of the pixel.
  • the first brightness may be a brightness value determined according to the color value of the original color of the pixel, wherein the brightness value may be determined by calculating the color value, in an example, the brightness value may be determined according to three of the color values.
  • the values of the color channels red R, green G, and blue B are calculated.
  • the second brightness can also be determined according to the color value of the pixel with the target brightness, wherein the pixel with the target brightness can be in the target part of the face image, within the preset processing range of the pixel and having the highest Brightness of pixels.
  • the range size of the preset processing range can be flexibly set according to the actual situation, which is not limited in the embodiments of the present disclosure.
  • the third brightness may be a brightness value determined according to a color value of an intermediate color of a pixel, wherein the intermediate color of a pixel may be a color obtained by filtering the pixel through a preset convolution check.
  • the form and size of the preset convolution kernel can be flexibly set according to the actual situation.
  • the filtering range of the preset convolution kernel is consistent with the preset processing range in the above-mentioned disclosed embodiments, that is,
  • a pixel point may be filtered through a preset convolution check to obtain an intermediate color of the pixel point after filtering, and a corresponding brightness value is calculated according to the color value of the intermediate color, as the third brightness
  • the range of the area covered by the filtering of the pixel points by the preset convolution check can be used as the preset processing range, and the target part of the face image is located within the preset processing range and has the highest brightness. Brightness of the pixel value, which can be used as the second brightness.
  • the filtering method is also not limited in the embodiment of the present disclosure, and can be flexibly selected according to the actual situation.
  • Gaussian filtering can be performed on the pixels through a preset convolution check.
  • the determination order of the first brightness, the second brightness, and the third brightness is not limited in the embodiments of the present disclosure, and may be determined simultaneously, or may be determined sequentially in a certain order, etc., and can be selected flexibly according to the actual situation. That's it.
  • the initial target color of the pixel can be adjusted according to the determined first brightness, second brightness and third brightness to obtain the target color of the pixel. How to realize the adjustment according to these three brightnesses , and its implementation can be found in the following disclosed embodiments, which will not be expanded here.
  • Adjusting the initial target color of the point can fully take into account the brightness information of the pixels in the face image within a certain range, so that the target color determined based on the brightness information can be more realistic and reliable, and improve the beauty of the fusion face image. effect and authenticity.
  • the initial target color of the pixel is adjusted to obtain the target color of the pixel, including:
  • the initial target color of the pixel is adjusted to obtain the target color of the pixel
  • the initial target color of the pixel is adjusted according to the first brightness, the second brightness, the third brightness and the preset brightness radius to obtain the target color of the pixel.
  • the method of adjusting the initial target color can refer to the formula (2) in the above disclosed embodiments, that is, The adjustment coefficient of the pixel point is determined according to the corresponding data, and then the initial target color is adjusted by using the adjustment coefficient and the preset light source value.
  • the adjustment coefficient can be determined according to the first brightness and the third brightness, and the determination method can be flexibly selected according to the actual situation, and is not limited to the following disclosed embodiments.
  • the manner of determining the adjustment coefficient according to the first brightness and the third brightness can be expressed by the following formula (3):
  • Adjustment coefficient (third brightness - first brightness)/(1.0 - first brightness) (3)
  • the adjustment coefficient can be determined according to the first brightness, the second brightness, the third brightness and a preset brightness radius, wherein the preset brightness radius can determine the metal in the metal light effect
  • the radius of the bright spot and the value of the preset brightness radius can be flexibly set according to the actual situation, and are not limited in the embodiments of the present disclosure.
  • the manner of determining the adjustment coefficient according to the first brightness, the second brightness, the third brightness and the preset brightness radius can be expressed by the following formula (4):
  • Adjustment coefficient pow((first brightness-third brightness)/(second brightness-third brightness),shiness) (4)
  • the calculation method of pow may refer to the above formula (1), which will not be repeated here, and shine is a preset brightness radius.
  • the adjustment coefficient can be calculated by the above formula (3), or the adjustment coefficient can be calculated by the above formula (4), no matter what method is used, the obtained adjustment coefficient is 0 .
  • the initial target color of the pixel is flexibly adjusted to obtain the target color of the pixel.
  • the initial target color can be flexibly changed according to the comparison of the brightness values. Adjust the way to improve the flexibility and realism of the image processing process.
  • step S13 may include:
  • the preset fusion strength respectively determine the first fusion ratio of the original color and the second fusion ratio of the target color
  • the original color and the target color are fused to obtain a fusion face image.
  • the preset fusion strength is used to indicate the respective fusion ratio or weight of the original color and the target color in the fusion process, and its value can be flexibly set according to the actual situation.
  • the fusion weight of the original color and the target color can be preset as the preset fusion strength; in a possible implementation, in the beauty operation for the face image, you can also Including the selection strength of the fusion strength, in this case, the fusion strength selected in the beauty operation can be used as the preset fusion strength.
  • the first ratio may be the fusion ratio of the original color in the fusion process
  • the second ratio may be the fusion ratio of the target color in the fusion process.
  • the preset fusion strength may be a percentage value less than 1.
  • the preset fusion strength may be used as the second fusion ratio of the target color, and the difference between 1 and the preset fusion strength may be used.
  • the first fusion ratio of the original color then the fusion is realized according to the first fusion ratio and the second fusion ratio, and the fusion process can be expressed by the following formula (5):
  • Color is the pixel value in the fusion face image after fusion
  • srcColor is the pixel value of the original color
  • lutColor is the pixel value of the target color
  • strength is the preset fusion strength
  • the preset fusion intensity the first fusion ratio and the second fusion ratio of the original color and the target color are respectively determined, and the original color and the target color are fused according to the corresponding fusion ratios, so as to obtain a fusion face image.
  • the preset fusion intensity can also be flexibly set according to actual needs, so as to obtain a fusion face image with fusion intensity and effect that meets the requirements, which improves the flexibility of image processing.
  • FIGS. 8 to 11 show schematic diagrams of a fusion face image according to an embodiment of the present disclosure (same as the above disclosed embodiments, in order to The object is protected, and part of the face in each figure has been subjected to mosaic processing), among which Figures 8 and 9 are the fused face images obtained by performing foundation processing operations on Figure 7 based on different selected colors. Since the image processing is After the grayscale image, the color difference between the two images may not be obvious; Figure 10 is the fused face image obtained under the natural lip makeup treatment; Figure 11 is obtained under the metallic light effect lip makeup treatment fused face images. It can be seen from the above images that, through the image processing methods proposed in the above disclosed embodiments, a more realistic and natural fused face image with better fusion effect can be obtained.
  • FIG. 12 shows a block diagram of an image processing apparatus according to an embodiment of the present disclosure.
  • the image processing apparatus 20 may include:
  • the original color extraction module 21 is configured to extract the original color of at least one pixel in the target object of the human face image in response to the cosmetic operation for the target object of the human face image.
  • the target color determination module 22 is configured to determine the target color of at least one pixel in the target object according to the color selected in the cosmetic operation and the original color of at least one pixel in the target object.
  • the fusion module 23 is used to fuse the original color of at least one pixel in the target object with the target color to obtain a fused face image.
  • the beauty operation includes a foundation processing operation
  • the target object includes a target face area to be performed the foundation processing operation
  • the original color extraction module is used to: determine the target based on the pixel color of the preset face material The position of the face region in the face image; according to the position of the target face region in the face image, the original color of at least one pixel in the target face region of the face image is extracted.
  • the original color extraction module is further configured to: fuse the preset face material and the preset face image to obtain a standard material image, wherein the pixel color of the target face area in the standard material image Match with the preset face material; obtain the position mapping relationship between the standard material image and the face image; determine the position of the target face area in the face image based on the pixel color and position mapping relationship of the standard material image.
  • the original color extraction module is further used to: perform key point recognition on the preset face image or standard material image to obtain the first key point recognition result; perform key point recognition on the face image to obtain The second key point identification result; the position mapping relationship between the standard material image and the face image is determined according to the position correspondence between the first key point identification result and the same key point in the second key point identification result.
  • the original color extraction module is further used to: determine the position of the target face area in the standard material image based on the pixel color of the standard material image; The position of the area is mapped to the face image, and the position of the target face area in the face image is determined.
  • the makeup operation includes a beautification operation on a target part of the face; the target object includes a target part to be beautified; the original color extraction module is used to: obtain the target material corresponding to the target part; The transparency of at least one pixel in the target material, and the original color of at least one pixel in the target part of the face image is extracted.
  • the device is further used for: recognizing the target part in the face image to obtain the initial position of the target part in the face image; the original color extraction module is further used for: obtaining and matching the target part according to the target part.
  • the original target material corresponding to the target part; the original target material is fused with the target part in the preset face image to obtain a standard material image; based on the initial position, the standard material image is extracted to obtain the target material.
  • the target color determination module is used to: according to the color selected in the beauty makeup operation, perform a corresponding color search on the original color of at least one pixel point in the target object of the face image, and obtain the color in the target object.
  • the target color of at least one pixel is used to: according to the color selected in the beauty makeup operation, perform a corresponding color search on the original color of at least one pixel point in the target object of the face image, and obtain the color in the target object.
  • the target color of at least one pixel is used to: according to the color selected in the beauty makeup operation, perform a corresponding color search on the original color of at least one pixel point in the target object of the face image, and obtain the color in the target object.
  • the target color of at least one pixel is used to: according to the color selected in the beauty makeup operation, perform a corresponding color search on the original color of at least one pixel point in the target object of the face image, and obtain the color in the target object.
  • the target color of at least one pixel is
  • the target color determination module is further configured to: obtain a color lookup table corresponding to the selected color according to the selected color in the beauty makeup operation, wherein the output color in the color lookup table is a gradient
  • the output color corresponding to the original color of at least one pixel in the target object of the face image is respectively searched in the color lookup table as the target color of at least one pixel in the target object.
  • the target object includes a target part
  • the target color of at least one pixel of the target object obtained through color search is the initial target color
  • the target color determination module is further configured to: according to at least one pixel in the target part The initial target color of the point, which determines the target color of at least one pixel in the target part.
  • the target color determination module is further configured to: in the case that the processing type corresponding to the beauty operation includes natural processing, use the initial target color of at least one pixel in the target part as at least one pixel in the target part.
  • the target color determination module is further configured to: for at least one pixel point in the target part, obtain the noise value corresponding to the pixel point respectively; when the noise value falls within the preset noise range, according to The noise value and the corresponding transparency of the pixel in the target material, adjust the initial target color of the pixel to obtain the target color of the pixel; or, when the noise value is outside the preset noise range, according to the brightness of the pixel information, adjust the initial target color of the pixel to obtain the target color of the pixel.
  • the target color determination module is further configured to: obtain a preset noise texture; according to the position of at least one pixel in the target part, sampling at the corresponding position of the preset noise texture to obtain a The noise value corresponding to the pixel.
  • the brightness information includes a first brightness, a second brightness, and a third brightness
  • the target color determination module is further configured to: determine the first brightness of the pixel according to the original color of the pixel; In the preset processing range in the target part, determine the second brightness of the pixel points with the target brightness in the preset processing range; filter the pixel points through the preset convolution check, and determine the intermediate color obtained by the filtering of the pixel points.
  • the third brightness of the pixel point wherein the filtering range of the preset convolution kernel is consistent with the preset processing range; according to the first brightness, the second brightness and the third brightness, the initial target color of the pixel point is adjusted to obtain the pixel point target color.
  • the target color determination module is further configured to: when the first brightness is less than the third brightness, adjust the initial target color of the pixel point according to the first brightness and the third brightness to obtain the pixel The target color of the point; when the first brightness is greater than the third brightness, the initial target color of the pixel is adjusted according to the first brightness, the second brightness, the third brightness and the preset brightness radius to obtain the pixel's target color. target color.
  • the fusion module is used to: determine the first fusion ratio of the original color and the second fusion ratio of the target color according to the preset fusion strength; The original color and the target color are fused to obtain a fused face image.
  • the functions or modules included in the apparatuses provided in the embodiments of the present disclosure may be used to execute the methods described in the above method embodiments, and the specific implementation and technical effects may refer to the above method embodiments. Description, for brevity, will not be repeated here.
  • FIG. 13 shows a schematic diagram of an application example according to the present disclosure.
  • the application example of the present disclosure proposes an image processing method to obtain a more realistic and natural image of foundation makeup, including the following processes:
  • step S31 a face image is collected in real time, and an image of the face to be tried makeup is acquired.
  • Step S32 determining the target face area in the face image that needs to be processed with foundation, including:
  • Step S321 obtaining a standard preset face image and a preset face material (mask) corresponding to the preset face image, wherein the mask indicates the target face area in the preset face image that needs to be subjected to foundation treatment , the color of the target face area that needs foundation treatment in the mask is set to a preset value, such as the color value of red;
  • Step S322 pre-identified face key points (106 face key points or 240 face key points) in the preset face image, key points interpolated according to the key points of the face, and constructed by connecting the key points to obtain a triangle. grid;
  • Step S323 identify the key points on the face image, and use the same method to perform interpolation processing and build a triangular mesh on the face image;
  • Step S324 fuse the mask with the preset face image to obtain a standard material image, then the pixel value of the pixel point of the target face area that needs to be subjected to foundation processing in the standard material image is consistent with the preset value set by the pixel point in the mask ;
  • Step S325 establishing a mapping relationship between the standard material image and the face image according to the key points in the preset face image (or the standard material image) or the interpolated key points, and the key points in the face image to obtain the interpolated key points , because according to the pixel value color of the pixel in the standard material image, the pixel in the standard material image that belongs to the target face area can be determined, and according to the mapping relationship, the pixel in the face image that belongs to the target face area can also be determined.
  • Step S33 obtaining the color lookup table corresponding to the selected foundation color that is pre-made in the image processing software (such as photoshop), wherein, different foundation models can correspond to different foundation effects, so it can be used for different types of foundation colors. or color number, and customize the corresponding color lookup table respectively.
  • image processing software such as photoshop
  • Step S34 extracting the original color of the pixel in the target face area in the face image, and searching for the corresponding target color on the color lookup table through the original color.
  • Step S35 fuse the found target color and the original color according to the preset fusion intensity (such as the effect intensity given by the user) to obtain a fusion face image, wherein the fusion process can refer to the formulas in the above disclosed embodiments (1).
  • the preset fusion intensity such as the effect intensity given by the user
  • the target face area in the face image can be determined based on the pixel color of the preset face material, and according to the original color of at least one pixel of the target face area in the face image, the corresponding search Determine the target color of each pixel point, so as to obtain a fusion face image that fuses the original color and the target color.
  • the fusion target face region in the fusion face image has an accurate location, high rendering accuracy and precision, and the fused color Excessive natural, color gradient, with high authenticity and better cosmetic effect.
  • FIG. 14 shows a schematic diagram according to an application example of the present disclosure.
  • the application example of the present disclosure proposes an image processing method to obtain a more realistic and natural lip makeup processed image, including the following processes:
  • Step S41 in response to the lip makeup operation on the lips of the human face image, place the original lip makeup material (the lip makeup mask in FIG. 5 ) on the position where the lips are located in the preset human face image as shown in FIG. 3 . position, get the standard material image;
  • Step S42 in the face image, determine the face key points through key point recognition, and use the face key points and some points interpolated through the face key points to construct the face area in the face image as shown in Figure 4. the triangular mesh;
  • Step S43 through the triangular mesh corresponding to the key points of the face, determine the position coordinates of the lips in the face image to sample the standard material image to obtain the target material;
  • Step S44 according to the target material, determine the image area where the lips are located in the face image, and obtain an image of the lips in the face image;
  • Step S45 extracts the original color of a plurality of pixel points in the image of the lip part, and searches the corresponding initial target color on the color lookup table as shown in Figure 6 by this original color;
  • Step S46 through a preset convolution kernel, obtain the middle color of each pixel and the second brightness corresponding to the middle color after the image of the convolution kernel is subjected to Gaussian filtering on the lip part, and the convolution kernel is in the lip part.
  • Step S47 in the case of performing natural light effect processing on the lips in the face image, the initial target color of each pixel can be directly used as the target color, and the target color and the original color can be used according to the preset fusion intensity given by the user. Fusion is performed to obtain a fused face image as shown in Figure 10;
  • Step S48 in the case of performing metal light effect processing on the lips in the face image, the target color can be determined through the following process, and the target color and the original color can be fused according to the preset fusion intensity given by the user to obtain: The fused face image shown in Figure 11.
  • the process of determining the target color may be: sampling on the noise texture through texture coordinates to obtain random noise values corresponding to each pixel in the image of the lip;
  • the preset noise range can be distributed in different parts between 0 and 1, such as 0.98 to 1.0, 0.78 to 0.8, etc.
  • the following A method is used to determine the adjustment coefficient of the pixel, otherwise the following B method is used to determine the adjustment coefficient of the pixel:
  • the adjustment factor is first equal to the noise value
  • Adjustment coefficient adjustment coefficient * pow (transparency of the target material, 4.0).
  • the adjustment coefficient is obtained by calculating the first brightness of the pixel (the brightness value corresponding to the color value of the pixel), the second brightness, the third brightness and the preset brightness radius (determining the radius of the highlight point):
  • Adjustment coefficient pow((first brightness-third brightness)/(second brightness-third brightness), shinness), where shine is the preset brightness radius above.
  • the initial target color can be adjusted according to the obtained adjustment coefficient and the preset light source value to obtain the target color:
  • Target color initial target color+adjustment factor ⁇ light source value.
  • the target color of each pixel can be determined correspondingly according to the original color of at least one pixel of the target part in the face image, so as to obtain a fusion face image that fuses the original color and the target color.
  • the fused color in the fused face image is overly natural, with a gradient of color, which has higher authenticity and better cosmetic effect.
  • the image processing methods proposed in the above disclosed application examples can be extended to other beauty operations, such as blush or eye shadow, in addition to the foundation processing operation and/or lip makeup operation on the face image.
  • the image processing method proposed in the application example of the present disclosure can be flexibly expanded and modified accordingly.
  • the writing order of each step does not mean a strict execution order but constitutes any limitation on the implementation process, and the specific execution order of each step should be based on its function and possible Internal logic is determined.
  • Embodiments of the present disclosure further provide a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the foregoing method is implemented.
  • the computer-readable storage medium may be a volatile computer-readable storage medium or a non-volatile computer-readable storage medium.
  • Embodiments of the present disclosure also provide a computer program product, including computer-readable codes.
  • a processor in the device executes the image processing method for implementing the image processing method provided by any of the above embodiments. instruction.
  • Embodiments of the present disclosure further provide another computer program product for storing computer-readable instructions, which, when executed, cause the computer to perform the operations of the image processing method provided by any of the foregoing embodiments.
  • An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to perform the above method.
  • the above-mentioned memory can be a volatile memory (volatile memory), such as RAM; or a non-volatile memory (non-volatile memory), such as ROM, flash memory (flash memory), hard disk (Hard Disk Drive) , HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above types of memory, and provide instructions and data to the processor.
  • volatile memory such as RAM
  • non-volatile memory such as ROM, flash memory (flash memory), hard disk (Hard Disk Drive) , HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above types of memory, and provide instructions and data to the processor.
  • the above-mentioned processor may be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor. It can be understood that, for different devices, the electronic device used to implement the function of the processor may also be other, which is not specifically limited in the embodiment of the present disclosure.
  • the electronic device may be provided as a terminal, server or other form of device.
  • an embodiment of the present disclosure further provides a computer program, which implements the above method when the computer program is executed by a processor.
  • FIG. 15 is a block diagram of an electronic device 1900 according to an embodiment of the present disclosure.
  • the electronic device 1900 may be provided as a server.
  • electronic device 1900 includes processing component 1922, which further includes one or more processors, and a memory resource represented by memory 1932 for storing instructions executable by processing component 1922, such as applications.
  • An application program stored in memory 1932 may include one or more modules, each corresponding to a set of instructions.
  • the processing component 1922 is configured to execute instructions to perform the above-described methods.
  • the electronic device 1900 may also include a power supply assembly 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input output (I/O) interface 1958 .
  • Electronic device 1900 may operate based on an operating system stored in memory 1932, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.
  • a non-volatile computer-readable storage medium such as memory 1932 comprising computer program instructions executable by processing component 1922 of electronic device 1900 to perform the above-described method.
  • a computer-readable storage medium may be a tangible device that can hold and store instructions for use by the instruction execution device.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • the computer readable program instructions described herein may be downloaded to various computing/processing devices from a computer readable storage medium, or to an external computer or external storage device over a network such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • a network adapter card or network interface in each computing/processing device receives computer-readable program instructions from a network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
  • Computer program instructions for carrying out operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or instructions in one or more programming languages. Source or object code written in any combination.
  • ISA instruction set architecture
  • machine instructions machine-dependent instructions
  • microcode firmware instructions
  • state setting data or instructions in one or more programming languages.
  • These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer or other programmable data processing apparatus to produce a machine that causes the instructions when executed by the processor of the computer or other programmable data processing apparatus , resulting in means for implementing the functions/acts specified in one or more blocks of the flowchart and/or block diagrams.
  • These computer readable program instructions can also be stored in a computer readable storage medium, these instructions cause a computer, programmable data processing apparatus and/or other equipment to operate in a specific manner, so that the computer readable medium on which the instructions are stored includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks of the flowchart and/or block diagrams.
  • Computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other equipment to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other equipment to produce a computer-implemented process , thereby causing instructions executing on a computer, other programmable data processing apparatus, or other device to implement the functions/acts specified in one or more blocks of the flowcharts and/or block diagrams.
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more functions for implementing the specified logical function(s) executable instructions.
  • the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented in dedicated hardware-based systems that perform the specified functions or actions , or can be implemented in a combination of dedicated hardware and computer instructions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Image Processing (AREA)

Abstract

本公开涉及一种图像处理方法及装置、电子设备和存储介质。所述方法包括:响应于针对人脸图像的目标对象的美妆操作,提取所述人脸图像的目标对象中至少一个像素点的原始颜色;根据所述美妆操作中被选中的颜色以及所述目标对象中至少一个像素点的原始颜色,确定所述目标对象中至少一个像素点的目标颜色;将所述目标对象中至少一个像素点的原始颜色和目标颜色进行融合,得到融合人脸图像。

Description

图像处理方法及装置、电子设备和存储介质
本申请要求在2021年2月23日提交中国专利局、申请号为202110203312.2、发明名称为“图像处理方法及装置、电子设备和存储介质”的中国专利申请的优先权,以及在2021年5月25日提交中国专利局、申请号为202110571420.5、发明名称为“图像处理方法及装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本公开涉及计算机视觉领域,尤其涉及一种图像处理方法及装置、电子设备和存储介质。
背景技术
粉底美妆可以对人的脸部进行渲染,调整肤色,掩盖皮肤缺陷,从而使皮肤看起来更加爽滑,美化视觉感受。随着计算机视觉技术的发展,对人脸图像进行粉底处理已经愈加广泛地应用于人们的生活之中。
发明内容
本公开提出了一种图像处理方案。
根据本公开的一方面,提供了一种图像处理方法,包括:
响应于针对人脸图像的目标对象的美妆操作,提取所述人脸图像的目标对象中至少一个像素点的原始颜色;根据所述美妆操作中被选中的颜色以及所述目标对象中至少一个像素点的原始颜色,确定所述目标对象中至少一个像素点的目标颜色;将所述目标对象中至少一个像素点的原始颜色和目标颜色进行融合,得到融合人脸图像。
根据本公开的一方面,提供了一种图像处理装置,包括:
原始颜色提取模块,用于响应于针对人脸图像的目标对象的美妆操作,提取所述人脸图像的目标对象中至少一个像素点的原始颜色;目标颜色确定模块,用于根据所述美妆操作中被选中的颜色以及所述目标对象中至少一个像素点的原始颜色,确定所述目标对象中至少一个像素点的目标颜色;融合模块,用于将所述目标对象中至少一个像素点的原始颜色和目标颜色进行融合,得到融合人脸图像。
根据本公开的一方面,提供了一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为:执行上述图像处理方法。
根据本公开的一方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述图像处理方法。
根据本公开的一方面,提供了一种计算机程序产品,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行上述方法。
在本公开实施例中,通过响应于针对人脸图像的粉底处理操作,基于预设脸部素材的像素颜色来确定人脸图像中待执行粉底处理操作的目标人脸区域的位置,从而根据粉底处理操作中被选中的颜色,以及人脸图像的目标人脸区域中至少一个像素点的原始颜色确定目标人脸区域中至少一个像素点的目标颜色,继而将原始颜色和目标颜色融合来得到融合人脸图像。通过上述过程,一方面可以基于预设脸部素材的像素颜色,来从人脸图像中较为精确地定位待执行粉底处理操作的目标人脸区域,提高粉底处理操作的精确度;另一方面可以令得到的多个像素点的目标颜色分别与各自的原始颜色相对应,从而使得融合了原始颜色和目标颜色的融合人脸图像中的颜色过度更加真实自然,提升了融合人脸图像的自然效果。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。
图1示出根据本公开一实施例的图像处理方法的流程图。
图2示出根据本公开一实施例的预设脸部素材的示意图。
图3示出根据本公开一实施例的预设人脸图像的示意图。
图4示出根据本公开一实施例的构建的三角网格的示意图。
图5示出根据本公开一实施例的目标素材的示意图。
图6示出根据本公开一实施例的颜色查找表的示意图。
图7示出根据本公开一实施例的人脸图像的示意图。
图8示出根据本公开一实施例的融合人脸图像的示意图。
图9示出根据本公开一实施例的融合人脸图像的示意图。
图10示出根据本公开一实施例的融合人脸图像的示意图。
图11示出根据本公开一实施例的融合人脸图像的示意图。
图12示出根据本公开一实施例的图像处理装置的框图。
图13示出根据本公开一应用示例的示意图。
图14示出根据本公开一应用示例的示意图。
图15示出根据本公开实施例的一种电子设备的框图。
具体实施方式
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。
另外,为了更好地说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。
图1示出根据本公开一实施例的图像处理方法的流程图,该方法可以应用于图像处理装置或图像处理***等,图像处理装置可以为终端设备、服务器或者其他处理设备等。其中,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字助理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等。在一个示例中,该图像处理方法可以应用于云端服务器或本地服务器,云端服务器可以为公有云服务器,也可以为私有云服务器,根据实际情况灵活选择即可。
在一些可能的实现方式中,该图像处理方法也可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。
如图1所示,在一种可能的实现方式中,所述图像处理方法可以包括:
步骤S11,响应于针对人脸图像的目标对象的美妆操作,提取人脸图像的目标对象中至少一个像素点的原始颜色。
其中,人脸图像可以是包含人脸的任意图像,人脸图像中可以包含一个人脸,也可以包含多个人脸,其实现形式可以根据实际情况灵活决定,在本公开实施例中不做限制。
针对人脸图像的美妆操作,其包含的操作内容可以根据实际情况灵活决定,不局限于下述各公开实施例。在一种可能的实现方式中,该美妆操作可以包括指示对人脸图像进行美妆处理的操作;在一种可能的实现方式中,该美妆操作还可以包括选中用于进行美妆的颜色等;在一种可能的实现方式中,该美妆操作还可以包括指示美妆的处理类型的操作等。
目标对象可以是人脸图像中需要进行美妆的任意对象,在一些可能的实现方式中,目标对象可以是人脸图像中的一个或多个目标部位,目标部位包含哪些部位,其实现形式同样可以根据美妆操作的实际情况灵活决定,在一种可能的实现方式中,在美妆操作包括唇妆操作的情况下,目标部位可以 包括嘴唇部位。
在一些可能的实现方式中,目标对象还可以是人脸图像中的目标人脸区域,该目标人脸区域可以是人脸图像中待执行美妆操作的任意区域,目标人脸区域可以包含人脸中的一个或多个部位区域,其实现形式可以根据实际情况灵活决定,比如可以包括人脸中的两颊部位区域、鼻梁部位区域、下巴部位区域、额头部位区域以及眼周部位区域中的一种或多种等。
其中,美妆操作的形式可以根据实际情况灵活决定,不局限于下述各公开实施例。在一种可能的实现方式中,美妆操作可以包括多种美妆类型中任一种或多种美妆操作,比如可以包括对脸部的目标区域的美妆操作,如粉底操作、高光操作、修容操作等,这里目标区域可以理解为人脸中待上妆的区域,还可以包括对脸部的目标部位的美妆操作,比如唇妆操作、眼妆操作、眼影操作等,这里目标部位可以理解为人脸中待上妆的器官部位。
在一种可能的实现方式中,以美妆操作包括粉底处理操作为例,该粉底处理操作可以是在人脸图像的部分或全部部位上添加粉底纹理的操作,粉底处理操作包含的操作内容可以根据实际情况灵活决定,不局限于下述各公开实施例。在一种可能的实现方式中,该粉底处理操作可以包括指示对人脸图像进行粉底处理的操作;在一种可能的实现方式中,该粉底处理操作还可以包括选中用于的粉底颜色等;在一种可能的实现方式中,该粉底处理操作还可以包括指示粉底处理的强弱程度的操作等。
随着美妆操作形式的不同,美妆操作中包含的处理类型也可以灵活发生变化,在一种可能的实现方式中,美妆操作可以包含一种处理类型,在一些可能的实现方式中,美妆操作也可以同时包含多种处理类型等。
在一种可能的实现方式中,以美妆操作包括唇妆操作为例,处理类型可以包括自然处理和/或金属光效处理。其中,自然处理可以包括对嘴唇颜色的自然修饰,保留唇部原始的光亮效果;金属光处理可以包括对嘴唇颜色的修饰以及光效的改变,得到具有金属光泽的唇妆效果。
原始颜色可以是目标对象在人脸图像中未经处理过的颜色,从人脸图像的目标对象中提取至少一个像素点的原始颜色的方式在本公开实施例中不做限定,可以根据实际情况灵活决定。在一些可能的实现方式中,可以确定目标对象在人脸图像中所在的区域,并对该区域包含的一个或多个像素点的颜色进行提取,以得到人脸图像的目标对象中至少一个像素点的原始颜色。
步骤S12,根据美妆操作中被选中的颜色以及目标对象中至少一个像素点的原始颜色,确定目标对象中至少一个像素点的目标颜色。
其中,美妆操作中被选中的颜色,可以是用户在选择进行美妆操作的情况下一并选中的美妆所用的颜色,也可以是选择美妆操作的情况下,预先设置好的与美妆操作所绑定对应的颜色,该颜色的具体颜色值可以根据实际情况灵活决定,在本公开实施例中不做限制。
根据被选中的颜色,以及目标对象在人脸图像中至少一个像素点的原始颜色,可以分别确定目标对象中至少一个像素点的目标颜色,其中,目标颜色可以与被选中的颜色相关,且与原始颜色对应。在一些可能的实现方式中,可以将被选中的颜色与至少一个像素点的原始颜色分别进行融合以得到目标颜色,在一些可能的实现方式中,也可以基于至少一个像素点的原始颜色,分别查找被选中的颜色所在的一定颜色范围中,与该原始颜色对应的目标颜色等。具体如何根据被选中的颜色以及原始颜色来分别得到目标对象中至少一个像素点的目标颜色,其处理方式可以根据实际情况灵活决定,详见下述各公开实施例,在此先不做展开。
步骤S13,将目标对象中至少一个像素点的原始颜色和目标颜色进行融合,得到融合人脸图像。
其中,将目标对象中至少一个像素点的原始颜色和目标颜色进行融合,可以是分别对目标对象中的多个像素点进行融合处理,其中,在像素点被进行融合处理的情况下,可以将该像素点基于原始颜色所确定的目标颜色,与该像素点的原始颜色进行融合,以得到该像素点融合后的颜色,继而得到融合人脸图像。
步骤S13中融合的方式可以根据实际情况灵活变化,详见下述各公开实施例,在此也先不做展开。
在本公开实施例中,通过响应于针对人脸图像的美妆操作,提取人脸图像的目标对象中至少一 个像素点的原始颜色,并根据美妆操作中被选中的颜色以及原始颜色,来确定目标对象中至少一个像素点的目标颜色,从而将目标对象中至少一个像素点的原始颜色和目标颜色进行融合,来得到融合人脸图像。通过上述过程,可以令得到的多个像素点的目标颜色分别与各自的原始颜色相对应,从而使得融合了原始颜色和目标颜色的融合人脸图像中的颜色过度更加真实自然,提升了融合人脸图像的效果和真实性。
如上述公开实施例所述,在一种可能的实现方式中,目标对象可以包括待执行粉底处理操作的目标人脸区域,在这种情况下,步骤S11可以包括:
基于预设脸部素材的像素颜色,确定目标人脸区域在人脸图像中的位置;
根据目标人脸区域在人脸图像中的位置,提取人脸图像的目标人脸区域中至少一个像素点的原始颜色。
其中,预设脸部素材可以是用于对人脸图像实现粉底处理的相关素材,预设脸部素材可以通过预设的像素颜色,来表明目标人脸区域所包括的区域和/或部位,其中,预设的像素颜色的颜色种类可以根据实际情况灵活设定,可以包含一种颜色,也可以包含多种颜色。在一个示例中,为了突出目标人脸区域与人脸其他区域之间的区别,预设的像素颜色可以是与人脸图像中包含的颜色具有明显区别的颜色,比如红色、绿色、蓝色或是其他人脸中较为稀有的颜色等。
图2示出根据本公开一实施例的预设脸部素材的示意图,如图所示,在一个示例中,预设脸部素材可以为面部掩模(mask),该面部mask通过红色的像素颜色(灰度处理后图中未体现),表明目标人脸区域包括除眼睛、眉毛和嘴唇以外的其他脸部区域。
在一些可能的实现方式中,预设脸部素材也可以是预先设置的素材,在粉底处理操作被选择的情况下自动被调用;在一种可能的实现方式中,预设脸部素材还可以是在粉底处理操作中用户一并选中的素材。
由于预设脸部素材可以通过预设的像素颜色表明目标人脸区域所包括的区域和/或部位,因此可以基于预设脸部素材的像素颜色,来确定目标人脸区域在人脸图像中的位置。确定的过程可以根据实际情况灵活决定,比如可以将预设脸部素材直接与人脸图像融合后,根据融合后图像中像素的颜色来确定人脸图像中目标人脸区域的位置;或是将预设脸部素材与标准的预设人脸图像融合,再根据融合后图像与人脸图像之间的对应关系,以及融合后图像中像素的颜色来确定人脸图像中目标人脸区域的位置等,具体的确定方式详见下述各公开实施例,在此先不做展开。
原始颜色的实现方式可以详见上述各公开实施例,在此不再赘述。根据目标人脸区域在人脸图像中的位置,提取人脸图像的目标人脸区域中至少一个像素点的原始颜色的方式在本公开实施例中也不做限制,可以根据实际情况灵活决定。在一些可能的实现方式中,可以根据目标人脸区域在人脸图像中的位置,对该区域包含的一个或多个像素点的颜色进行提取,以得到人脸图像的目标人脸区域中至少一个像素点的原始颜色。
在本公开实施例中,通过基于预设脸部素材的像素颜色来确定人脸图像中待执行粉底处理操作的目标人脸区域的位置,从而根据目标人脸区域在人脸图像中的位置,提取人脸图像的目标人脸区域中至少一个像素点的原始颜色。通过上述过程,可以基于预设脸部素材的像素颜色,来从人脸图像中较为精确地定位待执行粉底处理操作的目标人脸区域,提高粉底处理操作的精确度。
在一种可能的实现方式中,基于预设脸部素材的像素颜色,确定目标人脸区域在人脸图像中的位置,可以包括:
将预设脸部素材与预设人脸图像进行融合,得到标准素材图像,其中,标准素材图像中目标人脸区域的像素颜色与预设脸部素材匹配。
获取标准素材图像与人脸图像之间的位置映射关系。
基于标准素材图像的像素颜色与位置映射关系,确定目标人脸区域在人脸图像中的位置。
其中,预设人脸图像可以是标准的人脸图像模板,可以包括完整全面的人脸部位,且各人脸部位在预设人脸图像中的位置是标准的。预设人脸图像的实现形式可以根据实际情况灵活决定,任何人脸图像处理领域中采用的标准脸(standard face)均可以作为预设人脸图像的实现形式。图3示出根 据本公开一实施例的预设人脸图像的示意图(为了对图像中的对象进行保护,图中人脸的部分部位进行了马赛克处理),从图中可以看出,在一个示例中,预设人脸图像中包含的人脸部位是清楚、完整且符合人脸中各人脸部位的客观分布的。
由于预设人脸图像中各人脸部位的位置是标准的,因此预设脸部素材可以直接与预设人脸图像进行融合,以得到标准素材图像。预设脸部素材与预设人脸图像进行融合的方式在本公开实施例中不做限制,在一种可能的实现方式中,可以直接将预设脸部素材与预设人脸图像对应的像素点进行叠加,来得到标准素材图像;在一些可能的实现方式中,也可以将预设脸部素材与预设人脸图像按照预设的权重进行叠加融合等。
如上述各公开实施例所述,预设脸部素材可以通过预设的像素颜色,来表明目标人脸区域所包括的区域和/或部位,因此在一些可能的实现方式中,融合后的标注素材图像中,位于目标人脸区域的像素的颜色也可以与预设脸部素材中预设的像素颜色相匹配,从而可以根据像素颜色来确定目标人脸区域在标准素材图像中的位置。在一些可能的实现方式中,颜色相匹配可以是相同或相似等。在一个示例中,标准素材图像中目标人脸区域的像素颜色可以与预设脸部素材中预设的像素颜色一致,比如都是红色;在一个示例中,在预设脸部素材与预设人脸图像按照权重进行叠加融合的情况下,标准素材图像中目标人脸区域的像素颜色可以与预设脸部素材中预设的像素颜色属于相同颜色类别但具有一定的差异,比如预设脸部素材中预设的像素颜色可以是深红色,而融合后标准素材图像中目标人脸区域的像素颜色可以为浅红色等。
基于得到的标准素材图像,可以进一步获取标准素材图像与人脸图像之间的位置映射关系,其中,位置映射关系可以表明相同像素点在标准素材图像与人脸图像之间的位置映射情况。如何确定标准素材图像与人脸图像之间的位置映射关系,确定的方式可以根据实际情况灵活选择,比如可以根据标准素材图像和人脸图像中属于相同人脸部位的像素点在两个图像中的坐标位置,来计算得到位置映射关系,或是根据标准素材图像和人脸图像的图像大小以及顶点坐标等来确定位置映射关系等。获取位置映射关系的可能实现方式详见下述各公开实施例,在此先不做展开。
在得到标准素材图像和位置映射关系以后,可以根据标准素材图像的像素颜色和位置映射关系来确定目标人脸区域在人脸图像中的位置。确定目标人脸区域在人脸图像中的位置的实现方式可以根据实际情况灵活决定,比如可以根据标准素材图像的像素颜色确定目标人脸区域在标准素材图像中的位置,再通过位置映射关系来确定目标人脸区域在人脸图像中的位置;或是根据位置映射关系,将标准素材图像的像素颜色映射至人脸图像中,再基于映射后人脸图像中的像素颜色,确定目标人脸区域在人脸图像中的位置等。同样详见下述各公开实施例,在此先不做展开。
通过本公开实施例,可以将预设脸部素材中的像素颜色先融合至标准的预设人脸图像上,再利用融合后的标准素材图像与人脸图像之间的位置映射关系,确定目标人脸区域在人脸图像中的位置,通过上述过程,可以将标准的预设人脸图像作为中间媒介,利用预设脸部素材中的像素颜色,更为准确地在人脸图像中对目标人脸区域进行定位,进一步提高粉底处理操作的精确度。
在一种可能的实现方式中,获取标准素材图像与人脸图像之间的位置映射关系,可以包括:
对预设人脸图像或标准素材图像进行关键点识别,得到第一关键点识别结果;
对人脸图像进行关键点识别,得到第二关键点识别结果;
根据第一关键点识别结果与第二关键点识别结果中相同关键点之间的位置对应关系,确定标准素材图像与人脸图像之间的位置映射关系。
其中,第一关键点识别结果可以是对预设人脸图像或标准素材图像进行关键点识别所得到的结果,第二关键点识别结果可以是对人脸图像进行关键点识别的结果,“第一”与“第二”仅用于区分关键点识别的对象,不限制识别的顺序或是方式等。
由于标准素材图像可以通过融合预设人脸图像和预设脸部素材所得到,因此标准素材图像中各关键点的位置与预设人脸图像中各关键点的位置是相同的,因此,在一种可能的实现方式中,可以通过对预设人脸图像进行关键点识别以得到第一关键点识别结果,也可以通过对标准素材图像进行关键点识别以得到第一关键点识别结果。
在一些可能的实现方式中,第一关键点识别结果可以包括识别的关键点,还可以包括基于识别的关键点进行插值所得到的插值关键点等。第二关键点识别结果同理,在此不再赘述。其中,识别的关键点可以是对人脸面部中的关键区域位置进行定位的相关关键点,比如眼睛关键点、嘴巴关键点、眉毛关键点或是鼻子关键点等。识别的关键点具体包含哪些关键点以及包含的关键点数量在本公开实施例中不做限制,可以根据实际情况灵活选择。在一些可能的实现方式中,可以识别人脸图像中相关的所有关键点,比如人脸的106个整脸关键点(Face106)等;在一些可能的实现方式中,也可以获取人脸图像中的部分关键点,比如与目标人脸区域相关的关键点,如两颊、下巴或是额头等部位的相关关键点等。
关键点识别的方式在本公开实施例中不做限制,任何可以对图像中的关键点进行识别的方式,均可以作为识别关键点的实现方式。对预设人脸图像或标准素材图像,以及人脸图像进行关键点识别的方式可以相同,也可以不同,在本公开实施例中同样不做限制。在一些可能的实现方式中,可以通过具有关键点识别功能的神经网络,来分别对预设人脸图像或标准素材图像以及人脸图像进行关键点识别。
基于第一关键点识别结果中关键点在标准素材图像中的位置坐标,以及第二关键点识别结果中相同关键点在人脸图像中的位置坐标,可以确定相同关键点在标准素材图像和人脸图像中的位置变换关系,且该位置变换关系可以作为标准素材图像与人脸图像之间的位置映射关系。
在一些可能的实现方式中,还可以基于第一关键点识别结果和第二关键点识别结果,分别在标准素材图像和人脸图像中构建三角网格。构建三角网格的方式在本公开实施例中不做限制,以标准素材图像中的三角网格为例,在一种可能的实现方式中,可以在第一关键点识别结果中包含的多个关键点和/或插值关键点中,每三个相邻的点进行连接以得到多个三角网格。构建的三角网格可以用于后续的融合或渲染,也可以通过三角网格的顶点坐标来确定标准素材图像与人脸图像之间的位置映射关系等。
图4示出根据本公开一实施例的构建的三角网格的示意图(同上,为了对图像中的对象进行保护,图中人脸的部分部位进行了马赛克处理),从图中可以看出,在一种可能的实现方式中,通过对人脸图像的第二关键点识别结果中的关键点或插值关键点进行连接,可以得到多个三角网格。
在本公开实施例中,通过对预设人脸图像或标准素材图像进行关键点识别得到第一关键点识别结果,以及对人脸图像进行关键点识别以得到第二关键点识别结果,从而根据第一关键点识别结果和第二关键点识别结果确定标准素材图像与人脸图像之间的位置映射关系,通过上述过程,可以利用关键点识别,更为精确地确定标准素材图像和人脸图像之间的位置映射关系,继而提升对人脸图像中目标人脸区域定位的精度,从而有效提升粉底处理操作的精度,精准地实现粉底渲染。
在一种可能的实现方式中,基于标准素材图像的像素颜色与位置映射关系,确定目标人脸区域在人脸图像中的位置,包括:
基于标准素材图像的像素颜色,确定标准素材图像中目标人脸区域的位置;
根据位置映射关系,将标准素材图像中目标人脸区域的位置映射至人脸图像中,确定目标人脸区域在人脸图像中的位置。
如上述各公开实施例所述,融合后标准素材图像中目标人脸区域的像素颜色与预设脸部素材匹配,因此,在一种可能的实现方式中,可以将标准素材图像中像素颜色与预设脸部素材中预设的像素颜色匹配的颜色的像素点,确认为属于目标人脸区域的像素点。举例来说,在一个示例中,预设脸部素材中预设的像素颜色为红色,而将预设脸部素材与预设人脸图像融合后,与预设脸部素材融合的像素点的颜色也为红色,在这种情况下,可以将标准素材图像中像素颜色为红色的像素点确认为属于目标人脸区域,从而得到标准素材图像中目标人脸区域的位置;在一个示例中,预设脸部素材中预设的像素颜色为深红色,而将预设脸部素材与预设人脸图像融合后,与预设脸部素材融合的像素点的颜色为与深红色匹配的浅红色,在这种情况下,可以将标准素材图像中像素颜色为浅红色的像素点确认为属于目标人脸区域,从而得到标准素材图像中目标人脸区域的位置等。
在确定标准素材图像中目标人脸区域的位置的情况下,可以根据位置映射关系,将标准素材图 像中目标人脸区域的位置映射至人脸图像中,映射的方式在本公开实施例中不做限制,可以根据位置映射关系的实现形式灵活决定,在一个示例中,可以将标准素材图像中目标人脸区域的位置坐标,通过位置映射关系进行坐标转换,来得到目标人脸区域在人脸图像中的位置坐标。
通过本公开实施例,可以基于标准素材图像的像素颜色,对标准素材图像中目标人脸区域的位置进行确定,再进一步基于位置关系来确定目标人脸区域在人脸图像中的位置,通过上述过程,可以利用像素筛选和位置变换,简单快速地对人脸图像中的目标人脸区域进行定位,提升图像处理的速度和便捷程度。
在一种可能的实现方式中,美妆操作可以包括对人脸的目标部位的美化操作,目标对象可以包括待执行美化操作的目标部位;步骤S11可以包括:
获取目标部位对应的目标素材;
根据目标素材中至少一个像素点的透明度,提取人脸图像的目标部位中至少一个像素点的原始颜色。
其中,美化操作的实现方式可以参考上述公开实施例中的美妆操作的各类实现形式,目标部位的实现形式同样可以参考上述公开实施例中目标部位的实现方式,在此均不再赘述。
目标素材可以是用于对人脸图像实现美妆的相关素材,目标素材的实现形式可以根据美妆操作的实际情况灵活决定。在一种可能的实现方式中,在美妆操作包括唇妆操作的情况下,目标素材可以是唇妆素材,比如唇部掩模(mask)等。在一些可能的实现方式中,目标素材也可以是上述公开实施例中提到的预设脸部素材。
在一种可能的实现方式中,目标素材可以是在美妆操作中用户一并选中的素材;在一些可能的实现方式中,目标素材也可以是预先设置的素材,在美妆操作被选择的情况下自动被调用。在一些可能的实现方式中,目标素材还可以是基于人脸图像,对原始目标素材进行处理后所得到的素材。如何获取目标素材,其实现方式可以详见下述各公开实施例,在此先不做展开。
在获取目标部位对应的目标素材以后,可以根据目标素材中至少一个像素点的透明度,来提取人脸图像的目标部位中至少一个像素点的原始颜色。其中,提取的方式可以根据实际情况灵活决定,在一种可能的实现方式中,可以在目标素材中的像素点的透明度属于预设透明度范围的情况下,将人脸图像中与像素点的位置对应的区域,作为目标部位所在图像区域,并提取该图像区域中多个像素点的原始颜色。
其中,预设透明度范围的具体范围情况可以根据实际情况灵活决定,在一种可能的实现方式中,可以将预设透明度范围设定为低于100%,即在目标素材中像素点的透明度低于100%(并非全透明)的情况下,可以将人脸图像中与像素点的位置对应的区域,作为目标部位所在图像区域,并提取图像区域内像素点的原始颜色;在一种可能的实现方式中,也可以将预设透明度范围设定为低于其他透明度值,或是处于某一透明度范围以内等,本公开实施例对预设透明度范围的范围值不做限定。
通过在目标素材中的像素点的透明度属于预设透明度范围的情况下,对人脸图像对应的像素点的原始颜色进行提取,通过上述过程,可以通过设定预设透明度范围的值,更有针对性地确定符合需求的目标部位所在图像区域,从而从人脸图像中提取到更加准确的目标部位中的原始颜色,继而提升后续得到的融合人脸图像的可靠性和真实性。
图5示出根据本公开一实施例的目标素材的示意图,从图中可以看出,在一个示例中,目标素材可以为唇部掩模,且该唇部掩模中不同像素点的透明度不同,可以更好地表现自然真实的唇部形状,因此基于该唇部掩模提取到的人脸图像中的原始颜色,也更加准确可靠。
通过获取目标部位对应的目标素材,并根据目标素材中至少一个像素点的透明度来提取人脸图像的目标部位中至少一个像素点的原始颜色,通过上述过程,可以提取到更加真实可靠,与人脸图像中唇部真实位置相对应的原始颜色,继而使得后续基于原始颜色得到的融合人脸图像更加真实自然。
在一种可能的实现方式中,本公开实施例提出的方法还可以包括:对人脸图像中的目标部位进行识别,得到人脸图像中目标部位的初始位置。
其中,初始位置可以是根据人脸图像所确定的,目标部位在人脸图像中的大致位置。确定目标 部位的初始位置的方法,在本公开实施例中不做限制,可以根据实际情况灵活选择,不局限于下述各公开实施例。
在一种可能的实现方式中,可以通过对目标部位的关键点进行识别的方式来确定目标部位的初始位置,比如可以根据识别到的目标部位的关键点在人脸图像中的坐标来确定初始位置;或是根据识别到目标部位的关键点来对目标部位在人脸图像中的范围进行确定,以得到目标部位的初始位置等。
在一种可能的实现方式中,对人脸图像中的目标部位进行识别,得到人脸图像中目标部位的初始位置,可以包括:
获取人脸图像中的至少一个人脸关键点;
根据人脸关键点,在人脸图像中构建与目标部位对应的三角网格;
根据三角网格的位置坐标,确定人脸图像中目标部位的初始位置。
其中,人脸关键点可以是对人脸面部中的关键区域位置进行定位的相关关键点,比如眼睛关键点、嘴巴关键点、眉毛关键点或是鼻子关键点等。获取到的人脸关键点具体包含哪些关键点以及包含的关键点数量在本公开实施例中不做限制,可以根据实际情况灵活选择。在一些可能的实现方式中,可以获取人脸图像中相关的所有关键点,比如人脸的106个整脸关键点(Face106)等;在一些可能的实现方式中,也可以获取人脸图像中的部分关键点,比如与目标部位相关的关键点,比如嘴唇部位的相关关键点等。
获取人脸关键点的方式在本公开实施例中不做限制,任何可以对图像中的人脸关键点进行识别的方式,均可以作为获取人脸关键点的实现方式。在一些可能的实现方式中,人脸关键点以及获取人脸关键点的方式,均可以参考上述各公开实施例中关键点识别的方式,在此不再赘述。
在获取到至少一个人脸关键点以后,可以根据人脸关键点,在人脸图像中构建三角网格。构建三角网格的方式在本公开实施例中不做限制,同样可以参考上述各公开实施例,在此不再赘述。
在一种可能的实现方式中,也可以根据人脸关键点,在人脸图像中构建与目标部位对应的三角网格,其中,构建三角网格的方式可以参考上述各公开实施例,区别在于可以获取与目标部位相关的人脸关键点和插值点,来构建与目标部位对应的三角网格,而省略对人脸图像中其他部位的三角网格的构建。
在得到与目标部位对应的三角网格以后,可以根据该三角网格在人脸图像中的位置坐标,来确定人脸图像中目标部位的初始位置。初始位置的表现形式在本公开实施例中不做限制,在一种可能的实现方式中,可以将目标部位对应的一个或多个三角网格的中心点位置作为目标部位的初始位置;在一种可能的实现方式中,也可以将目标部位对应的一个或多个三角网格的各顶点坐标作为目标部位的初始位置等,可以根据实际情况进行灵活选择。
通过获取人脸图像中的至少一个人脸关键点,并根据人脸关键点,在人脸图像中构建与目标部位对应的三角网格,从而根据三角网格的位置坐标,确定人脸图像中目标部位的初始位置。通过上述过程,可以通过关键点识别与网格构建的方式,高效且准确地对目标部位在人脸图像中的部位进行初步定位,从而便于后续获取与目标部位匹配的目标素材,继而提高图像处理的精度和真实性。
在一种可能的实现方式中,获取目标部位对应的目标素材可以包括:
根据目标部位,获取与目标部位对应的原始目标素材;
将原始目标素材与预设人脸图像中的目标部位进行融合,得到标准素材图像;
基于初始位置,对标准素材图像进行提取,得到目标素材。
其中,原始目标素材可以是预先设置好的,与美妆操作所绑定的素材,比如与唇妆操作对应的可以是原始的唇部掩模作为原始目标素材等。获取原始目标素材的方式在本公开实施例中不做限制,可以将美妆操作中选中的素材作为原始目标素材,也可以根据美妆操作,自动读取对应的原始目标素材等。
预设人脸图像的实现形式可以参考上述各公开实施例,在此不再赘述。由于预设人脸图像中各人脸部位的位置是标准的,因此原始目标素材可以直接与预设人脸图像中目标部位对应的位置进行融合,以得到标准素材图像。原始目标素材与预设人脸图像中目标部位进行融合的方式在本公开实施例 中不做限制,在一种可能的实现方式中,可以直接将原始目标素材与预设人脸图像中目标部位中对应的像素点进行相加,来得到标准素材图像;在一些可能的实现方式中,也可以将原始目标素材与预设人脸图像中的目标部位按照预设的权重进行相加融合等。
将原始目标素材与预设人脸图像中的目标部位进行融合,可以得到标准素材图像,标准素材图像的实现形式可以参考上述各公开实施例,在此不再赘述。在一种可能的实现方式中,可以基于上述各公开实施例中的初始位置,来从标准素材图像中提取目标素材。
在一种可能的实现方式中,基于初始位置提取目标素材的方式可以包括:获取标准素材图像中与初始位置对应范围内的各像素点的颜色值和透明度,将包含颜色值和透明度的多个像素点所构成的图像,作为目标素材。
通过将原始目标素材与预设人脸图像中的目标部位进行融合,得到标准素材图像,并基于初始位置,从标准素材图像中提取目标素材,由于初始位置是根据对人脸图像中目标部位进行识别所得到的,因此通过上述过程,可以使得获取的目标素材与人脸图像中目标部位所在的位置更加对应,从而使得提取到的目标部位中至少一个像素点的原始颜色更加真实可靠。
在一种可能的实现方式中,步骤S12可以包括:
根据美妆操作中被选中的颜色,对人脸图像的目标对象中至少一个像素点的原始颜色进行对应颜色查找,得到目标对象中至少一个像素点的目标颜色。
其中,目标颜色可以在被选中的颜色的范围中,基于原始颜色进行对应查找所确定的颜色,该目标颜色属于被选中的颜色范围以内,且与原始颜色相对应。
如何根据被选中的颜色和原始颜色,对人脸图像的目标对象中至少一个像素点的目标颜色进行对应颜色查找,其查找方式可以根据实际情况灵活决定,详见下述各公开实施例,在此先不做展开。
通过根据美妆操作中被选中的颜色,对人脸图像的目标对象中至少一个像素点的原始颜色进行对应颜色查找,得到目标对象中至少一个像素点的目标颜色。通过上述过程,可以利用颜色查找,得到属于被选中的颜色的范围,且与原始颜色对应的目标颜色,从而使得目标颜色的颜色更加真实,不同像素点之间颜色的过度更加自然,继而提升了融合人脸图像的自然程度,也提升了美妆效果。
在一种可能的实现方式中,根据美妆操作中被选中的颜色,对人脸图像的目标对象中至少一个像素点的原始颜色进行对应颜色查找,得到目标对象中至少一个像素点的目标颜色,可以包括:
根据美妆操作中被选中的颜色,获取与被选中的颜色对应的颜色查找表,其中,颜色查找表中的输出颜色以渐变形式进行排列;
在颜色查找表中分别查找与人脸图像的目标对象中至少一个像素点的原始颜色对应的输出颜色,作为目标对象中至少一个像素点的目标颜色。
其中,颜色查找表可以包含多个输入颜色与输出颜色之间的对应关系,其中输入颜色可以为向颜色查找表进行查找的颜色,输出颜色可以为颜色查找表中查找到的颜色。举例来说,比如根据输入颜色A在颜色查找表中查找,可以找到与A对应的输出颜色B。颜色查找表中颜色之间的对应关系可以根据实际情况灵活设定,在本公开实施例中不做限制。在一种可能的实现方式中,颜色查找表中的输出颜色可以通过渐变形式进行排列,具体的排列方式在本公开实施例中不做限制,不局限于下述各公开实施例。
在一种可能的实现方式中,可以根据美妆操作中被选中的颜色,来获取与被选中的颜色对应的颜色查找表,在这种情况下,颜色查找表中的输出颜色属于对应的被选中的颜色的范围以内,因而根据颜色查找表查找到的目标颜色,可以在被选中的颜色的相应范围以内,且与原始颜色相互对应。
在获取到颜色查找表以后,可以根据目标对象中多个像素点的原始颜色,分别从颜色查找表中查找各像素点对应的输出颜色,来作为目标对象中多个像素点的目标颜色。查找的方式可以根据颜色查找表的形式灵活决定,在本公开实施例中不做限定。
图6示出根据本公开一实施例的颜色查找表的示意图,从图中可以看出,在一个示例中,颜色查找表中包括多个自然过渡的渐变色作为输出颜色(由于灰度图显示的限制,图中深浅不同的颜色实际上为具有颜色区别的渐变色),在获取到目标人脸区域中多个像素点的原始颜色后,可以从颜色查 找表中分别查找这多个像素点的输出颜色来作为目标颜色。
通过根据美妆操作中被选中的颜色,获取与被选中的颜色对应的包含多个渐变输出颜色的颜色查找表,并在颜色查找表中分别查找与人脸图像的目标对象中至少一个像素点的原始颜色对应的输出颜色,来作为目标对象中至少一个像素点的目标颜色,通过上述过程,可以利用包含渐变输出颜色的颜色查找表,得到颜色过渡自然的目标颜色,从而使得后续得到的目标颜色的过渡也更加自然,提高得到的融合人脸图像的自然程度和美妆效果。
在一种可能的实现方式中,目标对象可以包括上述公开实施例中提到的目标部位,通过颜色查找得到的目标对象的至少一个像素点的目标颜色可以为初始目标颜色,在这种情况下,步骤S12还可以包括:
根据目标部位中至少一个像素点的初始目标颜色,确定目标部位中至少一个像素点的目标颜色。
其中,初始目标颜色可以是上述公开实施例中提到的目标颜色,即在被选中的颜色的范围中,基于原始颜色进行对应查找所确定的颜色,该初始目标颜色属于被选中的颜色范围以内,且与原始颜色相对应。
在一些可能的实现方式中,步骤S12还可以基于初始目标颜色进一步确定目标颜色。在一种可能的实现方式中,可以将初始目标颜色直接作为目标颜色;在一些可能的实现方式中,还可以对初始目标颜色进行一些处理,比如进行调整或是与其他颜色进行融合等,来得到目标颜色;在一些可能的实现方式中,还可以根据美妆操作对应的处理类型,来选择如何对初始目标颜色进行处理以得到目标颜色等。如何根据初始目标颜色进一步确定目标颜色,其实现方式同样可以详见下述各公开实施例,在此也先不做展开。
通过根据初始目标颜色确定目标部位中至少一个像素点的目标颜色。通过上述过程,可以基于初始目标颜色进行进一步目标颜色调整,进一步提升融合人脸图像的自然程度与美妆效果。
在一种可能的实现方式中,根据目标部位中至少一个像素点的初始目标颜色,确定目标部位中至少一个像素点的目标颜色,可以包括:
在美妆操作对应的处理类型包括自然处理的情况下,将目标部位中至少一个像素点的初始目标颜色,作为目标部位中至少一个像素点的目标颜色。或者,
在美妆操作对应的处理类型包括金属光效处理的情况下,基于随机获取的噪声值,对目标部位中至少一个像素点的初始目标颜色进行调整,得到目标部位中至少一个像素点的目标颜色。
其中,自然处理和金属光效处理的处理效果可以参考上述各公开实施例,在此不再赘述。噪声值可以为向图像中各像素点添加的噪声数值或信息,随机获取噪声值的方式可以为,通过生成随机数据的方式,来得到随机获取的噪声值,随机数据的生成方式在本公开实施例中不做限制,详见下述各公开实施例,在此先不做展开。
在一种可能的实现方式中,可以在处理类型为自然处理的情况下,直接将初始目标颜色作为目标颜色。
在一种可能的实现方式中,还可以在处理类型为金属光效处理的情况下,基于随机获取的噪声值来对目标部位中至少一个像素点的初始目标颜色进行调整,来改变不同像素点的颜色使得目标部位出现金属光效的效果。其中,对哪些像素点的颜色进行调整,以及如何基于随机获取到的噪声值,来对初始目标颜色进行调整,其实现方式可以根据实际需求灵活发生变化,详见下述各公开实施例,在此先不做展开。
通过本公开实施例,可以在美妆操作对应的处理类型不同的情况下,选择不同的方式对初始目标颜色进行调整以确定目标颜色,提高了美妆操作的灵活性;而且通过随机获取的噪声值,来对目标部位中至少一个像素点的初始目标颜色进行调整,可以基于随机数据调整颜色,得到更加自然的金属光效果。
在一种可能的实现方式中,基于随机获取的噪声值,对目标部位中至少一个像素点的初始目标颜色进行调整,得到目标部位中至少一个像素点的目标颜色,可以包括:
针对目标部位中至少一个像素点,分别获取与像素点对应的噪声值;
在噪声值属于预设噪声范围以内的情况下,根据噪声值以及像素点在目标素材中对应的透明度,对像素点的初始目标颜色进行调整,得到像素点的目标颜色;或者,
在噪声值属于预设噪声范围以外的情况下,根据像素点的亮度信息,对像素点的初始目标颜色进行调整,得到像素点的目标颜色。
其中,对于目标部位中包括的一个或多个像素点,可以分别获取各像素点的噪声值,其中,各像素点的噪声值均可以是通过随机的方式进行获取的,获取方式可以根据实际情况灵活选择。在一种可能的实现方式中,可以通过生成在某一数值范围内的随机数的方式,来得到各像素点的噪声值。在一种可能的实现方式中,针对目标部位中至少一个像素点,分别获取与像素点对应的噪声值,可以包括:
获取预设噪声纹理;
根据至少一个像素点在目标部位中的位置,在预设噪声纹理的对应位置处进行采样,获得到与像素点对应的噪声值。
其中,预设噪声纹理可以是形状与目标部位相匹配的图像,该图像中各点的噪声值可以预先随机生成。在一种可能的实现方式中,可以根据目标部位与预设噪声纹理之间的位置对应关系,分别确定目标部位中各像素点在预设噪声纹理中对应的噪声值。
通过获取预设噪声纹理,并根据该预设噪声纹理获取目标部位中至少一个像素点的噪声值,通过上述过程,可以通过较为便捷地获取多个像素点的对应噪声值,在使得获取到的噪声值为随机值的同时,提升了获取噪声值的效率,从而提高图像处理的效率。
在分别获取到至少一个像素点对应的噪声值以后,可以通过噪声值与预设噪声范围之间的比较,来确定不同像素点对应的处理方式。其中,预设噪声范围的数值可以根据实际情况灵活设定,不局限于下述各公开实施例,在一个示例中,预设噪声范围可以分布在0~1之间,比如0.98~1.0或是0.78~0.8等。
在像素点对应的噪声值属于预设噪声范围的情况下,可以根据该像素点对应的噪声值,以及该像素点在目标素材中对应的像素点的透明度,来对像素点的初始目标颜色进行调整,从而得到像素点的目标颜色。具体的调整方式可以根据实际情况灵活选择,不局限于下述各公开实施例。
在一种可能的实现方式中,根据噪声值以及像素点在目标素材中对应的透明度,对像素点的初始目标颜色进行调整,得到像素点的目标颜色,可以包括:
根据噪声值以及像素点在目标素材中对应像素点的透明度,确定对初始目标颜色进行调整的调整系数;
根据调整系数和预设光源值,对像素点的初始目标颜色进行调整,得到像素点的目标颜色。
其中,目标素材的实现方式可以详见上述各公开实施例,在此不再赘述。调整系数可以是对初始目标颜色进行调整过程中的相关参数。根据噪声值以及透明度所确定的调整系数,其计算方式可以根据实际情况灵活决定,不局限于下述公开实施例,在一个示例中,根据噪声值以及透明度确定调整系数的方式可以通过下述公式(1)进行表示:
调整系数=噪声值×pow(透明度,4.0)           (1)
其中,pow(x,y)表明计算x的y次方的结果,因而pow(透明度,4.0)为计算透明度的4次方的值。
在确定调整系数以后,可以根据调整系数和预设光源值来确定像素点的目标颜色,其中,预设光源值可以为根据实际情况灵活为美妆操作进行设定的光源值,其数值的大小在本公开实施例中不做限制。
基于调整系数和预设光源值对初始目标颜色进行调整的方式,同样可以根据实际情况灵活设定,不局限于下述各公开实施例,在一个示例中,根据调整系数和预设光源值确定目标颜色的方式可以通过下述公式(2)进行表示:
目标颜色=初始目标颜色+调整系数×预设光源值         (2)
通过上述过程,可以在噪声值属于预设噪声范围以内的情况下,得到目标部位中至少一个像素 点的目标颜色。
在一种可能的实现方式中,噪声值也可能属于预设噪声范围以外,在这种情况下,可以根据像素点的亮度信息,来对像素点的初始目标颜色进行调整,以得到像素点的目标颜色。其中,亮度信息可以为根据像素点在人脸图像的目标部位中的颜色等情况所确定的相关信息,其包含的信息内容可以根据实际情况灵活决定。如何确定像素点的亮度信息,以及如何根据亮度信息调整初始目标颜色,其实现方式可以详见下述各公开实施例,在此先不做展开。
在本公开实施例中,通过针对目标部位中至少一个像素点,分别获取与像素点对应的噪声值,并在噪声值属于预设噪声范围以内的情况下,根据噪声值来对像素点的初始目标颜色进行调整,在噪声值属于预设噪声范围以外的情况下,根据像素点的亮度信息对初始目标颜色进行调整,通过上述过程,可以通过随机生成的像素点的噪声值与预设噪声范围的比较,对不同像素点进行不同方式的颜色调整处理,从而更好地对金属光效中的闪烁情况进行模拟,得到更加自然逼真的金属光效果。
在一种可能的实现方式中,亮度信息可以包括第一亮度、第二亮度以及第三亮度,根据像素点的亮度信息,对像素点的初始目标颜色进行调整,得到像素点的目标颜色,可以包括:
根据像素点的原始颜色,确定像素点的第一亮度。
根据像素点在目标部位中的预设处理范围,确定预设处理范围中具有目标亮度的像素点的第二亮度。
通过预设卷积核对所述像素点进行滤波,根据像素点经过滤波所得到的中间颜色,确定像素点的第三亮度,其中,预设卷积核的滤波范围与所述预设处理范围一致。
根据第一亮度、第二亮度以及第三亮度,对像素点的初始目标颜色进行调整,得到像素点的目标颜色。
其中,第一亮度可以为根据像素点的原始颜色的颜色值所确定的亮度值,其中,亮度值可以通过对颜色值进行计算所确定,在一个示例中,亮度值可以根据颜色值中三个颜色通道(红色R、绿色G以及蓝色B)的值进行计算所得到。
第二亮度同样可以根据具有目标亮度的像素点的颜色值所确定,其中,具有目标亮度的像素点,可以是在人脸图像的目标部位中,位于像素点的预设处理范围以内且具有最高亮度的像素点。其中,预设处理范围的范围大小可以根据实际情况灵活设定,在本公开实施例中不做限制。
第三亮度可以是根据对像素点的中间颜色的颜色值所确定的亮度值,其中,像素点的中间颜色,可以是通过预设卷积核对像素点进行滤波后所得到的颜色。其中,预设卷积核的形式与大小可以根据实际情况灵活设定,在一种可能的实现方式中,预设卷积核的滤波范围与上述公开实施例中的预设处理范围一致,即在一个示例中,一方面可以通过预设卷积核对像素点进行滤波处理,以得到该像素点在滤波后的中间颜色,并根据中间颜色的颜色值计算对应的亮度值,作为第三亮度,另一方面可以将预设卷积核对像素点进行滤波所覆盖的区域范围作为预设处理范围,则人脸图像的目标部位中,位于该预设处理范围以内且具有最高亮度的像素点的亮度值,可以作为第二亮度。
滤波的方式在本公开实施例中也不做限制,可以根据实际情况灵活选择,在一个示例中,可以通过预设卷积核对像素点进行高斯滤波。
上述各公开实施例中,第一亮度、第二亮度以及第三亮度的确定顺序在本公开实施例中不做限定,可以同时确定,也可以按照一定的顺序依次确定等,根据实际情况灵活选择即可。
在一种可能的实现方式中,可以根据确定的第一亮度、第二亮度和第三亮度对像素点的初始目标颜色进行调整,以得到像素点的目标颜色,如何根据这三个亮度实现调整,其实现方式可以详见下述各公开实施例,在此先不做展开。
通过根据像素点的原始颜色确定的第一亮度、根据像素点在目标部位中的预设处理范围所确定的第二亮度以及根据像素点滤波后的颜色值所确定的第三亮度,来对像素点的初始目标颜色进行调整,可以充分考虑到人脸图像中像素点在一定范围内的亮度信息,从而使得基于该亮度信息所确定的目标颜色可以更加真实可靠,提高融合人脸图像的美妆效果和真实性。
在一种可能的实现方式中,根据第一亮度、第二亮度以及第三亮度,对像素点的初始目标颜色 进行调整,得到像素点的目标颜色,包括:
在第一亮度小于第三亮度的情况下,根据第一亮度以及第三亮度,对像素点的初始目标颜色进行调整,得到像素点的目标颜色;
在第一亮度大于所述第三亮度的情况下,根据第一亮度、第二亮度、第三亮度以及预设的亮度半径,对像素点的初始目标颜色进行调整,得到像素点的目标颜色。
其中,无论是在第一亮度小于第三亮度的情况,还是在第一亮度大于第三亮度的情况,对初始目标颜色进行调整的方式均可以参考上述公开实施例中的公式(2),即根据相应的数据确定像素点的调整系数,然后利用调整系数和预设光源值,对初始目标颜色进行调整。
在第一亮度小于第三亮度的情况下,可以根据第一亮度和第三亮度来确定调整系数,确定的方式可以根据实际情况灵活选择,不局限于下述各公开实施例。在一种可能的实现方式中,根据第一亮度以及第三亮度,确定调整系数的方式,可以通过下述公式(3)进行表示:
调整系数=(第三亮度-第一亮度)/(1.0-第一亮度)         (3)
在第一亮度大于第三亮度的情况下,可以根据第一亮度、第二亮度、第三亮度以及预设的亮度半径来确定调整系数,其中,预设的亮度半径可以决定金属光效果中金属光亮斑的半径,预设的亮度半径的值可以根据实际情况灵活设定,在本公开实施例中不做限定。在一种可能的实现方式中,根据第一亮度、第二亮度、第三亮度以及预设的亮度半径,确定调整系数的方式,可以通过下述公式(4)进行表示:
调整系数=pow((第一亮度-第三亮度)/(第二亮度-第三亮度),shiness)  (4)
其中,pow的计算方式可以参考上述公式(1),在此不再赘述,shiness为预设的亮度半径。
在第一亮度等于第三亮度的情况下,可以通过上述公式(3)来计算调整系数,也可以通过上述公式(4)来计算调整系数,无论通过何种方式,得到的调整系数均为0。
通过第一亮度与第三亮度的比较情况,灵活对像素点的初始目标颜色进行调整,以得到像素点的目标颜色,通过上述过程,可以根据亮度值的比较情况,灵活改变对初始目标颜色的调整方式,提高图像处理过程的灵活性和真实性。
在得到目标颜色以后,可以通过步骤S13,来对原始颜色和目标颜色进行融合,在一种可能的实现方式中,步骤S13可以包括:
根据预设融合强度,分别确定原始颜色的第一融合比例以及目标颜色的第二融合比例;
根据第一融合比例和第二融合比例,将原始颜色与目标颜色进行融合,得到融合人脸图像。
其中,预设融合强度用于指示原始颜色和目标颜色在融合过程中各自的融合比例或权重,其数值可以根据实际情况灵活设定。在一种可能的实现方式中,可以预先设置好原始颜色与目标颜色的融合权重,作为预设融合强度;在一种可能的实现方式中,针对于人脸图像的美妆操作中,也可以包括对融合强度的选择强度,在这种情况下,可以将美妆操作中被选中的融合强度作为预设融合强度。
第一比例可以是原始颜色在融合过程中的融合比例,第二比例可以是目标颜色在融合过程中的融合比例,在根据预设融合强度分别确定第一融合比例和第二融合比例以后,可以将原始颜色与目标颜色按照对应的融合比例进行相互融合,以得到融合人脸图像,其中,在按照融合比例进行融合的过程中,可以是直接通过相加进行融合,也可以是通过一些其他的方式,如正片叠底或是柔光等图像处理方式进行融合,具体选择何种融合方式在本公开实施例中同样不做限制。
在一个示例中,预设融合强度可以为小于1的百分比数值,在这种情况下,可以将预设融合强度作为目标颜色的第二融合比例,并将1与该预设融合强度的差值作为原始颜色的第一融合比例,继而根据第一融合比例和第二融合比例实现融合,融合的过程可以通过下述公式(5)进行表述:
Color=srcColor*(1.0-strength)+lutColor*strength        (5)
其中,Color为融合后融合人脸图像中的像素值,srcColor为原始颜色的像素值,lutColor为目标颜色的像素值,strength为预设融合强度。
通过根据预设融合强度,分别确定原始颜色与目标颜色的第一融合比例和第二融合比例,并将原始颜色与目标颜色分别按照对应的融合比例进行融合,得到融合人脸图像,通过上述过程,还可以 根据实际需求,灵活设定预设融合强度,来得到融合强度与效果符合需求的融合人脸图像,提升了图像处理的灵活性。
随着美妆操作中处理类型的不同,最终得到的融合人脸图像也可以灵活随之变化。图7示出根据本公开一实施例的人脸图像的示意图,图8~图11示出根据本公开一实施例的融合人脸图像的示意图(同上述各公开实施例,为了对图像中的对象进行保护,各图中人脸的部分部位进行了马赛克处理),其中图8和图9为基于不同被选中的颜色对图7进行粉底处理操作所得到的融合人脸图像,由于图像处理为灰度图后,两图之间的颜色差异可能不太明显;图10为在自然处理的唇妆处理方式下得到的融合人脸图像;图11为在金属光效的唇妆处理方式下得到的融合人脸图像。通过上述各图像可以看出,通过上述各公开实施例提出的图像处理方法,可以得到较为真实自然,具有较好融合效果的融合人脸图像。
图12示出根据本公开一实施例的图像处理装置的框图。如图所示,所述图像处理装置20可以包括:
原始颜色提取模块21,用于响应于针对人脸图像的目标对象的美妆操作,提取人脸图像的目标对象中至少一个像素点的原始颜色。
目标颜色确定模块22,用于根据美妆操作中被选中的颜色以及目标对象中至少一个像素点的原始颜色,确定目标对象中至少一个像素点的目标颜色。
融合模块23,用于将目标对象中至少一个像素点的原始颜色和目标颜色进行融合,得到融合人脸图像。
在一种可能的实现方式中,美妆操作包括粉底处理操作,目标对象包括待执行粉底处理操作的目标人脸区域;原始颜色提取模块用于:基于预设脸部素材的像素颜色,确定目标人脸区域在人脸图像中的位置;根据目标人脸区域在人脸图像中的位置,提取人脸图像的目标人脸区域中至少一个像素点的原始颜色。
在一种可能的实现方式中,原始颜色提取模块进一步用于:将预设脸部素材与预设人脸图像进行融合,得到标准素材图像,其中,标准素材图像中目标人脸区域的像素颜色与预设脸部素材匹配;获取标准素材图像与人脸图像之间的位置映射关系;基于标准素材图像的像素颜色与位置映射关系,确定目标人脸区域在人脸图像中的位置。
在一种可能的实现方式中,原始颜色提取模块进一步用于:对预设人脸图像或标准素材图像进行关键点识别,得到第一关键点识别结果;对人脸图像进行关键点识别,得到第二关键点识别结果;根据第一关键点识别结果与第二关键点识别结果中相同关键点之间的位置对应关系,确定标准素材图像与人脸图像之间的位置映射关系。
在一种可能的实现方式中,原始颜色提取模块进一步用于:基于标准素材图像的像素颜色,确定标准素材图像中目标人脸区域的位置;根据位置映射关系,将标准素材图像中目标人脸区域的位置映射至人脸图像中,确定目标人脸区域在人脸图像中的位置。
在一种可能的实现方式中,美妆操作包括对人脸的目标部位的美化操作;目标对象包括待执行美化操作的目标部位;原始颜色提取模块用于:获取目标部位对应的目标素材;根据目标素材中至少一个像素点的透明度,提取人脸图像的目标部位中至少一个像素点的原始颜色。
在一种可能的实现方式中,装置还用于:对人脸图像中的目标部位进行识别,得到人脸图像中目标部位的初始位置;原始颜色提取模块进一步用于:根据目标部位,获取与目标部位对应的原始目标素材;将原始目标素材与预设人脸图像中的目标部位进行融合,得到标准素材图像;基于初始位置,对标准素材图像进行提取,得到目标素材。
在一种可能的实现方式中,目标颜色确定模块用于:根据美妆操作中被选中的颜色,对人脸图像的目标对象中至少一个像素点的原始颜色进行对应颜色查找,得到目标对象中至少一个像素点的目标颜色。
在一种可能的实现方式中,目标颜色确定模块进一步用于:根据美妆操作中被选中的颜色,获取与被选中的颜色对应的颜色查找表,其中,颜色查找表中的输出颜色以渐变形式进行排列;在颜色 查找表中分别查找与人脸图像的目标对象中至少一个像素点的原始颜色对应的输出颜色,作为目标对象中至少一个像素点的目标颜色。
在一种可能的实现方式中,目标对象包括目标部位,通过颜色查找得到的目标对象的至少一个像素点的目标颜色为初始目标颜色,目标颜色确定模块还用于:根据目标部位中至少一个像素点的初始目标颜色,确定目标部位中至少一个像素点的目标颜色。
在一种可能的实现方式中,目标颜色确定模块进一步用于:在美妆操作对应的处理类型包括自然处理的情况下,将目标部位中至少一个像素点的初始目标颜色,作为目标部位中至少一个像素点的目标颜色;或者,在美妆操作对应的处理类型包括金属光效处理的情况下,基于随机获取的噪声值,对目标部位中至少一个像素点的初始目标颜色进行调整,得到目标部位中至少一个像素点的目标颜色。
在一种可能的实现方式中,目标颜色确定模块进一步用于:针对目标部位中至少一个像素点,分别获取与像素点对应的噪声值;在噪声值属于预设噪声范围以内的情况下,根据噪声值以及像素点在目标素材中对应的透明度,对像素点的初始目标颜色进行调整,得到像素点的目标颜色;或者,在噪声值属于预设噪声范围以外的情况下,根据像素点的亮度信息,对像素点的初始目标颜色进行调整,得到像素点的目标颜色。
在一种可能的实现方式中,目标颜色确定模块进一步用于:获取预设噪声纹理;根据至少一个像素点在目标部位中的位置,在预设噪声纹理的对应位置处进行采样,获得到与像素点对应的噪声值。
在一种可能的实现方式中,亮度信息包括第一亮度、第二亮度、第三亮度;目标颜色确定模块进一步用于:根据像素点的原始颜色,确定像素点的第一亮度;根据像素点在目标部位中的预设处理范围,确定预设处理范围中具有目标亮度的像素点的第二亮度;通过预设卷积核对像素点进行滤波,根据像素点经过滤波所得到的中间颜色,确定像素点的第三亮度,其中,预设卷积核的滤波范围与预设处理范围一致;根据第一亮度、第二亮度以及第三亮度,对像素点的初始目标颜色进行调整,得到像素点的目标颜色。
在一种可能的实现方式中,目标颜色确定模块进一步用于:在第一亮度小于第三亮度的情况下,根据第一亮度以及第三亮度,对像素点的初始目标颜色进行调整,得到像素点的目标颜色;在第一亮度大于第三亮度的情况下,根据第一亮度、第二亮度、第三亮度以及预设的亮度半径,对像素点的初始目标颜色进行调整,得到像素点的目标颜色。
在一种可能的实现方式中,融合模块用于:根据预设融合强度,分别确定原始颜色的第一融合比例以及目标颜色的第二融合比例;根据第一融合比例和第二融合比例,将原始颜色与目标颜色进行融合,得到融合人脸图像。
在本公开的一些实施例中,本公开实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现和技术效果可参照上文方法实施例的描述,为了简洁,这里不再赘述。
应用场景示例一
图13示出根据本公开一应用示例的示意图,如图所示,本公开应用示例提出了一种图像处理方法,以得到更加真实自然的粉底妆容的图像,包括如下过程:
步骤S31,实时采集人脸图像,获取待试妆的人脸图像。
步骤S32,确定人脸图像中需要做粉底处理的目标人脸区域,包括:
步骤S321,获取标准的预设人脸图像,以及,与预设人脸图像对应的预设脸部素材(mask),其中,mask表明预设人脸图像中需要做粉底处理的目标人脸区域,该mask中需要做粉底处理的目标人脸区域的颜色设置为一个预设值,如红色的颜色值等;
步骤S322,预设人脸图像中预先标识有人脸的关键点(106人脸关键点或240人脸关键点)、根据人脸的关键点插值出的关键点,以及通过连接关键点构建得到三角网格;
步骤S323,识别人脸图像上的关键点,并采用同样的方式进行插值处理并构建得到人脸图像上的三角网格;
步骤S324,将mask与预设人脸图像进行融合,得到标准素材图像,则标准素材图像中需要做粉底处理的目标人脸区域的像素点的像素值与mask中像素点设置的预设值一致;
步骤S325,根据预设人脸图像(或标准素材图像)中关键点或插值的关键点,与人脸图像中关键点获插值的关键点,建立标准素材图像与人脸图像之间的映射关系,由于根据标准素材图像中像素点的像素值颜色,可以确定标准素材图像中属于目标人脸区域的像素点,根据该映射关系,也可以确定人脸图像中属于目标人脸区域的像素点。
步骤S33,获取在图片处理软件中(如photoshop)预先制作好的与被选中的粉底颜色对应的颜色查找表,其中,不同的粉底型号可对应不同的粉底效果,因此可针对不同类型的粉底颜色或色号,分别定制其对应的颜色查找表。
步骤S34,提取人脸图像中目标人脸区域内像素的原始颜色,通过该原始颜色在颜色查找表上查找对应的目标颜色。
步骤S35,将查找到的目标颜色与原始颜色按照预设融合强度(如用户所给的效果强度)进行融合,得到融合人脸图像,其中,融合的过程可以参考上述各公开实施例中的公式(1)。
通过本公开应用示例提出的方法,可以基于预设脸部素材的像素颜色确定人脸图像中的目标人脸区域,并根据人脸图像中目标人脸区域至少一个像素点的原始颜色,对应查找确定各像素点的目标颜色,从而得到融合原始颜色与目标颜色的融合人脸图像,该融合人脸图像中融合的目标人脸区域位置准确,渲染准确度和精度较高,且融合后的颜色过度自然,颜色渐变,具有较高的真实性和较好的美妆效果。
应用场景示例二
图14示出根据本公开一应用示例的示意图,如图所示,本公开应用示例提出了一种图像处理方法,以得到更加真实自然的唇妆处理后的图像,包括如下过程:
步骤S41,响应于针对人脸图像的唇部的唇妆操作,将原始的唇妆素材(图5中的唇妆mask)放置到如图3所示的预设人脸图像中唇部所在的位置,得到标准素材图像;
步骤S42,在人脸图像中,通过关键点识别确定人脸关键点,并使用人脸关键点与通过人脸关键点插值出的一些点构建如图4所示的人脸图像中人脸区域的三角网格;
步骤S43,通过人脸关键点对应的三角网格,确定人脸图像中唇部的位置坐标去采样标准素材图像,来获取目标素材;
步骤S44,根据目标素材,确定人脸图像中唇部所在图像区域,得到人脸图像中唇部部位的图像;
步骤S45,提取唇部部位的图像中多个像素点的原始颜色,并通过该原始颜色在如图6所示的颜色查找表上查找对应的初始目标颜色;
步骤S46,通过一个预设的卷积核,获取该卷积核对唇部部位的图像做高斯滤波之后各像素点的中间颜色以及中间颜色对应的第二亮度,以及该卷积核在唇部部位的图像上进行移动的过程中,覆盖的每个区域中具有最高亮度的像素点的第三亮度;
步骤S47,在对人脸图像中的唇部进行自然光效处理的情况下,可以直接将各像素点的初始目标颜色作为目标颜色,并将目标颜色与原始颜色按照用户所给的预设融合强度进行融合,得到如图10所示的融合人脸图像;
步骤S48,在对人脸图像中的唇部进行金属光效处理的情况下,可以通过下述过程确定目标颜色,并将目标颜色与原始颜色按照用户所给的预设融合强度进行融合,得到如图11所示的融合人脸图像。
其中,确定目标颜色的过程可以为:通过纹理坐标在噪声纹理上进行采样,得到唇部部位的图像中各像素点对应的随机噪声值;
对于各像素点,分别判断其对应的噪声值是否在预设噪声范围之内(预设噪声范围可以分布在0~1之间的不同部分,如0.98~1.0,0.78~0.8等);
若在预设噪声范围内,采用下述A方法确定该像素点的调整系数,否则采用下述B方法确定该像素点的调整系数:
A、通过噪声值以及目标素材的透明度来计算调整系数:
调整系数首先等于噪声值;
调整系数=调整系数*pow(目标素材的透明度,4.0)。
B、通过像素点的第一亮度(与像素点的颜色值对应的亮度值)、第二亮度、第三亮度以及预设的亮度半径(决定高光点的半径)进行计算得到调整系数:
如果第一亮度小于第三亮度,则:
调整系数=(第三亮度–第一亮度)/(1.0–第一亮度);
如果第一亮度大于第三亮度,则:
调整系数=pow((第一亮度–第三亮度)/(第二亮度-第三亮度),shinness),其中shiness为上述预设的亮度半径。
在通过A获B确定调整系数以后,可以根据得到的调整系数,以及预设的光源值来对初始目标颜色进行调整,得到目标颜色:
目标颜色=初始目标颜色+调整系数×光源值。
通过本公开应用示例提出的方法,可以根据人脸图像中目标部位至少一个像素点的原始颜色,对应查找确定各像素点的目标颜色,从而得到融合原始颜色与目标颜色的融合人脸图像,该融合人脸图像中融合后的颜色过度自然,颜色渐变,具有较高的真实性和较好的美妆效果。
上述各公开应用示例中提出的图像处理方法,除了可以应用于对人脸图像进行粉底处理操作和/或唇妆操作以外,还可以扩展应用于其他的美妆操作,比如腮红或是眼影等美妆操作,随着美妆操作类型的不同,本公开应用示例提出的图像处理方法可以相应的进行灵活扩展与改动。
可以理解,本公开提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开不再赘述。
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。
本公开实施例还提出一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。计算机可读存储介质可以是易失性计算机可读存储介质或非易失性计算机可读存储介质。
本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,当计算机可读代码在设备上运行时,设备中的处理器执行用于实现如上任一实施例提供的图像处理方法的指令。
本公开实施例还提供了另一种计算机程序产品,用于存储计算机可读指令,指令被执行时使得计算机执行上述任一实施例提供的图像处理方法的操作。
本公开实施例还提出一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为上述方法。
在实际应用中,上述存储器可以是易失性存储器(volatile memory),例如RAM;或者非易失性存储器(non-volatile memory),例如ROM,快闪存储器(flash memory),硬盘(Hard Disk Drive,HDD)或固态硬盘(Solid-State Drive,SSD);或者上述种类的存储器的组合,并向处理器提供指令和数据。
上述处理器可以为ASIC、DSP、DSPD、PLD、FPGA、CPU、控制器、微控制器、微处理器中的至少一种。可以理解地,对于不同的设备,用于实现上述处理器功能的电子器件还可以为其它,本公开实施例不作具体限定。
电子设备可以被提供为终端、服务器或其它形态的设备。
基于前述实施例相同的技术构思,本公开实施例还提供了一种计算机程序,该计算机程序被处理器执行时实现上述方法。
图15是根据本公开实施例的一种电子设备1900的框图。例如,电子设备1900可以被提供为一服务器。参照图15,电子设备1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指令,例如应用程序。存储器 1932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述方法。
电子设备1900还可以包括一个电源组件1926被配置为执行电子设备1900的电源管理,一个有线或无线网络接口1950被配置为将电子设备1900连接到网络,和一个输入输出(I/O)接口1958。电子设备1900可以操作基于存储在存储器1932的操作***,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM或类似。
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器1932,上述计算机程序指令可由电子设备1900的处理组件1922执行以完成上述方法。
本公开可以是***、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是但不限于电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码。
这里参照根据本公开实施例的方法、装置(***)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。
附图中的流程图和框图显示了根据本公开的多个实施例的***、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的***来实现,或者可以用专用硬件与计算机指令的组合来实现。
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。

Claims (20)

  1. 一种图像处理方法,其特征在于,包括:
    响应于针对人脸图像的目标对象的美妆操作,提取所述人脸图像的目标对象中至少一个像素点的原始颜色;
    根据所述美妆操作中被选中的颜色以及所述目标对象中至少一个像素点的原始颜色,确定所述目标对象中至少一个像素点的目标颜色;
    将所述目标对象中至少一个像素点的原始颜色和目标颜色进行融合,得到融合人脸图像。
  2. 根据权利要求1所述的方法,其特征在于,所述美妆操作包括粉底处理操作,所述目标对象包括待执行粉底处理操作的目标人脸区域;
    所述提取所述人脸图像的目标对象中至少一个像素点的原始颜色,包括:
    基于预设脸部素材的像素颜色,确定所述目标人脸区域在所述人脸图像中的位置;
    根据所述目标人脸区域在所述人脸图像中的位置,提取所述人脸图像的所述目标人脸区域中至少一个像素点的原始颜色。
  3. 根据权利要求2所述的方法,其特征在于,所述基于预设脸部素材的像素颜色,确定所述目标人脸区域在所述人脸图像中的位置,包括:
    将所述预设脸部素材与预设人脸图像进行融合,得到标准素材图像,其中,所述标准素材图像中所述目标人脸区域的像素颜色与所述预设脸部素材匹配;
    获取所述标准素材图像与所述人脸图像之间的位置映射关系;
    基于所述标准素材图像的像素颜色与所述位置映射关系,确定所述目标人脸区域在所述人脸图像中的位置。
  4. 根据权利要求3所述的方法,其特征在于,所述获取所述标准素材图像与所述人脸图像之间的位置映射关系,包括:
    对所述预设人脸图像或所述标准素材图像进行关键点识别,得到第一关键点识别结果;
    对所述人脸图像进行关键点识别,得到第二关键点识别结果;
    根据所述第一关键点识别结果与所述第二关键点识别结果中相同关键点之间的位置对应关系,确定所述标准素材图像与所述人脸图像之间的位置映射关系。
  5. 根据权利要求3或4所述的方法,其特征在于,所述基于所述标准素材图像的像素颜色与所述位置映射关系,确定所述目标人脸区域在所述人脸图像中的位置,包括:
    基于所述标准素材图像的像素颜色,确定所述标准素材图像中所述目标人脸区域的位置;
    根据所述位置映射关系,将所述标准素材图像中目标人脸区域的位置映射至所述人脸图像中,确定所述目标人脸区域在所述人脸图像中的位置。
  6. 根据权利要求1所述的方法,其特征在于,所述美妆操作包括对人脸的目标部位的美化操作;所述目标对象包括待执行美化操作的目标部位;
    所述提取所述人脸图像的目标部位中至少一个像素点的原始颜色,包括:
    获取所述目标部位对应的目标素材;
    根据所述目标素材中至少一个像素点的透明度,提取所述人脸图像的目标部位中至少一个像素点的原始颜色。
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:
    对所述人脸图像中的目标部位进行识别,得到所述人脸图像中目标部位的初始位置;
    所述获取所述目标部位对应的目标素材,包括:
    根据所述目标部位,获取与所述目标部位对应的原始目标素材;
    将所述原始目标素材与预设人脸图像中的目标部位进行融合,得到标准素材图像;
    基于所述初始位置,对所述标准素材图像进行提取,得到目标素材。
  8. 根据权利要求1至7中任意一项所述的方法,其特征在于,所述根据所述美妆操作中被选中的颜色以及所述目标对象中至少一个像素点的原始颜色,确定所述目标对象中至少一个像素点的目标颜色,包括:
    根据所述美妆操作中被选中的颜色,对所述人脸图像的目标对象中至少一个像素点的原始颜色进行对应颜色查找,得到所述目标对象中至少一个像素点的目标颜色。
  9. 根据权利要求8所述的方法,其特征在于,所述根据所述美妆操作中被选中的颜色,对所述人脸图像的目标对象中至少一个像素点的原始颜色进行对应颜色查找,得到所述目标对象中至少一个像素点的目标颜色,包括:
    根据所述美妆操作中被选中的颜色,获取与所述被选中的颜色对应的颜色查找表,其中,所述颜色查找表中的输出颜色以渐变形式进行排列;
    在所述颜色查找表中分别查找与所述人脸图像的目标对象中至少一个像素点的原始颜色对应的输出颜色,作为所述目标对象中至少一个像素点的目标颜色。
  10. 根据权利要求8或9所述的方法,其特征在于,所述目标对象包括目标部位,通过颜色查找得到的所述目标对象的至少一个像素点的目标颜色为初始目标颜色,所述方法还包括:
    根据所述目标部位中至少一个像素点的初始目标颜色,确定所述目标部位中至少一个像素点的目标颜色。
  11. 根据权利要求10所述的方法,其特征在于,所述根据所述目标部位中至少一个像素点的初始目标颜色,确定所述目标部位中至少一个像素点的目标颜色,包括:
    在所述美妆操作对应的处理类型包括自然处理的情况下,将所述目标部位中至少一个像素点的初始目标颜色,作为所述目标部位中至少一个像素点的目标颜色;或者,
    在所述美妆操作对应的处理类型包括金属光效处理的情况下,基于随机获取的噪声值,对所述目标部位中至少一个像素点的初始目标颜色进行调整,得到所述目标部位中至少一个像素点的目标颜色。
  12. 根据权利要求11所述的方法,其特征在于,所述基于随机获取的噪声值,对所述目标部位中至少一个像素点的初始目标颜色进行调整,得到所述目标部位中至少一个像素点的目标颜色,包括:
    针对所述目标部位中至少一个像素点,分别获取与所述像素点对应的噪声值;
    在所述噪声值属于预设噪声范围以内的情况下,根据所述噪声值以及所述像素点在目标素材中对应的透明度,对所述像素点的初始目标颜色进行调整,得到所述像素点的目标颜色;或者,
    在所述噪声值属于预设噪声范围以外的情况下,根据所述像素点的亮度信息,对所述像素点的初始目标颜色进行调整,得到所述像素点的目标颜色。
  13. 根据权利要求12所述的方法,其特征在于,所述针对所述目标部位中至少一个像素点,分别获取与所述像素点对应的噪声值,包括:
    获取预设噪声纹理;
    根据所述至少一个像素点在所述目标部位中的位置,在所述预设噪声纹理的对应位置处进行采样,获得到与所述像素点对应的噪声值。
  14. 根据权利要求12或13所述的方法,其特征在于,所述亮度信息包括第一亮度、第二亮度、第三亮度;
    所述根据所述像素点的亮度信息,对所述像素点的初始目标颜色进行调整,得到所述像素点的目标颜色,包括:
    根据所述像素点的原始颜色,确定所述像素点的第一亮度;
    根据所述像素点在所述目标部位中的预设处理范围,确定所述预设处理范围中具有目标亮度的像素点的第二亮度;
    通过预设卷积核对所述像素点进行滤波,根据所述像素点经过滤波所得到的中间颜色,确定所述像素点的第三亮度,其中,所述预设卷积核的滤波范围与所述预设处理范围一致;
    根据所述第一亮度、所述第二亮度以及所述第三亮度,对所述像素点的初始目标颜色进行调整,得到所述像素点的目标颜色。
  15. 根据权利要求14所述的方法,其特征在于,所述根据所述第一亮度、所述第二亮度以及所述第三亮度,对所述像素点的初始目标颜色进行调整,得到所述像素点的目标颜色,包括:
    在所述第一亮度小于所述第三亮度的情况下,根据所述第一亮度以及所述第三亮度,对所述像素点的初始目标颜色进行调整,得到所述像素点的目标颜色;
    在所述第一亮度大于所述第三亮度的情况下,根据所述第一亮度、所述第二亮度、所述第三亮度以及预设的亮度半径,对所述像素点的初始目标颜色进行调整,得到所述像素点的目标颜色。
  16. 根据权利要求1至15中任意一项所述的方法,其特征在于,所述将所述目标对象中至少一个像素点的原始颜色和目标颜色进行融合,得到融合人脸图像,包括:
    根据预设融合强度,分别确定所述原始颜色的第一融合比例以及所述目标颜色的第二融合比例;
    根据所述第一融合比例和所述第二融合比例,将所述原始颜色与所述目标颜色进行融合,得到融合人脸图像。
  17. 一种图像处理装置,其特征在于,包括:
    原始颜色提取模块,用于响应于针对人脸图像的目标对象的美妆操作,提取所述人脸图像的目标对象中至少一个像素点的原始颜色;
    目标颜色确定模块,用于根据所述美妆操作中被选中的颜色以及所述目标对象中至少一个像素点的原始颜色,确定所述目标对象中至少一个像素点的目标颜色;
    融合模块,用于将所述目标对象中至少一个像素点的原始颜色和目标颜色进行融合,得到融合人脸图像。
  18. 一种电子设备,其特征在于,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器被配置为调用所述存储器存储的指令,以执行权利要求1至16中任意一项所述的方法。
  19. 一种计算机可读存储介质,其上存储有计算机程序指令,其特征在于,所述计算机程序指令被处理器执行时实现权利要求1至16中任意一项所述的方法。
  20. 一种计算机程序产品,其特征在于,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行用于实现权利要求1至16中任意一项所述的方法。
PCT/CN2021/133045 2021-02-23 2021-11-25 图像处理方法及装置、电子设备和存储介质 WO2022179215A1 (zh)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202110203312.2A CN112801916A (zh) 2021-02-23 2021-02-23 图像处理方法及装置、电子设备和存储介质
CN202110203312.2 2021-02-23
CN202110571420.5 2021-05-25
CN202110571420.5A CN113160094A (zh) 2021-02-23 2021-05-25 图像处理方法及装置、电子设备和存储介质

Publications (1)

Publication Number Publication Date
WO2022179215A1 true WO2022179215A1 (zh) 2022-09-01

Family

ID=75815416

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/133045 WO2022179215A1 (zh) 2021-02-23 2021-11-25 图像处理方法及装置、电子设备和存储介质

Country Status (3)

Country Link
CN (2) CN112801916A (zh)
TW (1) TW202234341A (zh)
WO (1) WO2022179215A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115348709A (zh) * 2022-10-18 2022-11-15 良业科技集团股份有限公司 适用于文旅的智慧云服务照明展示方法及***
CN116503933A (zh) * 2023-05-24 2023-07-28 北京万里红科技有限公司 一种眼周特征提取方法、装置、电子设备及存储介质

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112801916A (zh) * 2021-02-23 2021-05-14 北京市商汤科技开发有限公司 图像处理方法及装置、电子设备和存储介质
CN113240760B (zh) * 2021-06-29 2023-11-24 北京市商汤科技开发有限公司 一种图像处理方法、装置、计算机设备和存储介质
CN113570581A (zh) * 2021-07-30 2021-10-29 北京市商汤科技开发有限公司 图像处理方法及装置、电子设备和存储介质
CN113436284A (zh) * 2021-07-30 2021-09-24 上海商汤智能科技有限公司 一种图像处理方法、装置、计算机设备和存储介质
CN113763286A (zh) * 2021-09-27 2021-12-07 北京市商汤科技开发有限公司 图像处理方法及装置、电子设备和存储介质
CN113781359B (zh) * 2021-09-27 2024-06-11 北京市商汤科技开发有限公司 图像处理方法及装置、电子设备和存储介质
CN113763287A (zh) * 2021-09-27 2021-12-07 北京市商汤科技开发有限公司 图像处理方法及装置、电子设备和存储介质
CN113762212B (zh) * 2021-09-27 2024-06-11 北京市商汤科技开发有限公司 图像处理方法及装置、电子设备和存储介质
CN114723600A (zh) * 2022-03-11 2022-07-08 北京字跳网络技术有限公司 美妆特效的生成方法、装置、设备、存储介质和程序产品
CN117078685B (zh) * 2023-10-17 2024-02-27 太和康美(北京)中医研究院有限公司 基于图像分析的化妆品功效评价方法、装置、设备及介质

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109191410A (zh) * 2018-08-06 2019-01-11 腾讯科技(深圳)有限公司 一种人脸图像融合方法、装置及存储介质
CN109859098A (zh) * 2019-01-15 2019-06-07 深圳市云之梦科技有限公司 人脸图像融合方法、装置、计算机设备及可读存储介质
US20200082607A1 (en) * 2018-09-11 2020-03-12 Apple Inc. Techniques for providing virtual lighting adjustments utilizing regression analysis and functional lightmaps
CN111047511A (zh) * 2019-12-31 2020-04-21 维沃移动通信有限公司 一种图像处理方法及电子设备
CN111784568A (zh) * 2020-07-06 2020-10-16 北京字节跳动网络技术有限公司 人脸图像处理方法、装置、电子设备及计算机可读介质
CN112766234A (zh) * 2021-02-23 2021-05-07 北京市商汤科技开发有限公司 图像处理方法及装置、电子设备和存储介质
CN112767285A (zh) * 2021-02-23 2021-05-07 北京市商汤科技开发有限公司 图像处理方法及装置、电子设备和存储介质
CN112801916A (zh) * 2021-02-23 2021-05-14 北京市商汤科技开发有限公司 图像处理方法及装置、电子设备和存储介质

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109191410A (zh) * 2018-08-06 2019-01-11 腾讯科技(深圳)有限公司 一种人脸图像融合方法、装置及存储介质
US20200082607A1 (en) * 2018-09-11 2020-03-12 Apple Inc. Techniques for providing virtual lighting adjustments utilizing regression analysis and functional lightmaps
CN109859098A (zh) * 2019-01-15 2019-06-07 深圳市云之梦科技有限公司 人脸图像融合方法、装置、计算机设备及可读存储介质
CN111047511A (zh) * 2019-12-31 2020-04-21 维沃移动通信有限公司 一种图像处理方法及电子设备
CN111784568A (zh) * 2020-07-06 2020-10-16 北京字节跳动网络技术有限公司 人脸图像处理方法、装置、电子设备及计算机可读介质
CN112766234A (zh) * 2021-02-23 2021-05-07 北京市商汤科技开发有限公司 图像处理方法及装置、电子设备和存储介质
CN112767285A (zh) * 2021-02-23 2021-05-07 北京市商汤科技开发有限公司 图像处理方法及装置、电子设备和存储介质
CN112801916A (zh) * 2021-02-23 2021-05-14 北京市商汤科技开发有限公司 图像处理方法及装置、电子设备和存储介质
CN113160094A (zh) * 2021-02-23 2021-07-23 北京市商汤科技开发有限公司 图像处理方法及装置、电子设备和存储介质

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115348709A (zh) * 2022-10-18 2022-11-15 良业科技集团股份有限公司 适用于文旅的智慧云服务照明展示方法及***
CN116503933A (zh) * 2023-05-24 2023-07-28 北京万里红科技有限公司 一种眼周特征提取方法、装置、电子设备及存储介质
CN116503933B (zh) * 2023-05-24 2023-12-12 北京万里红科技有限公司 一种眼周特征提取方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
TW202234341A (zh) 2022-09-01
CN113160094A (zh) 2021-07-23
CN112801916A (zh) 2021-05-14

Similar Documents

Publication Publication Date Title
WO2022179215A1 (zh) 图像处理方法及装置、电子设备和存储介质
WO2022179026A1 (zh) 图像处理方法及装置、电子设备和存储介质
CN108229278B (zh) 人脸图像处理方法、装置和电子设备
JP4862955B1 (ja) 画像処理装置、画像処理方法、および制御プログラム
JP4760999B1 (ja) 画像処理装置、画像処理方法、および制御プログラム
CN108229279B (zh) 人脸图像处理方法、装置和电子设备
CN109829930A (zh) 人脸图像处理方法、装置、计算机设备及可读存储介质
CN111066026B (zh) 用于向图像数据提供虚拟光调节的技术
KR20200014842A (ko) 이미지 조명 방법, 장치, 전자 기기 및 저장 매체
CN108463823A (zh) 一种用户头发模型的重建方法、装置及终端
JP2024500896A (ja) 3d頭部変形モデルを生成するための方法、システム及び方法
CN109919030A (zh) 黑眼圈类型识别方法、装置、计算机设备和存储介质
JP2005276182A (ja) 人物の肌および唇領域マスクデータの作成方法および作成装置
CN112308944A (zh) 仿真唇妆的扩增实境显示方法
Mould et al. Developing and applying a benchmark for evaluating image stylization
JP2021144582A (ja) メイクアップシミュレーション装置、メイクアップシミュレーション方法及びプログラム
KR20210032489A (ko) 신체 영역 상의 메이크업 제품의 렌더링의 시뮬레이션 방법
JP2024503794A (ja) 2次元(2d)顔画像から色を抽出するための方法、システム及びコンピュータプログラム
CN107808372B (zh) 图像穿越处理方法、装置、计算设备及计算机存储介质
US10810775B2 (en) Automatically selecting and superimposing images for aesthetically pleasing photo creations
US20220028149A1 (en) System and method for automatically generating an avatar with pronounced features
US20200126314A1 (en) Method and system of automated facial morphing for eyebrow hair and face color detection
KR20230110787A (ko) 개인화된 3d 머리 및 얼굴 모델들을 형성하기 위한 방법들 및 시스템들
CN109447931A (zh) 图像处理方法及装置
CN114359030A (zh) 一种人脸逆光图片的合成方法

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: 21927639

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21927639

Country of ref document: EP

Kind code of ref document: A1