CN111429536B - Method, system and storage medium for toning skin color in image - Google Patents

Method, system and storage medium for toning skin color in image Download PDF

Info

Publication number
CN111429536B
CN111429536B CN202010176425.3A CN202010176425A CN111429536B CN 111429536 B CN111429536 B CN 111429536B CN 202010176425 A CN202010176425 A CN 202010176425A CN 111429536 B CN111429536 B CN 111429536B
Authority
CN
China
Prior art keywords
skin
color
model
average value
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010176425.3A
Other languages
Chinese (zh)
Other versions
CN111429536A (en
Inventor
丁凡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Emperor Technology Co Ltd
Original Assignee
Shenzhen Emperor Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Emperor Technology Co Ltd filed Critical Shenzhen Emperor Technology Co Ltd
Priority to CN202010176425.3A priority Critical patent/CN111429536B/en
Publication of CN111429536A publication Critical patent/CN111429536A/en
Application granted granted Critical
Publication of CN111429536B publication Critical patent/CN111429536B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0012Biomedical image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template 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/10004Still image; Photographic 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Medical Informatics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Databases & Information Systems (AREA)
  • Multimedia (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Radiology & Medical Imaging (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to the technical field of image processing, in particular to a method, a system and a storage medium for toning skin colors in images, wherein the method comprises the following steps: acquiring a skin area, and identifying a face image area, wherein the skin area is contained in the face image area; obtaining skin color parameter values of all skin colors in a skin area, counting to obtain a skin color parameter average value, and comparing the skin color parameter average value with a preset standard color average value to obtain a skin color average value difference; acquiring face color parameters of a face image area, and carrying out overall offset adjustment on the face color parameter values according to the average difference of skin colors to align the average value of the offset face color parameters with the standard color average value; two components in the offset-adjusted skin color parameter value are extracted and adjusted to be within a predetermined range. The invention can automatically adjust the complexion of the characters and effectively improve the qualification rate of the certificate of the self-service photographing equipment.

Description

Method, system and storage medium for toning skin color in image
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method for toning skin tone in an image, a system for toning skin tone in an image, and a storage medium storing a method for toning skin tone in an image.
Background
Along with the rapid development of society, the variety of certificates used by masses of citizens is increased, and part of certificates need to be attached with certificates, so that the shooting requirement of the certificates is gradually increased; in order to facilitate the citizens to shoot the credentials, some self-service shooting devices appear on the market nowadays, and the application of the self-service shooting devices brings very convenient experience for people who need to shoot credentials. However, because the imaging effect of the credentials is a certain requirement, the complexion of the characters in the credentials also has a certain requirement standard.
In the existing self-service photographing equipment, the parameters of a camera, the photographing lamplight atmosphere and the skin state of a person can influence the skin color effect of the person in the certificate photo, and sometimes the skin color of the person in the certificate photo deviates from the standard requirement; the photographed certificate photo cannot be used, so that the rejection rate is high, and the popularization of the self-service photographing equipment is affected to a certain extent.
Disclosure of Invention
To overcome the above-mentioned drawbacks, an object of the present invention is to provide a method, a system and a storage medium storing the method for automatically toning the skin color of an image in a certificate photo.
The aim of the invention is realized by the following technical scheme:
the invention relates to a method for toning skin color in an image, which comprises the following steps:
acquiring a skin area in the certificate photo image according to a preset skin color model;
identifying a face image area according to the background color parameters in the certificate photo image, wherein the skin area is contained in the face image area;
obtaining skin color parameter values of all skin colors in the skin region, counting to obtain a skin color parameter average value, and comparing the skin color parameter average value with a preset standard color average value to obtain a skin color average value difference;
acquiring face color parameters of the face image area, and carrying out overall offset adjustment on the face color parameter values according to the average difference of the skin colors to align the average value of the offset face color parameters with the standard color average value;
and extracting two components in the skin color parameter values subjected to offset adjustment, and adjusting the two components to be within a preset range to obtain the skin color adjusted certificate photograph image.
In the present invention, the obtaining the skin color parameter values of all skin colors in the skin area, counting to obtain a skin color parameter average value, and comparing the skin color parameter average value with a preset standard color average value to obtain a skin color average value difference includes:
and converting the certificate photo image model from an RGB model to an LAB model, acquiring all corresponding skin LAB parameters in the skin area, counting the average value of the skin LAB parameters, and comparing the average value with the average value of preset standard LAB parameters to obtain the average difference of the skin colors.
In the present invention, the obtaining the face color parameter of the face image area, and performing overall offset adjustment on the face color parameter value according to the skin color mean difference includes:
and acquiring a human face LAB parameter of the human face image area, and shifting three components of the human face LAB parameter according to three corresponding components of average difference of skin colors.
In the invention, the obtaining the skin area in the credential image according to the preset skin color model comprises the following steps:
and converting the credentials image model from an RGB model to a YCrCb model, detecting each pixel point in the image of the estimated skin area by using a preset skin color model, judging whether the pixel point is matched with the skin color model, if so, defining the pixel point as a skin pixel point, and integrating all the skin pixel points to obtain the skin area.
In the present invention, the extracting two components in the skin color parameter value after offset adjustment, and adjusting the two components to be within a predetermined range, the obtaining the skin color adjusted credential image includes:
extracting A, B components in all offset-adjusted skin LAB parameters to form a skin parameter model; and adjusting the skin parameter model according to a preset ideal model to enable the skin parameter model to approach the ideal model, so as to obtain the skin color adjusted certificate photo image.
In the present invention, the two components are adjusted to be within a predetermined range, and then include:
and converting the image subjected to skin color parameter value adjustment into an RGB model by using the LAB model.
In the present invention, the comparing the skin color parameter value with a preset standard color parameter to obtain a skin color mean difference includes:
judging whether the average difference of the skin colors is within a preset range, and if not, acquiring face color parameters of the face image area; if the image is within the predetermined range, outputting the certificate image.
The invention is a system for toning skin tone in an image, comprising:
the skin region acquisition module is used for acquiring a skin region in the credential image according to a preset skin color model;
the face region acquisition module is used for identifying a face image region according to the background color parameters in the certificate photo image, and the skin region is contained in the face image region;
the skin color comparison module is connected with the skin area acquisition module and is used for acquiring skin color parameter values of all skin colors in the skin area, counting to obtain a skin color parameter average value, and comparing the skin color parameter average value with a preset standard color average value to obtain a skin color average value difference;
the skin color integral deviation module is respectively connected with the facial area acquisition module and the skin color comparison module and is used for acquiring facial color parameters of the facial image area, and carrying out integral deviation adjustment on the facial color parameter values according to the skin color mean value difference so as to align the mean value of the deviated facial color parameters with the standard color mean value;
and the skin area fine adjustment module is connected with the skin color integral offset module and is used for extracting two components in the skin color parameter value subjected to offset adjustment and adjusting the two components to be within a preset range to obtain the adjusted skin color parameter value.
In the present invention, the system further comprises:
the camera is respectively connected with the skin region acquisition module and the face region acquisition module and is used for acquiring a certificate photo image through shooting;
and the background color selector is connected with the skin color comparison module and is used for selecting the background color and inputting parameters of the selected background color into the skin color comparison module.
The present invention is a computer readable program storage medium storing computer program instructions which, when executed by a computer, cause the computer to perform a method as described above.
The invention can automatically adjust the complexion of the characters in the certificate photo, so that the color of the characters can meet the standard, the certificate photo yield of the self-help photo equipment is effectively improved, and the self-help photo equipment is favorable for further popularization in the market.
Drawings
For ease of illustration, the invention is described in detail by the following preferred embodiments and the accompanying drawings.
FIG. 1 is a schematic workflow diagram of one embodiment of a method of toning skin tone in an image according to the present invention;
FIG. 2 is a schematic workflow diagram of another embodiment of a method of toning skin tone in an image according to the present invention;
FIG. 3 is a schematic logical structure diagram of one embodiment of a system for toning skin tone in an image according to the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings are merely for convenience in describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more of the described features. In the description of the present invention, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
In the description of the present invention, it should be noted that the terms "mounted," "connected," and "coupled" are to be construed broadly, as well as, for example, fixedly coupled, detachably coupled, or integrally coupled, unless otherwise specifically indicated and defined. Either mechanically or electrically. Can be directly connected or indirectly connected through an intermediate medium, and can be communicated with the inside of two elements or the interaction relationship of the two elements. The specific meaning of the above terms in the present invention can be understood by those of ordinary skill in the art according to the specific circumstances.
A method of toning skin tone in an image according to one embodiment of the present invention is described in detail below with reference to fig. 1, which includes:
s101, acquiring a skin area
Acquiring a credentials image of a user in real time through a camera, or importing credentials image files from external equipment; and acquiring a skin area in the credential image according to a preset skin color model so as to determine the position of the skin area in the credential image.
S102, identifying a face image area
Identifying a face image area according to the background color parameters in the certificate photo image, wherein the skin area is contained in the face image area; the color parameters of the background color are compared with the color parameters in the certificate photo, and the color of the certificate photo is generally as follows: the background color of the three colors of red, white and blue is single, so that the face image area can be identified in the certificate photo image by comparing the background color.
S103, obtaining average difference of skin colors through comparison
Obtaining skin color parameter values of all skin colors in the skin region, counting to obtain a skin color parameter average value, and comparing the skin color parameter average value with a preset standard color average value to obtain a skin color average value difference; if the average value of the skin color parameters is X+Y and the average value of the standard colors is X, the average difference of the skin colors is +Y
S104, carrying out offset adjustment on the face color parameter value
And acquiring the face color parameters of the face image area, and carrying out overall offset adjustment on the face color parameter values according to the average difference of the skin colors so that the average value of the offset face color parameters is aligned with the standard color average value. And if the average value of the skin color is poor plus Y, reducing Y in the face color parameter value, so that the face color parameter is shifted integrally.
S105, adjusting components of skin color parameter values
And extracting two components in the skin color parameter values subjected to offset adjustment, and adjusting the two components to be within a preset range to obtain the skin color adjusted certificate photograph image. All two components of the skin color parameter value may form an approximately circular image (A t ,B t ) The preset standard range is (A, B), so that the image formed by the two components is contracted to be within the preset standard range, and the adjusted skin color parameter value is obtained.
In this embodiment, the overall offset adjustment is performed on all the face color parameter values, and then the skin color parameter values after the offset adjustment are adjusted; the processing has the advantages that the brightness of the skin color area and the non-skin color area in the foreground area is ensured not to have obvious difference after the adjustment processing, so that the connection of the skin color area and the non-skin color area is more natural.
In another embodiment, a method for toning skin color in an image according to the present invention is described in detail below with reference to fig. 2, which includes:
s201, obtaining a certificate photo image and a background parameter
And controlling the camera to acquire the certificate photo image and acquiring parameters of background color in the certificate photo image.
S202, acquiring the skin area
In the certificate photograph, the certificate photograph image model is converted into a YCrCb model from an RGB model, wherein the RGB color mode is a color standard in the industry, and various colors are obtained by changing three color channels of red R, green G and blue B and overlapping the three color channels; YCrCb is YUV, where Y represents brightness, i.e., gray scale value; while U and V represent chromaticity, which is used to describe the image color and saturation for specifying the color of the pixel. Detecting each pixel point in an image of a predicted skin area by using a preset skin color model, judging whether the pixel point is matched with the skin color model, if so, defining the pixel point as a skin pixel point, and integrating all skin pixel points to obtain the skin area; the method specifically comprises the following steps: conversion of an original image from RGB to YCrCb image I f2 Detecting image I by using preset elliptical skin color model f2 And judging whether each point (Cr, cb) is in the ellipse, if so, the point belongs to the skin, otherwise, the point is a non-skin pixel point. Traversing all pixel points to obtain the skin area I of the person f The method comprises the steps of carrying out a first treatment on the surface of the Wherein, the ellipse model is obtained through the statistics of skin color CrCb of a large number of character photos, and then an ellipse equation is utilized to approximately fit the rough distribution edge of skin CrCb, so as to determine the ellipse model. The formula for converting an RGB image into a YCrCb image is as follows:
s203, identifying a face image area
Identifying a face image area according to the background color parameters in the certificate photo image, wherein the skin area is contained in the face image area; the method comprises the following steps: marking a background area according to the distribution range of the background color of the certificate and the uniform characteristic of the background color; judging whether the (R, G, B) value of each pixel in the certificate photo image is in the background color range, if so, mapping the face image area I fg Setting the corresponding coordinate to 0, otherwise setting the coordinate to 255; thus, the face image area and the background area can be separated in the credentials photo image to obtain the faceCoordinates of the image area on the map; since in a credential photo, its color is typically: the background color of the three colors of red, white and blue is single, so that the face image area can be identified in the certificate photo image by comparing the background color.
S204, obtaining average difference of skin colors through comparison
And converting the certificate image model from an RGB model to a LAB model, wherein the Lab model is a color model and consists of three elements, one element is brightness L, and A and B are two color channels. The color included in A is from dark green to gray to bright pink; b is from bright blue to gray to yellow. And acquiring all corresponding skin LAB parameters in the skin area, counting the average value of the skin LAB parameters, and comparing the average value with the average value of preset standard LAB parameters to obtain the average difference of the skin color. Because of the distribution range of preset standard LAB parameters, L epsilon (L min ,L max ),A∈(A min ,A max ),B∈(B min ,B max ) Calculating a prescribed LAB mean value L e 、A e 、B e
Conversion of a credential image from an RGB image to a LAB image I lab The formula is as follows:
L * =116·f(Y/Y n )-16
a * =500·[f(X/X n )-f(Y/Y n )]
b * =200·[f(Y/Y n )-f(Z/Z n )]
then in the skin area I f For template constraints, a gray level histogram of the skin over the L, A, B three components is calculated, then the L, A, B centroid mean L of the sphere et 、A et 、B et With a prescribed LAB mean value L e 、A e 、B e Comparing to obtain a difference result:
ΔL=(L e -L et )
ΔA=(A e -A et )
ΔB=(B e -B et )
s205, judging whether the average difference of the skin colors is within a preset range
Judging whether the average difference of the skin colors is within a preset range, if not, performing step S206, and performing offset adjustment on the color parameter value of the human face; if the image is within the preset range, a step S209 is performed to output the certificate photograph.
S206, performing offset adjustment on the face color parameter value
And acquiring a human face LAB parameter of the human face image area, and shifting three components of the human face LAB parameter according to three corresponding components of average difference of skin colors respectively to align the average value of the shifted human face color parameter with the standard color average value. Specifically, the human face image area I fg The template is a constraint range, and the values of DeltaL, deltaA and DeltaB are respectively shifted on three components of L, A, B, so that the average value of the centroid of the skin color L, A, B is aligned with the specified average value, and the center of the actual distribution of L, A, B is coincident with the specified center.
S207 adjusting the component of the skin color parameter value
Extracting A, B components in all offset-adjusted skin LAB parameters to form a skin parameter model; and adjusting the skin parameter model according to a preset ideal model to enable the skin parameter model to approach the ideal model, so as to obtain the skin color adjusted certificate photo image. The method comprises the following steps: obtaining an ideal circular model describing the joint distribution of A, B components through sample statistics of the previous skin color meeting the specification, wherein the radius is recorded as R o The method comprises the steps of carrying out a first treatment on the surface of the After calculating the mass center, counting the distances from the (A, B) value of each pixel point of the skin color region to the mass center, approximately determining the actual circular model distribution, and marking the radius as R t The method comprises the steps of carrying out a first treatment on the surface of the Setting up a coordinate system by A, B to adjust each skin(A) of color pixel points t ,B t ) Calculating the direction theta of the pixel point relative to the centroid in the coordinate system t And distance l t And the position in the circular model, then find the distance l corresponding to the ideal model midpoint to centroid o Then converting the position to the position of the ideal circular model (A o ,B o ) The formula is as follows, all pixel points in the skin color area are traversed, and transformation processing is carried out one by one until the skin color area is finished.
l o =R o l t /R t
A o =l o ·cosθ t
B o =l o ·sinθ t
S208, converting the image into RGB model
And converting the adjusted certificate photographic image from the LAB model to the RGB model, wherein the formula is as follows, and the color matching is finished.
Y=Y n ·f -1 ((L * +16)/116)
X=X n ·f -1 ((L * +16)/116+a * /500)
Z=Z n ·f -1 ((L * +16)/116-b * /200)
Wherein,
s209, outputting certificate photo images
The obtained document image is output, and in this embodiment, the document image may be output through a display, or may be output through a manner of printing a photograph.
The embodiment can automatically identify whether the certificate photograph image needs to be mixed with colors, and when the conditions are met, the certificate photograph is automatically mixed with colors, so that the work is more intelligent.
Referring to fig. 3, the present invention is a system for toning skin color in an image, comprising:
the skin area obtaining module 301, where the skin area obtaining module 301 is configured to obtain a skin area in the credential image according to a preset skin color model;
the face region acquiring module 302 is configured to identify a face image region according to a parameter of a background color in a credential image, where the skin region is included in the face image region;
the skin color comparison module 303 is connected with the skin area acquisition module 301, and is configured to acquire skin color parameter values of all skin colors in the skin area, count to obtain a skin color parameter average value, and compare the skin color parameter average value with a preset standard color average value to obtain a skin color average difference;
the overall skin color shifting module 304 is respectively connected with the facial region acquiring module 302 and the skin color comparing module 303, and is used for acquiring facial color parameters of the facial image region, and carrying out overall shifting adjustment on the facial color parameter values according to the average difference of the skin colors so as to align the average value of the facial color parameters after shifting with the standard color average value;
the skin area fine adjustment module 305 is connected to the overall skin color offset module 304, and is configured to extract two components of the offset-adjusted skin color parameter value, and adjust the two components to be within a predetermined range, so as to obtain an adjusted skin color parameter value.
In the present invention, the system further comprises:
the cameras are respectively connected with the skin region acquisition module 301 and the face region acquisition module 302 and are used for acquiring credentials images through shooting;
and the background color selector is connected with the skin color comparison module 303 and is used for selecting the background color and inputting parameters of the selected background color into the skin color comparison module 303.
The present invention includes a computer readable storage medium having stored thereon a program product capable of implementing the method described above in the present specification. In some possible embodiments, the various aspects of the invention may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the invention as described in the "exemplary methods" section of this specification, when said program product is run on the terminal device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on the above readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
In the description of the present specification, reference to the terms "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, and alternatives falling within the spirit and principles of the invention.

Claims (7)

1. A method of toning skin tone in an image, comprising:
obtaining a skin area in the certificate photo image according to a preset skin color model;
identifying a face image area according to the background color parameters in the certificate photo image, wherein the skin area is contained in the face image area;
obtaining skin color parameter values of all skin colors in the skin region, counting to obtain a skin color parameter average value, and comparing the skin color parameter average value with a preset standard color average value to obtain a skin color average value difference; it comprises the following steps: converting the credentials image from an RGB model to an LAB model, taking the skin area as template constraint, calculating gray histograms of all corresponding skin LAB parameters in the skin area on three components L, A and B, counting the average value of the skin LAB parameters on three components L, A and B, and comparing the average value with the average value of the three components of preset standard L, A and B to obtain skin color average value difference;
acquiring face color parameters of the face image area, and performing offset adjustment on the face color parameter values according to the average difference of the skin colors to align the average value of the offset face color parameters with the standard color average value;
extracting two components A and B in all offset-adjusted skin LAB parameters to form a skin parameter model; according to a preset ideal model, adjusting a skin parameter model to enable the skin parameter model to approach the ideal model, and obtaining a skin color adjusted certificate photo image, wherein the method comprises the following steps of: obtaining an ideal model describing the joint distribution of the component A and the component B through skin color sample statistics conforming to the specification; processing the skin color distribution of the credentials in real time, determining the mass centers of the component A and the component B in the skin LAB parameter, and determining an actual ideal model according to the distances from the value A and the value B of each pixel point in the skin area to the mass centers; establishing a coordinate system by using the component A and the component B in the skin LAB parameter, adjusting the component A and the component B of each skin color pixel point, determining the direction and the distance of each skin color pixel point relative to the centroid in the coordinate system and the distance from each skin color pixel point to the centroid in the actual ideal model, converting the position of each pixel point into the actual ideal model, traversing all the pixel points in the skin area, performing transformation processing one by one until the completion, calculating the formula as follows,
l o =R o ·l t /R t
A o =l o ·cosθ t
B o =l o ·sinθ t
wherein l o R is the distance between each pixel point in the actual ideal model and the mass center of the component A and B in the skin LAB parameters o Radius, R, of an ideal model of the joint distribution t For the radius of the actual ideal model, A o And B o Converting each skin pixel point into coordinates of a position in the actual ideal model, theta t And l t And the directions and the distances of the barycenters of the two components A and B in the parameters of the skin LAB in the coordinate system are the skin pixel points.
2. The method of claim 1, wherein the obtaining the face color parameters of the face image area and the offset adjusting the face color parameter values according to the mean difference of the skin colors comprises:
and acquiring a human face LAB parameter of the human face image area, and shifting three components of the human face LAB parameter according to three corresponding components of average difference of skin colors.
3. The method of claim 2, wherein the obtaining the skin area in the credential image according to the predetermined skin color model comprises:
and converting the credential image into a YCrCb model from an RGB model, detecting each pixel point of the estimated skin area by using a preset skin color model, judging whether the pixel point is matched with the skin color model, if so, defining the pixel point as a skin pixel point, and integrating all the skin pixel points to obtain the skin area.
4. A method of toning skin tone in an image according to claim 3, further comprising:
and converting the image subjected to skin color parameter value adjustment into an RGB model by using the LAB model.
5. A system for toning skin tone in an image, comprising:
the skin region acquisition module is used for acquiring a skin region in the credential image according to a preset skin color model;
the face region acquisition module is used for identifying a face image region according to the background color parameters in the certificate photo image, and the skin region is contained in the face image region;
the skin color comparison module is connected with the skin region acquisition module and is used for acquiring skin color parameter values of all skin colors in the skin region, counting to obtain a skin color parameter average value, and comparing the skin color parameter average value with a preset standard color average value to obtain a skin color average value difference; it comprises the following steps: converting the credentials image from an RGB model to an LAB model, taking the skin area as template constraint, calculating gray histograms of all corresponding skin LAB parameters in the skin area on three components L, A and B, counting the average value of the skin LAB parameters on three components L, A and B, and comparing the average value with the average value of the three components of preset standard L, A and B to obtain skin color average value difference;
the skin color integral shifting module is respectively connected with the human face region acquisition module and the skin color comparison module and is used for acquiring human face color parameters of the human face image region, shifting and adjusting the human face color parameter value according to the average value difference of the skin colors so that the average value of the shifted human face color parameters is aligned with the standard color average value; the skin area fine adjustment module is connected with the skin color integral offset module and is used for extracting two components A and B in all offset-adjusted skin LAB parameters to form a skin parameter model; according to a preset ideal model, adjusting a skin parameter model to enable the skin parameter model to approach the ideal model, and obtaining a skin color adjusted certificate photo image, wherein the method comprises the following steps of: obtaining an ideal model describing the joint distribution of the component A and the component B through skin color sample statistics conforming to the specification; processing the skin color distribution of the credentials in real time, determining the mass centers of the component A and the component B in the skin LAB parameter, and determining an actual ideal model according to the distances from the value A and the value B of each pixel point in the skin area to the mass centers; establishing a coordinate system by using the component A and the component B in the skin LAB parameter, adjusting the component A and the component B of each skin color pixel point, determining the direction and the distance of each skin color pixel point relative to the centroid in the coordinate system and the distance from each skin color pixel point to the centroid in the actual ideal model, converting the position of each pixel point into the actual ideal model, traversing all the pixel points in the skin area, performing transformation processing one by one until the completion, calculating the formula as follows,
l o =R o ·l t /R t
A o =l o ·cosθ t
B o =l o ·sinθ t
wherein l o R is the distance between each pixel point in the actual ideal model and the mass center of the component A and B in the skin LAB parameters o Radius, R, of an ideal model of the joint distribution t For the radius of the actual ideal model, A o And B o Converting each skin pixel point into coordinates of a position in the actual ideal model, theta t And l t And the directions and the distances of the barycenters of the two components A and B in the parameters of the skin LAB in the coordinate system are the skin pixel points.
6. The system for toning skin tone in an image according to claim 5, further comprising:
the camera is respectively connected with the skin region acquisition module and the face region acquisition module and is used for acquiring a certificate photo image through shooting;
and the background color selector is connected with the skin color comparison module and is used for selecting the background color and inputting parameters of the selected background color into the skin color comparison module.
7. A computer readable program storage medium, characterized in that it stores computer program instructions, which when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 4.
CN202010176425.3A 2020-03-13 2020-03-13 Method, system and storage medium for toning skin color in image Active CN111429536B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010176425.3A CN111429536B (en) 2020-03-13 2020-03-13 Method, system and storage medium for toning skin color in image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010176425.3A CN111429536B (en) 2020-03-13 2020-03-13 Method, system and storage medium for toning skin color in image

Publications (2)

Publication Number Publication Date
CN111429536A CN111429536A (en) 2020-07-17
CN111429536B true CN111429536B (en) 2023-12-19

Family

ID=71546583

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010176425.3A Active CN111429536B (en) 2020-03-13 2020-03-13 Method, system and storage medium for toning skin color in image

Country Status (1)

Country Link
CN (1) CN111429536B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111831193A (en) * 2020-07-27 2020-10-27 北京思特奇信息技术股份有限公司 Automatic skin changing method, device, electronic equipment and storage medium
CN114445302A (en) * 2022-01-30 2022-05-06 北京字跳网络技术有限公司 Image processing method, image processing device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106127708A (en) * 2016-06-24 2016-11-16 华东师范大学 A kind of colored eye fundus image Enhancement Method based on LAB color space
CN107180415A (en) * 2017-03-30 2017-09-19 北京奇艺世纪科技有限公司 Skin landscaping treatment method and device in a kind of image
CN107948617A (en) * 2017-12-06 2018-04-20 广东欧珀移动通信有限公司 Image processing method, device, computer-readable recording medium and computer equipment
CN108269290A (en) * 2018-01-19 2018-07-10 厦门美图之家科技有限公司 Skin complexion recognition methods and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101303877B1 (en) * 2005-08-05 2013-09-04 삼성전자주식회사 Method and apparatus for serving prefer color conversion of skin color applying face detection and skin area detection

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106127708A (en) * 2016-06-24 2016-11-16 华东师范大学 A kind of colored eye fundus image Enhancement Method based on LAB color space
CN107180415A (en) * 2017-03-30 2017-09-19 北京奇艺世纪科技有限公司 Skin landscaping treatment method and device in a kind of image
CN107948617A (en) * 2017-12-06 2018-04-20 广东欧珀移动通信有限公司 Image processing method, device, computer-readable recording medium and computer equipment
CN108269290A (en) * 2018-01-19 2018-07-10 厦门美图之家科技有限公司 Skin complexion recognition methods and device

Also Published As

Publication number Publication date
CN111429536A (en) 2020-07-17

Similar Documents

Publication Publication Date Title
US7668365B2 (en) Determination of main object on image and improvement of image quality according to main object
US8055067B2 (en) Color segmentation
US7333653B2 (en) Detecting and correcting redeye in an image
US9530045B2 (en) Method, system and non-transitory computer storage medium for face detection
CN111429536B (en) Method, system and storage medium for toning skin color in image
JP4549352B2 (en) Image processing apparatus and method, and image processing program
JP3557659B2 (en) Face extraction method
CN110136071A (en) A kind of image processing method, device, electronic equipment and storage medium
US7903870B1 (en) Digital camera and method
US8675960B2 (en) Detecting skin tone in images
CN107862657A (en) Image processing method, device, computer equipment and computer-readable recording medium
CN111263074A (en) Method, system and equipment for automatically adjusting brightness of camera and storage medium thereof
CN107730446A (en) Image processing method, device, computer equipment and computer-readable recording medium
CN104834908A (en) Image exposure method for mobile terminal based on eye pattern recognition and exposure system
JP2006119817A (en) Image processor
CN106611415A (en) Detection method and device for skin area
WO2019210707A1 (en) Image sharpness evaluation method, device and electronic device
CN107105172A (en) A kind of method and apparatus for being used to focus
CN106416218A (en) Image processing device, imaging device, image processing method, and program
CN107845076A (en) Image processing method, device, computer-readable recording medium and computer equipment
CN113095148B (en) Method and system for detecting occlusion of eyebrow area, photographing device and storage medium
CN105812668A (en) Image processing method, processing device and photographing apparatus
KR20190142931A (en) Code authentication method of counterfeit print image and its application system
JP2004265431A (en) Face extraction method
CN111429535B (en) Method, system, equipment and medium for evaluating difference degree between clothes and background in image

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant