CN114463212A - Image processing method and device, electronic equipment and storage medium - Google Patents

Image processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114463212A
CN114463212A CN202210106872.0A CN202210106872A CN114463212A CN 114463212 A CN114463212 A CN 114463212A CN 202210106872 A CN202210106872 A CN 202210106872A CN 114463212 A CN114463212 A CN 114463212A
Authority
CN
China
Prior art keywords
image
mask image
region
area
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210106872.0A
Other languages
Chinese (zh)
Inventor
苏柳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Datianmian White Sugar Technology Co ltd
Original Assignee
Beijing Datianmian White Sugar Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Datianmian White Sugar Technology Co ltd filed Critical Beijing Datianmian White Sugar Technology Co ltd
Priority to CN202210106872.0A priority Critical patent/CN114463212A/en
Publication of CN114463212A publication Critical patent/CN114463212A/en
Priority to PCT/CN2022/134617 priority patent/WO2023142645A1/en
Pending legal-status Critical Current

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
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • 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

Landscapes

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

Abstract

The method determines a first mask image and a second mask image of a face image, and the first mask image and the second mask image are respectively used for representing a first part area and a second part area in the face image, and the second part area is in the first part area. And lip processing information including area information and beautification parameter information is acquired, and the range of a second part area in the second mask image is adjusted according to the area information and the first mask image. And beautifying the face image according to the beautifying parameter information and the adjusted second mask image to obtain a target image with the color of the second part region adjusted.

Description

