WO2015149475A1 - 图片处理方法及装置 - Google Patents

图片处理方法及装置 Download PDF

Info

Publication number
WO2015149475A1
WO2015149475A1 PCT/CN2014/085482 CN2014085482W WO2015149475A1 WO 2015149475 A1 WO2015149475 A1 WO 2015149475A1 CN 2014085482 W CN2014085482 W CN 2014085482W WO 2015149475 A1 WO2015149475 A1 WO 2015149475A1
Authority
WO
WIPO (PCT)
Prior art keywords
skin
picture
area
processed
value
Prior art date
Application number
PCT/CN2014/085482
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 北京金山网络科技有限公司
Priority to US14/905,762 priority Critical patent/US9959603B2/en
Publication of WO2015149475A1 publication Critical patent/WO2015149475A1/zh

Links

Classifications

    • G06T5/77
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T5/90
    • 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/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/161Detection; Localisation; Normalisation
    • G06V40/162Detection; Localisation; Normalisation using pixel segmentation or colour matching
    • 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/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Definitions

  • the present application relates to the field of image processing technologies, and in particular, to a picture processing method and apparatus.
  • a "skinning" technique is commonly used in the prior art to modify the facial skin of a person in a photograph. After using this function, the rough part of the human face will become smoother, and the lighter spots will disappear. That is, the smaller part of the human face and the slightly darker part of the surrounding color will become lighter, visually disappearing.
  • whiteflies, scars, etc. still can leave obvious traces.
  • the existing applications basically require the user to manually specify the position and size of the face skin flaw, and then according to the specified position and size, the color of the area is replaced with the color close to the surrounding skin color, thereby achieving Modify the image to remove the purpose of the flaw.
  • the purpose of the embodiments of the present application is to provide a picture processing method and apparatus for automatically modifying the facial skin of a person in a photo to eliminate the obvious problem in the face skin.
  • the embodiment of the present application discloses a picture processing method, where the method includes: performing face recognition on a picture to be processed;
  • the determining the area of the skin to be treated in the face area comprises:
  • the skin area is detected in the face area.
  • the to-be-processed picture includes:
  • the determining the location of the skin defect in the area of the skin to be treated comprises: obtaining a picture of different conflict degree levels of the skin area to be treated;
  • the position of the skin flaw in the area of the skin to be treated is determined based on the different conflict threshold picture and the skin similarity picture.
  • the determining a color value of the area to be treated, and generating a skin similarity picture of the skin area to be processed according to the color value comprising:
  • the calculated similarity value is mapped to a gray value, and a skin similarity picture reflecting the skin color is generated.
  • the obtaining a picture of different conflict degree levels of the skin area to be treated includes:
  • Determining the location of the skin flaw in the area of the skin to be treated according to the different conflict level map and the skin similarity picture including:
  • the position of the skin flaw in the area to be treated is determined based on the first to third pictures and the skin similarity picture.
  • the determining, according to the first to third pictures and the skin similarity picture, the position of the skin flaw in the skin area to be treated comprises:
  • the step of determining the position of the skin flaw in the area of the skin to be treated according to the first to third pictures and the skin similarity picture comprises:
  • the first to fourth skin imperfections are combined to obtain a position of all skin imperfections in the area of the skin to be treated.
  • the step of generating the first skin defect set according to the second picture, the skin similarity picture and the to-be-processed skin area comprises:
  • the first search condition is that the pixel point gray value is less than or equal to the first gray threshold, and the gray value is less than or equal to the first gray threshold
  • the number of mutually adjacent pixel points is less than or equal to the first adjacent threshold
  • the corresponding range in which the location of the plaque is extracted is centered a gray value of the pixel, and determining whether a gray value corresponding to the pixel point within a predetermined range centered on the position is within a grayscale threshold value indicating that the skin color is similar;
  • the searched plaque is taken as the first skin sputum collection.
  • the step of generating a second skin defect set according to the first picture, the skin similarity picture and the to-be-processed skin area comprises:
  • the second search condition is that the pixel point gradation value is less than or equal to the second gradation threshold, and the gradation value is less than or equal to the second gray threshold
  • the number of mutually adjacent pixel points is less than or equal to the second adjacency threshold
  • the searched plaque is taken as the second skin sputum collection.
  • the step of generating the third and fourth skin defects according to the third picture, the skin similarity picture and the to-be-processed skin area comprises:
  • the third search condition is that the pixel point gray value is less than or equal to the third gray threshold, and the gray value is less than or equal to the third gray threshold
  • the number of mutually adjacent pixel points is less than or equal to a third adjacent threshold
  • the fourth search condition is that the pixel point gradation value is less than or equal to the fourth gradation threshold, and the gradation value is less than or equal to the fourth gray threshold
  • the number of mutually adjacent pixel points is less than or equal to a fourth adjacent threshold
  • the searched plaque satisfying the third search condition is used as the third skin ⁇ collection
  • the searched plaque satisfying the fourth search condition is used as the fourth skin sputum collection.
  • the step of generating the first picture having the first black and white contrast comprises: performing a first gray level processing on the skin area to be processed, thereby generating a first picture having a first black and white contrast;
  • the step of generating a second picture having a second black and white contrast comprises: performing a second gray level processing on the skin area to be processed to generate a second picture having a second black and white contrast; wherein the second gray Degree processing is different from the first gray level processing method;
  • the step of generating a third picture having a third black-and-white contrast includes: first performing a dermabrasion process on the skin area to be treated, obtaining a dermabrasion-processed image, and performing the tempered-processed image on the image Three gradation processing, thereby generating a third picture having a third black and white contrast, wherein the third gradation processing is the same as the first gradation processing.
  • the removing the corresponding skin flaw in the face region according to the determined position of the skin flaw in the skin area to be treated, and obtaining the processed image comprising:
  • mapping processing result the skin flaw in the face area of the to-be-processed picture is removed, and the processed picture is obtained.
  • the method further includes:
  • the area where the skin flaw is located is enlarged according to a preset second ratio, wherein the preset second ratio is greater than 1.
  • the removing the skin flaw in the face region of the to-be-processed image according to the mapping processing result includes:
  • the method further comprises: performing a dermabrasion process on the processed image to obtain a picture for removing the abrupt effect.
  • the skin imperfection comprises any one or more of the following: acne, smudge, scar or sputum.
  • the embodiment of the present application discloses a picture processing device, where the device includes: a face recognition module, configured to perform face recognition in a picture to be processed;
  • a skin area determining module configured to determine a skin area to be treated in the face area according to the detection result
  • a skin flaw determining module configured to determine a position of the skin flaw in the skin area to be treated
  • a skin flaw removal module configured to remove the person according to the determined position of the skin flaw in the skin area to be treated
  • the skin area determining module includes:
  • a cover area detecting submodule for detecting a cover area in a face area
  • a non-covering area determining sub-module configured to determine a non-covered area in the face area according to the covering area
  • a skin area detecting submodule for detecting a skin area in the non-covered area; or for detecting a skin area in a face area.
  • the to-be-processed picture includes:
  • the skin defect determining module comprises:
  • Different protrusion level picture obtaining sub-modules configured to obtain different conflicting degree level pictures of the to-be-processed skin area
  • a skin similarity image generation sub-module configured to determine a color value of the to-be-processed skin region, and generate a skin similarity image of the to-be-processed skin region according to the color value;
  • the likelihood picture determines the location of the skin flaw in the area of the skin to be treated.
  • the skin similarity picture generation sub-module includes:
  • a sampling value obtaining unit configured to respectively perform skin color value sampling on a plurality of regions in the skin region to be processed to obtain a plurality of sampling values for each region;
  • a skin color value calculation unit configured to calculate a skin color value of each region according to the sampled value
  • a similarity calculation unit configured to respectively traverse pixel points in each region, and calculate a similarity value between a color value of each pixel and a skin color value of the region in which the pixel is located;
  • the skin similarity picture generating unit is configured to map the calculated similarity value to a gray value, and generate a skin similarity picture reflecting the skin color.
  • the different abrupt level picture obtaining sub-modules includes:
  • a first picture generating unit configured to generate a first picture having a first black and white contrast
  • a second picture generating unit configured to generate a second picture having a second black and white contrast; wherein the first black and white contrast is greater than the first picture Two black and white contrast;
  • a third picture generating unit configured to generate a third picture having a third black and white contrast; wherein, the third black and white contrast is the same as the first black and white contrast;
  • the skin defect determining sub-module is specifically configured to determine a position of the skin flaw in the skin area to be treated according to the first to third pictures and the skin similarity picture.
  • the skin defect determining sub-module is specifically configured to generate a first skin defect set according to the second picture and the skin similarity picture; and generate a second skin defect set according to the first picture and the skin similarity picture. And generating a third and fourth skin defect collection according to the third picture and the skin similarity picture; combining the first to fourth skin defects to obtain a position of all skin defects in the skin area to be treated.
  • the skin defect determining sub-module comprises:
  • a first skin defect collection generating unit configured to generate a first skin defect set according to the second picture, the skin similarity picture, and the to-be-processed skin area
  • a second skin defect collection generating unit configured to generate a second skin defect set according to the first picture, the skin similarity picture, and the to-be-processed skin area
  • a third and fourth skin sputum collection generating unit configured to generate a third and fourth skin sputum collection according to the third picture, the skin similarity picture, and the to-be-processed skin area;
  • a skin sputum obtaining unit for combining the first to fourth skin sputum collections, obtaining all The location of the skin in the area of the skin to be treated.
  • the first skin defect collection generating unit comprises:
  • a first search subunit configured to search for a plaque that satisfies a first search condition in the second picture, where the first search condition is that a pixel point gradation value is less than or equal to a first gradation threshold, and the gradation is And the number of mutually adjacent pixel points whose value is less than or equal to the first gray threshold is less than or equal to the first neighboring threshold;
  • the first mapping subunit is configured to map the location of the patch to the skin area to be processed and the skin is similar Degree picture
  • a first plaque position and color value extraction subunit configured to extract, from the to-be-processed skin region, a location of a plaque and a color value of a pixel corresponding to the plaque;
  • a first gray value determining subunit configured to: when the color value extracted by the first patch position and the color value extracting subunit is within a predetermined threshold color range, from the skin similarity picture, Extracting a gray value of a corresponding pixel within a predetermined range centered on the position where the plaque is located, and determining whether a gray value corresponding to the pixel point within a predetermined range centered on the position is within a grayscale threshold value indicating that the skin color is similar; If so, the searched plaque is taken as the first skin sputum collection.
  • the second skin defect collection generating unit comprises:
  • a second search subunit configured to search for a plaque that satisfies a second search condition in the first picture, where the second search condition is that a pixel point gradation value is less than or equal to a second gradation threshold, and the gradation is And the number of mutually adjacent pixel points whose value is less than or equal to the second gray threshold is less than or equal to the second neighboring threshold;
  • the second mapping subunit is configured to map the position of the patch to the skin area to be treated and the skin is similar Degree picture
  • a second plaque position and color value extraction subunit configured to extract, from the to-be-processed skin region, a location of the plaque and a color value of the pixel corresponding to the plaque;
  • a second gray value determining subunit configured to extract, from the skin similarity picture, a color value extracted by the second patch position and the color extracting subunit within a predetermined threshold color range a gray value corresponding to a pixel in a predetermined range centered on the plaque, and determining whether the gray value corresponding to the pixel point within the predetermined range centered at the position is within a grayscale threshold value indicating that the skin color is similar; if yes, The searched plaque is then used as a second skin sputum collection.
  • the third and fourth skin ⁇ collection generating units include:
  • a third search subunit configured to search for a plaque that satisfies a third search condition in the third picture, where the third search condition is that the pixel point gradation value is less than or equal to a third gradation threshold, and the gradation is The number of mutually adjacent pixel points whose value is less than or equal to the third gray threshold is less than or equal to the third adjacent threshold; a fourth search subunit, configured to search for a plaque that satisfies a fourth search condition in the third picture, where the fourth search condition is that the pixel point gradation value is less than or equal to a fourth gray threshold, and the gradation is And the number of mutually adjacent pixel points whose value is less than or equal to the fourth gray level threshold is less than or equal to the fourth neighboring threshold; the third mapping subunit is configured to map the position of the third search condition and the fourth search condition patch Go to the skin area to be treated and the skin similarity picture;
  • a third plaque position and color value extraction subunit configured to extract, from the to-be-processed skin region, a location of the plaque and a color value of a pixel corresponding to the plaque;
  • a third gray value determining subunit configured to extract, from the skin similarity picture, a corresponding pixel within a predetermined range centered on the position of the plaque, in a case where the color value is within a predetermined threshold color range a gray value of the point, and determining whether the gray value corresponding to the pixel point within the predetermined range centered on the position is within a grayscale threshold range indicating that the skin color is similar; if yes, the searched third search condition spot is satisfied As a third skin collection, the block will search for the fourth search condition plaque as the fourth skin collection.
  • the first picture generating unit is configured to perform a first gray level processing on the skin area to be processed, thereby generating a first picture having a first black and white contrast;
  • the second image generating unit is configured to perform a second grayscale processing on the to-be-processed skin region to generate a second image having a second black and white contrast; wherein the second grayscale processing and the second A grayscale processing method is different;
  • the third image generating unit is configured to perform a dermabrasion process on the skin area to be processed first, obtain a dermabrasion processed image, and perform a third gradation processing on the dermabrasion processed image, thereby Generating a third picture having a third black and white contrast, wherein the third gray level processing is the same as the first gray level processing.
  • the skin defect removal module comprises:
  • a skin mapping sub-module configured to map a skin defect in the to-be-processed skin region to a face region in the to-be-processed image
  • the skin defect removal sub-module is configured to remove the skin flaw in the face region of the to-be-processed image according to the mapping processing result, and obtain the processed image.
  • the skin defect removal module further includes:
  • a skin ⁇ magnification sub-module configured to: after the skin ⁇ mapping sub-module maps the skin ⁇ in the to-be-processed skin area into the face area of the to-be-processed picture, in the to-be-processed picture, according to Presetting a second ratio to enlarge an area where the skin flaw is located, wherein the pre-predetermined The second ratio is set to be greater than one.
  • the skin sputum removal sub-module comprises:
  • a horizontal and vertical color value obtaining unit configured to substitute the horizontal coordinate and the vertical coordinate of each pixel in the skin defect in the face region of the image to be processed into the horizontal skin color change function and the vertical skin color change function, respectively The color value of each pixel in the horizontal and vertical directions;
  • a normal skin color value obtaining unit configured to obtain an average value of the color values in the horizontal and vertical directions of each pixel point, and obtain a normal skin color value corresponding to each pixel point;
  • a color value replacing unit configured to sequentially replace, by using the calculated normal skin color value of each pixel point, a color value of each pixel in the skin region in the face region of the to-be-processed image, thereby removing the to-be-processed
  • the skin in the face area of the picture is ⁇ , and the processed picture is obtained.
  • the device further includes: a dermabrasion processing module;
  • the dermabrasion processing module is configured to perform dermabrasion treatment on the processed image to obtain a picture for removing the abrupt effect.
  • the skin imperfection comprises any one or more of the following: acne, smudge, scar or sputum.
  • the embodiment of the present application further discloses a terminal, where the terminal includes: a processor, a memory, a communication interface, and a bus;
  • the processor, the memory, and the communication interface are connected by the bus and complete communication with each other;
  • the memory stores executable program code
  • the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory for:
  • the embodiment of the present application further discloses an application program for executing the image processing method described in the embodiment of the present application at runtime.
  • the embodiment of the present application further discloses a storage medium for storing an application, and the application is used to execute the image processing method described in the embodiment of the present application.
  • the image processing method and device provided by the embodiments of the present application can automatically modify the facial skin of a person in a photo image, that is, the shallower flaw in the human skin is eliminated, and the A more obvious problem in the human face.
  • the method provided by the present application provides a better user experience than the manual method of manually erasing facial skin flaws in various types of APPs that are aesthetically treated.
  • FIG. 1 is a flowchart of a picture processing method according to an embodiment of the present application.
  • FIG. 2 is a flow chart of a method of determining a location of a skin defect in a skin area to be treated in accordance with an embodiment of the present application
  • FIG. 3 is a specific example of a picture to be processed according to an embodiment of the present application.
  • FIG. 4 is a specific example of a first picture according to an embodiment of the present application.
  • FIG. 5 shows another specific example of a first picture according to an embodiment of the present application
  • FIG. 6 shows a specific example of a second picture according to an embodiment of the present application.
  • FIG. 7 shows a specific example of a third picture according to an embodiment of the present application.
  • FIG. 8 is a specific example of a processed picture corresponding to the picture shown in FIG. 3 according to an embodiment of the present application.
  • FIG. 9 is a view showing a specific example of a picture obtained after the dermabrasion process of the image shown in FIG. 8 according to an embodiment of the present application.
  • FIG. 10 is a schematic diagram showing the logical structure of an image processing apparatus according to an embodiment of the present application
  • FIG. 11 is a schematic diagram showing the logical structure of a skin defect determination module according to an embodiment of the present application.
  • the R color channel represents a single red component in the image, usually represented by a grayscale image. The closer to black, the less the component, the closer it is to white, the more the component is represented.
  • the G color channel and the B color channel are similar concepts.
  • Microdermabrasion After performing a microdermabrasion on the image, many shallow spots in the skin will be removed, making the skin appear smooth and delicate. There are many kinds of dermabrasion algorithms, but they can only eliminate relatively shallow acne, scars, etc., and can not directly remove acne and scars by grinding.
  • FIG. 1 is a flowchart of a picture processing method according to an embodiment of the present application, the process specifically includes:
  • S101 Perform face recognition in the picture to be processed.
  • the to-be-processed picture may be the original to-be-processed picture, or may be the picture obtained by scaling the original to-be-processed picture according to the preset first ratio.
  • the original to-be-processed picture is reduced according to the ratio of 1:2.
  • FIG. 3 is a specific example of a picture to be processed according to an embodiment of the present application.
  • the face recognition in the to-be-processed picture may be performed by the user manually determining the face area in the image to be processed, or the face recognition area may be recognized by the face recognition technology, wherein the face recognition technology is A technique for analyzing an input picture based on a person's facial features, First, it is possible to first determine whether there is a face area in the picture, and if so, to detect the position and size of the face area in the picture and the position of each major facial organ, etc., there are various implementers in the prior art. The method of face recognition technology will not be described here.
  • a method for determining a skin area to be treated in a face region which may include:
  • the skin area is detected in the face area.
  • the above-mentioned cover area may include a facial feature area in a human face.
  • the facial features in the face can also be obtained by facial recognition technology to obtain the position information of the facial features, and the covering area is determined based on the position information of the facial features.
  • the eyebrows are covered by the hair, so if the eyebrows are not detected, you can not detect them.
  • the size and position can be marked with a certain model. For example, the position of the eye can be marked with an ellipse or directly with a rectangle to obtain the covered area.
  • the area of the skin to be processed may be stored in the form of a picture, so that the image processing may be performed subsequently, or the skin area to be processed may not be separately stored. Instead, the corresponding position is marked on the image to be processed, and the skin area to be processed is processed according to the mark position in subsequent processing.
  • FIG. 8 is a schematic diagram of a processed image corresponding to the image shown in FIG. 3 according to an embodiment of the present application.
  • removing the skin flaw in the face region of the to-be-processed image can be implemented in the following manner:
  • the pixel point of the preset relative position may be a pixel point at a center position in the skin flaw, or a pixel point in the upper left corner of the skin flaw, and the like.
  • the preset relative position is not limited, and the value of the preset relative position may be determined according to a specific situation in an actual application.
  • the above color value may be a value representing all color components of the pixel point color, for example, the gray value of the R color channel in the RGB picture, the gray value of the G color channel, and the gray value of the B color channel. It may also be a value representing a certain color component of a pixel point color, for example, a gray value of a G color channel.
  • the color between the skin area and the surrounding skin area in the picture to be processed is continuously changed, after the determined skin defect is mapped to the preset mapping picture, it can still be processed.
  • the area of the skin defect is enlarged according to a preset second ratio to better remove the skin flaw, wherein the preset second ratio is greater than 1.
  • the method may further include: performing a dermabrasion process on the processed image to obtain a picture for removing the abrupt effect.
  • Figure 9 is a dermabrasion-processed picture of the image of Figure 8 in accordance with an embodiment of the present application. Comparing Figure 9 with Figure 3, it can be seen that the effect of removing skin imperfections is very obvious.
  • the to-be-processed picture may be the original to-be-processed picture, or may be the picture obtained by scaling the original to-be-processed picture according to the preset first ratio.
  • the picture to be processed is the picture obtained by scaling the original picture to be processed according to the preset first scale
  • the processed picture needs to be enlarged to the original picture size to be processed. For example, if the image to be processed is the image obtained by reducing the original image to be processed according to the ratio of 1:2, the processed image corresponding to the image to be processed is obtained, and the processed image is enlarged by a ratio of 2:1.
  • the size of the original pending image is the image obtained by reducing the original image to be processed according to the ratio of 1:2.
  • the facial skin of the person in the picture is automatically modified, that is, the shallow sputum in the skin of the face is eliminated, and the skin of the face is also eliminated. More obvious flaws.
  • the method provided by the present application provides the user with a better user experience than the manual treatment of facial skin flaws in various types of facial skin beautification treatments.
  • FIG. 2 is a skin defect determined in the skin area to be treated according to an embodiment of the present application.
  • the steps of obtaining different levels of acuity pictures may include:
  • the above step may be: performing a first gradation processing on the skin area to be processed, thereby generating a first picture having a first black and white contrast; performing a second gradation processing on the skin area to be processed, thereby generating a second black and white a second picture of contrast, wherein the second gradation processing is different from the first gradation processing method; the skin area to be treated is first subjected to dermabrasion treatment to obtain a dermabrasion-treated image, and then the dermabrasion-treated image is subjected to Three gradation processing, thereby generating a third picture having a third black and white contrast, wherein the third gradation processing is the same as the first gradation processing.
  • the step of generating the first picture may include: performing a "high contrast retention" and at least three "light” processing on the skin area to be processed to obtain the first picture; or, performing a "high contrast” on the skin area to be processed.
  • the first picture can be obtained by the process of the first picture.
  • the first picture can be referred to as FIG. 4 or FIG. 5.
  • FIG. 4 is a specific example of the first picture according to the embodiment of the present application.
  • FIG. 5 is another specific example of the first picture according to an embodiment of the present application, which may be referred to as IMAGE_ALPHA_LIGHT.
  • the step of generating the second picture may include: performing a "high contrast retention” and at least one "light” processing on the treated skin area to obtain a second picture; or, performing a "high contrast retention” and at least once on the skin area to be processed
  • the "glare” process is performed to obtain a second picture.
  • the second picture can be seen in FIG. 6.
  • FIG. 6 is a specific example of the second picture according to an embodiment of the present application, which may be referred to as IMAGE_ALPHA_NO_LIGHT.
  • the number of times of processing when generating the second picture is less than the number of times of processing when the first picture is generated.
  • the step of generating the third picture may include: performing a dermabrasion treatment on the treated skin area to obtain an image after the dermabrasion treatment; thereafter, performing a "high contrast retention” and at least three times “lighting” on the dermabrasion processed image. "Processing, obtaining a third picture; or, performing a "high contrast retention” and at least three “glare” processing on the treated skin area to obtain a third picture, the third picture can be seen in FIG. 7, and FIG. 7 is according to the present application.
  • a specific example of the third picture of the embodiment may be referred to as IMAGE_ALPHA_FINAL.
  • the step of performing the dermabrasion treatment on the skin area to be treated to obtain the image after the dermabrasion treatment may include:
  • the green channel to be treated in the skin area is slightly brightened, and the highlighted image and the grayed image are grayed out as the grayscale image.
  • the program processes the aforementioned skin area to be processed as long as the generated first, second, and third pictures are black and white images (ie, grayscale images), and the black and white contrast of the first picture is greater than the black and white of the third two image pictures. Contrast can be.
  • the green channel of the skin area to be processed may be subjected to gradation processing because the skin in the red channel is ⁇ Usually not obvious, and there are too many variegations in the blue channel, and the green channel is moderate, so choose the green channel.
  • the three components of red, green, and blue may be given the same or different weights, and then the average value may be obtained, and then the image of the average value is gray-scaled.
  • the purpose of generating the first picture is to more appropriately find out the more prominent areas of the skin area, such as the face area, which are darker than the surrounding area, wherein the darker part indicates the more abrupt, which is in the area of the skin to be treated.
  • the color is darker, see Figure 4 or Figure 5 for the first picture.
  • the purpose of generating the second picture is to highlight the very obvious skin blemishes, which are used to search for more obvious skin flaws. See Figure 6 for the second picture.
  • the first image highlights a lot of colors, which are only slightly deeper than the surrounding pixels, these pixels will also become close to black. If there is skin such as acne nearby, the acne will turn black, which may even In one piece, the number of total pixels in the black area is determined to be large, which may exceed the preset threshold of the number of mutually adjacent pixels, thereby causing a false positive.
  • the dermabrasion operation has erased only the pixels with slightly darker colors, thus avoiding such misjudgment, ⁇ , so that the still abrupt areas that are not erased in the image after the dermabrasion are once again highlighted. See Figure 7 for the third picture.
  • the foregoing three types of pictures of the first, second, and third pictures are only for the purpose of highlighting different sizes of skin flaws, but the present application is not limited thereto, and those skilled in the art may according to the present application.
  • the design idea of the embodiment is to set a variety of pictures of the level of the squatting degree, for example, four kinds, five kinds of ... to further highlight the skin flaws, and achieve a good effect of removing the skin flaws.
  • S103B Determine a color value of the skin area to be processed, and generate a skin similarity picture of the skin area to be processed according to the color value.
  • this step can be implemented in the following ways:
  • the calculated similarity value is mapped to a gray value, and a skin similarity picture reflecting the skin color is generated.
  • the reason is divided into several areas because sometimes the color direction of the skin may cause a significant color difference between the left and right or the upper and lower sides of the skin.
  • the skin area to be treated can be divided into several areas. For example, in the case of a human face, the face can be simply centered on the nose, and divided into four upper rectangular areas, upper left, upper right, lower left, and lower right, respectively, and the similarities are sampled and calculated. . For images without the effect of light and dark, this calculation method does not affect the calculation results.
  • S103C Determine the position of the skin flaw according to the different conflict degree map and the skin similarity picture.
  • the position of the skin flaw can be determined according to the first, second and third pictures and the skin similarity picture.
  • the position of the skin defect is determined according to the first, second, and third pictures and the skin similarity picture.
  • the steps can include:
  • the first to fourth skin imperfections are combined to obtain a position of all skin imperfections in the area of the skin to be treated.
  • the generating the first skin defect set according to the second picture and the skin similarity picture may include:
  • the first search condition is that the pixel point gray value is less than or equal to the first gray level threshold, for example, 30 (0 is Black, 255 is white), and the number of mutually adjacent pixel points whose gray value is less than or equal to the first gray threshold is less than or equal to the first adjacent threshold, and if the width of the face is about 100 pixels, the first adjacent threshold Suitable for 6;
  • the searched plaque is taken as the first skin sputum collection.
  • the purpose of searching for the first skin collection is to find out the more obvious skin such as acne in the dark area of the larger piece in the second picture (see Fig. 6). Since the large shadows are usually large black areas in the first picture (see Figure 5) and the third picture (see Figure 7), the size exceeds the threshold defined by the acne, which may lead to skin acne. The acne can't be detected, and the second picture (see Figure 6) can only turn the area of the skin, such as the acne, where the darker center is small, so that the step can be a darker one. The more obvious acne in the area is found out.
  • the step of generating the second skin defect set according to the first picture and the skin similarity picture area may include:
  • the second search condition is that the pixel point gradation value is less than or equal to the second gradation threshold, for example, 30 (0 is Black, 255 is white), and the number of mutually adjacent pixel points whose gray value is less than or equal to the second gray threshold is less than or equal to the second adjacent threshold. If the width of the face is about 100 pixels, the second adjacent threshold is used. Suitable for 30;
  • the purpose of searching for the second skin sputum collection described above is to find a relatively light and large piece of skin such as acne. Because the first picture (see Figure 5) has skin such as acne, other variegated and subtle changes in the skin are also blackened, which causes the black area corresponding to the skin, such as acne, to become larger. After this search, it is possible to find a skin that is relatively light in color but actually larger in size, such as acne.
  • the step of generating the third and fourth skin collections according to the third picture and the skin similarity picture may include:
  • the third search condition is that the pixel point gradation value is less than or equal to the third gradation threshold, for example, 30 (0 is Black, 255 is white), and the number of mutually adjacent pixel points whose gray value is less than or equal to the third gray threshold is less than or equal to the third adjacent threshold. If the width of the face is about 100 pixels, the third adjacent threshold is used. Suitable for 15;
  • the fourth search condition is that the pixel point gradation value is less than or equal to the fourth gradation threshold, for example, 30 (0 is Black, 255 is white), and the number of mutually adjacent pixel points whose gray value is less than or equal to the fourth gray threshold is less than or equal to the fourth adjacent threshold. If the width of the face is about 100 pixels, the third adjacent threshold is used. Suitable for 30; Mapping the location of the third search condition and the fourth search condition plaque to the skin similarity picture;
  • the purpose of searching for the third skin collection is to find a skin of moderate size such as acne. Because many of the variegated colors have been removed during the dermabrasion process, the remaining skin, such as acne, will also become lighter, so the black areas produced by the acne in the third picture (see Figure 7) will become relatively more moderate. Therefore, after this search, you can find a moderately sized skin such as acne.
  • the purpose of searching for the fourth skin sputum collection above is to find a larger piece of skin such as acne.
  • Some skin sputum is actually larger, so the black area produced by the acne in the third picture (see Figure 7) is relatively large. After this search, the actual larger piece of skin can be found, such as acne. come out.
  • the skin ⁇ set found on the scaled picture needs to be mapped to the original to be processed.
  • the position of the skin flaw in the original image to be processed is determined and then removed.
  • the skin may be determined according to the first, second and third pictures, the skin similarity picture and the to-be-processed picture. Awkward location.
  • the step of determining the position of the skin defect according to the first, second, and third pictures, the skin similarity picture, and the image to be processed may include:
  • the first to fourth skin imperfections are combined to obtain a position of all skin imperfections in the area of the skin to be treated.
  • the step of generating a first skin defect set according to the second picture, the skin similarity picture, and the to-be-processed skin area may include:
  • the first search condition is that the pixel point gray value is less than or equal to the first gray level threshold, for example, 30 (0 is Black, 255 is white), and the number of pixels in the pixel points adjacent to each other whose gray value is less than or equal to the first gray threshold is less than or equal to the first adjacent threshold, and if the width of the face is about 100 pixels, the first A neighboring threshold of 6 is more suitable;
  • the searched plaque is taken as the first skin sputum collection.
  • the purpose of searching for the first skin collection is to find out the more obvious skin such as acne in the darker area of the larger piece in the second picture (see Fig. 6). Since the large shadows are usually large black areas in the first picture (see Figure 5) and the third picture (see Figure 7), the size exceeds the threshold defined by the acne, which may lead to skin acne. The acne can't be detected, and the second picture (see Figure 6) can only turn the area of the skin, such as the acne, where the darker center is small, so that the step can be a darker one. The more obvious acne in the area is found out.
  • the step of generating the second skin ⁇ set according to the first picture, the skin similarity picture, and the to-be-processed skin area may include:
  • the second search condition is that the pixel point gradation value is less than or equal to the second gradation threshold, for example, 30 (0 is Black, 255 is white), and the pixel of the pixel whose gray value is less than or equal to the second gray threshold is The number is less than or equal to the second adjacency threshold, and if the width of the face is about 100 pixels, the second adjacency threshold is 30;
  • the searched plaque is taken as the second skin sputum collection.
  • the purpose of searching for the second skin sputum collection described above is to find a relatively light and large piece of skin such as acne. Because the first picture (see Figure 5) has skin such as acne, other variegated and subtle changes in the skin are also blackened, which causes the black area corresponding to the skin, such as acne, to become larger. After this search, it is possible to find a skin that is relatively light in color but actually larger in size, such as acne.
  • the step of generating a third, fourth skin collection according to the third picture, the skin similarity picture, and the skin area to be processed may include:
  • the third search condition is that the pixel point gradation value is less than or equal to the third gradation threshold, for example, 30 (0 is Black, 255 is white), and the number of pixels in the pixel points adjacent to each other whose gray value is less than or equal to the third gray threshold is less than or equal to the third adjacent threshold, and if the width of the face is about 100 pixels, the first A three-neighboring threshold of 15 is appropriate;
  • the fourth search condition is that the pixel point gradation value is less than or equal to the fourth gradation threshold, for example, 30 (0 is Black, 255 is white), and the number of pixels in the pixel points adjacent to each other whose gray value is less than or equal to the fourth gray threshold is less than or equal to the fourth adjacent threshold, and if the width of the face is about 100 pixels, the first A three-neighboring threshold of 30 is appropriate;
  • the searched plaque satisfying the third search condition is used as the third skin sputum set
  • the searched plaque satisfying the fourth search condition is used as the fourth skin sputum set.
  • the purpose of searching for the third skin collection is to find a skin of moderate size such as acne. Because many of the variegated colors have been removed during the dermabrasion process, the remaining skin, such as acne, will also become lighter, so the black areas produced by the acne in the third picture (see Figure 7) will become relatively more moderate. Therefore, after this search, you can find a moderately sized skin such as acne.
  • the purpose of searching for the fourth skin sputum collection above is to find a larger piece of skin such as acne.
  • Some skin sputum is actually larger, so the black area produced by the acne in the third picture (see Figure 7) is relatively large. After this search, the actual larger piece of skin can be found, such as acne. come out.
  • threshold values may be determined according to actual requirements, and specific values of the respective thresholds may be the same or different.
  • the skin sputum may be acne, smudge, sputum, scar, etc.
  • the present application does not limit the specific expression of skin sputum.
  • the foregoing is only an example of acne, by changing the acne process. Decontamination, scars, etc. can be achieved by the actual values of various thresholds.
  • a schematic diagram of a logical structure of a picture processing apparatus includes: a face recognition module 1001, a skin area determining module 1002, a skin layer determining module 1003, and a skin layer removing module 1004.
  • the face recognition module 1001 is configured to perform face recognition in the to-be-processed picture.
  • a skin area determining module 1002 configured to determine a skin area to be processed in the image to be processed;
  • the skin defect removal module 1004 is configured to remove the skin flaws in the face region according to the determined position of the skin flaw in the skin region to be treated, and obtain a processed picture.
  • the skin area determining module 1002 may include: a cover area detecting submodule, a non-covering area determining submodule, and a skin area detecting submodule (not shown).
  • the cover area detecting sub-module is configured to detect a cover area in the face area; the non-cover cover area determining sub-module is configured to determine a non-coverage area in the face area according to the cover area; a module for detecting a skin area in the non-covered area; or for detecting a skin area in a face area.
  • the to-be-processed image includes:
  • the skin defect removal module 1004 may include: a skin pupil mapping sub-module and a skin pupil removal sub-module (not shown).
  • the skin ⁇ mapping sub-module is configured to map a skin defect in the to-be-processed skin region to a face region in the to-be-processed image; a skin defect removal sub-module, configured to remove the skin defect according to a mapping processing result
  • the skin in the face area of the image to be processed is ⁇ , and the processed picture is obtained.
  • the skin defect removal module 1004 may further include: a skin pupil amplification sub-module (not shown).
  • a skin ⁇ magnification sub-module configured to: after the skin ⁇ mapping sub-module maps the skin ⁇ in the to-be-processed skin area into the face area of the to-be-processed picture, in the to-be-processed picture, according to The preset second ratio enlarges the area where the skin flaw is located, wherein the preset second ratio is greater than 1.
  • the skin defect removal sub-module may include: a function calculation unit, a horizontal and vertical color value obtaining unit, a normal skin color value obtaining unit, and a color value replacing unit (not shown) .
  • the lateral coordinate and the longitudinal coordinate of a pixel are respectively substituted into the above-mentioned lateral skin color change function and the longitudinal skin color change function, and the color values of each pixel point in the horizontal and vertical directions are obtained;
  • a normal skin color value obtaining unit configured to obtain an average value of the color values in the horizontal and vertical directions of each pixel point, and obtain a normal skin color value corresponding to each pixel point;
  • a color value replacing unit configured to sequentially replace, by using the calculated normal skin color value of each pixel point, a color value of each pixel in the skin region in the face region of the to-be-processed image, thereby removing the to-be-processed
  • the skin in the face area of the picture is ⁇ , and the processed picture is obtained.
  • the apparatus may further include: a dermabrasion processing module (not shown).
  • the dermabrasion processing module is configured to perform dermabrasion treatment on the processed image to obtain a picture for removing the abrupt effect.
  • the skin sputum may include any one or more of the following: acne, stain, scar or sputum.
  • the facial skin of the person in the photo image is automatically modified, that is, the shallow sputum in the human skin is eliminated, and the problem of obvious in the human skin is also eliminated.
  • the method provided by the present application provides the user with a better user experience than the manual method of manually erasing the skin in various APPs that are beautified by the existing face skin.
  • FIG. 11 is a schematic diagram of a logical structure of a skin defect determination module according to an embodiment of the present application.
  • the skin defect determination module 1003 can include: a different abruptness level picture obtaining sub-module 10031, a skin similarity picture generating sub-module 10032, and a skin defect determining sub-module 10033.
  • the different abruptness level picture obtaining sub-module 10031 is configured to obtain different conflicting level pictures of the to-be-processed skin area
  • a skin similarity image generation sub-module 10032 configured to determine a color value of the to-be-processed skin region, and generate a skin similarity image of the to-be-processed skin region according to the color value;
  • a skin defect determination sub-module 10033 for arranging pictures and skins according to the different condylar tone levels
  • the skin similarity picture determines the location of skin imperfections in the area of the skin to be treated.
  • the skin similarity picture generation sub-module 10032 may include: a sample value obtaining unit, a skin color value calculation unit, a similarity calculation unit, and a skin similarity picture generation unit (not shown).
  • the sampling value obtaining unit is configured to perform skin color value sampling on each of the regions in the skin region to be processed, and obtain a plurality of sampling values for each region;
  • a skin color value calculation unit configured to calculate a skin color value of each region according to the sampled value
  • a similarity calculation unit configured to respectively traverse pixel points in each region, and calculate a similarity value between a color value of each pixel and a skin color value of the region in which the pixel is located;
  • the skin similarity picture generating unit is configured to map the calculated similarity value to a gray value, and generate a skin similarity picture reflecting the skin color.
  • the different protrusion level picture obtaining sub-module 10031 may include: a first picture generating unit, a second picture generating unit, and a third picture generating unit (not shown).
  • the first picture generating unit is configured to generate a first picture having a first black and white contrast
  • the second picture generating unit is configured to generate a second picture having a second black and white contrast; wherein, the first black and white contrast is greater than Said second black and white contrast;
  • a third picture generating unit configured to generate a third picture having a third black and white contrast; wherein, the third black and white contrast is the same as the first black and white contrast;
  • the skin defect determining sub-module 10033 is specifically configured to determine a position of the skin flaw in the skin area to be treated according to the first to third pictures and the skin similarity picture.
  • the skin defect determining sub-module 10033 is further configured to determine skin flaws on the skin to be treated according to the first to third pictures, the skin similarity picture, and the skin area to be treated. The location in the area.
  • the skin defect determination sub-module 10033 may include: a first skin defect collection generation unit, a second skin defect collection generation unit, a third, a fourth skin defect collection generation unit, and a skin defect acquisition unit (not shown in the figure ).
  • the first skin defect collection generating unit is configured to generate a first skin defect set according to the second picture, the skin similarity picture, and the to-be-processed skin area;
  • a second skin defect collection generating unit configured to generate a second skin defect set according to the first picture, the skin similarity picture, and the to-be-processed skin area
  • a third and fourth skin ⁇ collection generating unit configured to generate a third and fourth skin ⁇ collection according to the third picture, the skin similarity picture, and the to-be-processed skin area
  • a skin sputum obtaining unit for combining the first to fourth skin sputum collections to obtain a position of all skin ridges in the area of the skin to be treated.
  • the first skin defect set generating unit may include: a first search subunit, a first mapping subunit, a first patch position and a color value extracting subunit, and a first gray value determining subunit (in the figure) Not shown).
  • the first search sub-unit is configured to search for a plaque that satisfies the first search condition in the second picture, where the first search condition is that the gray value of the pixel point is less than or equal to the first gray level threshold, and The number of mutually adjacent pixel points whose gray value is less than or equal to the first gray threshold is less than or equal to the first adjacent threshold;
  • a first mapping subunit configured to map a location of the plaque to the to-be-processed skin region and a skin similarity picture
  • a first plaque position and color value extraction subunit configured to extract, from the to-be-processed skin region, a location of a plaque and a color value of a pixel corresponding to the plaque;
  • a first gray value determining subunit configured to: when the color value extracted by the first patch position and the color value extracting subunit is within a predetermined threshold color range, from the skin similarity picture, Extracting a gray value of a corresponding pixel within a predetermined range centered on the position where the plaque is located, and determining whether a gray value corresponding to the pixel point within a predetermined range centered on the position is within a grayscale threshold value indicating that the skin color is similar; If so, the searched plaque is taken as the first skin sputum collection.
  • the second skin defect set generating unit may include: a second search subunit, a second mapping subunit, a second patch position and color value extracting subunit, and a second gray value judging subunit.
  • a second search subunit configured to search for a plaque that satisfies a second search condition in the first picture, where the second search condition is that a pixel point gradation value is less than or equal to a second gradation threshold, and the gradation is And the number of mutually adjacent pixel points whose value is less than or equal to the second gray threshold is less than or equal to the second neighboring threshold;
  • the second mapping subunit is configured to map the position of the patch to the skin area to be treated and the skin is similar Degree picture
  • a second plaque position and color value extraction subunit configured to extract, from the to-be-processed skin region, a location of the plaque and a color value of the pixel corresponding to the plaque;
  • a second gray value determining subunit configured to: when the color value extracted by the second patch position and the color extracting subunit is within a predetermined threshold color range, from the skin similarity picture Extracting a gray value of a corresponding pixel within a predetermined range centered on the position where the plaque is located, and determining whether the gray value corresponding to the pixel point within the predetermined range centered at the position is within a gray threshold value indicating that the skin color is similar If yes, the searched plaque is used as the second skin sputum collection.
  • the third and fourth skin ⁇ set generating unit may include: a third search subunit, a fourth search subunit, a third mapping subunit, a third plaque position and a color value extracting subunit, and a third gray The degree value judgment subunit (not shown in the figure).
  • the third search sub-unit is configured to search for a plaque that satisfies a third search condition in the third picture, where the third search condition is that the pixel point gradation value is less than or equal to a third gradation threshold, and The number of mutually adjacent pixel points whose gray value is less than or equal to the third gray threshold is less than or equal to the third adjacent threshold;
  • a fourth search subunit configured to search for a plaque that satisfies a fourth search condition in the third picture, where the fourth search condition is that the pixel point gradation value is less than or equal to a fourth gray threshold, and the gradation is And the number of mutually adjacent pixel points whose value is less than or equal to the fourth gray level threshold is less than or equal to the fourth neighboring threshold;
  • the third mapping subunit is configured to map the position of the third search condition and the fourth search condition patch Go to the skin area to be treated and the skin similarity picture;
  • a third plaque position and color value extraction subunit configured to extract, from the to-be-processed skin region, a location of the plaque and a color value of a pixel corresponding to the plaque;
  • a third gray value determining subunit configured to extract, from the skin similarity picture, a corresponding pixel within a predetermined range centered on the position of the plaque, in a case where the color value is within a predetermined threshold color range a gray value of the point, and determining whether the gray value corresponding to the pixel point within the predetermined range centered on the position is within a grayscale threshold range indicating that the skin color is similar; if yes, the searched third search condition spot is satisfied As a third skin collection, the block will search for the fourth search condition plaque as the fourth skin collection.
  • the first image generating unit is specifically configured to perform a first grayscale processing on the to-be-processed skin region, thereby generating a first image having a first black and white contrast;
  • the second image generating unit is configured to perform a second grayscale processing on the to-be-processed skin region to generate a second image having a second black and white contrast; wherein the second grayscale processing and the second A grayscale processing method is different;
  • the third picture generating unit is specifically configured to perform dermabrasion processing on the skin area to be processed first, obtain a picture after dermabrasion processing, and perform third gradation processing on the dermabrasion processed picture. Thereby, a third picture having a third black-and-white contrast is generated, wherein the third gradation processing is the same as the first gradation processing.
  • the embodiment of the present application provides a terminal, where the terminal includes:
  • the processor, the memory, and the communication interface are connected by the bus and complete communication with each other;
  • the memory stores executable program code
  • the processor runs a program corresponding to the executable program code by reading executable program code stored in the memory for:
  • the skin flaw in the face area is removed, and the processed picture is obtained.
  • the embodiment of the present application provides an application program for executing the image processing method provided by the embodiment of the present application at runtime.
  • the image processing method includes:
  • the skin flaw in the face area is removed, and the processed picture is obtained.
  • the embodiment of the present application provides a storage medium for storing an application, and the application is used to execute the image processing method provided by the embodiment of the present application.
  • the image processing method includes: performing face recognition on the to-be-processed image;
  • the skin flaw in the face area is removed, and the processed picture is obtained.
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
  • the present application can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present application may be embodied in the form of a software product in essence or in the form of a software product, which may be stored in a storage medium such as a ROM/RAM or a disk. , an optical disk, etc., includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present application or portions of the embodiments.
  • a computer device which may be a personal computer, server, or network device, etc.
  • This application can be used in a variety of general purpose or special purpose computing system environments or configurations.
  • personal computer server computer, handheld or portable device, tablet device, multiprocessor system, microprocessor based system, set-top box, programmable consumer electronics device, network PC, small computer, mainframe computer, including A distributed computing environment of any of the above systems or devices, and the like.

Landscapes

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

Abstract

一种图片处理方法及装置,所述方法包括:在待处理图片中进行人脸识别;根据检测结果,确定人脸区域中的待处理皮肤区域;确定所述待处理皮肤区域中皮肤瑕疵的位置;根据确定出的所述皮肤瑕疵在所述待处理皮肤区域中的位置,去除所述人脸区域中的皮肤瑕疵,得到处理后的图片。能够自动地对照片图像中人的皮肤进行修改,即消除了皮肤中较浅的瑕疵,也消除了皮肤中比较明显的问题。相对于现有的皮肤美化处理的各类APP中手动抹除皮肤瑕疵的方案,该方法给用户提供了更好的用户的体验。

Description

图片处理方法及装置 本申请要求于 2014年 4月 4日提交中国专利局、申请号为 201410137069. 9 发明名称为 "图片处理方法及装置" 的中国专利申请的优先权, 其全部内容 通过引用结合在本申请中。 技术领域
本申请涉及图像处理技术领域, 特别涉及图片处理方法及装置。
背景技术
相机已广泛的应用于人们的日常生活中, 对照片图像的修改需求也日益 普遍。 现有技术中通常使用一种 "磨皮"技术对照片中人的脸部皮肤进行修 改。 使用该功能后人脸皮肤中粗糙的地方会变得平滑, 比较浅的斑会消失, 即人脸皮肤中较小的、 相对周围颜色略深的部分颜色会变浅, 视觉上跟消失 了一样; 但是, 对于人脸皮肤中比较明显的问题如粉剌、 伤疤等, 仍能留下 明显的痕迹。 为了解决这个问题, 现有的应用基本上都是需要用户手工指定 人脸皮肤瑕疵的位置和大小, 然后根据所指定位置和大小, 将该区域的颜色 替换为与周围肤色接近的颜色, 从而达到修改图像, 去除瑕疵的目的。
可见, 在现有的图像处理过程中, 对于计算机自动处理的歩骤, 只能消 除比较浅的瑕疵如比较浅的痘痘、 斑痕等, 对于人脸皮肤中比较明显的问题 如粉剌、 伤疤等无法消除, 即使处理后也能留下明显的痕迹。 而对于这类人 脸皮肤中比较明显的问题, 只能手动去除。 手动去除不但操作繁琐, 对用户 的要求也较高, 只有掌握一定技能的用户才能手动消除人脸皮肤中比较明显 的问题, 普通用户无法操作。
发明内容
本申请实施例的目的在于提供图片处理方法及装置, 以自动对照片中人 的脸部皮肤进行修改, 消除人脸皮肤中比较明显的问题。
为达到上述目的, 本申请实施例公开了图片处理方法, 所述方法包括: 在待处理图片中进行人脸识别;
根据检测结果, 确定人脸区域中的待处理皮肤区域;
确定所述待处理皮肤区域中皮肤瑕疵的位置;
根据确定出的所述皮肤瑕疵在所述待处理皮肤区域中的位置, 去除所述 人脸区域中的皮肤瑕疵, 得到处理后的图片。
较佳的, 所述确定人脸区域中的待处理皮肤区域, 包括:
检测人脸区域中的遮盖区域;
根据所述遮盖区域确定出所述人脸区域中的非遮盖区域;
在所述非遮盖区域中检测皮肤区域;
在人脸区域中检测皮肤区域。
较佳的, 所述待处理图片, 包括:
原始待处理图片或原始待处理图片按照预设的第一比例缩放后得到的图 片。
较佳的, 所述确定所述待处理皮肤区域中皮肤瑕疵的位置, 包括: 获得所述待处理皮肤区域的不同瑕疵突兀度等级图片;
确定所述待处理皮肤区域的颜色值, 根据所述颜色值生成所述待处理皮 肤区域的皮肤相似度图片;
根据所述不同瑕疵突兀度等级图片和皮肤相似度图片确定皮肤瑕疵在所 述待处理皮肤区域中的位置。
较佳的, 所述确定所述待处理皮肤区域的颜色值, 根据所述颜色值生成 所述待处理皮肤区域的皮肤相似度图片, 包括:
对所述待处理皮肤区域内的若干区域分别进行皮肤颜色值采样, 获得针 对每个区域的若干采样值;
根据所述采样值计算出每个区域的皮肤颜色值;
分别遍历每个区域内的像素点, 计算每个像素点的颜色值与其所在区域 的皮肤颜色值之间的相似度值;
将计算出的所述相似度值映射为灰度值, 生成反映皮肤颜色的皮肤相似 度图片。
较佳的, 所述获得所述待处理皮肤区域的不同瑕疵突兀度等级图片, 包 括:
生成具有第一黑白对比度的第一图片;
生成具有第二黑白对比度的第二图片; 其中, 所述第一黑白对比度大于 所述第二黑白对比度;
生成具有第三黑白对比度的第三图片; 其中, 所述第三黑白对比度与第 一黑白对比度相同;
所述根据所述不同瑕疵突兀度等级图片和皮肤相似度图片确定皮肤瑕疵 在所述待处理皮肤区域中的位置, 包括:
根据所述第一至三图片和皮肤相似度图片确定皮肤瑕疵在所述待处理皮 肤区域中的位置。
较佳的, 所述根据所述第一至三图片和皮肤相似度图片确定皮肤瑕疵在 所述待处理皮肤区域中的位置, 包括:
根据所述第二图片、 皮肤相似度图片生成第一皮肤瑕疵集合;
根据所述第一图片、 皮肤相似度图片生成第二皮肤瑕疵集合;
根据所述第三图片、 皮肤相似度图片生成第三、 四皮肤瑕疵集合; 将所述第一至四皮肤瑕疵集合合并, 获得所有皮肤瑕疵在所述待处理皮 肤区域中的位置。
较佳的, 根据所述第一至三图片和皮肤相似度图片确定皮肤瑕疵在所述 待处理皮肤区域中的位置的歩骤包括:
根据所述第二图片、 皮肤相似度图片和待处理皮肤区域生成第一皮肤瑕 疵集合;
根据所述第一图片、 皮肤相似度图片和待处理皮肤区域生成第二皮肤瑕 疵集合;
根据所述第三图片、 皮肤相似度图片和待处理皮肤区域生成第三、 四皮 肤瑕疵集合;
将所述第一至四皮肤瑕疵集合合并, 获得所有皮肤瑕疵在所述待处理皮 肤区域中的位置。
较佳的, 根据所述第二图片、 皮肤相似度图片和待处理皮肤区域生成第 一皮肤瑕疵集合的歩骤包括:
在所述第二图片中搜索满足第一搜索条件的斑块; 其中, 所述第一搜索 条件为像素点灰度值小于等于第一灰度阈值, 且灰度值小于等于第一灰度阈 值的相互邻接的像素点的个数小于等于第一邻接阈值;
将所述斑块的位置映射到所述待处理皮肤区域和皮肤相似度图片中; 从所述待处理皮肤区域中提取斑块所在位置及斑块所对应像素点的颜色 值; 若所述颜色值在预定的瑕疵颜色阈值范围内; 则
从所述皮肤相似度图片中, 提取斑块所在位置为中心的预定范围内对应 像素点的灰度值, 并且判断以该位置为中心的预定范围内像素点对应的灰度 值是否在表示皮肤颜色相似的灰度阈值范围内;
若是, 则将搜索到的斑块作为第一皮肤瑕疵集合。
较佳的, 根据所述第一图片、 皮肤相似度图片和待处理皮肤区域生成第 二皮肤瑕疵集合的歩骤包括:
在所述第一图片中搜索满足第二搜索条件的斑块; 其中, 所述第二搜索 条件为像素点灰度值小于等于第二灰度阈值, 且灰度值小于等于第二灰度阈 值的相互邻接的像素点的个数小于等于第二邻接阈值;
将所述斑块的位置映射到所述待处理皮肤区域和皮肤相似度图片中; 从所述待处理皮肤区域中提取斑块所在位置及斑块所对应像素点的颜色 值; 若所述颜色值在预定的瑕疵颜色阈值范围内; 则
从所述皮肤相似度图片中, 提取斑块所在位置为中心的预定范围内对应 像素点的灰度值, 并且判断该位置为中心的预定范围内像素点对应的灰度值 是否在表示皮肤颜色相似的灰度阈值范围内;
若是, 则将搜索到的斑块作为第二皮肤瑕疵集合。
较佳的, 根据所述第三图片、 皮肤相似度图片和待处理皮肤区域生成第 三、 四皮肤瑕疵集合的歩骤包括:
在所述第三图片中搜索满足第三搜索条件的斑块; 其中, 所述第三搜索 条件为像素点灰度值小于等于第三灰度阈值, 且灰度值小于等于第三灰度阈 值的相互邻接的像素点的个数小于等于第三邻接阈值;
在所述第三图片中搜索满足第四搜索条件的斑块; 其中, 所述第四搜索 条件为像素点灰度值小于等于第四灰度阈值, 且灰度值小于等于第四灰度阈 值的相互邻接的像素点的个数小于等于第四邻接阈值;
将所述满足第三搜索条件和第四搜索条件斑块的位置映射到所述待处理 皮肤区域和皮肤相似度图片中;
从所述待处理皮肤区域中提取斑块所在位置及斑块所对应像素点的颜色 值; 若所述颜色值在预定的瑕疵颜色阈值范围内; 则
从所述皮肤相似度图片中, 提取斑块所在位置为中心的预定范围内对应 像素点的灰度值, 并且判断以该位置为中心的预定范围内像素点对应的灰度 值是否在表示皮肤颜色相似的灰度阈值范围内;
若是, 则将搜索到的满足第三搜索条件斑块作为第三皮肤瑕疵集合, 将 搜索到的满足第四搜索条件斑块作为第四皮肤瑕疵集合。
较佳的, 所述生成具有第一黑白对比度的第一图片的歩骤包括: 对所述 待处理皮肤区域进行第一灰度处理, 从而生成具有第一黑白对比度的第一图 片;
所述生成具有第二黑白对比度的第二图片的歩骤包括: 对所述待处理皮 肤区域进行第二灰度处理,从而生成具有第二黑白对比度的第二图片;其中, 所述第二灰度处理与所述第一灰度处理方式不同;
所述生成具有第三黑白对比度的第三图片的歩骤包括: 对所述待处理皮 肤区域先进行磨皮处理, 获得磨皮处理后的图片, 再对所述磨皮处理后的图 片进行第三灰度处理, 从而生成具有第三黑白对比度的第三图片, 其中, 所 述第三灰度处理与所述第一灰度处理方式相同。
较佳的, 所述根据确定出的所述皮肤瑕疵在所述待处理皮肤区域中的位 置, 去除所述人脸区域中对应的皮肤瑕疵, 得到处理后的图片, 包括:
将所述待处理皮肤区域中的皮肤瑕疵映射到所述待处理图片的人脸区域 中;
根据映射处理结果, 去除所述待处理图片的人脸区域中的皮肤瑕疵, 得 到处理后的图片。
较佳的, 在所述将所述待处理皮肤区域中的皮肤瑕疵映射到所述待处理 图片的人脸区域中之后, 还包括:
在所述待处理图片中, 按照预设的第二比例放大所述皮肤瑕疵所在区域, 其中, 所述预设的第二比例大于 1。
较佳的, 所述根据映射处理结果, 去除所述待处理图片的人脸区域中的 皮肤瑕疵, 包括:
计算待处理图片中的人脸区域的皮肤瑕疵中位于预设相对位置的像素点 所对应的横向皮肤颜色变化函数 y=f ( X ) , 以及纵向皮肤颜色变化函数 y ' =f ( χ ' ), 其中, χ表示所述待处理图片中像素点的横向坐标、 χ ' 表示所述待 处理图片中像素点的纵向坐标, y表示横向坐标为 X的像素点对应的颜色值、 y ' 表示纵向坐标为 χ ' 的像素点对应的颜色值;
将所述待处理图片的人脸区域中的皮肤瑕疵中每一像素点的横向坐标和 纵向坐标分别代入上述横向皮肤颜色变化函数和纵向皮肤颜色变化函数, 获 得每一像素点在横向及纵向的颜色值; 对所述每一像素点在横向及纵向的颜色值取均值, 获得每一像素点对应 的正常皮肤颜色值;
依次使用计算出的每一像素点的正常皮肤颜色值替换所述待处理图片的 人脸区域中的皮肤瑕疵中每个像素点的颜色值, 从而去除所述待处理图片的 人脸区域中的皮肤瑕疵, 得到处理后的图片。
较佳的, 所述方法还包括: 对所述处理后的图片进行磨皮处理, 以获得 去除突兀效果的图片。
较佳的, 所述皮肤瑕疵, 包括以下几种中的任意一种或几种: 痘痘、 污 点、 伤疤或痣。
为达到上述目的, 本申请实施例公开了图片处理装置, 所述装置包括: 人脸识别模块, 用于在待处理图片中进行人脸识别;
皮肤区域确定模块, 用于根据检测结果, 确定人脸区域中的待处理皮肤 区域;
皮肤瑕疵确定模块, 用于确定所述待处理皮肤区域中皮肤瑕疵的位置; 皮肤瑕疵去除模块, 用于根据确定出的所述皮肤瑕疵在所述待处理皮肤 区域中的位置, 去除所述人脸区域中的皮肤瑕疵, 得到处理后的图片。
较佳的, 所述皮肤区域确定模块, 包括:
遮盖区域检测子模块, 用于检测人脸区域中的遮盖区域;
非遮盖区域确定子模块, 用于根据所述遮盖区域确定出所述人脸区域中 的非遮盖区域;
皮肤区域检测子模块, 用于在所述非遮盖区域中检测皮肤区域; 或 用于在人脸区域中检测皮肤区域。
较佳的, 所述待处理图片, 包括:
原始待处理图片或原始待处理图片按照预设的第一比例缩放后得到的图 片。
较佳的, 所述皮肤瑕疵确定模块, 包括:
不同突兀度等级图片获得子模块, 用于获得所述待处理皮肤区域的不同 瑕疵突兀度等级图片;
皮肤相似度图片生成子模块, 用于确定所述待处理皮肤区域的颜色值, 根据所述颜色值生成所述待处理皮肤区域的皮肤相似度图片;
皮肤瑕疵确定子模块, 用于根据所述不同瑕疵突兀度等级图片和皮肤相 似度图片确定皮肤瑕疵在所述待处理皮肤区域中的位置。
较佳的, 所述皮肤相似度图片生成子模块, 包括:
采样值获得单元, 用于对所述待处理皮肤区域内的若干区域分别进行皮 肤颜色值采样, 获得针对每个区域的若干采样值;
皮肤颜色值计算单元, 用于根据所述采样值计算出每个区域的皮肤颜色 值;
相似度计算单元, 用于分别遍历每个区域内的像素点, 计算每个像素点 的颜色值与其所在区域的皮肤颜色值之间的相似度值;
皮肤相似度图片生成单元, 用于将计算出的所述相似度值映射为灰度值, 生成反映皮肤颜色的皮肤相似度图片。
较佳的, 所述不同突兀度等级图片获得子模块, 包括:
第一图片生成单元, 用于生成具有第一黑白对比度的第一图片; 第二图片生成单元, 用于生成具有第二黑白对比度的第二图片; 其中, 所述第一黑白对比度大于所述第二黑白对比度;
第三图片生成单元, 用于生成具有第三黑白对比度的第三图片; 其中, 所述第三黑白对比度与第一黑白对比度相同;
所述皮肤瑕疵确定子模块, 具体用于根据所述第一至三图片和皮肤相似 度图片确定皮肤瑕疵在所述待处理皮肤区域中的位置。
较佳的, 所述皮肤瑕疵确定子模块, 具体用于根据所述第二图片、 皮肤 相似度图片生成第一皮肤瑕疵集合; 根据所述第一图片、 皮肤相似度图片生 成第二皮肤瑕疵集合; 根据所述第三图片、 皮肤相似度图片生成第三、 四皮 肤瑕疵集合; 将所述第一至四皮肤瑕疵集合合并, 获得所有皮肤瑕疵在所述 待处理皮肤区域中的位置。
较佳的, 所述皮肤瑕疵确定子模块, 包括:
第一皮肤瑕疵集合生成单元, 用于根据所述第二图片、 皮肤相似度图片 和待处理皮肤区域生成第一皮肤瑕疵集合;
第二皮肤瑕疵集合生成单元, 用于根据所述第一图片、 皮肤相似度图片 和待处理皮肤区域生成第二皮肤瑕疵集合;
第三、 四皮肤瑕疵集合生成单元, 用于根据所述第三图片、 皮肤相似度 图片和待处理皮肤区域生成第三、 四皮肤瑕疵集合;
皮肤瑕疵获得单元, 用于将所述第一至四皮肤瑕疵集合合并, 获得所有 皮肤瑕疵在所述待处理皮肤区域中的位置。
较佳的, 所述第一皮肤瑕疵集合生成单元, 包括:
第一搜索子单元, 用于在所述第二图片中搜索满足第一搜索条件的斑块; 其中, 所述第一搜索条件为像素点灰度值小于等于第一灰度阈值, 且灰度值 小于等于第一灰度阈值的相互邻接的像素点的个数小于等于第一邻接阈值; 第一映射子单元, 用于将所述斑块的位置映射到所述待处理皮肤区域和 皮肤相似度图片中;
第一斑块位置和颜色值提取子单元, 用于从所述待处理皮肤区域中提取 斑块所在位置及斑块所对应像素点的颜色值;
第一灰度值判断子单元, 用于在所述第一斑块位置和颜色值提取子单元 提取的颜色值在预定的瑕疵颜色阈值范围内的情况下, 从所述皮肤相似度图 片中, 提取斑块所在位置为中心的预定范围内对应像素点的灰度值, 并且判 断以该位置为中心的预定范围内像素点对应的灰度值是否在表示皮肤颜色相 似的灰度阈值范围内; 若是, 则将搜索到的斑块作为第一皮肤瑕疵集合。
较佳的, 所述第二皮肤瑕疵集合生成单元, 包括:
第二搜索子单元, 用于在所述第一图片中搜索满足第二搜索条件的斑块; 其中, 所述第二搜索条件为像素点灰度值小于等于第二灰度阈值, 且灰度值 小于等于第二灰度阈值的相互邻接的像素点的个数小于等于第二邻接阈值; 第二映射子单元, 用于将所述斑块的位置映射到所述待处理皮肤区域和 皮肤相似度图片中;
第二斑块位置和颜色值提取子单元, 用于从所述待处理皮肤区域中提取 斑块所在位置及斑块所对应像素点的颜色值;
第二灰度值判断子单元, 用于在所述第二斑块位置和颜色提取子单元提 取的颜色值在预定的瑕疵颜色阈值范围内的情况下, 从所述皮肤相似度图片 中, 提取斑块所在位置为中心的预定范围内对应像素点的灰度值, 并且判断 该位置为中心的预定范围内像素点对应的灰度值是否在表示皮肤颜色相似的 灰度阈值范围内; 若是, 则将搜索到的斑块作为第二皮肤瑕疵集合。
较佳的, 所述第三、 四皮肤瑕疵集合生成单元, 包括:
第三搜索子单元, 用于在所述第三图片中搜索满足第三搜索条件的斑块; 其中, 所述第三搜索条件为像素点灰度值小于等于第三灰度阈值, 且灰度值 小于等于第三灰度阈值的相互邻接的像素点的个数小于等于第三邻接阈值; 第四搜索子单元, 用于在所述第三图片中搜索满足第四搜索条件的斑块; 其中, 所述第四搜索条件为像素点灰度值小于等于第四灰度阈值, 且灰度值 小于等于第四灰度阈值的相互邻接的像素点的个数小于等于第四邻接阈值; 第三映射子单元, 用于将所述满足第三搜索条件和第四搜索条件斑块的 位置映射到所述待处理皮肤区域和皮肤相似度图片中;
第三斑块位置和颜色值提取子单元, 用于从所述待处理皮肤区域中提取 斑块所在位置及斑块所对应像素的颜色值;
第三灰度值判断子单元, 用于在所述颜色值在预定的瑕疵颜色阈值范围 内的情况下, 从所述皮肤相似度图片中, 提取斑块所在位置为中心的预定范 围内对应像素点的灰度值, 并且判断以该位置为中心的预定范围内像素点对 应的灰度值是否在表示皮肤颜色相似的灰度阈值范围内; 若是, 则将搜索到 的满足第三搜索条件斑块作为第三皮肤瑕疵集合, 将搜索到的满足第四搜索 条件斑块作为第四皮肤瑕疵集合。
较佳的, 所述第一图片生成单元, 具体用于对所述待处理皮肤区域进行 第一灰度处理, 从而生成具有第一黑白对比度的第一图片;
所述第二图片生成单元, 具体用于对所述待处理皮肤区域进行第二灰度 处理, 从而生成具有第二黑白对比度的第二图片; 其中, 所述第二灰度处理 与所述第一灰度处理方式不同;
所述第三图片生成单元, 具体用于对所述待处理皮肤区域先进行磨皮处 理,获得磨皮处理后的图片,再对所述磨皮处理后的图片进行第三灰度处理, 从而生成具有第三黑白对比度的第三图片, 其中, 所述第三灰度处理与所述 第一灰度处理方式相同。
较佳的, 所述皮肤瑕疵去除模块, 包括:
皮肤瑕疵映射子模块, 用于将所述待处理皮肤区域中的皮肤瑕疵映射到 所述待处理图片中的人脸区域;
皮肤瑕疵去除子模块, 用于根据映射处理结果, 去除所述待处理图片的 人脸区域中的皮肤瑕疵, 得到处理后的图片。
较佳的, 所述皮肤瑕疵去除模块, 还包括:
皮肤瑕疵放大子模块, 用于在所述皮肤瑕疵映射子模块将所述待处理皮 肤区域中的皮肤瑕疵映射到所述待处理图片的人脸区域中之后, 在所述待处 理图片中, 按照预设的第二比例放大所述皮肤瑕疵所在区域, 其中, 所述预 设的第二比例大于 1。
较佳的, 所述皮肤瑕疵去除子模块, 包括:
函数计算单元, 用于计算待处理图片的人脸区域中的皮肤瑕疵中位于预 设相对位置的像素点所对应的横向皮肤颜色变化函数 y=f ( χ), 以及纵向皮肤 颜色变化函数 y ' =f ( χ ' ), 其中, χ表示所述待处理图片中像素点的横向坐 标、 χ ' 表示所述待处理图片中像素点的纵向坐标, y表示横向坐标为 X的像 素点对应的颜色值、 y ' 表示纵向坐标为 χ ' 的像素点对应的颜色值;
横纵向颜色值获得单元, 用于将所述待处理图片的人脸区域中的皮肤瑕 疵中每一像素点的横向坐标和纵向坐标分别代入上述横向皮肤颜色变化函数 和纵向皮肤颜色变化函数, 获得每一像素点在横向及纵向的颜色值;
正常皮肤颜色值获得单元, 用于对所述每一像素点在横向及纵向的颜色 值取均值, 获得每一像素点对应的正常皮肤颜色值;
颜色值替换单元, 用于依次使用计算出的每一像素点的正常皮肤颜色值 替换所述待处理图片的人脸区域中的皮肤瑕疵中每个像素点的颜色值, 从而 去除所述待处理图片的人脸区域中的皮肤瑕疵, 得到处理后的图片。
较佳的, 所述装置还包括: 磨皮处理模块;
所述磨皮处理模块, 用于对所述处理后的图片进行磨皮处理, 以获得去 除突兀效果的图片。
较佳的, 所述皮肤瑕疵, 包括以下几种中的任意一种或几种: 痘痘、 污 点、 伤疤或痣。
为达到上述目的, 本申请实施例还公开了一种终端, 所述终端包括: 处理器、 存储器、 通信接口和总线;
所述处理器、 所述存储器和所述通信接口通过所述总线连接并完成相互 间的通信;
所述存储器存储可执行程序代码;
所述处理器通过读取所述存储器中存储的可执行程序代码来运行与所述 可执行程序代码对应的程序, 以用于:
在待处理图片中进行人脸识别;
根据检测结果, 确定人脸区域中的待处理皮肤区域;
确定所述待处理皮肤区域中皮肤瑕疵的位置;
根据确定出的所述皮肤瑕疵在所述待处理皮肤区域中的位置, 去除所述 人脸区域中的皮肤瑕疵, 得到处理后的图片。
本申请实施例还公开了一种应用程序, 该应用程序用于在运行时执行本 申请实施例所述的图片处理方法。
本申请实施例还公开了一种存储介质, 用于存储应用程序, 所述应用程 序用于执行本申请实施例所述的图片处理方法。
由上述的技术方案可见, 应用本申请实施例提供的图片处理方法及装置, 能够自动地对照片图像中人的脸部皮肤进行修改, 即消除了人脸皮肤中较浅 的瑕疵, 也消除了人脸皮肤中比较明显的问题。 相对于现有的人脸皮肤美化 处理的各类 APP 中手动抹除人脸皮肤瑕疵的方案, 本申请所提供的方法给用 户提供了更好的用户的体验。
当然, 实施本申请的任一产品或方法必不一定需要同时达到以上所述的 所有优点。
附图说明
为了更清楚地说明本申请实施例和现有技术的技术方案, 下面对实施例 和现有技术中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的 附图仅仅是本申请的一些实施例, 对于本领域普通技术人员来讲, 在不付出 创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1是根据本申请实施例的一种图片处理方法的流程图;
图 2 是根据本申请实施例的一种在待处理皮肤区域确定皮肤瑕疵位置的 方法的流程图;
图 3所述为根据本申请实施例的待处理图片的一具体实例;
图 4所示为根据本申请实施例的第一图片的一具体实例;
图 5所示为根据本申请实施例的第一图片的另一具体实例;
图 6所示为根据本申请实施例的第二图片的一具体实例;
图 7所示为根据本申请实施例的第三图片的一具体实例;
图 8所示为根据本申请实施例的图 3所示图片对应的处理后图片的一具 体实例;
图 9所示为根据本申请实施例的图 8所示图片磨皮处理后所得图片的具 体实例;
图 10是根据本申请实施例的一种图像处理装置的逻辑结构示意图; 图 11是根据本申请实施例的一种皮肤瑕疵确定模块的逻辑结构示意图。 具体实施方式
为使本申请的目的、 技术方案、 及优点更加清楚明白, 以下参照附图并 举实施例, 对本申请进一歩详细说明。 显然, 所描述的实施例仅仅是本申请 一部分实施例, 而不是全部的实施例。 基于本申请中的实施例, 本领域普通 技术人员在没有作出创造性劳动前提下所获得的所有其他实施例, 都属于本 申请保护的范围。
下面先对本文中用到术语做一简单介绍。
RGB颜色通道: RGB ( R=红, G=绿, B=蓝)是计算机表示颜色的一种方式, 任何一个颜色都可用 RGB方式表示, 即任何一个颜色都可以由 R、 G、 B三个 颜色的成分的多少来表示。 R颜色通道表示图像当中的单独的红色成分, 通常 用灰度图像表示, 越接近黑色, 表示该成分越少, 越接近白色, 则表示该成 分越多。 同理 G颜色通道、 B颜色通道都是类似概念。
磨皮: 是对图像执行一遍磨皮后, 皮肤中的很多浅的斑会去掉, 使皮肤 显得光滑细嫩。 磨皮算法本身有多种, 但是都只能消除比较浅的瑕疵如比较 浅的痘痘、 斑痕等, 不能直接靠磨皮把痘痘、 伤疤去掉。
下面通过具体实施例, 对本申请进行详细说明。
参见图 1, 其是根据本申请实施例的一种图片处理方法的流程图, 该流程 具体包括:
S101 : 在待处理图片中进行人脸识别。
实际应用中, 手机、 平板电脑、 数码相机等终端设备拍摄的图片较大或 者较小,而对这些图片进行处理时,一方面: 处理速度与图片的大小成正比; 另一方面: 若图片太小细节信息不清晰, 影响处理效果, 因此, 在进行图片 处理之前可先对原始待处理图片进行缩放, 再对缩放后的原始待处理图片进 行相应处理。
因此, 由上述可知, 待处理图片可以是原始待处理图片, 也可以是原始 待处理图片按照预设的第一比例缩放后得到的图片, 例如, 原始待处理图片 按照 1 : 2的比例缩小后得到的图片, 具体的, 参见图 3, 图 3为本申请实施例 提供的待处理图片的一具体实例。
另外, 在待处理图片中进行人脸识别, 可以是通过用户手动操作的方式 确定待处理图片中的人脸区域, 也可以通过人脸识别技术识别出人脸区域, 其中, 人脸识别技术是基于人的脸部特征, 对输入的图片进行分析的技术, 首先, 可先判断图片中是否存在人脸区域, 若存在, 可进一歩检测出人脸区 域在图片中的位置、 大小以及各个主要五官器官的位置等, 现有技术中已存 在多种实现人脸识别技术的方法, 这里不再赘述。
S102 : 根据检测结果, 确定人脸区域中的待处理皮肤区域。
实际应用中, 在确定待处理皮肤区域时, 可以对人脸区域中的一些区域 进行遮挡, 以避免误将人脸上的非瑕疵区域判断为瑕疵区域。 在本申请的一 个具体实施例中, 提供了一种确定人脸区域中的待处理皮肤区域的方法, 具 体可以包括:
检测人脸区域中的遮盖区域;
根据所述遮盖区域确定出所述待人脸区域中的非遮盖区域;
在所述非遮盖区域中检测皮肤区域;
在人脸区域中检测皮肤区域。
实际应用中, 为避免将五官区域中的某些像素误认为皮肤瑕疵, 上述的 遮盖区域可以包括人脸中的五官区域。 人脸中的五官区域, 也可通人脸识别 技术获得五官的位置信息, 根据该五官的位置信息确定遮盖区域。 有时图片 中眉毛被头发遮住, 所以如果眉毛检测不到, 可以不进行检测。 检测到五官 后, 可以用一定的模型标记出大小和位置, 如眼睛的位置可以用一个椭圆标 记, 或者直接用矩形标记, 从而获得遮盖区域。 如遮盖嘴巴时, 使用椭圆形 遮盖, 遮盖鼻子时, 使用 "U"形模型遮盖, 遮盖住鼻子两侧的阴影和鼻子底 部的鼻孔位置, 而鼻头部位则空出来, 可以作为待处理皮肤, 进行皮肤瑕疵 的去除。
需要说明的是, 在人脸区域中确定出待处理皮肤区域之后, 可以将该待 处理皮肤区域以图片的形式进行存储, 以便于后续进行图片处理, 也可以不 对该待处理皮肤区域进行单独存储, 而是在待处理图片上标记出相应的位置, 后续处理中根据该标记位置对待处理皮肤区域进行处理。
S103 : 确定所述待处理皮肤区域中皮肤瑕疵的位置。
本歩骤的具体实现方式, 可参照图 2本申请实施例的一种在待处理皮肤 区域确定皮肤瑕疵位置的方法。
S104: 根据确定出的所述皮肤瑕疵在所述待处理皮肤区域中的位置, 去 除所述人脸区域中的皮肤瑕疵, 得到处理后的图片。 在根据 S103确定出待处理皮肤区域中皮肤瑕疵的位置后, 可以先将皮肤 瑕疵映射到待处理图片中的人脸区域, 然后再根据映射结果, 在待处理图片 中的人脸区域去除相应的皮肤瑕疵,得到待处理图片处理后的图片,参见图 8, 图 8为根据本申请实施例的图 3所示图片对应的处理后图片的一具体实例。
具体的, 根据映射结果, 去除待处理图片的人脸区域中的皮肤瑕疵, 可 以通过以下方式实现:
计算待处理图片的人脸区域中的皮肤瑕疵中位于预设相对位置的像素点 所对应的横向皮肤颜色变化函数 y=f ( X ) , 以及纵向皮肤颜色变化函数 y ' =f ( χ ' ), 其中, χ表示所述待处理图片中像素点的横向坐标、 χ ' 表示所述待 处理图片中像素点的纵向坐标, y表示横向坐标为 X的像素点对应的颜色值、 y ' 表示纵向坐标为 χ ' 的像素点对应的颜色值;
将所述待处理图片的人脸区域中的皮肤瑕疵中每一像素点的横向坐标和 纵向坐标分别代入上述横向皮肤颜色变化函数和纵向皮肤颜色变化函数, 获 得每一像素点在横向及纵向的颜色值;
对所述每一像素点在横向及纵向的颜色值取均值, 获得每一像素点对应 的正常皮肤颜色值;
依次使用计算出的每一像素点的正常皮肤颜色值替换所述待处理图片的 人脸区域中的皮肤瑕疵中每个像素点的颜色值, 从而去除所述待处理图片的 人脸区域中的皮肤瑕疵, 得到处理后的图片。
其中, 预设相对位置的像素点, 可以是皮肤瑕疵中中心位置的像素点, 或者皮肤瑕疵中左上角的像素点等等。这里,并不对预设相对位置进行限定, 实际应用中可根据具体情况确定预设相对位置的取值。
需要说明的是, 计算上述的横向和纵向皮肤颜色变化函数, 是在皮肤区 域的皮肤颜色值连续变化的前提下进行的。
需要说明的是, 上述的颜色值可以是表示像素点颜色的所有颜色分量的 值, 例如, RGB图片中 R颜色通道的灰度值、 G颜色通道的灰度值和 B颜色通 道的灰度值, 也可以是表示像素点颜色的某一颜色分量的值, 例如, G颜色通 道的灰度值。
上述计算待处理图片中的皮肤瑕疵中位于预设相对位置的像素点所对应 的横向皮肤颜色变化函数 y=f ( X ) , 以及纵向皮肤颜色变化函数 y ' =f ( χ ' ) 的歩骤可以包括: 从横向和纵向两个方向分别对待处理图片的人脸区域中的皮肤瑕疵中位 于预设相对位置的像素点两侧的皮肤颜色进行采样, 得到若干采样点, 然后 根据这些采样点的颜色值拟合出该方向上的一个连续变化的函数, 即横向皮 肤颜色变化函数 y=f (χ), 和纵向皮肤颜色变化函数 y' =f (χ' )。
需要说明的是, 本申请并不对如何计算出正常皮肤颜色值的方法做限定, 任何可能的方法都可以应用于本申请中, 以上只是一种可能的实施例而已。
由于通常情况下, 待处理图片中的皮肤瑕疵区域与其周围的皮肤区域之 间的颜色是连续变化的, 所以在将所确定的皮肤瑕疵映射到预设的映射图片 中之后, 还可以在待处理图片中, 按照预设的第二比例放大所述皮肤瑕疵所 在区域, 以更好的去除皮肤瑕疵, 其中, 预设的第二比例大于 1。
在本申请的另一个具体实施例中, 该方法还可以包括: 对所述处理后的 图片进行磨皮处理, 以获得去除突兀效果的图片。
对处理后的图片, 参见图 8, 进行磨皮处理可以去除在去除皮肤瑕疵过程 中残留的较浅的痕迹, 达到更好的效果。参见图 9, 图 9为根据本申请实施例 的图 8所示图片经磨皮处理的图片。 将图 9与图 3比较, 可看到去除皮肤瑕 疵的效果非常明显。
另外, 由前述可得知, 待处理图片可以是原始待处理图片, 也可以是原 始待处理图片按照预设的第一比例缩放后得到的图片。 当待处理图片为原始 待处理图片按照预设的第一比例缩放后得到的图片时, 在得到待处理图片处 理后的图片后, 还需将处理后的图片放大至原始待处理图片大小。 例如, 待 处理图片为原始待处理图片按照 1 : 2 的比例缩小后得到的图片, 则得到待处 理图片对应的处理后的图片后, 还需将该处理后的图片按照 2 : 1 的比例放大 至原始待处理图片的大小。
由以上可见, 本方案中, 通过执行图 1 所示的方法, 自动的对图片中人 的脸部皮肤进行了修改, 即消除了人脸皮肤中较浅的瑕疵, 也消除了人脸皮 肤中比较明显的瑕疵。 相对于现有的人脸皮肤美化处理的各类 ΑΡΡ 中手动抹 除人脸皮肤瑕疵的方案, 本申请所提供的方法给用户提供了更好的用户的体 验。
具体的, 本申请实施例中还提供了一种在待处理皮肤区域确定皮肤瑕疵 位置的具体实现方法, 参见图 2, 图 2是根据本申请实施例的一种在待处理皮 肤区域确定皮肤瑕疵位置的方法的流程图, 该方法包括: S103A: 获得所述待处理皮肤区域的不同瑕疵突兀度等级图片。
具体的, 获得不同突兀度等级图片的歩骤可以包括:
生成具有第一黑白对比度的第一图片;
生成具有第二黑白对比度的第二图片; 其中, 所述第一黑白对比度大于 所述第二黑白对比度;
生成具有第三黑白对比度的第三图片; 其中, 所述第三黑白对比度与第 一黑白对比度相同。
进一歩的, 上述歩骤可以是, 对待处理皮肤区域进行第一灰度处理, 从 而生成具有第一黑白对比度的第一图片; 对待处理皮肤区域进行第二灰度处 理, 从而生成具有第二黑白对比度的第二图片, 其中, 第二灰度处理与第一 灰度处理方式不同; 对待处理皮肤区域先进行磨皮处理, 获得磨皮处理后的 图片, 再对磨皮处理后的图片进行第三灰度处理, 从而生成具有第三黑白对 比度的第三图片, 其中, 第三灰度处理与第一灰度处理方式相同。
实际应用中, 生成第第一图片的歩骤可以包括: 对待处理皮肤区域进行 一次 "高反差保留"和至少三次 "亮光"处理, 获得第一图片; 或者, 对待 处理皮肤区域进行一次 "高反差保留"和至少三次 "强光"处理, 获得第一 图片, 该第一图片可参见图 4或图 5, 其中, 图 4为根据本申请实施例的第一 图片的一具体实例, 可被称为 IMAGE_ALPHA_BIG, 图 5为根据本申请实施例的 第一图片的另一具体实例, 可被称为 IMAGE_ALPHA_LIGHT。
生成第二图片的歩骤可以包括: 对待处理皮肤区域进行一次 "高反差保 留"和至少一次 "亮光"处理, 获得第二图片; 或者, 对待处理皮肤区域进 行一次 "高反差保留"和至少一次 "强光"处理, 获得第二图片, 该第二图 片可参见图 6, 图 6为根据本申请实施例的第二图片的一具体实例, 可被称为 IMAGE_ALPHA_NO_LIGHT。
其中, 采用 "亮光"或 "强光"处理时, 生成第二图片时的处理次数少 于生成第一图片时的处理次数。
生成第三图片的歩骤可以包括: 对待处理皮肤区域进行磨皮处理, 获得 磨皮处理后的图像;之后,对所述磨皮处理后的图像进行一次 "高反差保留" 和至少三次 "亮光"处理, 获得第三图片; 或者, 对待处理皮肤区域进行一 次 "高反差保留"和至少三次 "强光" 处理, 获得第三图片, 该第三图片可 参见图 7, 图 7 为根据本申请实施例的第三图片的一具体实例, 可被称为 IMAGE_ALPHA_FINAL。
上述对待处理皮肤区域进行磨皮处理, 获得磨皮处理后图像的歩骤可以 包括:
通过与 Photoshop软件中 "曲线"调节相同的方式, 对待处理皮肤区域 的绿色通道进行微提亮, 提亮后的图片与提亮前的图片以灰度图像对应像素 点的灰度值为透明度, 进行融合。 具体的, 设灰度值为 alpha, alpha=0表示 图像为黑色, alpha=l表示图像为白色, 其中, alpha的取值为 [0, 1]之间的 小数; 设待处理皮肤区域绿色通道的当前像素点的灰度值为 huidU_green, 设 提亮后的的灰度值为 huidu_l ight, 设融合后的灰度值为 huidu_f inal = huidu_green X alpha + huidu_l ight X ( 1. 0-alpha), 则得到一张把绿色通道 磨皮处理后的图像。
需要说明的是, 上述具体歩骤是以采用 Photoshop软件对图像进行处理 为例进行说明的, 本申请并不对第一、 二、 三图片的具体生成方式做限定, 可以使用任何已知的、 公开的程序对前述待处理皮肤区域进行处理, 只要所 生成的第一、 二、 三图片均为黑白图像 (即灰度图像), 且第一图片的黑白对 比度大于所述第三二图像图片的黑白对比度即可。
需要说明的是, 在本申请的一个较佳实施例中, 在对待处理皮肤区域进 行灰度处理时,可以对待处理皮肤区域的绿色通道进行灰度处理,这是因为, 红色通道中的皮肤瑕疵通常不明显, 而蓝色通道中的杂色太多, 绿色通道比 较适中, 所以选择绿色通道。 当然, 在其他可能的实施例中, 也可以对红、 绿、 蓝三个分量分别给相同或不同的权重后, 求均值, 之后对求均值的图像 进行灰度处理。
生成第一图片的目的是为了较为恰当的把皮肤区域中如人脸区域中较突 兀的、 颜色比周围较深的区域找出来, 其中越黑的部分表示越突兀, 其在待 处理皮肤区域中颜色较深, 第一图片参见图 4或图 5。
生成第二图片的目的是为了把非常明显的皮肤瑕疵凸显出来, 用于接下 来搜索较为明显的皮肤瑕疵, 第二图片参见图 6。
由于第一图片中凸显了很多颜色只是比周围略深的像素, 这些像素同样 会变为接近于黑色, 如果其附近有皮肤瑕疵如痘痘, 则痘痘也会变成黑色, 从而有可能连成一片, 导致在判断该黑色区域的总像素点个数时偏大, 可能 超出预先设定的相互邻接的像素点个数的邻接阈值, 进而导致误判, 有了第 三图片,其磨皮操作已经把只是颜色略深的像素抹除,因此避免了这种误判, δ卩, 使得一次磨皮后的图像中没有抹掉的仍然比较突兀的区域再次凸显出来, 第三图片参见图 7。
需要说明的是, 上述生成第一第二第三图片三种瑕疵突兀度等级的图片 仅为示例, 是为了突显不同大小的皮肤瑕疵, 但本申请不限于此, 本领域技 术人员可以根据本申请实施例的设计思想, 设置多种瑕疵突兀度等级的图片, 例如 4种、 5种……从而更为精细突显皮肤瑕疵, 达到良好的去除皮肤瑕疵的 效果。
S103B: 确定所述待处理皮肤区域的颜色值, 根据所述颜色值生成所述待 处理皮肤区域的皮肤相似度图片。
具体的, 本歩骤可以通过以下方式实现:
对所述待处理皮肤区域内的若干区域分别进行皮肤颜色值采样, 获得针 对每个区域的若干采样值;
根据所述采样值计算出每个区域的皮肤颜色值;
分别遍历每个区域内的像素点, 计算每个像素点的颜色值与其所在区域 的皮肤颜色值之间的相似度值;
将计算出的所述相似度值映射为灰度值, 生成反映皮肤颜色的皮肤相似 度图片。
其中, 相似度值越高, 越接近白色, 反之接近黑色。
上述歩骤中, 之所以分为若干区域, 是因为有时由于光线方向的问题, 会使得皮肤的左右或上下呈明显的颜色区别, 为了削弱该颜色区别对皮肤颜 色判断以及相似度判断的影响,可以将待处理皮肤区域分为若干区域,例如, 以人脸为例, 可以把人脸简单以鼻子为中心, 分为左上、 右上、 左下、 右下 4 个矩形区域, 分别采样和计算相似度。 对于无光线明暗影响的图像, 此计算 方法也不影响计算结果。
S103C: 根据所述不同瑕疵突兀度等级图片和皮肤相似度图片确定皮肤瑕 疵的位置。
在上述的 S103A 中, 生成的不同瑕疵突兀度等级图片包括第一、 二和三 图片时, 本歩骤中, 可以根据第一、 二、 三图片和皮肤相似度图片确定皮肤 瑕疵的位置。
具体的, 根据第一、 二、 三图片和皮肤相似度图片确定皮肤瑕疵的位置 的歩骤可以包括:
根据所述第二图片和皮肤相似度图片生成第一皮肤瑕疵集合, 其中, 第 二图片可参见图 6;
根据所述第一图片和皮肤相似度图片生成第二皮肤瑕疵集合, 其中, 第 一图片可参见图 5 ;
根据所述第三图片和皮肤相似度图片生成第三、四皮肤瑕疵集合,其中, 第三图片可参见图 7 ;
将所述第一至四皮肤瑕疵集合合并, 获得所有皮肤瑕疵在所述待处理皮 肤区域中的位置。
其中, 根据所述第二图片和皮肤相似度图片生成第一皮肤瑕疵集合的歩 骤可以包括:
在所述第二图片 (可参见图 6 ) 中搜索满足第一搜索条件的斑块; 其中, 所述第一搜索条件为像素点灰度值小于等于第一灰度阈值, 例如 30 ( 0 为黑 色, 255为白色), 且灰度值小于等于第一灰度阈值的相互邻接的像素点的个 数小于等于第一邻接阈值, 如假设人脸的宽度约 100像素, 则该第一邻接阈 值为 6比较合适;
将所述斑块的位置映射到所述皮肤相似度图片中;
从所述皮肤相似度图片中, 提取斑块所在位置对应像素值点的灰度值, 以判断各个像素点的灰度值是否在预设的皮肤瑕疵灰度值范围内, 即判断该 斑块在待处理皮肤区域中相应像素点的颜色值是否接近皮肤瑕疵如痘痘的颜 色值, 并且判断以该位置为中心的预定范围内像素点对应的灰度值是否在表 示皮肤颜色相似的灰度阈值范围内, 以判断该斑块周围是否有一定的皮肤区 域;
若是, 则将搜索到的斑块作为第一皮肤瑕疵集合。
上述搜索第一皮肤瑕疵集合的目的是, 在第二图片(可参见图 6 )中把较 大块的深色区域中的较为明显的皮肤瑕疵如痘痘找出来。 由于大块的阴影在 第一图片 (可参见图 5 ) 和第三图片 (可参见图 7 ) 中通常为大块黑色区域, 其大小超出痘痘所限定的阈值, 从而易导致皮肤瑕疵如痘痘无法被检测到, 而第二图片(可参见图 6 )中只能把皮肤瑕疵如痘痘中颜色较深中心很小的区 域变为黑色, 因此, 该歩骤可以将较大块深色区域中的较为明显的痘痘找出 来。 根据所述第一图片和皮肤相似度图片区域生成第二皮肤瑕疵集合的歩骤 可以包括:
在所述第一图片 (可参见图 5 ) 中搜索满足第二搜索条件的斑块; 其中, 所述第二搜索条件为像素点灰度值小于等于第二灰度阈值, 例如 30 ( 0 为黑 色, 255为白色), 且灰度值小于等于第二灰度阈值的相互邻接的像素点的个 数小于等于第二邻接阈值, 如假设人脸的宽度约 100像素, 则该第二邻接阈 值为 30比较合适;
将所述斑块的位置映射到所述皮肤相似度图片中;
从所述皮肤相似度图片中, 提取斑块所在位置对应像素点的灰度值, 以 判断各个像素点的灰度值是否在预设的皮肤瑕疵灰度值范围内, 即判断该斑 块在待处理皮肤区域中相应像素点的颜色值是否接近皮肤瑕疵如痘痘的颜色 值, 并且判断该位置为中心的预定范围内像素点对应的灰度值是否在表示皮 肤颜色相似的灰度阈值范围内, 以判断该斑块周围是否有一定的皮肤区域; 若是, 则将搜索到的斑块作为第二皮肤瑕疵集合。
上述搜索第二皮肤瑕疵集合的目的是, 将颜色相对较浅且较大块的皮肤 瑕疵如痘痘找出来。 因为第一图片 (可参加图 5 ) 中把皮肤瑕疵如痘痘以外, 其他的一些杂色和皮肤的细微变化也变黑了, 由此会导致皮肤瑕疵如痘痘对 应的黑色区域变大, 经过该次搜索, 可以将颜色相对较浅但实际较大块的皮 肤瑕疵如痘痘找出来。
根据所述第三图片和皮肤相似度图片生成第三、 四皮肤瑕疵集合的歩骤 可以包括:
在所述第三图片 (可参见图 7 ) 中搜索满足第三搜索条件的斑块; 其中, 所述第三搜索条件为像素点灰度值小于等于第三灰度阈值, 例如 30 ( 0 为黑 色, 255为白色), 且灰度值小于等于第三灰度阈值的相互邻接的像素点的个 数小于等于第三邻接阈值, 如假设人脸的宽度约 100像素, 则该第三邻接阈 值为 15比较合适;
在所述第三图片 (可参见图 7 ) 中搜索满足第四搜索条件的斑块; 其中, 所述第四搜索条件为像素点灰度值小于等于第四灰度阈值, 例如 30 ( 0 为黑 色, 255为白色), 且灰度值小于等于第四灰度阈值的相互邻接的像素点的个 数小于等于第四邻接阈值, 如假设人脸的宽度约 100像素, 则该第三邻接阈 值为 30比较合适; 将所述满足第三搜索条件和第四搜索条件斑块的位置映射到所述皮肤相 似度图片中;
从所述皮肤相似度图片中, 提取斑块所在位置对应像素点的灰度值, 以 判断各个像素点的灰度值是否在预设的皮肤瑕疵灰度值范围内, 即判断该斑 块在待处理皮肤区域中相应像素点的颜色值是否接近皮肤瑕疵如痘痘的颜色 值, 并且判断以该位置为中心的预定范围内像素点对应的灰度值是否在表示 皮肤颜色相似的灰度阈值范围内, 以判断该斑块周围是否有一定的皮肤区域; 若是, 则将搜索到的满足第三搜索条件斑块作为第三皮肤瑕疵集合, 将 搜索到的满足第四搜索条件斑块作为第四皮肤瑕疵集合。
上述搜索第三皮肤瑕疵集合的目的是, 将大小适中的皮肤瑕疵如痘痘找 出来。 因为很多杂色在磨皮过程中已经去除, 剩余的皮肤瑕疵如痘痘颜色也 会变浅, 因此痘痘在第三图片(可参见图 7 )中产生的黑色区域也就相对变得 较为适中, 因此,经过该次搜索, 可以将适中大小的皮肤瑕疵如痘痘找出来。
上述搜索第四皮肤瑕疵集合的目的是, 将较大块的皮肤瑕疵如痘痘找出 来。 有些皮肤瑕疵实际就比较大, 这样痘痘在第三图片 (可参见图 7 ) 中产生 的黑色区域也就相对比较大, 经过该次搜索, 可以将实际较大块的皮肤瑕疵 如痘痘找出来。
可以理解的是, 在找到这些第一至第四皮肤瑕疵集合后, 如果是在缩放 后的图片上找到的, 那么, 还需将在缩放后的图片上找到的皮肤瑕疵集合映 射至原始待处理图片中, 从而确定出原始待处理图片中皮肤瑕疵的位置进而 进行去除。
在上述的 S103A 中, 生成的不同瑕疵突兀度等级图片包括第一、 二和三 图片时, 本歩骤中, 还可以根据第一、 二、 三图片、 皮肤相似度图片和待处 理图片确定皮肤瑕疵的位置。
具体的, 根据第一、 二、 三图片、 皮肤相似度图片和待处理图片确定皮 肤瑕疵的位置的歩骤可以包括:
根据所述第二图片、 皮肤相似度图片和待处理皮肤区域生成第一皮肤瑕 疵集合, 其中, 第二图片可参见图 6;
根据所述第一图片、 皮肤相似度图片和待处理皮肤区域生成第二皮肤瑕 疵集合, 其中, 第一图片可参见图 5 ;
根据所述第三图片、 皮肤相似度图片和待处理皮肤区域生成第三、 四皮 肤瑕疵集合, 其中, 第三图片可参见图 7;
将所述第一至四皮肤瑕疵集合合并, 获得所有皮肤瑕疵在所述待处理皮 肤区域中的位置。
其中, 根据所述第二图片、 皮肤相似度图片和待处理皮肤区域生成第一 皮肤瑕疵集合的歩骤可以包括:
在所述第二图片 (可参见图 6 ) 中搜索满足第一搜索条件的斑块; 其中, 所述第一搜索条件为像素点灰度值小于等于第一灰度阈值, 例如 30 ( 0 为黑 色, 255为白色), 且相互邻接的像素点中灰度值小于等于第一灰度阈值的像 素点的个数小于等于第一邻接阈值, 如假设人脸的宽度约 100像素, 则该第 一邻接阈值为 6比较合适;
将所述斑块的位置映射到所述待处理皮肤区域和皮肤相似度图片中; 从所述待处理皮肤区域中提取斑块所在位置及斑块所对应像素点的颜色 值; 若所述颜色值在预定的瑕疵颜色阈值范围内, 说明该斑块在待处理皮肤 区域中对应的颜色值接近皮肤瑕疵如痘痘的颜色; 则
从所述皮肤相似度图片中, 提取斑块所在位置为中心的预定范围内对应 像素值点的灰度值, 并且判断以该位置为中心的预定范围内像素点对应的灰 度值是否在表示皮肤颜色相似的灰度阈值范围内, 以判断该斑块周围是否有 一定的皮肤区域;
若是, 则将搜索到的斑块作为第一皮肤瑕疵集合。
上述搜索第一皮肤瑕疵集合的目的是, 在第二图片(可参见图 6 )中把较 大块的深色区域中的较为明显的皮肤瑕疵如痘痘找出来。 由于大块的阴影在 第一图片 (可参见图 5 ) 和第三图片 (可参见图 7 ) 中通常为大块黑色区域, 其大小超出痘痘所限定的阈值, 从而易导致皮肤瑕疵如痘痘无法被检测到, 而第二图片(可参见图 6 )中只能把皮肤瑕疵如痘痘中颜色较深中心很小的区 域变为黑色, 因此, 该歩骤可以将较大块深色区域中的较为明显的痘痘找出 来。
根据所述第一图片、 皮肤相似度图片和待处理皮肤区域生成第二皮肤瑕 疵集合的歩骤可以包括:
在所述第一图片 (可参见图 5 ) 中搜索满足第二搜索条件的斑块; 其中, 所述第二搜索条件为像素点灰度值小于等于第二灰度阈值, 例如 30 ( 0 为黑 色, 255为白色), 且中灰度值小于等于第二灰度阈值的像素点的像素点的个 数小于等于第二邻接阈值, 如假设人脸的宽度约 100像素, 则该第二邻接阈 值为 30比较合适;
将所述斑块的位置映射到所述待处理皮肤区域和皮肤相似度图片中; 从所述待处理皮肤区域中提取斑块所在位置及斑块所对应像素点的颜色 值; 若所述颜色值在预定的瑕疵颜色阈值范围内, 说明该斑块在待处理皮肤 区域中对应的颜色值接近皮肤瑕疵如痘痘的颜色; 则
从所述皮肤相似度图片中, 提取斑块所在位置为中心的预定范围内对应 像素点的灰度值, 并且判断该位置为中心的预定范围内像素点对应的灰度值 是否在表示皮肤颜色相似的灰度阈值范围内, 以判断该斑块周围是否有一定 的皮肤区域;
若是, 则将搜索到的斑块作为第二皮肤瑕疵集合。
上述搜索第二皮肤瑕疵集合的目的是, 将颜色相对较浅且较大块的皮肤 瑕疵如痘痘找出来。 因为第一图片 (可参加图 5 ) 中把皮肤瑕疵如痘痘以外, 其他的一些杂色和皮肤的细微变化也变黑了, 由此会导致皮肤瑕疵如痘痘对 应的黑色区域变大, 经过该次搜索, 可以将颜色相对较浅但实际较大块的皮 肤瑕疵如痘痘找出来。
根据所述第三图片、 皮肤相似度图片和待处理皮肤区域生成第三、 四皮 肤瑕疵集合的歩骤可以包括:
在所述第三图片 (可参见图 7 ) 中搜索满足第三搜索条件的斑块; 其中, 所述第三搜索条件为像素点灰度值小于等于第三灰度阈值, 例如 30 ( 0 为黑 色, 255为白色), 且相互邻接的像素点中灰度值小于等于第三灰度阈值的像 素点的个数小于等于第三邻接阈值, 如假设人脸的宽度约 100像素, 则该第 三邻接阈值为 15比较合适;
在所述第三图片 (可参见图 7 ) 中搜索满足第四搜索条件的斑块; 其中, 所述第四搜索条件为像素点灰度值小于等于第四灰度阈值, 例如 30 ( 0 为黑 色, 255为白色), 且相互邻接的像素点中灰度值小于等于第四灰度阈值的像 素点的个数小于等于第四邻接阈值, 如假设人脸的宽度约 100像素, 则该第 三邻接阈值为 30比较合适;
将所述满足第三搜索条件和第四搜索条件斑块的位置映射到所述待处理 皮肤区域和皮肤相似度图片中;
从所述待处理皮肤区域中提取斑块所在位置及斑块所对应像素点的颜色 值; 若所述颜色值在预定的瑕疵颜色阈值范围内, 说明该斑块在待处理皮肤 区域中对应的颜色值接近皮肤瑕疵如痘痘的颜色; 则
从所述皮肤相似度图片中, 提取斑块所在位置为中心的预定范围内对应 像素点的灰度值, 并且判断以该位置为中心的预定范围内像素点对应的灰度 值是否在表示皮肤颜色相似的灰度阈值范围内, 以判断该斑块周围是否有一 定的皮肤区域;
若是, 则将搜索到的满足第三搜索条件斑块作为第三皮肤瑕疵集合, 将 搜索到的满足第四搜索条件斑块作为第四皮肤瑕疵集合。
上述搜索第三皮肤瑕疵集合的目的是, 将大小适中的皮肤瑕疵如痘痘找 出来。 因为很多杂色在磨皮过程中已经去除, 剩余的皮肤瑕疵如痘痘颜色也 会变浅, 因此痘痘在第三图片(可参见图 7)中产生的黑色区域也就相对变得 较为适中, 因此,经过该次搜索, 可以将适中大小的皮肤瑕疵如痘痘找出来。
上述搜索第四皮肤瑕疵集合的目的是, 将较大块的皮肤瑕疵如痘痘找出 来。 有些皮肤瑕疵实际就比较大, 这样痘痘在第三图片 (可参见图 7) 中产生 的黑色区域也就相对比较大, 经过该次搜索, 可以将实际较大块的皮肤瑕疵 如痘痘找出来。
最后, 通过将各种特征的皮肤瑕疵合并, 即将所述第一至四皮肤瑕疵集 合合并, 就可获得所有皮肤瑕疵位置及大小。 这样, 可以在待处理皮肤区域 中得到所有皮肤瑕疵的位置。
需要说明的是, 前述各种阈值的大小可以根据实际需求确定, 各个阈值 的具体取值可以相同也可以不同。
需要说明的是, 前述皮肤瑕疵可以是痘痘、 污点、 痣、 伤疤等等, 本申 请并不对皮肤瑕疵的具体表现形式做限定, 前述只是以痘痘为例进行说明, 通过改变祛痘过程中各种阈值的实际取值, 即可实现去污点、 伤疤等等。
由以上可见, 本方案中, 通过获得待处理皮肤区域的不同突兀度等级图 片以及皮肤相似度图片, 可以准确、 全面的检测出皮肤区域的皮肤瑕疵, 为 去除皮肤瑕疵提供基础。
参见图 10, 其实根据本申请实施例的一种图片处理装置的逻辑结构示意 图, 该结构具体包括: 人脸识别模块 1001、 皮肤区域确定模块 1002、 皮肤瑕 疵确定模块 1003和皮肤瑕疵去除模块 1004。
其中, 人脸识别模块 1001, 用于在待处理图片中进行人脸识别; 皮肤区域确定模块 1002, 用于确定待处理图片中的待处理皮肤区域; 皮肤瑕疵确定模块 1003, 用于确定所述待处理皮肤区域中皮肤瑕疵的位 置;
皮肤瑕疵去除模块 1004, 用于根据确定出的所述皮肤瑕疵在所述待处理 皮肤区域中的位置, 去除所述人脸区域中的皮肤瑕疵, 得到处理后的图片。
具体的, 皮肤区域确定模块 1002可以包括: 遮盖区域检测子模块、 非遮 盖区域确定子模块和皮肤区域检测子模块 (图中未示出)。
其中, 遮盖区域检测子模块, 用于检测人脸区域中的遮盖区域; 非遮盖 区域确定子模块, 用于根据所述遮盖区域确定出所述人脸区域中的非遮盖区 域; 皮肤区域检测子模块, 用于在所述非遮盖区域中检测皮肤区域; 或用于 在人脸区域中检测皮肤区域。
具体的, 所述待处理图片, 包括:
原始待处理图片或原始待处理图片按照预设的第一比例缩放后得到的图 片。
在本申请的一个具体实施例中, 所述皮肤瑕疵去除模块 1004可以包括: 皮肤瑕疵映射子模块和皮肤瑕疵去除子模块 (图中未示出)。
其中, 皮肤瑕疵映射子模块, 用于将所述待处理皮肤区域中的皮肤瑕疵 映射到所述待处理图片中的人脸区域; 皮肤瑕疵去除子模块, 用于根据映射 处理结果, 去除所述待处理图片的人脸区域中的皮肤瑕疵, 得到处理后的图 片。
在本申请的另一个具体实施例中, 所述皮肤瑕疵去除模块 1004, 还可以 包括: 皮肤瑕疵放大子模块 (图中未示出)。
皮肤瑕疵放大子模块, 用于在所述皮肤瑕疵映射子模块将所述待处理皮 肤区域中的皮肤瑕疵映射到所述待处理图片的人脸区域中之后, 在所述待处 理图片中, 按照预设的第二比例放大所述皮肤瑕疵所在区域, 其中, 所述预 设的第二比例大于 1。
在本申请的另一个具体实施例中, 所述皮肤瑕疵去除子模块可以包括: 函数计算单元、 横纵向颜色值获得单元、 正常皮肤颜色值获得单元和颜色值 替换单元 (图中未示出)。
其中, 函数计算单元, 用于计算待处理图片的人脸区域中的皮肤瑕疵中 位于预设相对位置的像素点所对应的横向皮肤颜色变化函数 y=f ( χ), 以及纵 向皮肤颜色变化函数 y ' =f ( χ ' ), 其中, χ表示所述待处理图片中像素点的 横向坐标、 χ ' 表示所述待处理图片中像素点的纵向坐标, y表示横向坐标为 X的像素点对应的颜色值、 y ' 表示纵向坐标为 χ ' 的像素点对应的颜色值; 横纵向颜色值获得单元, 用于将所述待处理图片的人脸区域中的皮肤瑕 疵中每一像素点的横向坐标和纵向坐标分别代入上述横向皮肤颜色变化函数 和纵向皮肤颜色变化函数, 获得每一像素点在横向及纵向的颜色值;
正常皮肤颜色值获得单元, 用于对所述每一像素点在横向及纵向的颜色 值取均值, 获得每一像素点对应的正常皮肤颜色值;
颜色值替换单元, 用于依次使用计算出的每一像素点的正常皮肤颜色值 替换所述待处理图片的人脸区域中的皮肤瑕疵中每个像素点的颜色值, 从而 去除所述待处理图片的人脸区域中的皮肤瑕疵, 得到处理后的图片。
在本申请的另一个具体实施例中, 所述装置还可以包括: 磨皮处理模块 (图中未示出)。
其中, 所述磨皮处理模块, 用于对所述处理后的图片进行磨皮处理, 以 获得去除突兀效果的图片。
具体的, 所述皮肤暇疵可以包括以下几种中的任意一种或几种: 痘痘、 污点、 伤疤或痣。
应用本申请实施例提供的图像处理装置, 自动的对照片图像中人的脸部 皮肤进行了修改, 即消除了人脸皮肤中较浅的瑕疵, 也消除了人脸皮肤中比 较明显的问题。 相对于现有的人脸皮肤美化处理的各类 APP 中手动抹除皮肤 瑕疵的方案, 本申请所提供的方法给用户提供了更好的用户的体验。
在本申请的另一个具体实施例中, 提供了一种皮肤瑕疵确定模块 1003的 具体实现方式, 具体参见图 11, 图 11是根据本申请实施例的一种皮肤瑕疵确 定模块的逻辑结构示意图, 该皮肤瑕疵确定模块 1003可以包括: 不同突兀度 等级图片获得子模块 10031、皮肤相似度图片生成子模块 10032和皮肤瑕疵确 定子模块 10033。
其中, 不同突兀度等级图片获得子模块 10031, 用于获得所述待处理皮肤 区域的不同瑕疵突兀度等级图片;
皮肤相似度图片生成子模块 10032,用于确定所述待处理皮肤区域的颜色 值, 根据所述颜色值生成所述待处理皮肤区域的皮肤相似度图片;
皮肤瑕疵确定子模块 10033,用于根据所述不同瑕疵突兀度等级图片和皮 肤相似度图片确定皮肤瑕疵在所述待处理皮肤区域中的位置。
具体的, 所述皮肤相似度图片生成子模块 10032可以包括: 采样值获得 单元、皮肤颜色值计算单元、相似度计算单元和皮肤相似度图片生成单元(图 中未示出)。
其中, 采样值获得单元, 用于对所述待处理皮肤区域内的若干区域分别 进行皮肤颜色值采样, 获得针对每个区域的若干采样值;
皮肤颜色值计算单元, 用于根据所述采样值计算出每个区域的皮肤颜色 值;
相似度计算单元, 用于分别遍历每个区域内的像素点, 计算每个像素点 的颜色值与其所在区域的皮肤颜色值之间的相似度值;
皮肤相似度图片生成单元, 用于将计算出的所述相似度值映射为灰度值, 生成反映皮肤颜色的皮肤相似度图片。
具体的, 所述不同突兀度等级图片获得子模块 10031 可以包括: 第一图 片生成单元、 第二图片生成单元和第三图片生成单元 (图中未示出)。
其中, 第一图片生成单元, 用于生成具有第一黑白对比度的第一图片; 第二图片生成单元, 用于生成具有第二黑白对比度的第二图片; 其中, 所述第一黑白对比度大于所述第二黑白对比度;
第三图片生成单元, 用于生成具有第三黑白对比度的第三图片; 其中, 所述第三黑白对比度与第一黑白对比度相同;
所述皮肤瑕疵确定子模块 10033,具体用于根据所述第一至三图片和皮肤 相似度图片确定皮肤瑕疵在所述待处理皮肤区域中的位置。
在本申请的一个具体实施例中, 所述皮肤瑕疵确定子模块 10033, 具体还 用于根据所述第一至三图片、 皮肤相似度图片和待处理皮肤区域确定皮肤瑕 疵在所述待处理皮肤区域中的位置。
具体的, 所述皮肤瑕疵确定子模块 10033可以包括: 第一皮肤瑕疵集合 生成单元、 第二皮肤瑕疵集合生成单元、 第三、 四皮肤瑕疵集合生成单元和 皮肤瑕疵获得单元 (图中未示出)。
其中, 第一皮肤瑕疵集合生成单元, 用于根据所述第二图片、 皮肤相似 度图片和待处理皮肤区域生成第一皮肤瑕疵集合;
第二皮肤瑕疵集合生成单元, 用于根据所述第一图片、 皮肤相似度图片 和待处理皮肤区域生成第二皮肤瑕疵集合; 第三、 四皮肤瑕疵集合生成单元, 用于根据所述第三图片、 皮肤相似度 图片和待处理皮肤区域生成第三、 四皮肤瑕疵集合;
皮肤瑕疵获得单元, 用于将所述第一至四皮肤瑕疵集合合并, 获得所有 皮肤瑕疵在所述待处理皮肤区域中的位置。
具体的, 所述第一皮肤瑕疵集合生成单元可以包括: 第一搜索子单元、 第一映射子单元、 第一斑块位置和颜色值提取子单元和第一灰度值判断子单 元 (图中未示出)。
其中, 第一搜索子单元, 用于在所述第二图片中搜索满足第一搜索条件 的斑块; 其中, 所述第一搜索条件为像素点灰度值小于等于第一灰度阈值, 且灰度值小于等于第一灰度阈值的相互邻接的像素点的个数小于等于第一邻 接阈值;
第一映射子单元, 用于将所述斑块的位置映射到所述待处理皮肤区域和 皮肤相似度图片中;
第一斑块位置和颜色值提取子单元, 用于从所述待处理皮肤区域中提取 斑块所在位置及斑块所对应像素点的颜色值;
第一灰度值判断子单元, 用于在所述第一斑块位置和颜色值提取子单元 提取的颜色值在预定的瑕疵颜色阈值范围内的情况下, 从所述皮肤相似度图 片中, 提取斑块所在位置为中心的预定范围内对应像素点的灰度值, 并且判 断以该位置为中心的预定范围内像素点对应的灰度值是否在表示皮肤颜色相 似的灰度阈值范围内; 若是, 则将搜索到的斑块作为第一皮肤瑕疵集合。
具体的, 第二皮肤瑕疵集合生成单元可以包括: 第二搜索子单元、 第二 映射子单元、 第二斑块位置和颜色值提取子单元和第二灰度值判断子单元。
第二搜索子单元, 用于在所述第一图片中搜索满足第二搜索条件的斑块; 其中, 所述第二搜索条件为像素点灰度值小于等于第二灰度阈值, 且灰度值 小于等于第二灰度阈值的相互邻接的像素点的个数小于等于第二邻接阈值; 第二映射子单元, 用于将所述斑块的位置映射到所述待处理皮肤区域和 皮肤相似度图片中;
第二斑块位置和颜色值提取子单元, 用于从所述待处理皮肤区域中提取 斑块所在位置及斑块所对应像素点的颜色值;
第二灰度值判断子单元, 用于在所述第二斑块位置和颜色提取子单元提 取的颜色值在预定的瑕疵颜色阈值范围内的情况下, 从所述皮肤相似度图片 中, 提取斑块所在位置为中心的预定范围内对应像素点的灰度值, 并且判断 该位置为中心的预定范围内像素点对应的灰度值是否在表示皮肤颜色相似的 灰度阈值范围内; 若是, 则将搜索到的斑块作为第二皮肤瑕疵集合。
具体的, 所述第三、 四皮肤瑕疵集合生成单元可以包括: 第三搜索子单 元、 第四搜索子单元、 第三映射子单元、 第三斑块位置和颜色值提取子单元 和第三灰度值判断子单元 (图中未示出)。
其中, 第三搜索子单元, 用于在所述第三图片中搜索满足第三搜索条件 的斑块; 其中, 所述第三搜索条件为像素点灰度值小于等于第三灰度阈值, 且灰度值小于等于第三灰度阈值的相互邻接的像素点的个数小于等于第三邻 接阈值;
第四搜索子单元, 用于在所述第三图片中搜索满足第四搜索条件的斑块; 其中, 所述第四搜索条件为像素点灰度值小于等于第四灰度阈值, 且灰度值 小于等于第四灰度阈值的相互邻接的像素点的个数小于等于第四邻接阈值; 第三映射子单元, 用于将所述满足第三搜索条件和第四搜索条件斑块的 位置映射到所述待处理皮肤区域和皮肤相似度图片中;
第三斑块位置和颜色值提取子单元, 用于从所述待处理皮肤区域中提取 斑块所在位置及斑块所对应像素的颜色值;
第三灰度值判断子单元, 用于在所述颜色值在预定的瑕疵颜色阈值范围 内的情况下, 从所述皮肤相似度图片中, 提取斑块所在位置为中心的预定范 围内对应像素点的灰度值, 并且判断以该位置为中心的预定范围内像素点对 应的灰度值是否在表示皮肤颜色相似的灰度阈值范围内; 若是, 则将搜索到 的满足第三搜索条件斑块作为第三皮肤瑕疵集合, 将搜索到的满足第四搜索 条件斑块作为第四皮肤瑕疵集合。
在本申请的一个具体实施例中, 所述第一图片生成单元, 具体用于对所 述待处理皮肤区域进行第一灰度处理, 从而生成具有第一黑白对比度的第一 图片;
所述第二图片生成单元, 具体用于对所述待处理皮肤区域进行第二灰度 处理, 从而生成具有第二黑白对比度的第二图片; 其中, 所述第二灰度处理 与所述第一灰度处理方式不同;
所述第三图片生成单元, 具体用于对所述待处理皮肤区域先进行磨皮处 理,获得磨皮处理后的图片,再对所述磨皮处理后的图片进行第三灰度处理, 从而生成具有第三黑白对比度的第三图片, 其中, 所述第三灰度处理与所述 第一灰度处理方式相同。
由以上可见, 本方案中, 通过获得待处理皮肤区域的不同突兀度等级图 片以及皮肤相似度图片, 可以准确、 全面的检测出皮肤区域的皮肤瑕疵, 为 去除皮肤瑕疵提供基础。
另外, 本申请实施例提供了一种终端, 该终端包括:
处理器、 存储器、 通信接口和总线;
所述处理器、 所述存储器和所述通信接口通过所述总线连接并完成相互 间的通信;
所述存储器存储可执行程序代码;
所述处理器通过读取所述存储器中存储的可执行程序代码来运行与所述 可执行程序代码对应的程序, 以用于:
在待处理图片中进行人脸识别;
根据检测结果, 确定人脸区域中的待处理皮肤区域;
确定所述待处理皮肤区域中皮肤瑕疵的位置;
根据确定出的所述皮肤瑕疵在所述待处理皮肤区域中的位置, 去除所述 人脸区域中的皮肤瑕疵, 得到处理后的图片。
本申请实施例提供了一种应用程序, 该应用程序用于在运行时执行本申 请实施例提供的图片处理方法。 其中, 图片处理方法, 包括:
在待处理图片中进行人脸识别;
根据检测结果, 确定人脸区域中的待处理皮肤区域;
确定所述待处理皮肤区域中皮肤瑕疵的位置;
根据确定出的所述皮肤瑕疵在所述待处理皮肤区域中的位置, 去除所述 人脸区域中的皮肤瑕疵, 得到处理后的图片。
本申请实施例提供了一种存储介质, 用于存储应用程序, 该应用程序用 于执行本申请实施例提供的图片处理方法。 其中, 图片处理方法, 包括: 在待处理图片中进行人脸识别;
根据检测结果, 确定人脸区域中的待处理皮肤区域;
确定所述待处理皮肤区域中皮肤瑕疵的位置;
根据确定出的所述皮肤瑕疵在所述待处理皮肤区域中的位置, 去除所述 人脸区域中的皮肤瑕疵, 得到处理后的图片。 对于装置实施例而言, 由于其基本相似于方法实施例, 所以描述的比较 简单, 相关之处参见方法实施例的部分说明即可。
为了描述的方便,描述以上装置是以功能分为各种单元分别描述。当然, 在实施本申请时可以把各单元的功能在同一个或多个软件和 /或硬件中实现。
通过以上的实施方式的描述可知, 本领域的技术人员可以清楚地了解到 本申请可借助软件加必需的通用硬件平台的方式来实现。 基于这样的理解, 本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品 的形式体现出来, 该计算机软件产品可以存储在存储介质中, 如 R0M/RAM、 磁 碟、 光盘等, 包括若干指令用以使得一台计算机设备 (可以是个人计算机, 服务器, 或者网络设备等) 执行本申请各个实施例或者实施例的某些部分所 述的方法。
需要说明的是, 在本文中, 诸如第一和第二等之类的关系术语仅仅用来 将一个实体或者操作与另一个实体或操作区分开来, 而不一定要求或者暗示 这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语 "包括" 、 "包含"或者其任何其他变体意在涵盖非排他性的包含, 从而使得包括一系 列要素的过程、 方法、 物品或者设备不仅包括那些要素, 而且还包括没有明 确列出的其他要素, 或者是还包括为这种过程、 方法、 物品或者设备所固有 的要素。 在没有更多限制的情况下, 由语句 "包括一个…… " 限定的要素, 并不排除在包括所述要素的过程、 方法、 物品或者设备中还存在另外的相同 要素。
本说明书中的各个实施例均采用相关的方式描述, 各个实施例之间相同 相似的部分互相参见即可, 每个实施例重点说明的都是与其他实施例的不同 之处。 尤其, 对于系统实施例而言, 由于其基本相似于方法实施例, 所以描 述的比较简单, 相关之处参见方法实施例的部分说明即可。
本申请可用于众多通用或专用的计算系统环境或配置中。 例如: 个人计 算机、服务器计算机、手持设备或便携式设备、平板型设备、 多处理器系统、 基于微处理器的系统、 置顶盒、 可编程的消费电子设备、 网络 PC、 小型计算 机、 大型计算机、 包括以上任何系统或设备的分布式计算环境等等。
以上所述仅为本申请的较佳实施例而已, 并不用以限制本申请, 凡在本 申请的精神和原则之内, 所做的任何修改、 等同替换、 改进等, 均应包含在 本申请保护的范围之内。

Claims

权 利 要 求
1、 图片处理方法, 其特征在于, 所述方法包括:
在待处理图片中进行人脸识别;
根据检测结果, 确定人脸区域中的待处理皮肤区域;
确定所述待处理皮肤区域中皮肤瑕疵的位置;
根据确定出的所述皮肤瑕疵在所述待处理皮肤区域中的位置, 去除所述 人脸区域中的皮肤瑕疵, 得到处理后的图片。
2、 根据权利要求 1所述的方法, 其特征在于, 所述确定人脸区域中的待 处理皮肤区域, 包括:
检测人脸区域中的遮盖区域;
根据所述遮盖区域确定出所述人脸区域中的非遮盖区域;
在所述非遮盖区域中检测皮肤区域;
在人脸区域中检测皮肤区域。
3、 根据权利要求 1所述的方法, 其特征在于, 所述确定所述待处理皮肤 区域中皮肤瑕疵的位置, 包括:
获得所述待处理皮肤区域的不同瑕疵突兀度等级图片;
确定所述待处理皮肤区域的颜色值, 根据所述颜色值生成所述待处理皮 肤区域的皮肤相似度图片;
根据所述不同瑕疵突兀度等级图片和皮肤相似度图片确定皮肤瑕疵在所 述待处理皮肤区域中的位置。
4、 根据权利要求 3所述的方法, 其特征在于, 所述确定所述待处理皮肤 区域的颜色值, 根据所述颜色值生成所述待处理皮肤区域的皮肤相似度图片, 包括:
对所述待处理皮肤区域内的若干区域分别进行皮肤颜色值采样, 获得针 对每个区域的若干采样值;
根据所述采样值计算出每个区域的皮肤颜色值;
分别遍历每个区域内的像素点, 计算每个像素点的颜色值与其所在区域 的皮肤颜色值之间的相似度值;
将计算出的所述相似度值映射为灰度值, 生成反映皮肤颜色的皮肤相似 度图片。
5、 根据权利要求 3所述的方法, 其特征在于,
所述获得所述待处理皮肤区域的不同瑕疵突兀度等级图片, 包括: 对所述待处理皮肤区域进行第一灰度处理, 从而生成具有第一黑白对比 度的第一图片;
对所述待处理皮肤区域进行第二灰度处理, 从而生成具有第二黑白对比 度的第二图片; 其中, 所述第一黑白对比度大于所述第二黑白对比度, 所述 第二灰度处理与所述第一灰度处理方式不同;
对所述待处理皮肤区域先进行磨皮处理, 获得磨皮处理后的图片, 再对 所述磨皮处理后的图片进行第三灰度处理, 从而生成具有第三黑白对比度的 第三图片; 其中, 所述第三黑白对比度与第一黑白对比度相同, 所述第三灰 度处理与所述第一灰度处理方式相同;
所述根据所述不同瑕疵突兀度等级图片和皮肤相似度图片确定皮肤瑕疵 在所述待处理皮肤区域中的位置, 包括:
根据所述第二图片、 皮肤相似度图片和待处理皮肤区域生成第一皮肤瑕 疵集合;
根据所述第一图片、 皮肤相似度图片和待处理皮肤区域生成第二皮肤瑕 疵集合;
根据所述第三图片、 皮肤相似度图片和待处理皮肤区域生成第三、 四皮 肤瑕疵集合;
将所述第一至四皮肤瑕疵集合合并, 获得所有皮肤瑕疵在所述待处理皮 肤区域中的位置。
6、 根据权利要求 5所述的方法, 其特征在于, 根据所述第二图片、 皮肤 相似度图片和待处理皮肤区域生成第一皮肤瑕疵集合的歩骤包括:
在所述第二图片中搜索满足第一搜索条件的斑块; 其中, 所述第一搜索 条件为像素点灰度值小于等于第一灰度阈值, 且灰度值小于等于第一灰度阈 值的相互邻接的像素点的个数小于等于第一邻接阈值;
将所述斑块的位置映射到所述待处理皮肤区域和皮肤相似度图片中; 从所述待处理皮肤区域中提取斑块所在位置及斑块所对应像素点的颜色 值; 若所述颜色值在预定的瑕疵颜色阈值范围内; 则
从所述皮肤相似度图片中, 提取斑块所在位置为中心的预定范围内对应 像素点的灰度值, 并且判断以该位置为中心的预定范围内像素点对应的灰度 值是否在表示皮肤颜色相似的灰度阈值范围内;
若是, 则将搜索到的斑块作为第一皮肤瑕疵集合;
根据所述第一图片、 皮肤相似度图片和待处理皮肤区域生成第二皮肤瑕 疵集合的歩骤包括:
在所述第一图片中搜索满足第二搜索条件的斑块; 其中, 所述第二搜索 条件为像素点灰度值小于等于第二灰度阈值, 且灰度值小于等于第二灰度阈 值的相互邻接的像素点的个数小于等于第二邻接阈值;
将所述斑块的位置映射到所述待处理皮肤区域和皮肤相似度图片中; 从所述待处理皮肤区域中提取斑块所在位置及斑块所对应像素点的颜色 值; 若所述颜色值在预定的瑕疵颜色阈值范围内; 则
从所述皮肤相似度图片中, 提取斑块所在位置为中心的预定范围内对应 像素点的灰度值, 并且判断该位置为中心的预定范围内像素点对应的灰度值 是否在表示皮肤颜色相似的灰度阈值范围内;
若是, 则将搜索到的斑块作为第二皮肤瑕疵集合;
根据所述第三图片、 皮肤相似度图片和待处理皮肤区域生成第三、 四皮 肤瑕疵集合的歩骤包括:
在所述第三图片中搜索满足第三搜索条件的斑块; 其中, 所述第三搜索 条件为像素点灰度值小于等于第三灰度阈值, 且灰度值小于等于第三灰度阈 值的相互邻接的像素点的个数小于等于第三邻接阈值;
在所述第三图片中搜索满足第四搜索条件的斑块; 其中, 所述第四搜索 条件为像素点灰度值小于等于第四灰度阈值, 且灰度值小于等于第四灰度阈 值的相互邻接的像素点的个数小于等于第四邻接阈值;
将所述满足第三搜索条件和第四搜索条件斑块的位置映射到所述待处理 皮肤区域和皮肤相似度图片中;
从所述待处理皮肤区域中提取斑块所在位置及斑块所对应像素点的颜色 值; 若所述颜色值在预定的瑕疵颜色阈值范围内; 则
从所述皮肤相似度图片中, 提取斑块所在位置为中心的预定范围内对应 像素点的灰度值, 并且判断以该位置为中心的预定范围内像素点对应的灰度 值是否在表示皮肤颜色相似的灰度阈值范围内;
若是, 则将搜索到的满足第三搜索条件斑块作为第三皮肤瑕疵集合, 将 搜索到的满足第四搜索条件斑块作为第四皮肤瑕疵集合。
7、 根据权利要求 1所述的方法, 其特征在于, 所述根据确定出的所述皮 肤瑕疵在所述待处理皮肤区域中的位置, 去除所述人脸区域中对应的皮肤瑕 疵, 得到处理后的图片, 包括:
将所述待处理皮肤区域中的皮肤瑕疵映射到所述待处理图片的人脸区域 中;
根据映射处理结果, 去除所述待处理图片的人脸区域中的皮肤瑕疵, 得 到处理后的图片。
8、 根据权利要求 7所述的方法, 其特征在于, 在所述将所述待处理皮肤 区域中的皮肤瑕疵映射到所述待处理图片的人脸区域中之后, 还包括:
在所述待处理图片中, 按照预设的第二比例放大所述皮肤瑕疵所在区域, 其中, 所述预设的第二比例大于 1。
9、 根据权利要求 7所述的方法, 其特征在于, 所述根据映射处理结果, 去除所述待处理图片的人脸区域中的皮肤瑕疵, 包括:
计算待处理图片的人脸区域中的皮肤瑕疵中位于预设相对位置的像素点 所对应的横向皮肤颜色变化函数 y=f ( X ) , 以及纵向皮肤颜色变化函数 y ' =f
( Χ ' ), 其中, X表示所述待处理图片中像素点的横向坐标、 X ' 表示所述待 处理图片中像素点的纵向坐标, y表示横向坐标为 X的像素点对应的颜色值、 y ' 表示纵向坐标为 χ ' 的像素点对应的颜色值;
将所述待处理图片的人脸区域中的皮肤瑕疵中每一像素点的横向坐标和 纵向坐标分别代入上述横向皮肤颜色变化函数和纵向皮肤颜色变化函数, 获 得每一像素点在横向及纵向的颜色值;
对所述每一像素点在横向及纵向的颜色值取均值, 获得每一像素点对应 的正常皮肤颜色值;
依次使用计算出的每一像素点的正常皮肤颜色值替换所述待处理图片的 人脸区域中的皮肤瑕疵中每个像素点的颜色值, 从而去除所述待处理图片的 人脸区域中的皮肤瑕疵, 得到处理后的图片。
10、 根据权利要求 1所述的方法, 其特征在于, 所述方法还包括: 对所 述处理后的图片进行磨皮处理, 以获得去除突兀效果的图片。
11、 图片处理装置, 其特征在于, 所述装置包括:
人脸识别模块, 用于在待处理图片中进行人脸识别;
皮肤区域确定模块, 用于根据检测结果, 确定人脸区域中的待处理皮肤 区域;
皮肤瑕疵确定模块, 用于确定所述待处理皮肤区域中皮肤瑕疵的位置; 皮肤瑕疵去除模块, 用于根据确定出的所述皮肤瑕疵在所述待处理皮肤 区域中的位置, 去除所述人脸区域中的皮肤瑕疵, 得到处理后的图片。
12、根据权利要求 11所述的装置,其特征在于,所述皮肤区域确定模块, 包括:
遮盖区域检测子模块, 用于检测待人脸区域中的遮盖区域;
非遮盖区域确定子模块, 用于根据所述遮盖区域确定出所述人脸区域中 的非遮盖区域;
皮肤区域检测子模块, 用于在所述非遮盖区域中检测皮肤区域; 或 用于在人脸区域中检测皮肤区域。
13、根据权利要求 11所述的装置,其特征在于,所述皮肤瑕疵确定模块, 包括:
不同突兀度等级图片获得子模块, 用于获得所述待处理皮肤区域的不同 瑕疵突兀度等级图片;
皮肤相似度图片生成子模块, 用于确定所述待处理皮肤区域的颜色值, 根据所述颜色值生成所述待处理皮肤区域的皮肤相似度图片;
皮肤瑕疵确定子模块, 用于根据所述不同瑕疵突兀度等级图片和皮肤相 似度图片确定皮肤瑕疵在所述待处理皮肤区域中的位置。
14、 根据权利要求 13所述的装置, 其特征在于, 所述皮肤相似度图片生 成子模块, 包括:
采样值获得单元, 用于对所述待处理皮肤区域内的若干区域分别进行皮 肤颜色值采样, 获得针对每个区域的若干采样值;
皮肤颜色值计算单元, 用于根据所述采样值计算出每个区域的皮肤颜色 值;
相似度计算单元, 用于分别遍历每个区域内的像素点, 计算每个像素点 的颜色值与其所在区域的皮肤颜色值之间的相似度值;
皮肤相似度图片生成单元, 用于将计算出的所述相似度值映射为灰度值, 生成反映皮肤颜色的皮肤相似度图片。
15、 根据权利要求 13所述的装置, 其特征在于, 所述不同突兀度等级图 片获得子模块, 包括: 第一图片生成单元, 用于对所述待处理皮肤区域进行第一灰度处理, 从 而生成具有第一黑白对比度的第一图片;
第二图片生成单元, 用于对所述待处理皮肤区域进行第二灰度处理, 从 而生成具有第二黑白对比度的第二图片; 其中, 所述第一黑白对比度大于所 述第二黑白对比度, 所述第二灰度处理与所述第一灰度处理方式不同;
第三图片生成单元, 用于对所述待处理皮肤区域先进行磨皮处理, 获得 磨皮处理后的图片, 再对所述磨皮处理后的图片进行第三灰度处理, 从而生 成具有第三黑白对比度的第三图片; 其中, 所述第三黑白对比度与第一黑白 对比度相同, 所述第三灰度处理与所述第一灰度处理方式相同;
所述皮肤瑕疵确定子模块, 包括:
第一皮肤瑕疵集合生成单元, 用于根据所述第二图片、 皮肤相似度图片 和待处理皮肤区域生成第一皮肤瑕疵集合;
第二皮肤瑕疵集合生成单元, 用于根据所述第一图片、 皮肤相似度图片 和待处理皮肤区域生成第二皮肤瑕疵集合;
第三、 四皮肤瑕疵集合生成单元, 用于根据所述第三图片、 皮肤相似度 图片和待处理皮肤区域生成第三、 四皮肤瑕疵集合;
皮肤瑕疵获得单元, 用于将所述第一至四皮肤瑕疵集合合并, 获得所有 皮肤瑕疵在所述待处理皮肤区域中的位置。
16、 根据权利要求 15所述的装置, 其特征在于, 所述第一皮肤瑕疵集合 生成单元, 包括:
第一搜索子单元, 用于在所述第二图片中搜索满足第一搜索条件的斑块; 其中, 所述第一搜索条件为像素点灰度值小于等于第一灰度阈值, 且灰度值 小于等于第一灰度阈值的相互邻接的像素点的个数小于等于第一邻接阈值; 第一映射子单元, 用于将所述斑块的位置映射到所述待处理皮肤区域和 皮肤相似度图片中;
第一斑块位置和颜色值提取子单元, 用于从所述待处理皮肤区域中提取 斑块所在位置及斑块所对应像素点的颜色值;
第一灰度值判断子单元, 用于在所述第一斑块位置和颜色值提取子单元 提取的颜色值在预定的瑕疵颜色阈值范围内的情况下, 从所述皮肤相似度图 片中, 提取斑块所在位置为中心的预定范围内对应像素点的灰度值, 并且判 断以该位置为中心的预定范围内像素点对应的灰度值是否在表示皮肤颜色相 似的灰度阈值范围内; 若是, 则将搜索到的斑块作为第一皮肤瑕疵集合; 所述第二皮肤瑕疵集合生成单元, 包括:
第二搜索子单元, 用于在所述第一图片中搜索满足第二搜索条件的斑块; 其中, 所述第二搜索条件为像素点灰度值小于等于第二灰度阈值, 且灰度值 小于等于第二灰度阈值的相互邻接的像素点的个数小于等于第二邻接阈值; 第二映射子单元, 用于将所述斑块的位置映射到所述待处理皮肤区域和 皮肤相似度图片中;
第二斑块位置和颜色值提取子单元, 用于从所述待处理皮肤区域中提取 斑块所在位置及斑块所对应像素点的颜色值;
第二灰度值判断子单元, 用于在所述第二斑块位置和颜色提取子单元提 取的颜色值在预定的瑕疵颜色阈值范围内的情况下, 从所述皮肤相似度图片 中, 提取斑块所在位置为中心的预定范围内对应像素点的灰度值, 并且判断 该位置为中心的预定范围内像素点对应的灰度值是否在表示皮肤颜色相似的 灰度阈值范围内; 若是, 则将搜索到的斑块作为第二皮肤瑕疵集合;
所述第三、 四皮肤瑕疵集合生成单元, 包括:
第三搜索子单元, 用于在所述第三图片中搜索满足第三搜索条件的斑块; 其中, 所述第三搜索条件为像素点灰度值小于等于第三灰度阈值, 且灰度值 小于等于第三灰度阈值的相互邻接的像素点的个数小于等于第三邻接阈值; 第四搜索子单元, 用于在所述第三图片中搜索满足第四搜索条件的斑块; 其中, 所述第四搜索条件为像素点灰度值小于等于第四灰度阈值, 且灰度值 小于等于第四灰度阈值的相互邻接的像素点的个数小于等于第四邻接阈值; 第三映射子单元, 用于将所述满足第三搜索条件和第四搜索条件斑块的 位置映射到所述待处理皮肤区域和皮肤相似度图片中;
第三斑块位置和颜色值提取子单元, 用于从所述待处理皮肤区域中提取 斑块所在位置及斑块所对应像素的颜色值;
第三灰度值判断子单元, 用于在所述颜色值在预定的瑕疵颜色阈值范围 内的情况下, 从所述皮肤相似度图片中, 提取斑块所在位置为中心的预定范 围内对应像素点的灰度值, 并且判断以该位置为中心的预定范围内像素点对 应的灰度值是否在表示皮肤颜色相似的灰度阈值范围内; 若是, 则将搜索到 的满足第三搜索条件斑块作为第三皮肤瑕疵集合, 将搜索到的满足第四搜索 条件斑块作为第四皮肤瑕疵集合。
17、根据权利要求 11所述的装置,其特征在于,所述皮肤瑕疵去除模块, 包括:
皮肤瑕疵映射子模块, 用于将所述待处理皮肤区域中的皮肤瑕疵映射到 所述待处理图片中的人脸区域;
皮肤瑕疵去除子模块, 用于根据映射处理结果, 去除所述待处理图片的 人脸区域中的皮肤瑕疵, 得到处理后的图片。
18、根据权利要求 17所述的装置,其特征在于,所述皮肤瑕疵去除模块, 还包括:
皮肤瑕疵放大子模块, 用于在所述皮肤瑕疵映射子模块将所述待处理皮 肤区域中的皮肤瑕疵映射到所述待处理图片的人脸区域中之后, 在所述待处 理图片中, 按照预设的第二比例放大所述皮肤瑕疵所在区域, 其中, 所述预 设的第二比例大于 1。
19、 根据权利要求 17所述的装置, 其特征在于, 所述皮肤瑕疵去除子模 块, 包括:
函数计算单元, 用于计算待处理图片的人脸区域中的皮肤瑕疵中位于预 设相对位置的像素点所对应的横向皮肤颜色变化函数 y=f ( χ), 以及纵向皮肤 颜色变化函数 y ' =f ( χ ' ), 其中, χ表示所述待处理图片中像素点的横向坐 标、 χ ' 表示所述待处理图片中像素点的纵向坐标, y表示横向坐标为 X的像 素点对应的颜色值、 y ' 表示纵向坐标为 χ ' 的像素点对应的颜色值;
横纵向颜色值获得单元, 用于将所述待处理图片的人脸区域中的皮肤瑕 疵中每一像素点的横向坐标和纵向坐标分别代入上述横向皮肤颜色变化函数 和纵向皮肤颜色变化函数, 获得每一像素点在横向及纵向的颜色值;
正常皮肤颜色值获得单元, 用于对所述每一像素点在横向及纵向的颜色 值取均值, 获得每一像素点对应的正常皮肤颜色值;
颜色值替换单元, 用于依次使用计算出的每一像素点的正常皮肤颜色值 替换所述待处理图片的人脸区域中的皮肤瑕疵中每个像素点的颜色值, 从而 去除所述待处理图片的人脸区域中的皮肤瑕疵, 得到处理后的图片。
20、 根据权利要求 11所述的装置, 其特征在于, 所述装置还包括: 磨皮 处理模块;
所述磨皮处理模块, 用于对所述处理后的图片进行磨皮处理, 以获得去除突 兀效果的图片。
PCT/CN2014/085482 2014-04-04 2014-08-29 图片处理方法及装置 WO2015149475A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/905,762 US9959603B2 (en) 2014-04-04 2014-08-29 Method and device for image processing

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410137069.9 2014-04-04
CN201410137069.9A CN103927719B (zh) 2014-04-04 2014-04-04 图片处理方法及装置

Publications (1)

Publication Number Publication Date
WO2015149475A1 true WO2015149475A1 (zh) 2015-10-08

Family

ID=51145931

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/085482 WO2015149475A1 (zh) 2014-04-04 2014-08-29 图片处理方法及装置

Country Status (3)

Country Link
US (1) US9959603B2 (zh)
CN (1) CN103927719B (zh)
WO (1) WO2015149475A1 (zh)

Families Citing this family (36)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103927719B (zh) * 2014-04-04 2017-05-17 北京猎豹网络科技有限公司 图片处理方法及装置
CN105787888A (zh) * 2014-12-23 2016-07-20 联芯科技有限公司 人脸图像美化方法
CN104574306A (zh) * 2014-12-24 2015-04-29 掌赢信息科技(上海)有限公司 一种即时视频中的人脸美化方法和电子设备
CN104504668B (zh) * 2014-12-30 2018-09-14 宇龙计算机通信科技(深圳)有限公司 含有人脸的图像加锐方法及装置
US10362984B2 (en) * 2015-01-27 2019-07-30 Healthy.Io Ltd Measuring and monitoring skin feature colors, form and size
CN106033593A (zh) * 2015-03-09 2016-10-19 夏普株式会社 图像处理设备和方法
US9965881B2 (en) * 2015-08-28 2018-05-08 Panasonic Intellectual Property Corporation Of America Method for generating image and image generation system
CN106558025B (zh) * 2015-09-29 2021-02-09 腾讯科技(深圳)有限公司 一种图片的处理方法和装置
CN105243371B (zh) * 2015-10-23 2018-12-11 厦门美图之家科技有限公司 一种人脸美颜程度的检测方法、系统及拍摄终端
CN106611429B (zh) 2015-10-26 2019-02-05 腾讯科技(深圳)有限公司 检测皮肤区域的方法和检测皮肤区域的装置
CN106210522B (zh) * 2016-07-15 2019-06-14 Oppo广东移动通信有限公司 一种图像处理方法、装置、移动终端及可读存储介质
CN106780595A (zh) * 2016-12-15 2017-05-31 歌尔科技有限公司 一种全景图片的识别方法和装置
CN106875332A (zh) * 2017-01-23 2017-06-20 深圳市金立通信设备有限公司 一种图像处理方法及终端
CN107316281B (zh) * 2017-06-16 2021-03-02 Oppo广东移动通信有限公司 图像处理方法、装置和终端设备
CN110741377A (zh) 2017-06-30 2020-01-31 Oppo广东移动通信有限公司 人脸图像处理方法、装置、存储介质及电子设备
CN107464212B (zh) * 2017-07-28 2021-01-01 Oppo广东移动通信有限公司 美颜方法、电子装置和计算机可读存储介质
CN107644159B (zh) * 2017-09-12 2021-04-09 Oppo广东移动通信有限公司 人脸识别方法及相关产品
CN110163805B (zh) * 2018-06-05 2022-12-20 腾讯科技(深圳)有限公司 一种图像处理方法、装置和存储介质
US20200020173A1 (en) * 2018-07-16 2020-01-16 Zohirul Sharif Methods and systems for constructing an animated 3d facial model from a 2d facial image
CN109325924B (zh) * 2018-09-20 2020-12-04 广州酷狗计算机科技有限公司 图像处理方法、装置、终端及存储介质
CN109345480B (zh) * 2018-09-28 2020-11-27 广州云从人工智能技术有限公司 一种基于图像修复模型的人脸自动去痘方法
CN111047619B (zh) * 2018-10-11 2022-09-30 展讯通信(上海)有限公司 人脸图像处理方法及装置、可读存储介质
CN109741272A (zh) * 2018-12-25 2019-05-10 维沃移动通信有限公司 一种图像处理方法及移动终端
US11308618B2 (en) 2019-04-14 2022-04-19 Holovisions LLC Healthy-Selfie(TM): a portable phone-moving device for telemedicine imaging using a mobile phone
CN110111245B (zh) * 2019-05-13 2023-12-08 Oppo广东移动通信有限公司 图像处理方法、装置、终端及计算机可读存储介质
CN110415237B (zh) * 2019-07-31 2022-02-08 Oppo广东移动通信有限公司 皮肤瑕疵检测方法、检测装置、终端设备及可读存储介质
CN110852967B (zh) * 2019-11-06 2023-09-12 成都品果科技有限公司 一种人像照片快速祛瑕疵的方法
US11410387B1 (en) 2020-01-17 2022-08-09 Facebook Technologies, Llc. Systems, methods, and media for generating visualization of physical environment in artificial reality
US10950034B1 (en) 2020-01-27 2021-03-16 Facebook Technologies, Llc Systems, methods, and media for generating visualization of physical environment in artificial reality
US11451758B1 (en) * 2020-02-12 2022-09-20 Meta Platforms Technologies, Llc Systems, methods, and media for colorizing grayscale images
CN111338545A (zh) * 2020-02-24 2020-06-26 北京字节跳动网络技术有限公司 图像处理方法、组件、电子设备及存储介质
CN111784635B (zh) * 2020-05-29 2023-05-30 北京工商大学 一种基于图像颜色空间的皮肤表面荧光点检测与评估方法
CN113808027B (zh) * 2020-06-16 2023-10-17 北京达佳互联信息技术有限公司 一种人体图像处理方法、装置、电子设备及存储介质
CN112221021B (zh) * 2020-11-02 2023-02-07 中南大学湘雅三医院 一种皮肤科智能激光祛斑控制系统
CN112598591A (zh) * 2020-12-18 2021-04-02 北京达佳互联信息技术有限公司 图像处理方法、装置、电子设备及存储介质
CN116823809B (zh) * 2023-08-23 2023-11-24 威海迈尼生物科技有限公司 一种微针贴片技术淡斑效果视觉检测方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101916370A (zh) * 2010-08-31 2010-12-15 上海交通大学 人脸检测中非特征区域图像处理的方法
US8265410B1 (en) * 2009-07-11 2012-09-11 Luxand, Inc. Automatic correction and enhancement of facial images
CN103268475A (zh) * 2013-05-10 2013-08-28 中科创达软件股份有限公司 一种基于人脸、肤色检测的皮肤美容方法
CN103927718A (zh) * 2014-04-04 2014-07-16 北京金山网络科技有限公司 一种图片处理方法及装置
CN103927719A (zh) * 2014-04-04 2014-07-16 北京金山网络科技有限公司 图片处理方法及装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7035461B2 (en) * 2002-08-22 2006-04-25 Eastman Kodak Company Method for detecting objects in digital images

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8265410B1 (en) * 2009-07-11 2012-09-11 Luxand, Inc. Automatic correction and enhancement of facial images
CN101916370A (zh) * 2010-08-31 2010-12-15 上海交通大学 人脸检测中非特征区域图像处理的方法
CN103268475A (zh) * 2013-05-10 2013-08-28 中科创达软件股份有限公司 一种基于人脸、肤色检测的皮肤美容方法
CN103927718A (zh) * 2014-04-04 2014-07-16 北京金山网络科技有限公司 一种图片处理方法及装置
CN103927719A (zh) * 2014-04-04 2014-07-16 北京金山网络科技有限公司 图片处理方法及装置

