Using weighted dynamic range for histogram equalization to improve the image contrast
 Thien HuynhThe†^{1},
 BaVui Le†^{1},
 Sungyoung Lee^{1}Email author,
 Thuong LeTien^{2} and
 Yongik Yoon^{3}
https://doi.org/10.1186/16875281201444
© HuynhThe et al.; licensee Springer. 2014
Received: 27 March 2014
Accepted: 29 August 2014
Published: 13 September 2014
Abstract
In this paper, an effective method, named the brightness preserving weighted dynamic range histogram equalization (BPWDRHE), is proposed for contrast enhancement. Although histogram equalization (HE) is a universal method, it is not suitable for consumer electronic products because this method cannot preserve the overall brightness. Therefore, the output images have an unnatural looking and more visual artifacts. An extension of the approach based on the brightness preserving bihistogram equalization method, the BPWDRHE used the weighted withinclass variance as the novel algorithm in separating an original histogram. Unlike others using the average or the median of gray levels, the proposed method determined grayscale values as break points based on the withinclass variance to minimize the total squared error of each subhistogram corresponding to the brightness shift when equalizing them independently. As a result, the contrast of both overall image and local details was enhanced adequately. The experimental results are presented and compared to other brightness preserving methods.
Keywords
Introduction
Enhancing contrast of images by using histogram equalization (HE) is the standard technique to improve the visual image by stretching the narrow input image histogram [1]. However, it is not the appropriate method for consumer electronics, such as TV, because it changes the brightness of the original image strongly and degrades the image quality in visualization. Various methods have been proposed to limit the level of enhancement based on modifying the input histogram with mapping functions. The brightness preserving bihistogram equalization (BBHE) [2], the dualistic subimage histogram equalization (DSIHE) [3], and the minimum mean brightness error bihistogram equalization (MMBEBHE) [4] divided the input histogram into two subhistograms by a separating point. In order to enhance the image contrast, each subhistogram was equalized independently. The BBHE method used the gray level as the mean value of image brightness to separate an input histogram into two parts: the first one is from the minimum gray level to the mean, and the second one is from the mean to the maximum gray level. The DSIHE method also used a similar approach to enhance the image contrast, except applying the median value instead of the mean value. In practice, the DSIHE is better than the BBHE in both preserving the image brightness and conserving the information content. The simple method to find out the separated point is to test all possible grayscale values from 0 to L−1 of the histogram by calculating the difference between the mean brightness of input and the mean brightness of output. The separated point is chosen as the value that achieves the minimum difference in overall brightness. Although the above methods are better than HE in keeping the brightness of images, the visualization of enhanced images is degraded seriously, sometimes in detail and overall.
Based on the BBHE, the recursive mean separate histogram equalization (RMSHE) [5] and the recursive subimage histogram equalization (RSIHE) [6] divided an original histogram into 2^{ n } subhistograms, where n is a positive integer value. The RMSHE splits the histogram into two parts by using the average of input brightness before separating one more time for each subhistogram to have four segments in total. In practice, there are 2^{ n } subhistograms for n separated times. Having the same idea with the RMSHE in separation of more segments, the RSIHE also divided the histogram as well based on the median, rather than the mean of intensity values. Of note in these approaches, the output image looks like the copy version of the input image when n is too large, i.e., there is clearly no contrast enhancement here. In [7], the brightness preserving dynamic histogram equalization (BPDHE) divided the input histogram into an arbitrary number of subhistograms based on break points which were determined by the local minima of the histogram. Based on the total number of pixels contained in each subhistogram, the new partitions are obtained from the dynamic ranges by the new function for resizing. After the histogram equalization step, the output image would be normalized in brightness with the original to ensure that the mean of output intensity is close to the mean of input intensity. Moreover, the authors in [8] proposed a contrast enhancement method using the dynamic range separate histogram equalization (DRSHE) approach to preserve the naturalness of images and improve the overall contrast. The weighted average of absolute color difference (WAAD) used in the DRSHE produced an output image in which the adjusted histogram looks like the uniform distribution. The dynamic ranges in this study could be controlled by the adaptive scale factor to preserve the brightness. Detecting the start and stop positions of dynamic ranges is a difficult mission; thus, this algorithm cannot be suitable for various histogram types.
Another technique to improve the contrast, the weighted threshold histogram equalization (WTHE) [9] modified the probability density function of an image histogram. In detail, each original probability density value could be replaced by a new value based on the probability density function (pdf) with an initial threshold. Nevertheless, the disadvantage of this method is determining the threshold value through a scale parameter for the good visualization with no conditions to ensure the sum of the probability density value conserved. In order to solve this trouble, the recursively separated and weighted histogram equalization (RSWHE) [10] normalized the modified probability density function. With the other solution, each subhistogram was smoothed by changing the corresponding original probability density function with the brightness preserving weight clustering histogram equalization (BPWCHE) [11]. This approach assigned each nonzero bin of the input histogram for the clusters and computed their weights. By using three criteria to merge pairs of neighbor clusters, the subhistograms were then equalized independently. The Global Contrast Enhancement Histogram Modification Algorithm [12] was represented as the effective method for contrast enhancement by adjusting linear operations of the input histogram and utilizing the black and white (BW) stretching to obtain the visually pleasing, artifactfree, and natural looking images. Recently, the authors in the article [13] proposed the adaptive gamma correction with weighting distribution (AGCWD) to adjust the brightness for dimmed images via the gamma correction mechanism and the probability density function of luminance pixels. In spite of achieving a better visualization in output images, failing in preservation of the overall brightness can be seen as the shortcoming of this approach. Besides that, some methods were designed to improve the contrast for low illumination color images [14], in which color restoration was used as the postprocess after adjusting the brightness in the local and global region. The artificial bee colony [15] in artificial intelligence science was also used for the contrast enhancement application. In this study, the function for mapping the input to the output intensity was established based on the searching and optimization algorithm.
In this paper, the brightness preserving weighted dynamic range histogram equalization (BPWDRHE) is proposed as an efficient contrast enhancement method. The input histogram is separated by applying the Otsu method [1] to determine divided points. The purpose of this approach is to minimize each subhistogram error corresponding to its mean brightness for histogram equalization. In order to be suitable to various input images, the region ranges can be resized by the scale factor that has been set as the initial value. As the postprocesses, the HEbased histogram will be smoothed and normalized to get the pleasing visualization with protection in the output brightness.
Brightness preserving weighted dynamic range histogram equalization
The contrast enhancement method proposed in this paper consists of three steps:

Proposed separation algorithm: Separate the input histogram and adjust subhistogram ranges by the scale factor.

Contrast enhancement: Apply histogram equalization for each subhistogram independently.

Postprocess: Smooth the histogram and normalize the overall brightness.To be clear about these steps, Figure 1 shows the flow chart of the BPWDRHE method. The framework in Figure 1 can be also applied for color images by improving the contrast of the luminance channel in the YCbCr color model.
Proposed separation: determine break points based on the minimization of the sum of weighted withinclass variance
Average of the means of 40 testing image brightness (denoted as AMB)
Contrast enhancement: histogram equalization for each subhistogram independently
where n_{ k } is the number of pixels of graylevel k, and N_{ i } is the total pixels contained in the i th subhistogram such that N_{1} denotes the first subhistogram.
Postprocess: smooth the histogram and normalize the brightness
where B and B_{ s } are the mean brightness of the original and modified image after using the smoothing algorithm, respectively. The output image not only preserved the overall brightness but also obtained the comfortable visualization by applying the mapping function as given in Equation 12.
Results and discussions
For simulation, the authors compared the BPWDRHE with the others which are the Global HE [1], BBHE [2], DSIHE [3], MMBEBHE [4], WTHE [9], BPDHE [7], RSWHE [10], and AGCWD [13] on various images. In practice, 40 gray images [17] and 10 color images [18] of the Kodak database set are utilized for quantitative measurement. Besides that, some random images are chosen for representation and discussion. For more details, the parameters and factors have been set in the proposed separation stage as follows: n=2 corresponding to four segments generated from the input histogram and α=0.85 for resizing the lengths of subhistograms. Moreover, with parameters in the postprocess, the authors use λ=1 and γ=10 to achieve efficiency in reducing negative effects from the overenhancement and visual artifact behavior. These parameters have been chosen through the intermediate simulation, in which the experimental results are represented in Figures 2 and 3 and Table 1 (for explanation of n), Figure 6 (for description of α), and Figure 7 (for clarification of λ and γ). It is important to note that determined values for these parameters cannot be optimal for all images because the assessment for image quality depends on various aspects. In this paper, the authors try to estimate their values based on the observation of their specification. The influence of parameter n is measured by the average mean brightness (AMB) as shown in Table 1; meanwhile, the remaining parameters are proposed to overcome unexpected events from the histogram equalization scheme under visualization. However, the influence assessment of these parameters on the overall performance of the output images is necessary to be employed in the next simulation.
where max(X_{i, j}) and min(X_{i, j}) are the maximum and minimum gray levels, respectively, in block X_{i, j}. Highcontrast subblocks give a high EME value, whereas for homogeneous subblocks, the EME value should be close to zero. It is worth to note that the EME is highly sensitive to noise. However, for the contrast enhancement application, this value is expected to be EME(Y)>EME(X).
In the next step, an evaluation of the proposed method includes three simulations. Firstly, the authors assess the influence of some parameters in the separation and postprocess stage on the overall performance with the quantitative and quality results. Then, the proposed method is compared to the others with subjective assessment for both grayscale and color images. Finally, the comparison of the objective assessment based on the above quantitative measurements is presented in detail.
Parameter assessment
Quantitative assessment of parameters on the overall performance
n  α  λ  γ  AMBE  DE  EME  

(a)  The original image    3.7277  7.5317  
(c)  2  0.85  1  10  0.0288  3.6578  10.8647 
(b)  1  0.85  1  10  0.0334  3.6770  15.3762 
(d)  3  0.85  1  10  0.0380  3.7005  9.2426 
(e)  2  0.5  1  10  0.0048  3.6734  10.6417 
(f)  2  1  1  10  0.0308  3.6470  10.9212 
(g)  2  0.85  5  10  0.1201  3.6892  8.6789 
(h)  2  0.85  10  10  0.0960  3.7042  8.1405 
(i)  2  0.85  1  1  0.0167  3.6409  11.1318 
(j)  2  0.85  1  100  0.0479  3.7049  10.1021 
Subjective assessment
Gray image
Color image
Objective assessment
Absolute mean brightness error (AMBE) and average of AMBEs (AAMBE)
AMBE  AAMBE  

Method  Toy  Aircraft  Pentagon  Hats  Wall  (50 images) 
Global HE [1]  29.38  47.82  11.04  7.81  10.19  30.49 
BBHE [2]  5.48  1.46  6.89  23.77  17.19  12.29 
DSIHE [3]  1.27  15.42  28.65  0.03  10.19  11.98 
MMBEBHE [4]  3.16  6.51  1.37  1.25  1.00  2.99 
WTHE [9]  27.13  55.61  12.36  22.25  23.62  29.62 
BPDHE [7]  0.15  0.05  0.02  0.02  0.007  0.26 
RSWHE [10]  7.70  3.48  0.80  0.76  0.45  2.19 
AGCWD [13]  26.14  58.45  35.46  33.52  38.33  36.75 
BPWDRHE  0.08  0.01  0.09  0.02  0.07  0.05 
Discrete entropy (DE) and average of DEs (ADE)
DE  ADE  

Method  Toy  Aircraft  Pentagon  Hats  Wall  (50 images) 
Original  4.19  2.78  4.66  4.79  4.83  4.52 
Global HE [1]  3.48  2.60  4.01  4.66  4.75  3.84 
BBHE [2]  4.09  2.72  4.61  4.1  4.11  4.42 
DSIHE [3]  4.03  2.74  4.57  4.67  4.75  4.40 
MMBEBHE [4]  4.07  2.71  4.59  4.65  4.74  4.41 
WTHE [9]  3.35  2.74  4.64  4.68  4.70  4.27 
BPDHE [7]  4.07  2.75  4.47  4.60  4.58  4.32 
RSWHE [10]  4.19  2.78  4.66  4.79  4.83  4.51 
AGCWD [13]  3.61  2.78  4.62  4.74  4.79  4.30 
BPWDRHE  4.15  2.77  4.64  4.77  4.81  4.48 
Measure of enhancement (EME) and average of EMEs (AEME)
EME  AEME  

Method  Toy  Aircraft  Pentagon  Hats  Wall  (50 images) 
Original  4.81  3.14  8.59  5.42  14.65  14.34 
Global HE [1]  13.94  25.64  40.57  15.64  39.87  28.86 
BBHE [2]  10.99  18.99  36.44  15.85  42.56  26.04 
DSIHE [3]  9.40  8.09  21.62  15.91  39.86  23.88 
MMBEBHE [4]  11.06  8.72  23.96  14.28  38.07  24.27 
WTHE [9]  10.34  15.39  32.5  12.89  34.92  22.44 
BPDHE [7]  7.18  5.68  14.71  12.76  19.55  21.09 
RSWHE [10]  6.60  3.37  10.16  7.03  16.65  15.12 
AGCWD [13]  4.61  1.98  8.56  5.55  14.44  14.19 
BPWDRHE  6.29  4.85  12.28  7.62  20.87  15.62 
With the second measurement, the DE of the original image will be seen as the standard to be compared with the DE of enhanced images. The important thing to note is that the DE values of modified images are always equal or less than the original. This means that it is difficult to retain the detail of the output like the detail of the input. The behavior of losing detail occurs in most of the enhancement methods because the mapping function is nonlinear, that is, it usually has one output value for many input values. This behavior is absolutely considered through mapping function graphs as in Figures 16 and 19. The other way to explain based on histograms is that many original histogram bins grouped into one bin after enhancement can be the reason of the decrement in the DE values for overenhanced images. It is not difficult to understand why the DE parameter of output images of these approaches is slightly reduced. Through Table 4, the performance of the proposed method and the RSWHE are quite similar in the average value of DE when both of them with high discrete entropy are better than the other methods. The Global HE gives the worst results in most of the samples with the least value of average as the loss of data of over 15%, while the remaining methods basically keep image content at the moderate level with the largest losing grade of 6%.
The comparison of EME values in Table 5 shows that the Global HE, BBHE, DSIHE, MMBEBHE, and WTHE methods usually get higher EME values than the remaining methods. Since the EME criterion measures a form of contrast, it is no surprise that these methods give the highest values even though they hardly ever produced the most visually pleasing images. Although the enhancement grade is identified through this value with the output value greater than the value of the original image, the high results of the above methods can be the main reason for the degradation of quality. As results for the Toy sample, some methods such as the Global HE, BBHE, DSIHE, MMBEBHE, and WTHE achieve the high value of EME corresponding to the high contrast; however, their outputs are seriously damaged unexpectedly in the quality. For the AGCWD method, increasing the brightness overall can be the cause of depressing the local contrast corresponding to the EME value, especially with the Aircraft sample. Meanwhile, the EME values achieved from the proposed method are enough to realize the difference of contrast between inputs and outputs without visual artifacts.
In summary, it is important to note that the quality of an enhanced image depends on many criteria. Besides increasing the contrast in the adequate grade to avoid the occurrence of artifact unexpectedly, the efficient method needs to preserve not only the overall brightness but also the detail in the output. Based on the experimental results, the proposed method satisfied these criteria at least in this evaluation with 50 test images; however, the tradeoff here is the computation fee, that is, the algorithm will need more time for enhancing the steps.
Conclusion
In this work, the authors proposed and experimented on the new contrast enhancement method for both grayscale and color image, called BPWDRHE. The BPWDRHE method enhanced the contrast with preservation of the overall brightness to generate the natural looking images. Unlike some previous techniques, the proposed method reduced the appearance of visual artifacts in the outputs. The novelty of proposed contrast enhancement is that the sum of weighted withinclass variance was utilized to determine the break points for histogram separation based on the minimization of the total squared error of each subhistogram corresponding to the equalizationbased brightness shift. After applying the HE technique for these subhistograms, the output image histogram will be smoothed and normalized to obtain the good visualization as the postprocesses. Moreover, the BPWDRHE was estimated for grayscale and color images and then compared to the others in various aspects with some common quantitative assessments, such as the absolute mean brightness error, the discrete entropy, and the measure of enhancement.
Notes
Declarations
Acknowledgements
This research was funded by the MSIP (Ministry of Science, ICT & Future Planning), Korea in the ICT R&D Program 2013.
Authors’ Affiliations
References
 Gonzalez RC, Woods RE: Digital Image Processing, 3rd Edition. Prentice Hall, New Jersey; 2007.Google Scholar
 Kim YT: Contrast enhancement using brightness preserving bihistogram equalization. IEEE Trans. Consum. Electron 1997, 43(1):18. 10.1109/30.580378View ArticleGoogle Scholar
 Wang Y, Chen Q, Zhang B: Image enhancement based on equal area dualistic subimage histogram equalization method. IEEE Trans. Consum. Electron 1999, 45(1):6875. 10.1109/30.754419View ArticleGoogle Scholar
 Chen SD, Ramli AR: Minimum mean brightness error bihistogram equalization in contrast enhancement. IEEE Trans. Consum. Electron 2003, 49(4):13101319. 10.1109/TCE.2003.1261234View ArticleGoogle Scholar
 Chen SD, Ramli AR: Contrast enhancement using recursive meanseparate histogram equalization for scalable brightness preservation. IEEE Trans. Consum. Electron 2003, 49(4):13011309. 10.1109/TCE.2003.1261233View ArticleGoogle Scholar
 Sim KS, Tso CP, Tan YY: Recursive subimage histogram equalization applied to gray scale images. Pattern Recogn. Lett 2007, 28(10):15.Google Scholar
 Ibrahim H, Kong NSP: Brightness preserving dynamic histogram equalization for image contrast enhancement. IEEE Trans. Consum. Electron 2007, 53(4):17521758.View ArticleGoogle Scholar
 Park GH, Cho HH, Choi MR: A contrast enhancement method using dynamic range separate histogram equalization. IEEE Trans. Consum. Electron 2008, 54(4):19811987.View ArticleGoogle Scholar
 Wang Q, Ward RK: Fast image/video contrast enhancement based on weighted thresholded histogram equalization. IEEE Trans. Consum. Electron 2007, 53(2):757764.View ArticleGoogle Scholar
 Kim M, Chung M: Recursively separated and weighted histogram equalization for brightness preservation and contrast enhancement. IEEE Trans. Consum. Electron 2008, 54(3):13891397.View ArticleGoogle Scholar
 Sengee N, Choi H: Brightness preserving weight clustering histogram equalization. IEEE Trans. Consum. Electron 2008, 54(3):13291337.View ArticleGoogle Scholar
 Arici T, Dikbas S, Altunbasak Y: A histogram modification framework and its application for image contrast enhancement. IEEE Trans. Image Process 2009, 18(9):19211935.MathSciNetView ArticleGoogle Scholar
 Huang SC, Cheng FC, Chiu YS: Efficient contrast enhancement using adaptive gamma correction with weighting distribution. IEEE Trans. Image Process 2013, 22(3):10321041.MathSciNetView ArticleGoogle Scholar
 Zhou Z, Sang N, Hu X: Global brightness and local contrast adaptive enhancement for low illumination color image. Optik  Int. J. Light Electron Opt 2014, 125(6):17951799. 10.1016/j.ijleo.2013.09.051View ArticleGoogle Scholar
 Draa A, Bouaziz A: An artificial bee colony algorithm for image contrast enhancement. Swarm Evol. Comput 2014, 16: 6984.View ArticleGoogle Scholar
 AbdullahAlWadud M, Kabir MH, Dewan MAA, Chae O: A dynamic histogram equalization for image contrast enhancement. IEEE Trans. Consum. Electron 2007, 53(2):593600.View ArticleGoogle Scholar
 The USCSIPI Image Database . Accessed 20 Jan 2013 http://sipi.usc.edu/database/
 Kodak Lossless True Color Image Suite . Accessed 5 August 2013 http://r0k.us/graphics/kodak/
 Agaian SS, Silver B, Panetta KA: Transform coefficient histogrambased image enhancement algorithms using contrast entropy. IEEE Trans. Image Process 2007, 16(3):741758.MathSciNetView ArticleGoogle Scholar
Copyright
This article is published under license to BioMed Central Ltd. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly credited.