Image processing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to an image processing method and apparatus, an electronic device, and a storage medium.
Background
Currently, face beautification mainly focuses on treatments such as whitening of the whole face, flaw repair, shape adjustment of local organs, makeup effect superposition and the like, and ideal effects are difficult to achieve for makeup treatment of details of the local organs.
Disclosure of Invention
According to a first aspect of the present disclosure, there is provided an image processing method including:
determining a first mask image and a second mask image of a face image, wherein the first mask image is used for representing a first part area of the face image, the second mask image is used for representing a second part area of the face image, and the second part area is at least partially different from the first part area;
obtaining lip processing information, wherein the lip processing information comprises area information and beautification parameter information, the area information is used for indicating the range of the second part area, and the beautification parameter information is used for indicating beautification parameters of the second part area;
adjusting the range of a second position region in the second mask image according to the region information and the first mask image;
and beautifying the face image according to the beautifying parameter information and the adjusted second mask image to obtain a target image with the color of the second part region adjusted.
In one possible implementation manner, the adjusting the range of the second location area in the second mask image according to the area information and the first mask image includes:
according to the region information and the first mask image, performing image corrosion operation on the second mask image, and adjusting the range of the second part region; during the image erosion process, the second region coincides with at least a partial region of the first region.
In a possible implementation manner, the performing, according to the area information and the first mask image, an image erosion operation on the second mask image, and adjusting the range of the second region area includes:
and according to the first mask image, carrying out image corrosion from the first edge to the second edge of the second position region in the second mask image until the adjustment condition corresponding to the region information is met.
In a possible implementation manner, the adjustment condition corresponding to the region information is that a ratio of the current second region to the original second region is a value of the region information.
In a possible implementation manner, the performing, according to the first mask image, image erosion from a first edge to a second edge of a second location area in the second mask image includes:
sequentially determining target pixels from a first edge to a second edge of the second part area;
determining a target area according to the position of the target pixel in the second mask image;
determining a reference pixel in the second mask image according to a pixel value of each pixel in the target region of the first mask image;
updating the pixel value of the target pixel according to the pixel value in the reference pixel in the second mask image.
In one possible implementation, the determining a reference pixel in the second mask image according to a pixel value of each pixel in the target region of the first mask image includes:
acquiring a pixel value of each pixel of the first mask image in the target area;
and determining a reference pixel in the second mask image according to the position of the pixel with the pixel value larger than the pixel threshold value in the first mask image.
In one possible implementation, the determining the first mask image of the face image includes:
determining a first reference mask image, the first reference mask image being used to characterize the first location area prediction shape;
identifying a first part area in the face image;
and generating a first mask image according to the first position region and the first reference mask image.
In one possible implementation manner, the determining the second mask image of the face image includes:
determining a second reference mask image, the second reference mask image being used to characterize an edge predicted shape of the first region;
identifying a first part area in the face image;
and generating a second mask image according to the first position area and the second reference mask image.
In one possible implementation manner, the acquiring lip processing information includes:
displaying a lip editing page comprising a region adjustment control and a color adjustment control;
responding to the triggering of the area adjusting control and the color adjusting control by the user, and respectively generating corresponding area information and beautifying parameter information;
and determining lip processing information according to the area information and the beautification parameter information.
In a possible implementation manner, the performing color editing on the face image according to the beautification parameter information and the adjusted second mask image to obtain a target image with an adjusted color of the second part area includes:
generating a beautification image according to the beautification parameter information and the adjusted second mask image, wherein the beautification image is an image with the beautification parameter information representing colors filled in the second part area;
and carrying out image fusion on the beautified image and the face image to obtain a target image with the color of the second part area adjusted.
In a possible implementation manner, the image processing method is used for adding a lip line beautification effect to the face image, the first part area is a lip area, and the second part area is a lip line area.
According to a second aspect of the present disclosure, there is provided an image processing apparatus comprising:
the image determining module is used for determining a first mask image and a second mask image of a face image, wherein the first mask image is used for representing a first part area of the face image, the second mask image is used for representing a second part area of the face image, and the second part area is at least partially different from the first part area;
the information acquisition module is used for acquiring lip processing information, and the lip processing information comprises area information and beautification parameter information;
a range adjusting module, configured to adjust a range of a second location area in the second mask image according to the area information and the first mask image;
and the color adjusting module is used for carrying out color editing on the face image according to the beautifying parameter information and the adjusted second mask image to obtain a target image with the color of the second part area adjusted.
In one possible implementation, the range adjustment module includes:
the image corrosion submodule is used for carrying out image corrosion operation on the second mask image according to the region information and the first mask image and adjusting the range of the second part region; during the image erosion process, the second region coincides with at least a partial region of the first region.
In one possible implementation, the image erosion submodule includes:
and the image corrosion unit is used for carrying out image corrosion from the first edge to the second edge of the second position region in the second mask image according to the first mask image until the adjustment condition corresponding to the region information is met.
In a possible implementation manner, the adjustment condition corresponding to the region information is that a ratio of the current second region to the original second region is a value of the region information.
In one possible implementation, the image erosion unit includes:
a target pixel determination subunit, configured to determine target pixels sequentially from a first edge to a second edge of the second region;
a region determining subunit, configured to determine a target region according to a position of the target pixel in the second mask image;
a reference pixel determination subunit, configured to determine a reference pixel in the second mask image according to a pixel value of each pixel in the target region of the first mask image;
a pixel value updating subunit, configured to update the pixel value of the target pixel according to the pixel value in the reference pixel in the second mask image.
In one possible implementation, the reference pixel determination subunit includes:
a pixel value acquisition subunit, configured to acquire a pixel value of each pixel of the first mask image in the target region;
and the reference pixel screening subunit is used for determining a reference pixel in the second mask image according to the position of the pixel of which the pixel value is greater than the pixel threshold value in the first mask image.
In one possible implementation, the image determination module includes:
a first reference image determination sub-module for determining a first reference mask image, the first reference mask image being used to characterize the first region predicted shape;
the first region identification submodule is used for identifying a first part region in the face image;
and the first image generation submodule is used for generating a first mask image according to the first position area and the first reference mask image.
In one possible implementation, the image determination module includes:
a second reference image determining sub-module, configured to determine a second reference mask image, where the second reference mask image is used to characterize an edge prediction shape of the first region;
the second area identification submodule is used for identifying a first part area in the face image;
and the second image generation submodule is used for generating a second mask image according to the first position area and the second reference mask image.
In one possible implementation manner, the information obtaining module includes:
the page display submodule is used for displaying a lip editing page comprising an area adjusting control and a color adjusting control;
the information determination submodule is used for responding to the triggering of the area adjustment control and the color adjustment control by a user and respectively generating corresponding area information and beautifying parameter information;
and the information generation submodule is used for determining lip processing information according to the area information and the beautification parameter information.
In one possible implementation, the color adjustment module includes:
a beautification image generation submodule, configured to generate an beautification image according to the beautification parameter information and the adjusted second mask image, where the beautification image is an image obtained by filling the beautification parameter information representation color in the second part area;
and the image fusion submodule is used for carrying out image fusion on the beautified image and the face image to obtain a target image with the color of the second part area adjusted.
In a possible implementation manner, the image processing method is used for adding a lip line beautification effect to the face image, the first part area is a lip area, and the second part area is a lip line area.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the memory-stored instructions to perform the above-described method.
According to a fourth aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described method.
In the embodiment of the disclosure, the beautification processing can be performed on the area needing to be beautified and edited by identifying the first part area and the second part area of the face image and adjusting the second part area based on the area information and the first part area specified by the user. Furthermore, the beautifying processing process can be used for adding a lip line beautifying effect to the face image, and the effect of accurately beautifying the specific area of the lip of the face image is achieved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
FIG. 1 shows a flow diagram of an image processing method according to an embodiment of the present disclosure;
FIG. 2 illustrates a schematic diagram of a first mask image according to an embodiment of the disclosure;
FIG. 3 illustrates a schematic diagram of a second mask image according to an embodiment of the disclosure;
FIG. 4 shows a schematic diagram of a lip edit page in accordance with an embodiment of the present disclosure;
FIG. 5 illustrates a schematic diagram of adjusting a second site region in accordance with an embodiment of the present disclosure;
FIG. 6 shows a schematic diagram of an image processing apparatus according to an embodiment of the present disclosure;
FIG. 7 shows a schematic diagram of an electronic device in accordance with an embodiment of the disclosure;
fig. 8 shows a schematic diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
In a possible implementation manner, the image processing method of the embodiment of the disclosure may be executed by an electronic device such as a terminal device or a server. The terminal device may be any fixed or mobile terminal such as a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, and a wearable device. The server may be a single server or a server cluster of multiple servers. Any electronic device can implement the image processing method of the embodiments of the present disclosure by means of a processor calling computer readable instructions stored in a memory.
Fig. 1 illustrates a flowchart of an image processing method according to an embodiment of the present disclosure, which may include the following steps S10-S40, as illustrated in fig. 1.
And step S10, determining a first mask image and a second mask image of the face image.
In a possible implementation manner, the face image is an image to be beautified, and includes a face to be processed. The electronic equipment can acquire a face image through a built-in or connected image acquisition device, or transmits the acquired face image to the electronic equipment executing the image processing method at present for image processing after being acquired by other electronic equipment. The electronic equipment determines a first mask image and a second mask image of the face image after the face image is obtained. The first mask image is used for representing a first part area of the face image, and the second mask image is used for representing a second part area of the face image. Optionally, the second site area is at least partially different from the first site area, for example may be within the first site area. The outer edge of the second region may also coincide with the outer edge of the first region. For example, the first region may be a region where all lips of the face to be processed in the face image are located, and the second region may be an edge region of the region where all lips of the face to be processed in the face image are located.
Alternatively, the first mask image and the second mask image may be binary images, the pixel values in the first region and the second region are 1, and the pixel values in the other regions are 0. In order to further perform image processing on each pixel value in the first region and the second region with different processing intensities, the image processing effect is improved. Each pixel value in the first mask image and the second mask image may also be a value in the middle of 0-1, which is used to distinguish the first region or the second region from other regions and characterize the processing intensity in the subsequent image processing. In an embodiment of the disclosure, the processing strength characterizes a corresponding beautification strength. For example, when the beautification parameter for performing image processing is N, the pixel value may be beautified by multiplying each pixel value by the beautification parameter N, for example, a pixel value having a pixel value of 1 is processed by the beautification parameter N, and a pixel value having a pixel value of 0.5 is processed by 0.5 times the beautification parameter N. The electronic device may determine the first region and the second region by a pixel value of each pixel and a preset pixel threshold. The preset pixel threshold value is 0.5 as an example for explanation. The first mask image includes pixels having pixel values not less than 0.5 in a first region, and pixels having pixel values less than 0.5 in a region other than the first region. The second mask image has a position where a pixel value not less than 0.5 is located in the second region, and a position where a pixel value less than 0.5 is located in a region other than the second region.
Fig. 2 illustrates a schematic diagram of a first mask image according to an embodiment of the present disclosure. As shown in fig. 2, the first mask image 20 has the same size as the acquired face image, and includes a first region 21 composed of pixels having pixel values not less than the pixel threshold value and a second region 22 composed of pixels having pixel values less than the pixel threshold value. The first region 21 corresponds to the position of the lips in the face image, that is, the position of the lips representing the face in the face image. The second region 22 corresponds to a position other than the position of the lips in the face image, and represents a position other than the position of the lips of the face in the face image. That is, the first region 21 is a first region represented by the first mask image.
Fig. 3 illustrates a schematic diagram of a second mask image according to an embodiment of the present disclosure. As shown in fig. 3, the second mask image 30 has the same size as the acquired face image, and includes a third region 31 composed of pixels having pixel values not less than the pixel threshold value and a fourth region 32 composed of pixels having pixel values less than the pixel threshold value. The third area 31 corresponds to the lip edge position in the face image, that is, the position where the lip representing the face in the face image needs to draw a lip line. The fourth region 32 corresponds to a position other than the position of the lip edge in the face image, and represents a position in the face image where a lip line is not required to be drawn. That is, the third region 31 is the second region represented by the second mask image. Optionally, the second region has an inner edge 33 and an outer edge 34.
In one possible implementation, the first mask image and the second mask image may be determined according to predetermined standard materials. For example, the determining process of the first mask image may be to determine a first reference mask image, where the first reference mask image is used to characterize the first region predicted shape, identify the first region in the face image, and generate the first mask image according to the first region and the first reference mask image. The determining process of the second mask image may be to determine a second reference mask image, where the second reference mask image is used to represent an edge predicted shape of the first region, identify the first region in the face image, and generate the second mask image according to the first region and the second reference mask image. The first reference mask image and/or the second reference mask image may be mask image materials preset according to a simulated human face, or mask image materials uploaded by a user according to the user's own needs. The image processing method is used for adding a lip line beautifying effect to a face image, the first position area is a lip area, and the second position area is a lip line area, the first reference mask image can be an image representing a lip shape uploaded by a user or generated by electronic equipment, and the second reference mask image can be an image representing a lip line shape uploaded by the user or generated by the electronic equipment.
Optionally, the manner of recognizing the face image to obtain the first region is key point recognition, and the obtained first region includes a plurality of key position points, such as a mouth corner position, an upper edge position, a lower edge position, a lip bead position, and the like. The determined first reference mask image and the second reference mask image also comprise a plurality of key position points, the first mask image can be determined in a mode of key position point mapping between the first reference mask image and the first position region, and the second mask image can be determined in a mode of key position point mapping between the second reference mask image and the first position region. Based on the key point mapping, the first mask image and the second mask image determined in the above manner can accurately position the positions of the first part area and the second part area in the face image.
Step S20, lip processing information is acquired.
In a possible implementation manner, the lip processing information may include area information and beautification parameter information, where the area information is used to indicate an area range of a second portion to be beautified in the face image, and the beautification parameter information is used to indicate an beautification parameter of the area of the second portion to be beautified in the face image. The beautification parameters may include any parameter that beautifies the lips, such as color, brightness, contrast, and transparency. Alternatively, the lip processing information may be obtained in any manner, such as directly receiving the lip processing information sent by other electronic devices, or determining with a user through a human-computer interaction manner.
For example, in an application scenario in which the lip processing information is determined by way of human-computer interaction with a user, the electronic device may display a lip editing page including a region adjustment control and a color adjustment control. And respectively generating corresponding area information and beautifying parameter information in response to the condition that a user triggers the area adjusting control and the color adjusting control. And determining lip processing information according to the area information and the beautification parameter information.
Fig. 4 shows a schematic diagram of a lip editing page 40 according to an embodiment of the present disclosure. When the electronic device is a terminal device, the lip edit page 40 may be displayed by a display device built in or connected to the electronic device. When the electronic device is a server, the lip editing page 40 may be transmitted to the terminal device through the server and displayed through a display device of the terminal device. As shown in fig. 4, a color adjustment control 41 and a region adjustment control 42 are included in the lip edit page 40.
Optionally, the color adjustment control 41 may include a preset color control capable of directly selecting a preset color by a user through human-computer interaction, and a self-selected color control capable of determining a color by dragging or inputting a color value by a user through human-computer interaction (R, G, B). In the process of man-machine interaction, the electronic equipment can receive one preset color of the colors 1-6 of the preset color controls directly selected by a user in a clicking mode. Alternatively, it is also possible to receive the RGB values determined by the user to be within 0-255 by means of input or dragging, so as to obtain the required color. Further, the color adjustment control 41 further includes an intensity adjustment control (L) for characterizing the intensity of the color to be adjusted, and the selected value may be between 0 and 1. The beautification parameter information can be determined according to the color and the color intensity which are determined or selected by the user in a man-machine interaction mode.
Further, the region adjustment control 42 may include a drag bar that a user can drag to determine the adjustment width ratio by means of human-computer interaction, and an input box that can input a desired adjustment width ratio. Alternatively, the user-determined adjustment width ratio may be a value representing the ratio of the width of the desired second region to the current second region. The electronic device may generate the region information according to an adjustment width ratio determined by a user through human-computer interaction. Alternatively, the electronic device may generate the lip treatment information including the area information and the beautification parameter information after the user generates the beautification parameter information by triggering the color adjustment control 41 and generates the area information by triggering the area adjustment control 42.
In a possible implementation manner, the lip editing page 40 may further be configured to display a face image 43 (performing occlusion processing on a partial region), and a second region 44 in the face image 43, and beautify the image according to the lip processing information and display the beautified image to the user in real time after the electronic device determines the lip processing information. The user can re-determine new lip treatment information in a human-computer interaction mode under the condition of dissatisfaction.
Step S30, adjusting the range of the second location area in the second mask image according to the area information and the first mask image.
In one possible implementation, the second mask image may be adjusted based on the first mask image and the user-determined region information to modify the extent of the second region characterized in the second mask image. Optionally, before and after the adjusting, the second location area of the second mask image representation is located in the first location area of the first mask image representation. The adjustment process of the second mask image may be implemented by image erosion, which is used to shrink or refine objects in the image. For example, the second mask image may be subjected to an image erosion operation based on the region information and the first mask image, and the range of the second region area may be adjusted. The second site region may coincide with at least a partial region of the first site region during image erosion.
In the image erosion process, the region information and the first mask image are both used to define an image erosion range. Wherein the region information may be used to define the adjusted second region width. Optionally, the second region is a continuous region including a first edge and a second edge, and the image erosion direction may be erosion from the first edge to the second edge. That is, according to the first mask image, image erosion may be performed from the first edge to the second edge of the second location area in the second mask image until the adjustment condition corresponding to the area information is satisfied. As shown in fig. 3, a first edge of the second region 31 is an inner edge 33 located at the inner side, and a second edge of the second region 32 is an outer edge 34 located at the outer side. Optionally, when the area information is a numerical value, the adjustment condition corresponding to the area information may be that a ratio of the current second part area to the original second part area is a value of the area information. That is, the preset lip edge region may be reduced by adjusting the region information. For example, when the preset second region width is 5mm and the region information is 0.3, the second region width obtained after the image erosion is 1.5 mm.
Further, in the image corrosion process, the first mask image is used for screening out reference pixels used for image corrosion in the second mask image, and the image corrosion process is realized according to the reference pixels obtained through screening. Therefore, according to the first mask image, the process of performing image erosion from the first edge to the second edge of the second location area in the second mask image may include: and sequentially determining the target pixels from the first edge to the second edge of the second position area. And determining a target area according to the position of the target pixel in the second mask image. And determining the reference pixel in the second mask image according to the pixel value of each pixel in the target area of the first mask image. And updating the pixel value of the target pixel according to the pixel value in the reference pixel in the second mask image. For example, the minimum pixel value in each reference pixel may be compared to replace the pixel value of the target pixel by the minimum pixel value in each reference pixel in the second mask image.
In one possible implementation, the selection of the target pixel may be determined sequentially outward starting from the first edge of the second location area position. After each target pixel replacement, a new target pixel can be determined again in the second region, and image erosion is performed again until the image erosion process is completed. The size of the target area may be a predetermined preset size, and after each target pixel is determined, the area with the target pixel as the center and the size of the preset size is determined as the corresponding target area. For example, when the preset size is 3 × 3 and the coordinates of the target pixel are (2,4), the target area is composed of pixels (1,3), (1,4), (1,5), (2,3), (2,4), (2,5), (3,3), (3,4) and (3, 5).
Further, after the target area is determined, the reference pixels are obtained through screening according to the pixel value of each pixel in the target area of the first mask image. Optionally, the screening may be implemented based on a preset pixel threshold. For example, the pixel value of each pixel in the target region of the first mask image is obtained, and the pixel value is determined in the second mask image according to the position of the pixel in the first mask image, wherein the pixel value is greater than the pixel threshold value. The target region is 3 × 3, and the included pixel coordinates are (1,3), (1,4), (1,5), (2,3), (2,4), (2,5), (3,3), (3,4), and (3,5), respectively. When the pixel values of the pixels with the coordinates of (1,3), (1,4), (1,5), (2,3), (2,4), (2,5), (3,3), (3,4) and (3,5) in the first mask image are 1, 0.7, 1, 0.8, 0.1, 0.9, 0.2 and 0, respectively, and the preset pixel threshold value is 0.5, the coordinates of the reference pixels are respectively (1,3), (1,4), (1,5), (2,3), (2,4) and (3,3) through screening. When the pixel values in the above-described reference pixels (1,3), (1,4), (1,5), (2,3), (2,4), and (3,3) in the second mask image are 0.1, 0.2, 1, 0.7, 0.8, 0, and 0.9, respectively, the pixel value 0.8 in the replacement target pixel (2,4) of which the minimum value is 0 is acquired.
Fig. 5 illustrates a schematic diagram of adjusting a second site area according to an embodiment of the disclosure. As shown in fig. 2, after the target area 50 with the current target pixel as the center in the second mask image is determined, the target area 51 at the target area position in the first mask image is also acquired. Reference pixels are obtained by screening the pixel values of each pixel in the target area 51 in the first mask image, and an image erosion area 52 composed of a plurality of reference pixels in the target area 50 in the second mask image is obtained. Further, the pixel value in the target pixel is replaced by the minimum value 0 in the image erosion area 52.
And after finishing image corrosion according to the region information and the first mask image, obtaining a second mask image after adjusting the characterized second position region.
And step S40, performing color editing on the face image according to the beautifying parameter information and the adjusted second mask image to obtain a target image with the adjusted color of the second part area.
In a possible implementation manner, after the second mask image is adjusted according to the area information and the first mask image, color editing is performed on a second part area in the face image according to the beautification parameter information in the color editing information and the adjusted second mask image, so as to obtain a target image.
Optionally, the adjusting process of the face image may be to generate a beautification image according to the beautification parameter information and the adjusted second mask image, where the beautification image is an image in which the beautification parameter information represents a color and is filled in the second region. Further, the beautified image may be an image with the same size as the face image, wherein only the second region area is filled with the color represented by the beautification parameter information according to the intensity of each pixel representing the second region area in the second mask image, and the other regions are set to be transparent, i.e., the pixel value is set to be 0. And after the beautified image is obtained, carrying out image fusion on the beautified image and the face image to obtain a target image with the color of the second part area adjusted. Optionally, the image fusion mode may be any fusion mode, such as any mode of front lamination and transparency fusion. And the process of stacking the front sheet on the bottom is to stack the second part area position in the beautified image on the second part area position in the face image in a slide form.
The image processing method of the embodiment of the disclosure can be used for beautifying the lips of the human face in the human face image. For example, a face image may be acquired by an electronic device, and feature point recognition is performed on a face in the face image to obtain a lip region of the face. And obtaining a first mask image representing the position of the face lip region in the face image according to a preset or user-uploaded first reference mask image and the lip region, and obtaining a second mask image representing the position of the face lip edge in the face image according to a preset or user-uploaded second reference mask image and the lip region. Further, the electronic device determines area information indicating an area where the user wishes to increase the lip line effect and beautification parameter information indicating effects such as color, intensity and brightness of the lip line that the user wishes to increase in a man-machine interaction manner with the user. And adjusting the second mask image according to the area information and the first mask image to determine an area which needs to be finally increased with the lip line effect, obtaining a beautification image for beautifying the area which needs to be increased with the lip line effect according to the beautification parameter information and the adjusted second mask image, and performing positive bottom-folding processing on the beautification image and the face image to obtain the face image with the beautified lip line effect.
The embodiment of the disclosure can obtain the area needing color editing for color editing by identifying the first part area and the second part area of the face image and adjusting the second part area based on the area information and the first part area specified by the user. The effect of accurately beautifying the specific area of the lips of the face image is achieved.
It is understood that the above-mentioned method embodiments of the present disclosure can be combined with each other to form a combined embodiment without departing from the logic of the principle, which is limited by the space, and the detailed description of the present disclosure is omitted. Those skilled in the art will appreciate that in the above methods of the specific embodiments, the specific order of execution of the steps should be determined by their function and possibly their inherent logic.
In addition, the present disclosure also provides an image processing apparatus, an electronic device, a computer-readable storage medium, and a program, which can be used to implement any one of the image processing methods provided by the present disclosure, and the corresponding technical solutions and descriptions and corresponding descriptions in the methods section are not repeated.
Fig. 6 shows a schematic diagram of an image processing apparatus according to an embodiment of the present disclosure. As shown in fig. 6, the image processing apparatus of the embodiment of the present disclosure includes an image determining module 60, an information acquiring module 61, a range adjusting module 62, and a color adjusting module 63.
An image determining module 60, configured to determine a first mask image and a second mask image of a face image, where the first mask image is used to characterize a first region of the face image, and the second mask image is used to characterize a second region of the face image, where the second region is at least partially different from the first region;
the information acquisition module 61 is used for acquiring lip processing information, wherein the lip processing information comprises area information and beautification parameter information;
a range adjusting module 62, configured to adjust a range of a second location area in the second mask image according to the area information and the first mask image;
and the color adjusting module 63 is configured to perform color editing on the face image according to the beautification parameter information and the adjusted second mask image, so as to obtain a target image with an adjusted color of the second part area.
In one possible implementation, the range adjustment module 62 includes:
the image corrosion submodule is used for carrying out image corrosion operation on the second mask image according to the region information and the first mask image and adjusting the range of the second part region; during the image erosion process, the second region coincides with at least a partial region of the first region.
In one possible implementation, the image erosion submodule includes:
and the image corrosion unit is used for carrying out image corrosion from the first edge to the second edge of the second position region in the second mask image according to the first mask image until the adjustment condition corresponding to the region information is met.
In a possible implementation manner, the adjustment condition corresponding to the region information is that a ratio of the current second region to the original second region is a value of the region information.
In one possible implementation, the image erosion unit includes:
a target pixel determination subunit, configured to determine target pixels sequentially from a first edge to a second edge of the second region;
a region determining subunit, configured to determine a target region according to a position of the target pixel in the second mask image;
a reference pixel determination subunit, configured to determine a reference pixel in the second mask image according to a pixel value of each pixel in the target region of the first mask image;
a pixel value updating subunit, configured to update the pixel value of the target pixel according to the pixel value in the reference pixel in the second mask image.
In one possible implementation, the reference pixel determination subunit includes:
a pixel value acquisition subunit, configured to acquire a pixel value of each pixel of the first mask image in the target region;
and the reference pixel screening subunit is used for determining a reference pixel in the second mask image according to the position of the pixel of which the pixel value is greater than the pixel threshold value in the first mask image.
In one possible implementation, the image determining module 60 includes:
a first reference image determination sub-module for determining a first reference mask image, the first reference mask image being used to characterize the first region predicted shape;
the first region identification submodule is used for identifying a first part region in the face image;
and the first image generation submodule is used for generating a first mask image according to the first position area and the first reference mask image.
In one possible implementation, the image determining module 60 includes:
a second reference image determining sub-module, configured to determine a second reference mask image, where the second reference mask image is used to characterize an edge prediction shape of the first region;
the second area identification submodule is used for identifying a first part area in the face image;
and the second image generation submodule is used for generating a second mask image according to the first position area and the second reference mask image.
In a possible implementation manner, the information obtaining module 61 includes:
the page display submodule is used for displaying a lip editing page comprising an area adjusting control and a color adjusting control;
the information determination submodule is used for responding to the triggering of the area adjustment control and the color adjustment control by a user and respectively generating corresponding area information and beautifying parameter information;
and the information generation submodule is used for determining the lip processing information according to the area information and the beautifying parameter information.
In one possible implementation, the color adjustment module 63 includes:
a beautification image generation submodule, configured to generate an beautification image according to the beautification parameter information and the adjusted second mask image, where the beautification image is an image obtained by filling the beautification parameter information representation color in the second part area;
and the image fusion submodule is used for carrying out image fusion on the beautified image and the face image to obtain a target image with the color of the second part area adjusted.
In a possible implementation manner, the image processing method is used for adding a lip line beautification effect to the face image, the first part area is a lip area, and the second part area is a lip line area.
In some embodiments, functions of or modules included in the apparatus provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and specific implementation thereof may refer to the description of the above method embodiments, and for brevity, will not be described again here.
Embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the above-mentioned method. The computer readable storage medium may be a volatile or non-volatile computer readable storage medium.
An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the memory-stored instructions to perform the above-described method.
The disclosed embodiments also provide a computer program product comprising computer readable code or a non-transitory computer readable storage medium carrying computer readable code, which when run in a processor of an electronic device, the processor in the electronic device performs the above method.
The electronic device may be provided as a terminal, server, or other form of device.
Fig. 7 shows a schematic diagram of an electronic device 800 according to an embodiment of the disclosure. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like terminal.
Referring to fig. 7, electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 800 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the electronic device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a Complementary Metal Oxide Semiconductor (CMOS) or Charge Coupled Device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as a wireless network (WiFi), a second generation mobile communication technology (2G) or a third generation mobile communication technology (3G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804, is also provided that includes computer program instructions executable by the processor 820 of the electronic device 800 to perform the above-described methods.
The disclosure relates to the field of augmented reality, and aims to detect or identify relevant features, states and attributes of a target object by means of various visual correlation algorithms by acquiring image information of the target object in a real environment, so as to obtain an AR effect combining virtual and reality matched with specific applications. For example, the target object may relate to a face, a limb, a gesture, an action, etc. associated with a human body, or a marker, a marker associated with an object, or a sand table, a display area, a display item, etc. associated with a venue or a place. The vision-related algorithms may involve visual localization, SLAM, three-dimensional reconstruction, image registration, background segmentation, key point extraction and tracking of objects, pose or depth detection of objects, and the like. The specific application can not only relate to interactive scenes such as navigation, explanation, reconstruction, virtual effect superposition display and the like related to real scenes or articles, but also relate to special effect treatment related to people, such as interactive scenes such as makeup beautification, limb beautification, special effect display, virtual model display and the like. The detection or identification processing of the relevant characteristics, states and attributes of the target object can be realized through the convolutional neural network. The convolutional neural network is a network model obtained by performing model training based on a deep learning framework.
Fig. 8 shows a schematic diagram of an electronic device 1900 according to an embodiment of the disclosure. For example, the electronic device 1900 may be provided as a server. Referring to fig. 8, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system, such as the Microsoft Server operating system (Windows Server), stored in the memory 1932TM) Apple Inc. of the present application based on the graphic user interface operating System (Mac OS X)TM) Multi-user, multi-process computer operating system (Unix)TM) Free and open native code Unix-like operating System (Linux)TM) Open native code Unix-like operating System (FreeBSD)TM) Or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the electronic device 1900 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
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, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown 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. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The computer program product may be embodied in hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK) or the like.
The foregoing description of the various embodiments is intended to highlight various differences between the embodiments, and the same or similar parts may be referred to each other, and for brevity, will not be described again herein.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
If the technical scheme of the application relates to personal information, a product applying the technical scheme of the application clearly informs personal information processing rules before processing the personal information, and obtains personal independent consent. If the technical scheme of the application relates to sensitive personal information, a product applying the technical scheme of the application obtains individual consent before processing the sensitive personal information, and simultaneously meets the requirement of 'express consent'. For example, at a personal information collection device such as a camera, a clear and significant identifier is set to inform that the personal information collection range is entered, the personal information is collected, and if the person voluntarily enters the collection range, the person is regarded as agreeing to collect the personal information; or on the device for processing the personal information, under the condition of informing the personal information processing rule by using obvious identification/information, obtaining personal authorization by modes of popping window information or asking a person to upload personal information of the person by himself, and the like; the personal information processing rule may include information such as a personal information processor, a personal information processing purpose, a processing method, and a type of personal information to be processed.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (14)

1. An image processing method, characterized in that the method comprises:
determining a first mask image and a second mask image of a face image, wherein the first mask image is used for representing a first part area of the face image, the second mask image is used for representing a second part area of the face image, and the second part area is at least partially different from the first part area;
obtaining lip processing information, wherein the lip processing information comprises area information and beautification parameter information, the area information is used for indicating the range of the second part area, and the beautification parameter information is used for indicating beautification parameters of the second part area;
adjusting the range of a second position region in the second mask image according to the region information and the first mask image;
and beautifying the face image according to the beautifying parameter information and the adjusted second mask image to obtain a target image with the color of the second part region adjusted.
2. The method of claim 1, wherein the adjusting the extent of the second location area in the second mask image based on the area information and the first mask image comprises:
according to the region information and the first mask image, performing image corrosion operation on the second mask image, and adjusting the range of the second part region; during the image erosion process, the second region coincides with at least a partial region of the first region.
3. The method of claim 2, wherein the performing an image erosion operation on the second mask image based on the region information and the first mask image, and wherein adjusting the extent of the second region comprises:
and according to the first mask image, carrying out image corrosion from the first edge to the second edge of the second position region in the second mask image until the adjustment condition corresponding to the region information is met.
4. The method according to claim 3, wherein the adjustment condition corresponding to the region information is that a ratio of the current second region to the original second region is a value of the region information.
5. The method according to claim 3 or 4, wherein said image eroding from the first edge to the second edge of the second region in the second mask image according to the first mask image comprises:
sequentially determining target pixels from a first edge to a second edge of the second part area;
determining a target area according to the position of the target pixel in the second mask image;
determining a reference pixel in the second mask image according to a pixel value of each pixel in the target region of the first mask image;
updating the pixel value of the target pixel according to the pixel value in the reference pixel in the second mask image.
6. The method of claim 5, wherein determining the reference pixel in the second mask image based on the pixel value of each pixel in the target region of the first mask image comprises:
acquiring a pixel value of each pixel of the first mask image in the target area;
and determining a reference pixel in the second mask image according to the position of the pixel with the pixel value larger than the pixel threshold value in the first mask image.
7. The method according to any one of claims 1-6, wherein determining the first mask image of the face image comprises:
determining a first reference mask image, the first reference mask image being used to characterize the first location area prediction shape;
identifying a first part area in the face image;
and generating a first mask image according to the first position area and the first reference mask image.
8. The method according to any one of claims 1-7, wherein determining the second mask image of the face image comprises:
determining a second reference mask image, the second reference mask image being used to characterize an edge predicted shape of the first region area;
identifying a first part area in the face image;
and generating a second mask image according to the first position area and the second reference mask image.
9. The method according to any one of claims 1-8, wherein the obtaining lip treatment information comprises:
displaying a lip editing page comprising a region adjustment control and a color adjustment control;
responding to the triggering of the area adjusting control and the color adjusting control by the user, and respectively generating corresponding area information and beautifying parameter information;
and determining lip processing information according to the area information and the beautification parameter information.
10. The method according to any one of claims 1 to 9, wherein the performing color editing on the face image according to the beautification parameter information and the adjusted second mask image to obtain the target image with the color of the second region area adjusted includes:
generating a beautification image according to the beautification parameter information and the adjusted second mask image, wherein the beautification image is an image with the beautification parameter information representing colors filled in the second part area;
and carrying out image fusion on the beautified image and the face image to obtain a target image with the color of the second part area adjusted.
11. The method according to any one of claims 1 to 10, wherein the image processing method is configured to add a lip line beautification effect to the face image, and the first region is a lip region and the second region is a lip line region.
12. An image processing apparatus, characterized in that the apparatus comprises:
the image determining module is used for determining a first mask image and a second mask image of a face image, wherein the first mask image is used for representing a first part area of the face image, the second mask image is used for representing a second part area of the face image, and the second part area is at least partially different from the first part area;
the information acquisition module is used for acquiring lip processing information, wherein the lip processing information comprises area information and beautification parameter information;
a range adjusting module, configured to adjust a range of a second location area in the second mask image according to the area information and the first mask image;
and the color adjusting module is used for carrying out color editing on the face image according to the beautifying parameter information and the adjusted second mask image to obtain a target image with the color of the second part area adjusted.
13. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to invoke the memory-stored instructions to perform the method of any of claims 1 to 11.
14. A computer readable storage medium having computer program instructions stored thereon, which when executed by a processor implement the method of any one of claims 1 to 11.
CN202210106872.0A 2022-01-28 2022-01-28 Image processing method and device, electronic equipment and storage medium Pending CN114463212A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210106872.0A CN114463212A (en) 2022-01-28 2022-01-28 Image processing method and device, electronic equipment and storage medium
PCT/CN2022/134617 WO2023142645A1 (en) 2022-01-28 2022-11-28 Image processing method and apparatus, and electronic device, storage medium and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210106872.0A CN114463212A (en) 2022-01-28 2022-01-28 Image processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114463212A true CN114463212A (en) 2022-05-10

