Piecewise Constant Histogram Specification for False Contour-Free Contrast Enhancement

We propose an algorithm for enhancing the contrast of grayscale images by piecewise constant histogram specification, which produces a contrast-enhanced image, the histogram of which is piecewise constant, and has no gap between neighboring intensities. As a result, false contouring caused by the intensity gap can be avoided. In order to evaluate the performance of contrast enhancement methods, we incorporate two conventional image quality measures into a single one. Experimental results show that the proposed algorithm outperforms two conventional histogram equalization methods in terms of the image quality measure.


Introduction
Histogram specification (HS) or histogram matching, which includes histogram equalization (HE) as a special case, is a technique for intensity transformation (1) , the main purpose of which is contrast enhancement (CE).Conventional HE (1) is a useful tool for CE because the target histogram is a constant function which has no parameter to be set.However, for digital images, HE (1) cannot equalize the resultant histogram in a strict sense, and tends to overenhance the contrast of low contrast images to cause false contouring.
Coltuc et al. (2) proposed an exact HS technique based on the strict ordering on image pixels.Once ordering is achieved, pixels are immediately separated into classes and assigned to the desired gray level.Nikolova and Steidl pointed out the importance of a meaningful strict ordering of pixels for HS, and proposed a fast ordering algorithm (3) .They also applied their algorithm to hue and range preserving color image enhancement (4) .
In general, HS accepts arbitrary shapes of target histograms including equalized (uniform), Gaussian and exponential histograms.However, specifying a meaningful histogram for a certain image is not obvious (2) .For example, a Gaussian histogram used in Ref. (4) has two parameters to be given by users.To overcome such difficulties in HS, we propose a method for generating a target histogram from a given grayscale image only.The generated histogram is piecewise constant, and has no gap between neighboring intensities.Therefore, the proposed algorithm can suppress false contouring and contrast over-enhancement which are frequently observed in contrast-enhanced images by conventional HEs.
Celik (5) quantitatively evaluated the performance of contrast enhancement algorithms by using two measures, i.e., the expected measure of enhancement by gradient (EMEG) and the gradient magnitude similarity deviation (GMSD) proposed by Xue et al. (6) .EMEG (5) is a modification of EME by entropy (EMEE) proposed by Agaian et al. (7) .In this paper, we incorporate EMEG (5) and GMSD (6) into a single measure, and evaluate the performance of contrast enhancement algorithms using the measure.Experimental results show that the proposed algorithm achieves higher (better) values of the measure than conventional HEs (1),(3), (4) .

Piecewise Constant Histogram Specification
In this section, we describe the proposed piecewise constant histogram specification algorithm, which fills 0valued bins of the histogram equalized by Conventional HE (1)  For a low contrast image , the histogram   of the histogram-equalized image  frequently becomes sparse, i.e., a number of elements of   are zero.The sparsity of   indicates that there exist gaps in continuous-tone, which may cause false contours in .To bridge those gaps, we fill all bins of   with non-zero values as follows: the histogram of which coincides with  �  .This procedure is an example of histogram specification (2) .We adopt the stateof-the-art technique proposed by Nikolova and Steidl (3), (4) .The proposed algorithm is summarized as follows: In Algorithm 1, line 21, the function Ordering returns an  × 2 array  in which the positions (, ) of pixels are stored in ascending order of the pixel values obtained by the fast ordering algorithm (3), (4) .Each intensity  ∈ {0,1, … ,  − 1} is assigned to the corresponding pixels in line 25, where we use the colon notations in MATLAB.
In summary, Algorithm 1 fills the empty bins in equalized histograms by copying the neighboring non-zero elements, and preserves the outline of original histograms.

Image Quality Measures
In this section, we briefly summarize two measures for evaluating the performance of contrast enhancement methods, and then incorporate them into a single measure. (5)e expected measure of enhancement by gradient (EMEG) proposed by Celik (5) is defined by ⁄ ) where fix denotes a function for rounding toward zero.When  is a contrast-enhanced image of , we expect that EMEG() > EMEG(). (6)e gradient magnitude similarity deviation (GMSD) proposed by Xue et al. (6) is a full reference image quality assessment model defined by

Gradient magnitude similarity deviation
, where GMSM , denotes the average of GMS  , which is the value of the GMS map at (, ) defined by where  , and  , denote the gradient magnitudes of  and  at (, ) , respectively, and  is a positive constant for numerical stability.A lower value of GMSD means higher quality.The MATLAB source code for calculating GMSD can be downloaded at http://www4.comp.polyu.edu.hk/~cslzhang/IQA/GMSD/GMSD.htm.We used it with the default settings. (5)and GMSD (6) In this subsection, we propose an image quality measure which incorporates EMEG (5) and GMSD (6) into a single value which we call EMEG over GMSD (EMEG/GMSD), which is defined by EMEG GMSD(, ) ⁄ = EMEG() GMSD(, ) .

