Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are used merely to distinguish one device, module, or unit from another device, module, or unit, and are not intended to limit the order or interdependence of the functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
For the purposes of clarity, technical solutions and advantages of the present disclosure, the following further details the embodiments of the present disclosure with reference to the accompanying drawings.
The image enhancement quality evaluation method, device, electronic equipment and storage medium provided by the disclosure aim to solve the technical problems in the prior art.
The following describes the technical solutions of the present disclosure and how the technical solutions of the present disclosure solve the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present disclosure will be described below with reference to the accompanying drawings.
An embodiment of the present disclosure provides a method for evaluating image enhancement quality, as shown in fig. 1, including:
step S101: a first image and a first enhanced image obtained by performing image enhancement processing on the first image are acquired.
The first image comprises an original image containing a portrait, and the first enhanced image comprises an image obtained after image enhancement processing is carried out on the original image.
It will be appreciated that the selected first image to be evaluated and the corresponding first enhanced image may be obtained locally; alternatively, the externally transmitted first image and the corresponding first enhanced image may be received via a network transmission. The first enhanced image may be obtained by performing enhancement processing in advance, or may be obtained by performing enhancement processing in real time.
Step S102: the method comprises the steps of extracting a human face skin color region in a first image to be used as a first skin color region, and extracting a human face skin color region in a first enhanced image to be used as a second skin color region.
In one embodiment of the present disclosure, extracting a face skin tone region in a first image as a first skin tone region and extracting a face skin tone region in a first enhanced image as a second skin tone region includes:
(1) And detecting a face key point area in the first image as a first face key point area, and extracting a face triangular area from the first face key point area as a first skin color area according to the position points of the preset face triangular area.
(2) And detecting a face key point area in the first enhanced image as a second face key point area, and extracting a face triangular area from the second face key point area as a second skin color area according to the position points of the preset face triangular area.
It will be appreciated that when an image is subjected to image enhancement processing, the change of the face is often more focused, so that in a specific implementation process, the relevant area of the whole face in the image can be used as a skin color area, then the image enhancement quality is evaluated for the skin color area, and the whole face area is selected instead of the whole image, so that the overall evaluation efficiency can be improved.
Further, in an embodiment of the present disclosure, the evaluation of the image enhancement quality may be performed by continuously extracting the face triangle area from the face key point area according to the preset face triangle area. It can be understood that the face is easy to illuminate and the five sense organs are affected, so that a smaller area of the face area, such as a flatter area, can be extracted from the whole face area to serve as a skin color area, so that the influence of the environment on the evaluation is reduced, and the objectivity of the evaluation is improved.
In one embodiment of the present disclosure, face keypoints in an image are extracted by:
and inputting the image of the face key points to be extracted into a pre-trained face key point detection model, and obtaining 68 face key points output by the face key point model.
The pre-trained face key point detection model includes a face 68 point detection model DAN (Deep Alignment Network) trained on a 300W data set, and by inputting an image containing a face into the face key point detection model, the face key points of the face image can be output, and specifically, reference may be made to fig. 2, and fig. 2 is a 68 face key points in the face image. The evaluation may be terminated directly for face images for which no face keypoints can be detected.
It should be noted that, when extracting a face key point in an image, the embodiment of the disclosure may detect the face key point by using the face 68 point detection model, and may detect other face detection models, and specifically, the face key point detection model further includes multiple detection models such as faces 72, 128, 150, 201 points, and the like. The key point coordinate positions of the human face can be returned, including the human face outline, eyes, eyebrows, lips, nose outline and the like.
Therefore, the face key point area in the first image can be extracted as the first face key point area according to the face key point detection model, and the face key point area in the first enhanced image can be extracted as the second face key point area. And extracting skin color areas in the first face key point area and the second face key point area, wherein the number and the number of the extracted key points can be set by a person skilled in the art.
In one embodiment of the present disclosure, the preset face triangle area position includes a triangle area constructed by three points 37, 32, 49 and a triangle area constructed by three points 46, 36, 55 in fig. 2. It can be appreciated that the area is selected as a skin color area, instead of a complete face as a skin color area, because the area is flat, the influence of illumination and five sense organs is reduced, and the recognition accuracy can be improved. The extent of this region on the face image can be referred to as the triangular region enclosed by the white lines in fig. 3.
It should be noted that, in the present disclosure, the skin color area may be a skin color average value of a determined skin color area, and it may be understood that, after a face triangle area is extracted from a face key point area according to a preset face triangle area position point, the skin color average value of the skin color area may be obtained according to a pixel average value of a pixel point in the area.
Specifically, the pixel mean includes values of r, g, b. Where r, g, b are a color standard that includes almost all colors perceived by human vision, which is obtained by varying the three color channels of red (r), green (g), blue (b) and overlapping them with each other. The average skin tone includes values of Y, cb, cr. Where YCbCr represents a color space, Y represents a luminance component of a color, cb and Cr represent chrominance components of a color, and specifically Cb represents a blue chrominance component, and Cr represents a red chrominance component.
According to the pixel mean value of the pixel points in the skin color region, obtaining the skin color mean value of the skin color region can be obtained through color gamut change, and concretely, the skin color value of the skin color region can be obtained through the following color gamut conversion formula (1):
in one embodiment of the present disclosure, the face triangle area is extracted by:
(1) And extracting a left face triangle area and/or a right face triangle area from the face key point area of the face triangle area to be extracted.
(2) When only the left face triangle area is extracted, the extracted left face triangle area is used as a face triangle area.
(3) When only the right face triangle area is extracted, the extracted right face triangle area is used as a human face triangle area.
(4) When the left face triangle area and the right face triangle area are extracted, carrying out mean processing on pixels of the extracted left face triangle area and right face triangle area, and taking the area obtained after the mean processing as a face triangle area.
It will be appreciated that the inclusion of faces is not the same for each image containing a face, and that some include only left faces, some include only right faces, and some include full faces. The extraction of the left face triangle area and the right face triangle area from the face key point area of the face triangle area to be extracted includes various cases.
It can be understood that, for the left face triangle area and the right face triangle area, pixels on two sides are slightly different due to the influence of illumination and five sense organs, in order to achieve the purpose of accurate evaluation, the average value of the pixels can be processed for the left face triangle area and the right face triangle area, and the area after the average value processing is used as a new face triangle area.
Step S103: and determining the skin color probability corresponding to the first skin color region as a first skin color probability and determining the skin color probability corresponding to the second skin color region as a second skin color probability through a pre-trained skin color recognition model, wherein the skin color recognition model is used for recognizing the probability that the skin color region is a standard natural skin color.
Wherein, the pre-trained skin color recognition model can recognize the probability that the skin color region is the standard natural skin color. In one embodiment of the present disclosure, as shown in fig. 4, the process of constructing the skin tone recognition model includes:
step S401: acquiring a preset face image data set, and extracting a skin color data set corresponding to the preset face image data set.
The preset face image data set defaults to a 300W face image data set, and a more accurate skin color recognition model can be constructed by using heavyweight sample data. After the 300W data set is acquired, for each face image data, skin color areas in the face image can be extracted, the pixel value of each skin color area is utilized, then the skin color value of each skin color area is obtained according to a color gamut change formula in a formula 1, and the corresponding 300W skin color data set is obtained through statistics.
It should be noted that, as the evaluation image increases, the skin tone value of the evaluation image may also be added to the skin tone data set to update the skin tone data set. By continuously updating the skin tone dataset, the constructed skin tone recognition model may be made more accurate.
Step S402: and calculating based on the skin color data set to obtain skin color parameters, wherein the skin color parameters comprise a chromaticity mean value, a chromaticity standard deviation and a chromaticity covariance.
It should be noted that, the skin colors of different human faces have a larger difference in the luminance component Y, but are more concentrated in the chrominance components Cr and Cb; to avoid the influence of different person proportions in the dataset, the luminance component Y may be truncated to be compatible with recognizing faces of various skin colors.
Specifically, the average blue chromaticity and the average red chromaticity can be obtained by the following formulas (2) and (3), respectively:
wherein,,
represents the mean value of blue chromaticity,/>
Representing the red chromaticity mean, N represents the number of skin tone datasets, which in one embodiment of the present disclosure may be 300w, i represents the number of skin tone datasets, with no actual physical meaning.
The standard deviation of blue chromaticity and the standard deviation of red chromaticity can be obtained by the following formulas (4) and (5), respectively:
wherein sigma Cb Represents the standard deviation of blue chromaticity, sigma Cr Representing the standard deviation of red chromaticity.
The chromaticity covariance can be obtained by the following formula (6):
wherein Cov (Cb, cr) represents the chroma covariance.
Step S403: training the Gaussian mixture model by using skin color parameters to obtain a skin color recognition model.
It will be appreciated that since the skin tone parameters relate to both the blue component and the red component, the gaussian mixture model may be a two-dimensional gaussian mixture model by combining the skin tone parameters obtained above, such as the chrominance mean, the chrominance standard deviation, and the chrominance covariance. The skin color recognition model can be obtained by inputting a two-dimensional Gaussian mixture model, wherein the skin color recognition model can be represented by the following formula (7).
Wherein Cb is ~ Represents the blue chromaticity variable, cr ~ Representing the red chromaticity variable, f (Cb) ~ ,Cr ~ ) Representing a skin tone recognition function, i.e. a skin tone recognition model. From the above formula, by inputting the skin color region into the model, the probability that the skin color region is a standard natural skin color can be identified.
In one embodiment of the present disclosure, the skin tone probability corresponding to a skin tone region is determined by:
and determining the chromaticity component of the skin color region to be identified, inputting the chromaticity component into a skin color identification model, and acquiring the skin color probability of the skin color identification model based on the chromaticity component.
It should be noted that, by determining the chrominance component of the skin color region to be identified and excluding the luminance component, the face recognition method can be compatible with faces with various skin colors.
Specifically, cb in equation 7 ~ Represents the blue chromaticity variable, cr ~ Representing red chromaticity variables, the chromaticity components, i.e., blue and red components, of the skin color region to be identified can be input into a pre-trained skin color identification model to output the probability of the current skin color region to be identified being a natural skin color region. Inputting a first chrominance component in a first skin color area into a skin color recognition model to output a first skin color probability corresponding to the first skin color area, and inputting a second chrominance component in a second skin color area into the skin color recognition model to output a second skin color probability corresponding to the second skin color area.
Step S104: and determining the skin tone distortion degree of the first enhanced image relative to the first image according to the first skin tone probability and the second skin tone probability.
It may be appreciated that the first enhanced image is an image of the first image after the image enhancement processing, and in order to evaluate the influence degree of the image enhancement processing on the skin color, the distortion value of the enhanced image relative to the original image may be further obtained by using the probability of obtaining the natural standard skin color in the skin color recognition model.
In one embodiment of the present disclosure, determining a skin tone distortion degree of a first enhanced image relative to a first image based on a first skin tone probability and a second skin tone probability comprises:
and calculating joint probability according to the first skin color probability and the second skin color probability, and taking the joint probability as the skin color distortion degree of the first enhanced image relative to the first image.
The first skin tone probability is the probability that the skin tone in the original face image is the natural standard skin tone, the second skin tone probability is the probability that the skin tone in the image after the image enhancement is carried out according to the original face image is the natural standard skin tone, and in order to more intuitively measure the influence of the image enhancement on the skin tone in the face image, the joint probability can be calculated according to the first skin tone probability and the second skin tone probability, and the joint probability is used as the skin tone distortion degree of the enhanced image relative to the original image.
Specifically, the skin tone distortion degree of the first enhanced image with respect to the first image may be obtained by the following formula (8):
wherein y represents the distortion degree of skin color, P Original picture Representing a first skin tone probability, P After reinforcement The second skin tone probability delta is represented as a minimum value and is not actually meaningful, just to avoid calculation errors.
In addition, as the skin color distortion degree represents the distortion degree of the enhanced image relative to the original image, when the distortion degree reaches a certain threshold value, the enhanced image with larger distortion degree can be further screened and deleted so as not to cause discomfort of human eyes.
According to the method and the device, the human face skin color area in the first image is extracted to serve as the first skin color area, the human face skin color area in the first enhanced image is extracted to serve as the second skin color area, so that the overall effect of the image can be evaluated based on the extracted skin color area instead of the whole image area, the probability that the skin colors in the first image and the first enhanced image are natural standard skin colors can be objectively evaluated by inputting the extracted skin color area into a pre-trained skin color recognition model, evaluation efficiency is improved, finally the skin color distortion degree of the first enhanced image relative to the first image is determined by utilizing the first skin color probability and the second skin color probability, and the influence of image enhancement on the skin colors in the human face image is intuitively balanced.
For a better understanding of the present disclosure, in one embodiment of the present disclosure, as shown in fig. 5, another method of image enhancement quality assessment is provided.
Specifically, the first image is an original image comprising a human face, the first enhanced image is an image enhanced according to the original image, the original image and the image enhanced image are respectively input into a human face skin color extraction unit, key points of the human face are extracted, and if the key points exist, the evaluation is continued; if no face key point exists, the evaluation of the image enhancement quality is terminated.
And then connecting specific face key points according to the points (37, 32, 49 and 46, 36 and 55) in fig. 2 in the corresponding areas in the first image and the first enhanced image to determine a first skin color area and a second skin color area, wherein it can be understood that the area is selected as the skin color area instead of the whole face as the skin color area, because the area is flat, the influence of illumination and five sense organs is reduced, and the recognition accuracy can be improved.
After skin color areas are determined, respectively extracting pixel average values in the first skin color area and the second skin color area, and converting a pixel parameter value rgb into a chromaticity parameter value YCbCr by using a color gamut conversion formula in a formula (1), wherein the difference of the skin colors of different human faces on a luminance component Y is larger, but the difference of the skin colors of different human faces on chromaticity components Cb and Cr is more concentrated; to avoid the influence of different person proportions, the luminance component Y may be truncated to be compatible with recognizing faces of various skin colors.
And inputting the chromaticity component into a pre-trained skin color recognition model to output the probability of the current skin color region to be recognized as a natural skin color region. Namely, inputting a first chrominance component in a first skin color area into a skin color recognition model to output a first skin color probability corresponding to the first skin color area, and inputting a second chrominance component in a second skin color area into the skin color recognition model to output a second skin color probability corresponding to the second skin color area.
In order to more intuitively measure the influence of image enhancement on skin colors in a face image, joint probabilities can be calculated according to the first skin color probability and the second skin color probability, and the joint probabilities are used as skin color distortion degrees of the enhanced image relative to the original image.
It should be noted that, as the evaluation image increases, the skin tone value of the evaluation image may also be added to the skin tone data set to update the skin tone data set. By continuously updating the skin tone dataset, the constructed skin tone recognition model may be made more accurate.
The embodiment of the present disclosure provides an image enhancement quality evaluation apparatus, as shown in fig. 6, the image evaluation apparatus 60 may include: an acquisition module 601, an extraction module 602, a first determination module 603, and a second determination module 604, wherein,
An acquiring module 601, configured to acquire a first image and a first enhanced image obtained by performing image enhancement processing on the first image;
an extraction module 602, configured to extract a skin color region of a face in the first image as a first skin color region, and extract a skin color region of a face in the first enhanced image as a second skin color region;
a first determining module 603, configured to determine, by using a pre-trained skin tone recognition model, a skin tone probability corresponding to a first skin tone region as a first skin tone probability, and determine, by using a skin tone recognition model, a skin tone probability corresponding to a second skin tone region as a second skin tone probability, where the skin tone recognition model is configured to recognize that the skin tone region is a probability of a standard natural skin tone;
the second determining module 604 is configured to determine a skin tone distortion degree of the first enhanced image relative to the first image according to the first skin tone probability and the second skin tone probability.
The image enhancement quality evaluation device of the present embodiment may perform the image enhancement quality evaluation method shown in the foregoing embodiment of the present disclosure, and the implementation principle is similar, and will not be described here again.
According to the method and the device, the human face skin color area in the first image is extracted to serve as the first skin color area, the human face skin color area in the first enhanced image is extracted to serve as the second skin color area, so that the overall effect of the image can be evaluated based on the extracted skin color area instead of the whole image area, the probability that the skin colors in the first image and the first enhanced image are natural standard skin colors can be objectively evaluated by inputting the extracted skin color area into a pre-trained skin color recognition model, evaluation efficiency is improved, finally the skin color distortion degree of the first enhanced image relative to the first image is determined by utilizing the first skin color probability and the second skin color probability, and the influence of image enhancement on the skin colors in the human face image is intuitively balanced.
Referring now to fig. 7, a schematic diagram of an electronic device 700 suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 7 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
An electronic device includes: a memory and a processor, where the processor may be referred to as a processing device 701 described below, the memory may include at least one of a Read Only Memory (ROM) 702, a Random Access Memory (RAM) 703, and a storage device 708 described below, as follows:
as shown in fig. 7, the electronic device 700 may include a processing means (e.g., a central processor, a graphics processor, etc.) 701, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage means 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
In general, the following devices may be connected to the I/O interface 705: input devices 707 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, and the like; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 shows an electronic device 700 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communication device 709, or installed from storage 708, or installed from ROM 702. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 701.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but 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 of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-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 computer readable signal medium may also be any computer readable medium that is not a computer 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 a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to:
acquiring a first image and a first enhanced image obtained by performing image enhancement processing on the first image;
extracting a human face skin color region in the first image as a first skin color region, and extracting a human face skin color region in the first enhanced image as a second skin color region;
Determining skin color probability corresponding to a first skin color region as first skin color probability and skin color probability corresponding to a second skin color region as second skin color probability through a pre-trained skin color recognition model, wherein the skin color recognition model is used for recognizing the probability that the skin color region is standard natural skin color;
and determining the skin tone distortion degree of the first enhanced image relative to the first image according to the first skin tone probability and the second skin tone probability.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules or units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Where the name of a module or unit does not in some cases constitute a limitation of the unit itself.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, there is provided an image enhancement quality evaluation method including:
acquiring a first image and a first enhanced image obtained by performing image enhancement processing on the first image;
extracting a human face skin color region in the first image as a first skin color region, and extracting a human face skin color region in the first enhanced image as a second skin color region;
determining skin color probability corresponding to a first skin color region as first skin color probability and skin color probability corresponding to a second skin color region as second skin color probability through a pre-trained skin color recognition model, wherein the skin color recognition model is used for recognizing the probability that the skin color region is standard natural skin color;
and determining the skin tone distortion degree of the first enhanced image relative to the first image according to the first skin tone probability and the second skin tone probability.
In one embodiment of the present disclosure, extracting a face skin tone region in a first image as a first skin tone region and extracting a face skin tone region in a first enhanced image as a second skin tone region includes:
detecting a face key point area in a first image as a first face key point area, and extracting a face triangular area from the first face key point area as a first skin color area according to the position points of the preset face triangular area;
And detecting a face key point area in the first enhanced image as a second face key point area, and extracting a face triangular area from the second face key point area as a second skin color area according to the position points of the preset face triangular area.
In one embodiment of the present disclosure, the face triangle area is extracted by:
extracting a left face triangular region and/or a right face triangular region from a face key point region of a face triangular region to be extracted;
when only the left face triangle area is extracted, the extracted left face triangle area is used as a face triangle area;
when only the right face triangle area is extracted, the extracted right face triangle area is used as a human face triangle area;
when the left face triangle area and the right face triangle area are extracted, carrying out mean processing on pixels of the extracted left face triangle area and right face triangle area, and taking the area obtained after the mean processing as a face triangle area.
In one embodiment of the present disclosure, face keypoints in an image are extracted by:
and inputting the image of the face key points to be extracted into a pre-trained face key point detection model, and obtaining 68 face key points output by the face key point model.
In one embodiment of the present disclosure, the skin tone probability corresponding to a skin tone region is determined by:
and determining the chromaticity component of the skin color region to be identified, inputting the chromaticity component into a skin color identification model, and acquiring the skin color probability of the skin color identification model based on the chromaticity component.
In one embodiment of the present disclosure, determining a skin tone distortion degree of a first enhanced image relative to a first image based on a first skin tone probability and a second skin tone probability comprises:
and calculating joint probability according to the first skin color probability and the second skin color probability, and taking the joint probability as the skin color distortion degree of the first enhanced image relative to the first image.
In one embodiment of the present disclosure, the process of constructing the skin tone recognition model includes:
acquiring a preset face image data set, and extracting a skin color data set corresponding to the preset face image data set;
calculating based on the skin color data set to obtain skin color parameters, wherein the skin color parameters comprise a chromaticity mean value, a chromaticity standard deviation and a chromaticity covariance;
training the Gaussian mixture model by using skin color parameters to obtain a skin color recognition model.
According to one or more embodiments of the present disclosure, there is provided an image enhancement quality evaluation apparatus including:
The acquisition module is used for acquiring a first image and a first enhanced image obtained by performing image enhancement processing on the first image;
the extraction module is used for extracting a human face skin color region in the first image to be used as a first skin color region and extracting a human face skin color region in the first enhanced image to be used as a second skin color region;
the first determining module is used for determining skin color probability corresponding to a first skin color region as first skin color probability and determining skin color probability corresponding to a second skin color region as second skin color probability through a pre-trained skin color recognition model, wherein the skin color recognition model is used for recognizing the probability that the skin color region is standard natural skin color;
and the second determining module is used for determining the skin tone distortion degree of the first enhanced image relative to the first image according to the first skin tone probability and the second skin tone probability.
In one embodiment of the present disclosure, the extraction module includes:
the first extraction submodule is used for detecting a face key point area in the first image as a first face key point area, and extracting a face triangular area from the first face key point area as a first skin color area according to the position point of the preset face triangular area;
the second extraction sub-module is used for detecting a face key point area in the first enhanced image as a second face key point area, and extracting a face triangle area from the second face key point area as a second skin color area according to the position points of the preset face triangle area.
In one embodiment of the present disclosure, the face triangle area is extracted by:
extracting a left face triangular region and/or a right face triangular region from a face key point region of a face triangular region to be extracted;
when only the left face triangle area is extracted, the extracted left face triangle area is used as a face triangle area;
when only the right face triangle area is extracted, the extracted right face triangle area is used as a human face triangle area;
when the left face triangle area and the right face triangle area are extracted, carrying out mean processing on pixels of the extracted left face triangle area and right face triangle area, and taking the area obtained after the mean processing as a face triangle area.
In one embodiment of the present disclosure, face keypoints in an image are extracted by:
and inputting the image of the face key points to be extracted into a pre-trained face key point detection model, and obtaining 68 face key points output by the face key point model.
In one embodiment of the present disclosure, the first determining module includes:
the first obtaining submodule is used for determining the chromaticity component of the skin color region to be identified, inputting the chromaticity component into the skin color identification model and obtaining the skin color probability of the skin color identification model based on the chromaticity component.
In one embodiment of the present disclosure, the second determining module includes:
and the determining submodule is used for calculating joint probability according to the first skin color probability and the second skin color probability, and determining the joint probability as the skin color distortion degree of the first enhanced image relative to the first image.
In one embodiment of the present disclosure, the image enhancement quality evaluation device further includes a construction module of a skin color recognition model, specifically including:
the second acquisition sub-module is used for acquiring a preset face image data set and extracting a skin color data set corresponding to the preset face image data set;
the calculation sub-module is used for calculating based on the skin color data set to obtain skin color parameters, wherein the skin color parameters comprise a chromaticity mean value, a chromaticity standard deviation and a chromaticity covariance;
and the training submodule is used for training the Gaussian mixture model by utilizing skin color parameters to obtain a skin color recognition model.
According to one or more embodiments of the present disclosure, there is provided an electronic device including:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in memory and configured to be executed by one or more processors, the one or more applications configured to perform the image enhancement quality assessment method of the first aspect of the present disclosure.
According to one or more embodiments of the present disclosure, there is provided a storage medium having stored thereon a computer program which, when executed by a processor, implements the image enhancement quality evaluation method of the first aspect of the present disclosure.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.