A method for enhancing an uneven illumination face image using illumination prior
By utilizing edge-reserved joint bilateral filtering and logarithmic image processing in the HSV space, the noise amplification and inaccurate illumination of face images are solved, and the natural image enhancement effect is achieved, and the accuracy of face recognition is improved.
Patent Information
- Application Number
- CN202110148142.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-03
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2041-02-03
AI Technical Summary
When processing face images with uneven illumination, the prior art has problems such as noise amplification and inaccurate illumination estimation, resulting in a decrease in the accuracy of face recognition.
Using a method based on Retinex theory, the color space is transformed into the HSV space, and the illuminance image is estimated using the joint bilateral filtering retained by the edge, and the illuminance adjustment factor is calculated based on the brightness range under normal illumination, the brightness of the reflected image is stretched, and the logarithmic image processing is performed to obtain a natural enhancement effect.
The face image enhancement with uniform illumination is achieved, the face recognition accuracy is improved, color distortion, halo phenomenon and excessive enhancement are avoided, and the image is maintained.
Smart Images

Figure CN113850727B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to image processing, and more particularly, to a method and apparatus for enhancing a face image. Background Art
[0002] A face image is an important symbol for human authentication and also an important material for face recognition applications. However, face pictures taken under different illuminations, especially those taken in low-light conditions, often hide or lose some face information, resulting in a decrease in the accuracy of face recognition. Therefore, many preprocessing techniques for face images have emerged. For a face image that is overall dark, a normal-brightness face image can be obtained by simply using a histogram equalization algorithm or gamma correction. However, in real life, most of the face images we obtain have uneven illuminance. Enhancing such images is relatively complex because uniformly stretching the brightness of the image will cause overexposure of the face parts that are originally of normal brightness. For this reason, many scholars have proposed methods based on the Retinex theory, which decompose the image into an illumination image and a reflectance image, and enhance the brightness of the face image by adjusting the estimated brightness of the illumination image. However, it is often impossible to accurately estimate the true illumination, and there is no unified standard for the amplitude of the illumination adjustment. As a result, although the brightness of the enhanced face is increased, the noise is also amplified, which in turn affects the accuracy of face recognition.
[0003] Chinese Patent Application CN106056076A discloses a method for determining the illumination invariant of a face image under complex illumination. In order to improve the face recognition rate, a method for extracting a more robust illumination invariant is proposed. Based on the study of the classical Lambert model, starting from the imaging principle of the image, the illumination of the face image is estimated. By analyzing the Lambert model, two illumination estimation models are designed, and finally the illumination invariant is deduced. This method can effectively eliminate the illumination difference of the original image, and the numerical range of the illumination invariant R is between 0 and 1, which is consistent with the numerical range of the face eigen. However, for the regions with strong light and dark changes in the face part, there are still obvious boundaries in the deduced illumination invariant. Such an image will obviously interfere with the recognition accuracy when used for face recognition.
[0004] Chinese Patent Application CN108647620A discloses a method for illumination normalization of Weber face based on gamma transformation. First, a linear transformation is performed on the face image, then a gamma transformation is performed on the linearly transformed image. Next, the gamma-transformed image is differentiated using a Gaussian function, the differentiated image is subjected to neighborhood integration, and the integral result image is normalized to obtain the final illumination-normalized image. The illumination normalization method of Weber face based on gamma transformation provided by the invention makes the hypothesis conditions more perfect and universal through gamma transformation, and the obtained result has a good illumination normalization effect. However, for regions with strong face illumination changes, the edges of the illumination changes are amplified due to differentiation and then integration, and the amplification of the edges in this non-contour region will obviously affect the face recognition effect.
[0005] One of the above two patent applications is to remove illumination to obtain illumination invariants, and the other is to normalize illumination. Both are aimed at obtaining face images that are not affected by non-uniform illumination, so as to improve the accuracy of face recognition. However, both of these two patents have the same problem, that is, there are still obvious dividing lines in the regions with strong face illumination changes after processing. The patent application "A method for determining illumination invariants of complex illumination face images (CN106056076A)" eliminates the illumination differences in the original image, but ignores the regions with strong illumination changes. The patent application "A method for illumination normalization of Weber face based on gamma transformation (CN108647620A)" amplifies the edges with strong illumination changes due to the operations of differentiating and then integrating the image.
[0006] Accordingly, there is a need in the art for improved techniques for enhancing face images with uneven contrast. Summary of the Invention
[0007] The present invention content is provided to introduce in a simplified form some concepts that will be further described in the following detailed embodiments. The present invention content is not intended to identify the key features or essential features of the claimed subject matter, nor is it intended to be used to help determine the scope of the claimed subject matter.
[0008] In view of the defects in the prior art described above, the purpose of the present invention is to overcome the problems of serious noise amplification and inaccurate illumination estimation in the existing face image enhancement technologies.
[0009] According to a first aspect of the present invention, there is provided a method for enhancing a face image, the method may include: obtaining a face image; performing a color space transformation on the face image to convert the face image from a red-green-blue (RGB) color space to a hue-saturation-value (HSV) color space, wherein the face image in the HSV color space includes a hue channel image, a saturation channel image, and a value channel image; performing edge-preserving joint bilateral filtering on the value channel image to estimate an illumination image; statistically calculating a first brightness range of the face image under normal illumination; determining a second brightness range of the face region in the value channel image; calculating an illumination adjustment factor based on the first brightness range and the second brightness range; obtaining a reflection image based on the value channel image, the illumination image, and the illumination adjustment factor; stretching the brightness of the reflection image to obtain an enhanced value channel image; and combining the enhanced value channel image with the hue channel image and the saturation channel image, and then converting to the RGB color space to obtain a finally enhanced face image.
[0010] According to a second aspect of the present invention, there is provided an apparatus for enhancing a face image, the apparatus may include: a memory; and a processor coupled to the memory, wherein the processor is configured to: obtain a face image; perform a color space transformation on the face image to convert the face image from an RGB color space to an HSV color space, wherein the face image in the HSV color space includes a hue channel image, a saturation channel image, and a value channel image; perform edge-preserving joint bilateral filtering on the value channel image to estimate an illumination image; statistically calculate a first brightness range of the face image under normal illumination; determine a second brightness range of the face region in the value channel image; calculate an illumination adjustment factor based on the first brightness range and the second brightness range; obtain a reflection image based on the value channel image, the illumination image, and the illumination adjustment factor; stretch the brightness of the reflection image to obtain an enhanced value channel image; and combine the enhanced value channel image with the hue channel image and the saturation channel image, and then convert to the RGB color space to obtain a finally enhanced face image.
[0011] According to a third aspect of the present invention, there is provided an apparatus for enhancing a face image, the apparatus may include: a face image acquisition module configured to acquire a face image; a color space transformation module configured to perform a color space transformation on the face image to convert the face image from a Red-Green-Blue (RGB) color space to a Hue-Saturation-Value (HSV) color space, wherein the face image in the HSV color space includes a hue channel image, a saturation channel image, and a value channel image; an illuminance image estimation module configured to perform edge-preserving joint bilateral filtering on the value channel image to estimate an illuminance image; an illuminance adjustment factor calculation module configured to statistically calculate a first luminance range of the face image under normal illumination, determine a second luminance range of the face region in the value channel image, and calculate an illuminance adjustment factor based on the first luminance range and the second luminance range; a reflection image acquisition module configured to acquire a reflection image based on the value channel image, the illuminance image, and the illuminance adjustment factor; and a reflection image luminance boosting module configured to boost the luminance of the reflection image to obtain an enhanced value channel image; wherein the color space transformation module is further configured to combine the enhanced value channel image with the hue channel image and the saturation channel image, and then convert it to the RGB color space to obtain a finally enhanced face image.
[0012] According to a fourth aspect of the present invention, there is provided a computer-readable medium storing a computer program, which when executed by a processor, executes the method of the present invention.
[0013] By adopting the technical solution provided by the present invention, a face image with uniform illuminance can be obtained, thereby improving the accuracy of face recognition.
[0014] By reading the following detailed description and referring to the associated drawings, these and other features and advantages will become apparent. It should be understood that the foregoing general description and the following detailed description are illustrative only and do not limit the various aspects claimed. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to understand in detail the manner in which the above-described features of the present invention are used, the above briefly summarized content may be described in more detail with reference to the various embodiments, some of which are illustrated in the drawings. However, it should be noted that the drawings only illustrate some typical aspects of the present invention and should not be considered to limit its scope, as the description may admit other equally effective aspects.
[0016] Figure 1 A flowchart of a method for enhancing a face image according to an embodiment of the present invention is illustrated.
[0017] Figure 2 An application effect diagram according to an embodiment of the present invention is illustrated.
[0018] Figure 3 The block diagram of a device for enhancing a face image according to an embodiment of the present invention is illustrated.
[0019] Figure 4 The block diagram of a device for enhancing a face image according to an embodiment of the present invention is illustrated. Detailed implementation manners
[0020] The present invention will be described in detail below with reference to the accompanying drawings, and the features of the present invention will be further revealed in the following detailed description.
[0021] In order to overcome the problems of serious noise amplification and inaccurate illumination estimation in the existing face image enhancement technology, the present invention proposes an illumination-uneven face image enhancement algorithm based on the Retinex theory using illumination prior. According to the Retinex theory, the illumination image is estimated by using the method of joint bilateral filtering. Then, the illumination information of existing face images with normal illumination is statistically analyzed, and combined with the part of the face image with normal illumination as a reference to adjust the brightness of the estimated illumination image. Finally, the reflectance image is calculated using the Retinex model. In order to obtain a more natural face image, the present invention uses the logarithmic image processing subtraction model to compensate for the illumination of the reflectance component, thereby obtaining an illumination-uniform face image. The present invention also processes the reflectance image using the logarithmic image processing model to give a certain amount of illumination to the reflectance image to enhance the naturalness of the image.
[0022] Figure 1 The flowchart of a method 100 for enhancing a face image according to an embodiment of the present invention is illustrated. In some examples, the method 100 may be performed by Figure 3 the device 300 illustrated in Figure 4 and / or the device 400 illustrated in
[0023] In block 110, the method 100 may include obtaining a face image. In one example, the face image may be directly provided by a camera that captures a face. In another example, the face image captured by the camera may be first stored in a storage device and then read from the storage device when needed. In yet another example, a specific face to be recognized may be extracted from an image including multiple faces. Generally, the face region should occupy the central region of the face image and most of the face image. Therefore, it is also conceivable to adjust the obtained face image so that the face region is located in the central region of the face image and occupies most of the face image. Due to uneven illumination, the obtained face image often appears darker in some regions, which may affect the accuracy of face recognition.
[0024] At block 120, method 100 may include performing a color space transformation on a face image to convert the face image from the red-green-blue (RGB) color space to the hue-saturation-value (HSV) color space. The face image in the HSV color space includes a hue channel image H, a saturation channel image S, and a value channel image V. The mutual conversion between the RGB color space and the HSV color space is known. For example, the face image can be converted from the RGB color space to the HSV color space by the following formula:
[0025] max = max(R, G, B)
[0026] min = min(R, G, B)
[0027]
[0028]
[0029] V = max
[0030] In the present invention, only the value channel image V is processed without changing the hue channel image H and the saturation channel image S to avoid color distortion problems in the enhancement result.
[0031] At block 130, method 100 may include performing edge-preserving joint bilateral filtering on the value channel image V to estimate an illumination image L. According to the Retinex model, the original image can be regarded as composed of a reflection component and an illumination component. The reflection component represents the reflection property of an object, and its characteristics depend on the essential attributes of the object. The illumination component appears as a low-frequency component in the frequency domain. Generally, traditional Retinex image enhancement algorithms remove the illumination component from the original image and only retain the reflection component as the enhancement result. Therefore, accurately estimating the illumination component is crucial. In an embodiment of the present invention, performing edge-preserving joint bilateral filtering on the value channel image V to estimate the illumination image L may include: using the maximum illumination within a specific image block (e.g., a 7×7 image block) as the local illumination to estimate an initial illumination image L0; and performing joint bilateral filtering with the value channel image V as a guide to estimate the illumination image L.
[0032] In the present invention, edge-preserving joint bilateral filtering is implemented by filtering an input image with a guiding image, and its formula is:
[0033]
[0034]
[0035] where p is the center point of the local neighborhood Ω, q is any pixel point in the neighborhood, and W pis the normalization factor, p-q is the Euclidean distance between pixel points p and q, and f(||p-q||) represents the spatial distance weight. and are the grayscale values corresponding to the positions of pixels p and q in the guidance image respectively, is the pixel difference, represents the grayscale distance weight, and f(x) and g(x) represent Gaussian functions. The present invention adjusts the calculation method of the guidance image, and its calculation method is:
[0036]
[0037] where (x,y) is a point in the neighborhood Ω, the neighborhood block size is 15×15, L(x,y) is the guidance image pixel value, V(x,y) is the pixel value of the V channel of the original image, and T takes the value of 20.
[0038] In block 140, method 100 may include statistically analyzing a first brightness range of a face image under normal illumination, determining a second brightness range of a face area in the brightness channel image V, and calculating an illuminance adjustment factor w based on the first brightness range and the second brightness range.
[0039] In the present invention, statistically analyzing the first brightness range of a face image under normal illumination means: for a face image taken outdoors without occlusion and with uniform illumination, statistically analyzing the brightness range of the face in such an image as a lighting prior. To this end, superpixel segmentation can be performed on the face image taken under uniform illumination. Assuming that the face area is in the central area of the image, for example, the area of the middle three-quarters of the image (one-eighth from the top, bottom, left, and right of the image) is used as the face area, and the brightness mean of each pixel block in the face area is calculated. For example, the size of the face image can be unified to 200x200px, and the size of each pixel block is 25x25px. Subsequently, the first mean I min of the minimum brightness block and the second mean I max of the maximum brightness block are used as the first brightness range (I min ~I max ).
[0040] In addition, superpixel segmentation can be performed on the brightness channel image V to statistically analyze the second brightness range therein. Similarly, the brightness mean of each pixel block in the face area is calculated. The size of each pixel block can be 25x25px. The pixel blocks with brightness means within the first brightness range (I min ~I max ) are taken out and the first median V bright of the brightness means of these pixel blocks is recorded (i.e., the median of the brightness means of each pixel block located in the bright area). Next, record the brightness means that are not within the first brightness range (Imin ~I max ) the second median value V of the luminance means of the respective pixel blocks within dark (i.e., the median of the luminance means of the respective pixel blocks located within the dark region). Then, the first median value V bright and the second median value V dark are used as the second luminance range (V dark ~V bright ).
[0041] After determining the first luminance range (I min ~I max ) and the second luminance range (V dark ~V bright ), the illuminance adjustment factor w can be calculated to compress the illuminance of the bright region of the face and enhance the illuminance of the dark region of the face. In the present invention, the illuminance adjustment factor is set based on the just noticeable difference (JND) visual threshold (T JND ). The range of the illuminance adjustment factor is restricted by the first luminance range (I min ~I max ) and the second luminance range (V dark ~V bright ), and its calculation formula is as follows:
[0042]
[0043] where T JND is the just noticeable difference visual threshold proposed in the existing literature, and its calculation method is:
[0044]
[0045] where l is the luminance.
[0046] At block 150, method 100 may include obtaining a reflection image R based on the luminance channel image V, the illuminance image L, and the illuminance adjustment factor w. According to the improved center surround Retinex model, the adjusted illuminance image L can be removed from the original image to obtain the reflection image R, and its calculation formula is:
[0047] log(R) = log(V) - w·log(L).
[0048] At block 160, method 100 may include stretching the luminance of the reflected image R to obtain an enhanced luminance channel image E. The luminance of the reflected image obtained at block 150 is compressed within a smaller luminance range. To stretch its luminance, a logarithmic image processing subtraction model can be used to simulate illumination. First, the pixel luminances of the reflected image are sorted in ascending order. Since the luminance of the reflected image is compressed within a smaller range, to eliminate the influence of a very small number of discrete bright points in the reflected image, the maximum luminance value among the top 99% of the sorted pixels is taken as the parameter C of the logarithmic image processing subtraction model. For example, assume the sorted pixel luminance values are: {0, 1, 2, 2, 2, 3, 4, 5, 10, 10, 12, 13, 14, 14, …, 20, 21, 21, 25, 100, 200}, a total of 200 pixels, and the pixel values are mainly concentrated in the range of 0 to 25, with very few values exceeding 25, then 25 is taken as the parameter C. Subsequently, the logarithmic image processing subtraction model can be used to obtain the enhanced luminance channel image E through the following formula:
[0049]
[0050] where E represents the enhanced luminance channel image, R represents the reflected image, and C represents the parameter of the logarithmic image processing subtraction model.
[0051] At block 170, method 100 may include combining the enhanced luminance channel image E with the hue channel image H and the saturation channel image S, and then converting to the RGB color space to obtain a finally enhanced face image. That is, first, the enhanced luminance channel image E replaces the original luminance channel image V, and then it is combined with the hue channel image H and the saturation channel image S in the HSV color space obtained at block 120, and is converted to the RGB color space through the known conversion formula from the HSV color space to the RGB color space, thereby obtaining the finally enhanced face image.
[0052] Compared with the prior art, the significant advantages of the present invention are mainly manifested as follows:
[0053] (1) There is no color distortion. The present invention converts the face image from the RGB space to the HSV space, only performs luminance processing on the V channel, does not affect its hue and saturation, and then converts back to the RGB color space after adjusting the luminance of the V channel;
[0054] (2) There is no halo phenomenon. The illumination is estimated by edge-preserving joint bilateral filtering, including initial illumination estimation and final illumination estimation. The obtained illumination image is smooth enough in non-edge regions, and the edge details are preserved. The calculated reflected image has more details and there is no halo at the edges;
[0055] (3) Without over-enhancement, the present invention combines the brightness range of a face under normal illumination and the brightness of the bright regions of the face to adjust the illuminance component, rather than adjusting the brightness of the illuminance image without reference and without limitation. As a result, there is no noise amplification in the dark regions and no overexposure in the bright regions.
[0056] (4) There is no amplification of the edges with strong illumination changes, and the regions with strong illumination changes in the face image are enhanced to be smoother, without obvious contour phenomena.
[0057] (5) The result of enhancing the face image is more natural because logarithmic image processing is performed on the estimated reflection image to subtract and stretch its contrast. On the one hand, its brightness is enhanced, and on the other hand, the reflection image is given illuminance compensation, making the enhancement result more natural.
[0058] Figure 2 Illustrated is the application effect diagram 200 according to an embodiment of the present invention. Figure 2 The first row of images in [diagram] is the original face image with uneven illumination. Figure 2 The second row of images in [diagram] is the face image obtained after enhancing the original face image by using the method 100 according to the present invention. It can be seen that after using the method 100, the enhancement effect of the face image is very natural, without color distortion, without halo phenomena, without over-enhancement, and without amplification of the edges with strong illumination changes.
[0059] Figure 3 Illustrated is the block diagram of the device 300 for enhancing a face image according to an exemplary embodiment of the present invention. All functional blocks of the device 300 (including various units or modules in the device 300, whether shown in the drawings or not) can be implemented by hardware, software, or a combination of hardware and software to execute the principles of the present invention. Those skilled in the art should understand that Figure 3 the functional blocks described in [diagram] can be combined or divided into sub-blocks to implement the principles of the present invention as described above. Therefore, the descriptions herein can support any possible combination, division, or further definition of the functional blocks described herein.
[0060] As Figure 3As shown, according to an exemplary embodiment of the present invention, the apparatus 300 may include a plurality of modules coupled to each other via a bus 305, where the plurality of modules may include: a face image acquisition module 310 configured to acquire a face image; a color space transformation module 320 configured to perform a color space transformation on the face image to convert the face image from the red-green-blue (RGB) color space to the hue-saturation-value (HSV) color space, and the face image in the HSV color space includes a hue channel image, a saturation channel image, and a value channel image; an illuminance image estimation module 330 configured to perform edge-preserving joint bilateral filtering on the value channel image to estimate an illuminance image; an illuminance adjustment factor calculation module 340 configured to statistically determine a first luminance range of the face image under normal illumination, determine a second luminance range of the face region in the value channel image, and calculate an illuminance adjustment factor based on the first luminance range and the second luminance range; a reflection image acquisition module 350 configured to acquire a reflection image based on the value channel image, the illuminance image, and the illuminance adjustment factor; and a reflection image luminance boosting module 360 configured to boost the luminance of the reflection image to obtain an enhanced value channel image; where the color space transformation module 320 is further configured to combine the enhanced value channel image with the hue channel image and the saturation channel image, and then convert it to the RGB color space to obtain a finally enhanced face image.
[0061] Figure 4 FIG. shows a block diagram of an example of a hardware implementation of an apparatus 400 for enhancing a face image according to an embodiment of the present invention. The apparatus 400 may be implemented using a processing system 414 that includes one or more processors 404. Examples of the processor 404 include a microprocessor, a microcontroller, a digital signal processor (DSP), a field programmable gate array (FPGA), a programmable logic device (PLD), a state machine, gated logic, discrete hardware circuits, and other suitable hardware configured to perform the various functions described throughout the present disclosure. In various examples, the apparatus 400 may be configured to perform any one or more of the functions described herein. That is, the processor 404 utilized in the apparatus 400 may be used to implement the method 100 described above with reference to Figure 1 described.
[0062] In this example, the processing system 414 can be implemented to have a bus architecture generally represented by bus 402. Depending on the specific application and overall design constraints of the processing system 414, bus 402 can include any number of interconnected buses and bridges. Bus 402 communicatively couples various circuits of one or more processors (generally represented by processor 404), a memory 405, and a computer-readable medium (generally represented by computer-readable medium 406) together. Bus 402 can also link various other circuits, such as a timing source, peripherals, a voltage regulator, and a power management circuit, which are well known in the art and thus will not be described further. Bus interface 408 provides an interface between bus 402 and transceiver 410. Transceiver 410 provides a communication interface or means for communicating with various other devices over a transmission medium. Depending on the characteristics of the device, a user interface 412 (e.g., keypad, display, speaker, microphone, joystick) can also be provided. Of course, such a user interface 412 is optional and can be omitted in some examples.
[0063] In some aspects, the processor 404 can be configured to: obtain a face image; perform a color space transformation on the face image to convert the face image from the red-green-blue (RGB) color space to the hue-saturation-value (HSV) color space, where the face image in the HSV color space includes a hue channel image, a saturation channel image, and a value channel image; perform edge-preserving joint bilateral filtering on the value channel image to estimate an illumination image; statistically calculate a first brightness range of the face image under normal illumination; determine a second brightness range of the face region in the value channel image; calculate an illumination adjustment factor based on the first brightness range and the second brightness range; obtain a reflection image based on the value channel image, the illumination image, and the illumination adjustment factor; stretch the brightness of the reflection image to obtain an enhanced value channel image; and combine the enhanced value channel image with the hue channel image and the saturation channel image, and then convert it back to the RGB color space to obtain a final enhanced face image.
[0064] The processor 404 is responsible for managing bus 402 and general processing, including the execution of software stored on computer-readable medium 406. When executed by the processor 404, the software causes the processing system 414 to perform various functions described for any particular device. Computer-readable medium 406 and memory 405 can also be used to store data manipulated by the processor 404 when executing the software.
[0065] One or more processors 404 in the processing system may execute software. Software should be broadly construed to mean instructions, instruction sets, code, code segments, program code, programs, subprograms, software modules, applications, software applications, software packages, routines, subroutines, objects, executables, threads of execution, procedures, functions, etc., whether referred to in software, firmware, middleware, microcode, hardware description language, or other terms. The software may reside on a computer-readable medium 406. The computer-readable medium 406 may be a non-transitory computer-readable medium. By way of example, non-transitory computer-readable media include magnetic storage devices (e.g., hard disks, floppy disks, magnetic tape), optical disks (e.g., compact disc (CD) or digital versatile disc (DVD)), smart cards, flash memory devices (e.g., cards, sticks, or key drives), random access memory (RAM), read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), registers, removable disks, and any other suitable medium for storing software and / or instructions that can be accessed and read by a computer. The computer-readable medium 406 may reside within the processing system 414, outside the processing system 414, or be distributed across multiple entities including the processing system 414. The computer-readable medium 406 may be embodied in a computer program product. By way of example, a computer program product may include the computer-readable medium in a package material. Those skilled in the art will recognize how best to implement the described functionality presented throughout this disclosure depending on the particular application and overall design constraints imposed on the overall system.
[0066] In one or more examples, the computer-readable storage medium 406 may include software configured for various functions, including for example functions for enhancing a face image. The software may include instructions that may configure the processing system 414 to perform one or more of the functions described with reference to Figure 1 those described.
[0067] In the description of the present invention, it is to be understood that the terms "first", "second", "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0068] Those of ordinary skill in the art should appreciate that the various embodiments of the present invention may be provided as a method, apparatus, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-executable program code stored thereon.
[0069] The present invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus, systems and computer program products according to embodiments of the invention. It will be understood that each flow and / or block of the flowchart illustrations and / or block diagrams, and combinations of flows and / or blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing apparatus to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing apparatus produce means for implementing the functions specified in one or more flows and / or one or more blocks in the flowchart.
[0070] Although aspects of the invention have been described so far with reference to the accompanying drawings, the above methods, systems and devices are merely examples, and the scope of the invention is not limited to these aspects, but is defined only by the appended claims and their equivalents. Various components may be omitted or may also be replaced by equivalent components. In addition, the steps may be implemented in an order different from that described in the present invention. Further, the various components may be combined in various ways. It is also important to note that, as technology develops, many of the components described may be replaced by equivalent components that emerge later. Various modifications to the present disclosure will be apparent to those skilled in the art, and the general principles defined herein may be applied to other variations without departing from the scope of the present disclosure. Thus, the present disclosure is not limited to the examples and designs described herein, but should be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for enhancing a face image, the method comprising: Obtaining a face image; Performing a color space transformation on the face image to convert the face image from a Red-Green-Blue (RGB) color space to a Hue-Saturation-Value (HSV) color space, wherein the face image in the HSV color space includes a hue channel image H, a saturation channel image S, and a value channel image V; Performing edge-preserving joint bilateral filtering on the value channel image V to estimate an illumination image L; Statistically calculating a first brightness range of face images under normal illumination; Determining a second brightness range of the face region in the value channel image V; Calculating an illumination adjustment factor w based on the first brightness range and the second brightness range; Obtaining a reflection image R based on the value channel image V, the illumination image L, and the illumination adjustment factor w; Stretching the brightness of the reflection image R to obtain an enhanced value channel image E; And Combining the enhanced value channel image E with the hue channel image H and the saturation channel image S, and then converting to the RGB color space to obtain a finally enhanced face image; Calculating the illumination adjustment factor w based on the first brightness range and the second brightness range includes: Calculating the illumination adjustment factor w by the following formula: where w represents the illumination adjustment factor, V bright represents the first median value, V dark represents the second median value, I min represents the first mean value, I max represents the second mean value, and T JND represents the just noticeable difference visual threshold; Obtaining the reflection image R based on the value channel image V, the illumination image L, and the illumination adjustment factor w includes: Obtaining the reflection image R by the following formula: log(R) = log(V) - w·log(L) where R represents the reflection image, V represents the value channel image, w represents the illumination adjustment factor, and L represents the illumination image.
2. The method according to claim 1, wherein performing edge-preserving joint bilateral filtering on the value channel image V to estimate the illumination image L includes: Using the maximum illumination within a 7×7 image block as the local illumination to estimate an initial illumination image L0; And Performing joint bilateral filtering with the value channel image V as a guide to estimate the illumination image L.
3. The method according to claim 1, wherein statistically calculating the first brightness range of face images under normal illumination includes: Performing superpixel segmentation on face images taken under uniform illumination; Calculating the brightness mean of each pixel block in the face region; And The first mean value I of the minimum luminance pixel block min and the second mean value I of the maximum luminance pixel block max are used as the first luminance range.
4. The method according to claim 3, wherein determining the second brightness range of the face region in the value channel image V includes: Performing superpixel segmentation on the value channel image V; Calculating the brightness mean of each pixel block in the face region; Extract pixel blocks with brightness means within the first brightness range and record the first median V of the brightness means of these pixel blocks bright ; The second median value V of the luminance means of the pixel blocks whose recorded luminance means are not within the first luminance range dark ; And Take the first median value V bright and the second median value V dark as the second luminance range.
5. The method according to claim 1, wherein stretching the brightness of the reflection image R to obtain the enhanced value channel image E includes: Sorting the pixel brightness of the reflection image R in ascending order; Taking the maximum brightness value among the top 99% of the sorted pixels as the parameter C of the logarithmic image processing subtraction model; And Using the logarithmic image processing subtraction model to obtain the enhanced value channel image E by the following formula: Where E represents the enhanced luminance channel image, R represents the reflection image, and C represents the parameters of the logarithmic image processing subtraction model.
6. An apparatus for enhancing a face image, the apparatus comprising: A memory; And A processor coupled to the memory, wherein the processor is configured to: Obtain a face image; Perform a color space transformation on the face image to convert the face image from the red-green-blue RGB color space to the hue-saturation-value HSV color space, and the face image in the HSV color space includes a hue channel image H, a saturation channel image S, and a luminance channel image V; Perform edge-preserving joint bilateral filtering on the luminance channel image V to estimate an illumination image L; Statistically determine a first luminance range of face images under normal illumination; Determine a second luminance range of the face region in the luminance channel image V; Calculate an illumination adjustment factor w based on the first luminance range and the second luminance range; Obtain a reflection image R based on the luminance channel image V, the illumination image L, and the illumination adjustment factor w; Stretch the luminance of the reflection image R to obtain an enhanced luminance channel image E; And Combine the enhanced luminance channel image E with the hue channel image H and the saturation channel image S, and then convert to the RGB color space to obtain a finally enhanced face image; Calculating the illumination adjustment factor w based on the first luminance range and the second luminance range includes: Calculating the illumination adjustment factor w by the following formula: where w represents the illumination adjustment factor, V bright represents the first median, V dark represents the second median, I min represents the first mean, I max represents the second mean, and T JND represents the just-noticeable difference visual threshold; Obtaining the reflection image R based on the luminance channel image V, the illumination image L, and the illumination adjustment factor w includes: Obtaining the reflection image R by the following formula: log(R) = log(V) - w·log(L) Where R represents the reflection image, V represents the luminance channel image, w represents the illumination adjustment factor, and L represents the illumination image.
7. An apparatus for enhancing a face image, the apparatus comprising: A face image acquisition module configured to obtain a face image; A color space transformation module configured to perform a color space transformation on the face image to convert the face image from the red-green-blue RGB color space to the hue-saturation-value HSV color space, and the face image in the HSV color space includes a hue channel image H, a saturation channel image S, and a luminance channel image V; An illumination image estimation module configured to perform edge-preserving joint bilateral filtering on the luminance channel image V to estimate an illumination image L; An illumination adjustment factor calculation module configured to statistically determine a first luminance range of face images under normal illumination, determine a second luminance range of the face region in the luminance channel image V, and calculate an illumination adjustment factor w based on the first luminance range and the second luminance range; A reflection image acquisition module configured to obtain a reflection image R based on the luminance channel image V, the illumination image L, and the illumination adjustment factor w; And A reflected image brightness boosting module configured to boost the brightness of the reflected image R to obtain an enhanced luminance channel image E; wherein the color space transformation module is further configured to combine the enhanced luminance channel image E with the hue channel image H and the saturation channel image S, and then transform to the RGB color space to obtain a finally enhanced face image; Calculating the illuminance adjustment factor w based on the first luminance range and the second luminance range includes: Calculating the illuminance adjustment factor w by the following formula: where w represents the illuminance adjustment factor, V bright represents the first median, V dark represents the second median, I min represents the first mean, I max represents the second mean, and T JND represents the just noticeable difference visual threshold; Obtaining the reflected image R based on the luminance channel image V, the illuminance image L, and the illuminance adjustment factor w includes: Obtaining the reflected image R by the following formula: log(R) = log(V) - w·log(L) where R represents the reflected image, V represents the luminance channel image, w represents the illuminance adjustment factor, and L represents the illuminance image.
8. A computer-readable medium storing a computer program, the computer program performing the method according to any one of claims 1-5 when executed by a processor.
Citation Information
Patent Citations
Method for determining illumination invariant of complex illumination face image
CN106056076A
Weber human face illumination normalization method based on Gamma transformation
CN108647620A
Underwater image enhancement method in combination with bilateral filtering and Retinex
CN108053374A
Display screen energy saving method
CN108628571A