Incorporating EMEG
The higher the EMEG/GMSD value is, the higher the performance of contrast enhancement is.This property is consistent with that of both EMEG (5) and GMSD (6) .

Experimental Results
We compared the proposed algorithm with the conventional HE (1) and Nikolova and Steidl's one (3),(4) using the SIDBA standard image database (8) .Fig. 1 shows an original image and the contrast-enhanced ones in the left column and the corresponding histograms in the right.The original image in Fig. 1(a) has the histogram in Fig. 1(b), which provides a graphical evidence that the image is dark and low-contrast.The conventional HE produces a contrast-enhanced image in Fig. 1(c), the histogram of which has a comb-shaped graph as shown in Fig. 1(d).On the other hand, Nikolova's HE (3), (4) outputs a similar image in Fig. 1(e) to that in Fig. 1(c    On the other hand, in Fig. 2(d), the noise enhancement caused by false contouring is suppressed by the proposed algorithm.
Fig. 3 shows EMEG/GMSD values for 12 images in SIDBA (8) .The vertical axis denotes the EMEG/GMSD value, and the horizontal axis denotes the name of each image.The yellow, green and white bars denote the conventional HE (1) , Nikolova's one (3), (4) and the proposed algorithm, respectively.The proposed algorithm achieved higher EMEG/GMSD values than the conventional HE (1) and Nikolova's one (3), (4) for all 12 images.
Other contrast enhancement results are shown in Fig. 4, where the top row shows 5 original images: Airplane, Boat, Lighthouse, Text and Woman, and the second to fourth rows show the contrast-enhanced images by the conventional HE (1) , Nikolova's one (3), (4) and the proposed algorithm, respectively.The conventional HE (1) and Nikolova's one (3), (4) tends to over-enhance the global contrast in each image, while the proposed algorithm can alleviate the contrast overenhancement to obtain appropriate results.

Conclusions
In this paper, we proposed a contrast enhancement algorithm, by which the contrast-enhanced images have piecewise constant histograms.As a result, the gaps of intensity values, which may cause false contours, is bridged, and the proposed algorithm outputs proper results of contrast enhancement compared with conventional histogram equalization methods.The performance of the proposed algorithm is evaluated quantitatively and objectively by an image quality measure.

Fig. 1 (
Fig. 1(d).Fig. 1(g) shows the image generated by the proposed algorithm, which enhances the contrast more softly than the above HE algorithms (Figs.1(c) and (e)).The histogram of Fig. 1(g) is shown in Fig. 1(h), which demonstrates that the proposed algorithm generates a piecewise constant histogram.Table1shows CPU time for computing Figs.(c), (e) and (g).The proposed algorithm requires almost the same CPU time as Nikolova's HE(3),(4) .Both the proposed algorithm and Nikolova's HE(3),(4) spend most of the CPU time for computing the ordering of the pixel values as in Algorithm 1, line 21.We performed the experiments using MATLAB R2011b on a Pentium IV 3.4GHz machine with 2GB RAM.We zoomed up a region of wall behind the girl as shown in Fig.2, where Figs.2(a)-(d) correspond to Figs.1(a), (c), (e) and (g), respectively.Although the contrast around the belt-shaped slightly bright region is enhanced by the conventional and Nikolova's HEs, random noise is also enhanced by false contouring as shown in Figs.2(b) and (c).On the other hand, in Fig.2(d), the noise enhancement caused by false contouring is suppressed by the proposed algorithm.Fig.3showsEMEG/GMSD values for 12 images in SIDBA(8) .The vertical axis denotes the EMEG/GMSD value, and the horizontal axis denotes the name of each image.The yellow, green and white bars denote the conventional HE(1) , Nikolova's one(3),(4) and the proposed algorithm, respectively.The proposed algorithm achieved higher EMEG/GMSD values than the conventional HE(1) and Nikolova's one(3),(4) for all 12 images.Other contrast enhancement results are shown in Fig.4,
with non-zero values of neighboring bins.The repeated copies of non-zero values to the neighboring consecutive 0valued bins generate a piecewise constant histogram, with which the histogram-specified image is finally obtained.Let  = [  ] be a grayscale image of size  ×  pixels, where   ∈ {0,1, … ,  − 1} denotes the intensity at the position (, ) for  = 1,2, … ,  and  = 1,2, … ,  , where  denotes the number of intensity levels, e.g.  ] of  is given by   = ( − 1)(    −   min  , where  max = max{  } and  min = min{  }.