Also Published As

Publication number Publication date
CN103927719A (zh) 2014-07-16
US20160163028A1 (en) 2016-06-09
US9959603B2 (en) 2018-05-01
CN103927719B (zh) 2017-05-17

Similar Documents

Publication Publication Date Title
WO2015149475A1 (zh) 图片处理方法及装置
CN103927718B (zh) 一种图片处理方法及装置
AU2019204639B2 (en) Image and feature quality, image enhancement and feature extraction for ocular-vascular and facial recognition, and fusing ocular-vascular with facial and/or sub-facial information for biometric systems
JP7413400B2 (ja) 肌質測定方法、肌質等級分類方法、肌質測定装置、電子機器及び記憶媒体
WO2017092431A1 (zh) 基于肤色的人手检测方法及装置
WO2019100282A1 (zh) 一种人脸肤色识别方法、装置和智能终端
WO2019174276A1 (zh) 用于定位目标物体区域中心的图像处理方法、装置、设备和介质
CN103714345B (zh) 一种双目立体视觉检测手指指尖空间位置的方法与系统
JP2005316973A (ja) 赤目検出装置および方法並びにプログラム
WO2020233178A1 (zh) 一种图像处理方法、装置及电子设备
WO2018082388A1 (zh) 一种肤色检测方法、装置及终端
WO2021190168A1 (zh) 图像处理方法、装置、存储介质及电子设备
JP2007272435A (ja) 顔特徴抽出装置及び顔特徴抽出方法
CN111860369A (zh) 一种欺诈识别方法、装置以及存储介质
GB2541865A (en) Image processing system and method
CN104392211A (zh) 一种基于显著性检测的皮肤识别方法
JP2023521208A (ja) 人体画像処理方法および電子機器
JP6819445B2 (ja) 情報処理装置、制御方法、及びプログラム
US10909351B2 (en) Method of improving image analysis
CN108491820B (zh) 图像中肢体表示信息的识别方法、装置及设备、存储介质
CN115690130B (zh) 一种图像处理方法和装置
Gasparini et al. A review of redeye detection and removal in digital images through patents
CN114708266A (zh) 一种卡片缺陷的检测工装、方法、装置以及介质
CN107527083A (zh) 一种二维码生成方法及装置
WO2023225774A1 (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: 14888167

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14905762

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

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

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

122 Ep: pct application non-entry in european phase

Ref document number: 14888167

Country of ref document: EP

Kind code of ref document: A1