Shadow Brightening Image Enhancement
20200265563 ยท 2020-08-20
Assignee
Inventors
Cpc classification
G06T5/94
PHYSICS
International classification
Abstract
A shadow brightening method includes receiving, at a memory device, an original input image, a brightening level, and a threshold pixel intensity. If a pixel intensity is greater than the threshold, then the pixel is considered bright. Otherwise, the pixel is shadowed. The method includes calculating a gamma transformation for each pixel. If the pixel intensity is less than or equal to the threshold, then a gamma transformation equal to the received brightening level is applied. If the pixel intensity is greater than the threshold, then the gamma transformation is scaled to decrease with intensity. For each shadowed pixel, the method includes computing a minimum value. It also includes determining the brightening level to be applied, thus creating a gamma map. The method also includes applying the determined brightening level to the shadowed pixels and outputting a shadow-brightened output image.
Claims
1. A shadow brightening method, comprising: receiving, at a memory device, an original input image, a brightening level, and a threshold pixel intensity, wherein if a pixel intensity in the original input image is greater than the threshold pixel intensity, then the pixel intensity is a bright pixel, and wherein if a pixel intensity for a pixel in the original input image is less than or equal to the threshold pixel intensity, then the pixel is a shadowed pixel; calculating, via a processor, a gamma transformation for each said pixel, wherein if the pixel intensity is less than or equal to the threshold pixel intensity, then a gamma transformation value equal to the received brightening level is applied, and wherein if the pixel intensity is greater than the threshold pixel intensity, then a gamma transformation value that is scaled is applied such that the gamma value decreases with intensity; for each said shadowed pixel, computing, via the processor, a minimum of the calculated gamma transformation value and a value of one for each said shadowed pixel; determining, via the processor, the brightening level to be applied, thus creating a gamma map indicating brightening levels to be applied to each said pixel in the original input image; applying, via the processor, the determined brightening level to the shadowed pixels; outputting, via the processor, a shadow-brightened output image.
2. The method of claim 1, wherein the threshold pixel intensity is input by an end user.
3. The method of claim 1, wherein the original input image is a still image.
4. The method of claim 1, wherein the original input image is an image from a video.
5. The method of claim 1, wherein the threshold pixel intensity is predetermined.
6. The method of claim 1, wherein the threshold pixel intensity is based on histogram metrics.
7. The method of claim 1, wherein the brightening level is based on histogram metrics.
8. The method of claim 1, before the calculating step, grouping the pixels into smaller groups of a predetermined number such that the brightening level is not applied to groups of shadowed pixels smaller than the predetermined number.
9. The method of claim 1, wherein the original input image is color image, and the method further comprises the step of: converting the color image to an intensity image.
10. The method of claim 1, wherein the original input image is a monochrome image.
11. A shadow brightening system, comprising: a memory device configured to receive an original input image, a brightening level, and a threshold pixel intensity, wherein if a pixel intensity in the original input image is greater than the threshold pixel intensity, then the pixel intensity is a bright pixel, and wherein if a pixel intensity for a pixel in the original input image is less than or equal to the threshold pixel intensity, then the pixel is a shadowed pixel; a processor configured to: calculate a gamma transformation for each said pixel, wherein if the pixel intensity is less than or equal to the threshold pixel intensity, then a gamma transformation value equal to the received brightening level is applied, and wherein if the pixel intensity is greater than the threshold pixel intensity, then a gamma transformation value that is scaled is applied such that the gamma value decreases with intensity; for each said shadowed pixel, compute a minimum of the calculated gamma transformation value and a value of one for each said shadowed pixel; determine the brightening level to be applied, thus creating a gamma map indicating brightening levels to be applied to each said pixel in the original input image; apply the determined brightening level to the shadowed pixels; output a shadow-brightened output image.
12. The system of claim 11, wherein the original input image is a still image.
13. The system of claim 11, wherein the original input image is an image from a video.
14. The system of claim 11, wherein the threshold pixel intensity is predetermined.
15. The system of claim 11, wherein the threshold pixel intensity is based on histogram metrics.
16. The system of claim 11, wherein the brightening level is based on histogram metrics.
17. The system of claim 11, wherein the original input image is color image, and the processor is further configured to: convert the color image to an intensity image.
18. The system of claim 11, wherein the original input image is a monochrome image.
19. A shadow brightening method, comprising: receiving, at a memory device, an original input image, a brightening level, and a threshold pixel intensity, wherein if a pixel intensity in the original input image is greater than the threshold pixel intensity, then the pixel intensity is a bright pixel, and wherein if a pixel intensity for a pixel in the original input image is less than or equal to the threshold pixel intensity, then the pixel is a shadowed pixel; grouping the pixels into smaller groups of a predetermined number such that the brightening level is not applied to groups of shadowed pixels smaller than the predetermined number; calculating, via a processor, a gamma transformation for each said pixel, wherein if the pixel intensity is less than or equal to the threshold pixel intensity, then a gamma transformation value equal to the received brightening level is applied, and wherein if the pixel intensity is greater than the threshold pixel intensity, then a gamma transformation value that is scaled is applied such that the gamma value decreases with intensity; for each said shadowed pixel, computing, via the processor, a minimum of the calculated gamma transformation value and a value of one for each said shadowed pixel; determining, via the processor, the brightening level to be applied, thus creating a gamma map indicating brightening levels to be applied to each said pixel in the original input image; applying, via the processor, the determined brightening level to the shadowed pixels; outputting, via the processor, a shadow-brightened output image.
20. The method of claim 19, wherein the original input image is color image, and the method further comprises the step of: converting the color image to an intensity image.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0016] The accompanying drawings, which are incorporated in and form a part of the specification, illustrate example embodiments and, together with the description, serve to explain the principles of the method and system for shadow brightening. In the drawings:
[0017]
[0018]
[0019]
[0020]
[0021]
[0022]
[0023]
DETAILED DESCRIPTION OF THE INVENTION
[0024] The present system and method for shadow brightening involves enhancing overly dark images by brightening the shadowed portions of an image.
[0025] The present system and method are used to brighten the dark, or shadowed, regions of an image while leaving the bright regions of the image intact. This avoids the common problems caused by a standard gamma transformation, such as a washed-out result or blooming of the bright regions. Instead of a single gamma value being applied to every pixel in the original input image, the present system and method let the user divide the image into two regions: shadowed and bright regions. Thereafter, the shadowed and bright regions may be handled separately so that the bright regions are not further brightened, but the shadowed regions are enhanced.
[0026] Referring now to
[0027] At step 120, the method includes receiving input of a threshold pixel intensity, thus allowing the user to set the threshold level (T) for pixel intensities. Pixel intensities below or equal to the threshold are treated as shadowed pixels, and pixel intensities above the threshold are treated as bright pixels.
[0028] This value assigned for the threshold pixel intensity will depend on the specific images, but can vary in the range from [0,1] where zero (0) means that all the pixels are above the threshold (all bright) and one (1) means that no pixels are above the threshold (all dark). The image pixels are handled differently depending on whether a pixel is considered to be in the dark/shadowed region or the bright region. If the pixel is in the dark/shadowed region, then at step 130, the gamma () value for the power-law transformation is just the user input value, L. This value L determines the level of brightening to be applied and is in the range of [0,1]. The lower the value of L, the more brightening is applied. At zero (0), all the pixels become white and at one (1), no change is applied to the pixels.
[0029] If the image pixel intensity value is greater than the threshold T, then at step 140, the gamma value used in the power-law transformation is calculated differently than at step 130. In this case, at step 140, the gamma value is a function that decreases with intensity, e.g., in accordance with the following equation:
.sub.x,y=L*e.sup.S(I.sup.
[0030] Specifically, the further the pixel intensity is from the threshold, the less brightening is applied. If the pixel intensity is above, but near the threshold, the term in the exponent S (I.sub.x,YT) evaluates to approximately zero (0), so the gamma value is nearly L. As the pixel intensities get farther and farther from the threshold, the term in the exponent increases, which increases gamma. A larger gamma means less brightening. The value of the scale factor S changes the rate at which the exponent increases.
[0031] Referring now to
[0032] The scale factor has the effect of changing how abrupt the transition from shadowed to bright regions is. A higher value of S means a more abrupt transition and a lower value means a less abrupt transition. If S is lowered enough, the transition ceases to exist and the whole image is treated as the shadowed region. Referring back to
[0033] After a gamma value is calculated for each pixel in the image, thus creating a gamma map, then at step 160, the gamma value is applied to each pixel in the standard power-law transformation. Since the gamma values in the bright region are a function of intensity, but the gamma values in the shadowed region are constant, the shadowed areas are brightened, but the bright values are primarily left untouched (except in the transition region). For these pixels, the gamma value was greater than or equal to one and was reduced to one (1). Raising the pixel intensity to the power of 1 has no effect.
[0034] At step 170, the shadow brightened image is output. Referring now to
[0035] It is clear that only the dark portions of the image were changed when looking at the magnitude of the differences between the shadow enhanced image and the original images. This is evident in
[0036] The advantages of the present method over the old methods are that it brightens the dark, or shadowed, regions of an image while leaving the bright regions of the image intact as shown in
[0037] Instead of the blooming that can be caused by typical brightening schemes, the present system and method avoid blooming with the independent adjustment of the threshold level to define the shadows (T), a level of brightening (L), and a scale factor (S) to determine the sharpness of the transition between the shadowed and bright areas.
[0038] The washed out look from a prior art gamma correction and the shadows enhanced version may be seen in
[0039] Another way to highlight the differences between the standard gamma correction and the new shadow enhancement is to examine the histograms shown in
[0040]
[0041] Another new feature of this method is the level of fine control over how the shadowed and bright regions are separated. That is, the threshold controls the pixel intensity at which to set the threshold while the scale factor independently determines how sharp that transition is. The level of brightening then affects how bright the shadowed regions will become.
[0042] An advantage of the present system and method is the simplicity. It is computationally efficient and though three parameters seem burdensome to adjust, it has been found that the scale factor is nearly always a constant and the other two parameters only need to be varied over a very a small range. In fact, for a wide variety of images, a single set of parameters has been shown to be very effective. The present system and method is much simpler than, say, a genetic algorithm.
[0043] Another advantage of the present system and method is that they work across a variety of natural images including images from space (e.g.
[0044] One alternative is that the present system and method could be reversed, so to speak, and be used to darken the bright areas of an image while leaving the darker areas untouched. In this case, the level of brightening would take on values greater than one (1) and the pixels below the threshold would be handled differently (instead of those above the threshold for the shadow enhancement).
[0045] Another alternative would be that the selection of the threshold and level of brightening could be automated (the value of scale does not seem to vary much) based on histogram metrics or otherwise, instead of having the user select values.
[0046] The gamma map may be manipulated to prevent very small regions of dark pixels from being brightened. For example, groups of pixels numbering smaller than ten might be eliminated before the power-law transformation.
[0047] Instead of an actual power-law transformation calculated with gamma, a pixel mapping look-up table could be computed to reduce computations and improve speed.
[0048] The present system and method can be used for monochrome images or color images by converting the color image to an intensity image prior to processing.
[0049]
[0050] The imaging system 710 could be any digital imaging system. Digital imaging system 710 can connect to personal computer 720. The original input image may be fed from the imaging system 710 to the personal computer 720. The personal computer 720, which may include its own memory and processor, may feed the image to another processor 730 such as a graphics processing unit.
[0051] As an alternative to the system illustrated in
[0052] Software (not shown in
[0053] A memory resident on imaging system 710 and/or personal computer 720, as noted hereinabove, is sufficient to hold at least the original input image, a brightening level L and a threshold pixel intensity. A memory resident on imaging system 710 and/or personal computer 720, may also include other elements such as copies of the original input image, as well as processing steps or instructions related to shadow enhancement. Examples of such processing steps are described in the flow block diagram of
[0054] The speed of the processor 730 needed may depend on the application in which the processor 730 is used, as can be appreciated by one of ordinary skill in the art.
[0055] The foregoing description of various embodiments has been presented for purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise forms disclosed, and obviously many modifications and variations are possible in light of the above teaching. The example embodiments, as described above, were chosen and described in order to best explain the principles of the invention and its practical application to thereby enable others skilled in the art to best utilize the invention in various embodiments and with various modifications as are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the claims appended hereto.