Family

ID=81411321

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210106872.0A Pending CN114463212A (en) 2022-01-28 2022-01-28 Image processing method and device, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN114463212A (en)
WO (1) WO2023142645A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023142645A1 (en) * 2022-01-28 2023-08-03 上海商汤智能科技有限公司 Image processing method and apparatus, and electronic device, storage medium and computer program product

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4519681B2 (en) * 2004-02-26 2010-08-04 大日本印刷株式会社 Method and apparatus for creating human lip area mask data
CN102708575A (en) * 2012-05-17 2012-10-03 彭强 Daily makeup design method and system based on face feature region recognition
CN109584180A (en) * 2018-11-30 2019-04-05 深圳市脸萌科技有限公司 Face image processing process, device, electronic equipment and computer storage medium
CN112308944A (en) * 2019-07-29 2021-02-02 丽宝大数据股份有限公司 Augmented reality display method of simulated lip makeup
CN113763286A (en) * 2021-09-27 2021-12-07 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium
CN114463212A (en) * 2022-01-28 2022-05-10 北京大甜绵白糖科技有限公司 Image processing method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023142645A1 (en) * 2022-01-28 2023-08-03 上海商汤智能科技有限公司 Image processing method and apparatus, and electronic device, storage medium and computer program product

Also Published As

Publication number Publication date
WO2023142645A1 (en) 2023-08-03

Similar Documents

Publication Publication Date Title
CN110929651B (en) Image processing method, image processing device, electronic equipment and storage medium
US11114130B2 (en) Method and device for processing video
CN112766234B (en) Image processing method and device, electronic equipment and storage medium
CN111553864B (en) Image restoration method and device, electronic equipment and storage medium
CN113160094A (en) Image processing method and device, electronic equipment and storage medium
CN109840917B (en) Image processing method and device and network training method and device
CN109472738B (en) Image illumination correction method and device, electronic equipment and storage medium
CN110989901B (en) Interactive display method and device for image positioning, electronic equipment and storage medium
CN113194254A (en) Image shooting method and device, electronic equipment and storage medium
CN111626183A (en) Target object display method and device, electronic equipment and storage medium
CN113763286A (en) Image processing method and device, electronic equipment and storage medium
WO2023045979A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN112767288A (en) Image processing method and device, electronic equipment and storage medium
CN111724361B (en) Method and device for displaying focus in real time, electronic equipment and storage medium
CN110929616B (en) Human hand identification method and device, electronic equipment and storage medium
CN107424130B (en) Picture beautifying method and device
CN113822798B (en) Method and device for training generation countermeasure network, electronic equipment and storage medium
CN114581525A (en) Attitude determination method and apparatus, electronic device, and storage medium
CN114067085A (en) Virtual object display method and device, electronic equipment and storage medium
WO2023142645A1 (en) Image processing method and apparatus, and electronic device, storage medium and computer program product
CN113570581A (en) Image processing method and device, electronic equipment and storage medium
WO2023045946A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN114550261A (en) Face recognition method and device, electronic equipment and storage medium
CN114266305A (en) Object identification method and device, electronic equipment and storage medium
CN113870400A (en) Virtual object generation method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40067430

Country of ref document: HK