An analysis of Histogram equalization method for...
Transcript of An analysis of Histogram equalization method for...
1 Gourav Garg, Poonam Sharma
International Journal of Innovations & Advancement in Computer Science
IJIACS
ISSN 2347 – 8616
Volume 3, Issue 4
July 2014
An analysis of Histogram equalization method for Brightness
Preserving and Contrast Enhancement
Gourav Garg1 , Poonam Sharma2 Department of C.S.E. & I.T
Madhav Institute of Technology and Science
Gwalior, India
ABSTRACT: The contrast of an image is a feature which determines how image looks better
visually. The Contrast enhancement is considered as one of the most important issues in image
processing. Histogram equalization (HE) is one of the common methods used for improving contrast
in digital images. This technique is usually used for image enhancement because of its simplicity,
practical and comparatively better performance on almost all types of images. One drawback of HE
can be found that it is tends to introduce some annoying artifacts and unnecessary enhancement. In
this paper some brightness preserving techniques are used as a result overcome drawbacks of HE.
For performance assessment we have used Peak Signal to Noise Ratio (PSNR), absolute mean
brightness error (AMBE), and entropy. From experimental result, it is observed that NMSE and
BPDFHE have better image enhancement capability.
Keywords: Contrast enhancement, HE, BBHE, NMHE, BPDFHE
1. INTRODUCTION:
Image enhancement is a process in which changed the pixels’ intensity of the input image;
make the output image looks better. The aim of image enhancement is to recover the interpretability or perception of information
contained in the image for human viewers, or to deliver a “better” output for other automated
image processing systems. Many image enhancement techniques have been proposed such as aim, out of which histogram
equalization (HE) is one of technique for image enhancement. This technique is commonly
working for image enhancement because of its simplicity and comparatively. Histogram equalization achieves a uniform distributed
histogram by using the Cumulative density functions of the input image. Contrast
enhancement plays an important role in image processing applications, such as medical image processing, digital photography, satellite
imaging, and LCD display processing.
Normally, histogram equalization can be
categorized into two main processes: global
histogram equalization (GHE) and local
histogram equalization (LHE). In GHE, the
histogram of the whole input image is used to
calculate a histogram transformation function.
As a result, the dynamic range of the image
histogram is compressed and stretched, by
which the overall contrast is improved [1]. The
computational complexity of GHE is
comparatively low. The major drawbacks of
GHE are that it cannot adjust the local
information of the image and preserve the
brightness of the original image. Where LHE
uses a sliding window method, in this local
histograms are calculated from the windowed
neighbourhood to produce a local intensities
remapping for each pixel. The intensity of the
pixel at the centre of the neighbourhood is
2 Gourav Garg, Poonam Sharma
International Journal of Innovations & Advancement in Computer Science
IJIACS
ISSN 2347 – 8616
Volume 3, Issue 4
July 2014
improved according to the local intensity
remapping for that pixel. LHE is capable of
producing good contrast results but is
sometimes held to over-enhance images. It also
requires more computation than other methods
because a local histogram must be made and
deal with for every image pixel. Some extension
methods of GHE have been developed for
preserving brightness: Contrast-Limited
Adaptive Histogram Equalization(CLAHE) [2],
brightness preserving bi-histogram equalization
(BBHE) [3], dualistic sub- image histogram
equalization (DSIHE) [4], minimum mean
brightness error bi-histogram equalization
(MMBEBHE) [5], recursive mean separate
histogram equalization (RMSHE) [6], recursive
sub- image histogram equalization (RSIHE) [7],
Recursively Separated and Weighted Histogram
Equalization for Brightness Preservation and
Contrast Enhancement(RSWHE)[8].Non-
parametric modified histogram equalisation for
contrast enhancement (NMHE) [9], Brightness
Preserving Dynamic Fuzzy Histogram
Equalization [10].
Rest of the paper is organized as follows:
Section 2 presents Histogram equalization (HE).
In section 3, various HE techniques are
reviewed. Section 4 presents experimental
analysis of various HE Approaches. Section 5
concludes the paper.
2. Histogram equalization (HE):
Histogram equalization technique is commonly
working for image enhancement because of its
practical and comparatively better performance
on almost all types of images [1]. Histogram
equalization achieves a uniform distributed
histogram by using the Cumulative density
functions of the input image.
For a given image X, the probability density
function p ( ) is defined as:
(1)
Where is no. of times that the level
appears in input image X and n is total no. of
pixel in the image.
Its cumulative distribution function (CDF) is
defined as:
(2)
Where k=O, 1…L-1, and it is obvious
that . Let define transform function
f(x) by using the cumulative density function
(CDF), graphical representation of histogram
equalization plots an input gray level into an
output gray level f( ). Where f( ) is
commonly called a level transformation
function, which is defined as:
(3)
3. Some techniques of histogram
equalization:
3.1. Contrast limited adaptive histogram
equalization (CLAHE)
S.M. Pizer et al. (1990) has proposed Contrast
Limited Adaptive Histogram Equalization
(CLAHE) [2]. This method is depend on local
histogram equalization (LHE) such that CLAHE
operates on small regions in the image, is
known as tiles, rather than the entire image.
Each tile contrast is enhanced, to match the
histogram of the output region approximately
with the histogram specified by the distribution
parameter. Then combined the neighboring tiles
using bilinear interpolation to eliminate
artificially induced boundaries.
CLAHE ALGORITHM:
Step 1: Obtain all the inputs Image: In this step
find out the Number of regions in row and
column directions, Number of bins of the
histograms used in building image transform
3 Gourav Garg, Poonam Sharma
International Journal of Innovations & Advancement in Computer Science
IJIACS
ISSN 2347 – 8616
Volume 3, Issue 4
July 2014
function. Clip histogram is normalized from 0
to 1.
Step2: Pre-process the inputs: pad the image
before splitting it into regions. Normalize value
is determine the real clip limit.
Step3: Determine gray level value by process of
each contextual region (tile): Firstly citation a
single image region and determine histogram of
it by using the specified number of bins, after
that clip the histogram using clip limit, finally
create a transformation function for this region.
Step4: Interpolate gray level mappings in order
to assemble final CLAHE image: Extract cluster
of four neighboring mapping functions, process
image region partly overlapping each of the
mapping tiles, extract a single pixel, apply four
mappings to that pixel, and interpolate between
the results to obtain the output pixel; repeat over
the entire image.
3.2. Preserving Bi-Histogram Equalization
(BBHE) YEONG TAEG KIM [3] (1996) has
proposed Preserving Bi-Histogram Equalization
(BBHE) [3]. Histogram equalization (HE) is a
method of image enhancement has one
drawback; intensity value of an image can be
changed after the HE. This method divides the
image histogram into two parts as shown in
Figure 1. In this method, the separation
intensity is used for separation of
histogram. The intensity value ( ) is
calculated by the mean brightness of input
image. And then these two histograms are
independently equalized. The mean brightness
of the resultant image will lie between the
input mean and the middle gray level.
The histogram with range from 0 to L-1 is
divided into two parts with separating intensity
( ). This separation produces two histograms.
The first histogram has the range of 0 to
while the second histogram has the range of
to L-1.
Figure 1.bi-histogram equalization
The BBHE algorithm is given below: 1. Input the image, F (i, j) with a total number of ‘n’ pixels in the gray level range [ ].
2. Make the histogram of image.
3. Segment F (i, j) into lower sub- images and upper sub-image based on
its mean ‘ ’. 4. Equalize each partition independently using
PDF and CDF.
3.3. Dualistic sub image histogram
qualization (DSIHE)
YU WANG et al. (1999) has proposed Dualistic
sub image histogram equalization (DSIHE) [4],
one drawback of histogram equalization (HE) is
discuss the above (BBHE), intensity value of an
image may be changed suddenly it never be
utilized in video system in past. Following the
same basic ideas used by the BBHE method of
decomposing the original image into two sub-
images and then equalizes the histograms of the
sub- images separately. Dualistic sub- image HE
(DSIHE) method is used median value of image
instead of decomposing the image based on its
mean gray level, the DSIHE method
decomposes the images aiming at the
maximization of the Shannon's entropy of the
output image. For such aim, the input image is
decomposed into two sub- images, being one
dark and one bright.
The DSIHE algorithm is given below:
1. Input the image, F (i, j) with a total number
of ‘n’ pixels in the gray level range [ ].
4 Gourav Garg, Poonam Sharma
International Journal of Innovations & Advancement in Computer Science
IJIACS
ISSN 2347 – 8616
Volume 3, Issue 4
July 2014
2. Make the histogram of image.
3. Segment F (i, j) into lower sub- images
and upper sub-image based on
its median ‘ ’.
4. Equalize each partition independently using
PDF and CDF.
3.4. Minimum mean brightness error Bi -
histogram equalization (MMBEBHE)
CHEN & RAMLI (2003) has proposed
Minimum mean brightness error bi-histogram
equalization (MMBEBHE) method [5]. BBHE
and DSIHE could preserve the mean brightness
but these are not preserving optimally. To avoid
annoying artifacts, these images require higher
degree of brightness preservation. The main
difference between MMBEBHE and other is
that the minimum absolute mean brightness
error (AMBE) between the input image and the
output image is select as threshold. The ultimate
goal of the MMBEBHE is to allow maximum
level of brightness preservation in Bi-
Histogram Equalization and it avoids unpleasant
artifacts and unnatural enhancement due to
excessive equalization.
3.5. Recursive Mean-Separate Histogram
Equalization (RMSHE)
Chen and Ramli ( 2003) has proposed Recursive
Mean-Separate Histogram Equalization
(RMSHE)[6].This method is not only better but
also scable brightness preserving before
equalizing them independently, BBHE separates
the input image's histogram into two by using
mean histogram. However, an extended version
of the BBHE method named recursive mean
separate HE (RMSHE) proposes. In the BBHE
decomposing the image only once, the RMSHE
method proposes to perform image
decomposition recursively. Note that the
RMSHE method is equivalent to the CHE when
r = 0 (no sub- images are generated) and is
equivalent BBHE methods when r = 1 as shown
in Figure 2(a) and 2(b). The mathematically
showed that the brightness of the output image
is better preserved as r increases.
3.6 Non-parametric modified histogram
equalization for contrast enhancement
S. Poddar et al. (2013) has proposed Non-
parametric modified histogram equalization for
contrast enhancement [9].The proposed non-
parametric modified HE (NMHE)
Figure 2(a) RMSHE r=1 and Figure 2(b)
RMSHE r=2
Enhancement method performs HE on a
modified histogram which is explained in this
section. Let us consider an input image I, with
dynamic range [0-255], where I(i, j)∈[0, 255].
Step1: Compute histogram ( ) for input image
In order to proceed with NMHE, first read
image in data base and then calculate its
histogram.
Step2: Compute clipped histogram ( )
Consider the original histogram (hi) of any
generic image as shown in Figure 3(a). This
histogram is normalized and clipped to a value
of (1/L) as shown in Figure 3(b) defined by (4).
It is then subtracted from a perfectly uniform
5 Gourav Garg, Poonam Sharma
International Journal of Innovations & Advancement in Computer Science
IJIACS
ISSN 2347 – 8616
Volume 3, Issue 4
July 2014
probability density function (u) which is given
as
u=ones (L, 1)/L (4)
Figure 3(a). Histogram of image,
3(b).Clipped histogram at maximum level
of (1/L), where L is total no of gray level
Clipped histogram obtained from is given as
(K)=
(5)
if
Step3: Find ( ) using uniform histogram (u)
and clipped histogram ( )
Measure of un-equalization (Mu) is now
calculated by the following equation
(6)
Step 4: Calculate spike free histogram ( )
First the spikes are removed from the original
histogram. To compute the modified histogram
(hmod), Arici et al. proposed a method in which
they consider only those pixels which have
dissimilarity with their neighbour’s thus
removing spike from the histogram.
(i)=p[i|C] (7)
Where p[i|C] is the probability of occurrence of
grey- level given the event C, where C
denotes a horizontal contrast variation. C has
been assigned a default value of six empirically
and works fine with all sorts of image. The
modified histogram is then normalized by the
total no. of pixels considered in the above
process to keep the value in between ‘0’ and
‘1’.
Step 5: Use to obtain modified histogram
A unique parameter is calculated, which is used
in (8) to weight the uniform distribution and the
modified histogram ( ). This factor is
defined as measure of un-equalization (Mu) and
is calculated from the original histogram (hi) as
follows
+ (1-w) u (8)
The optimization function for a weighted
histogram is given by
(9)
Where W (i.j) is an average local variance of
pixels with the gray level I
Step6: Obtain modified HE image ( )
The output image produced NMHE
can be
expressed as
∈
(10)
Step7: using the altered histogram
This value of Mu indicates the degree to which
the histogram of any given image does not
follow a uniform distribution. It is then used as
weighing factor in (6) to obtain the modified
PDF given as
(11)
The CDF of the image is then obtained from
the eventually redesigned histogram ( ) as
(12)
The transformation function ( ) obtained by
using is given by
(13)
6 Gourav Garg, Poonam Sharma
International Journal of Innovations & Advancement in Computer Science
IJIACS
ISSN 2347 – 8616
Volume 3, Issue 4
July 2014
3.7. Brightness preserving dynamic fuzzy
histogram equalization
S. Sheet et al.(2010) has proposed brightness
preserving dynamic fuzzy histogram
equalization[10].The BPDFHE technique
operates the image histogram in such a way that
distribution of gray value in histogram is
equalize. It clearly depicts that no remapping of
the histogram peaks takes place, while only
redistribution of the gray-level values in the
valley portions between two consecutive peaks
takes place. The BPDFHE technique consists of
following operational stages:
Step1. Fuzzy Histogram Computation
Fuzzy histogram is a sequence of real numbers
h(i),I ∈
Where h(i) is the frequency of occurrence of
gray levels that are “around i”. By considering
the gray value I(x, y) as fuzzy number
the fuzzy histogram is computed as:
∈ (14)
Where is the triangular fuzzy
membership function defined as
(15)
And [a, b] is the support of the membership
function
Step2. Partitioning of the Histogram
The local maxima based partitioning of the
histogram, to obtain multiple sub-histograms, is
performed in this step. This way every valley
portion between two consecutive local maxima
forms a partition. When the dynamic
equalization of these partitions is performed, the
peaks of the histogram do not get remapped and
this results in better preservation of the mean
image-brightness while increasing the contrast.
(1)Detection of Local Maxima: The local
maxima in the Fuzzy Histogram are defined
using the first and second Derivative of the
Fuzzy histogram. Since the histogram is a
discrete data sequence, we use the central
difference operator for approximating a discrete
derivative
(2) Creating Partitions: The local maxima points
in the fuzzy histogram can now be used to form
the partitions. Let (n+1) intensity level
correspond to the local maxima, detected in the
previous stage of operation, i.e denoted by
{ }.Assume the original fuzzy
histogram is spread in the range of [ ],
then the (n+1) sub-histograms obtained after
partitioning are {[ ], [
],….[ ]}.
Step3. Dynamic Histogram Equalization of the
Partitions: The DHE [5] technique is used to
equalize the sub-histogram. This method uses a
spanning function based on total number of
pixels in the partition to perform equalization. It
involves two stages of operation, namely,
mapping partitions to a dynamic range and
histogram equalization.
Step4. Normalization of the image brightness
The image obtained from the dynamic
histogram equalization of each sub histogram
has the mean brightness that is slightly different
from the input image. To eliminate this
difference the normalization process is applied
on the output image. Let and be the
mean brightness levels of the input image and
the image (f) obtained after dynamic histogram
equalization stage. If g is the output image of
BPDFHE technique then the gray level value at
the pixel location (x, y) for the image g is given
as
(16)
7 Gourav Garg, Poonam Sharma
International Journal of Innovations & Advancement in Computer Science
IJIACS
ISSN 2347 – 8616
Volume 3, Issue 4
July 2014
This brightness preserving procedure ensures
that the mean intensity of the image obtained
after process is the same as the input.
4. Experiment Result:
Visual results have been displayed and
quantitative comparison has been done on the
basis of peak signal-to-noise ratio (PSNR),
Absolute mean brightness error (AMBE) and
Entropy.
4.1Peak signal to noise ratio (PSNR)
The value of PSNR is shows the ratio between
output image and input image, According to
definition of PSNR the output image quality is
better if that image has maximum PSNR.
Assume that N is the total number of pixels in
the input or output image, MSE (Mean Squared
Error) is calculated through (17). By the help of
MSE, we calculated value of PSNR. This is
defined by equation (18).
(17)
(18)
4.2. Absolute mean brightness error (AMBE)
The value of AMBE is shows the mean
brightness error between input image and output
image. If the value of AMBE is decreasing then
quality of image is decrease. Suppose is the
mean of the input image X = { } and is
the mean of the output image Y = { }. Then
AMBE is calculated by (19)
AMBE(X, Y) = | - | (19)
4.3. Entropy
The entropy is a valuable tool to measure of randomness that can be used to characterize the texture of i/p image. For a given PDF p, entropy
Ent[p] is computed by (20).
(20)
So AMBE is used to assess the degree of brightness preservation, while both PSNR and
entropy are employed to quantitatively assess the degree of contrast enhancement.
Figure 4: PSNR bar graph of image
enhancement of various techniques
Figure 5: AMBE bar graph of image
enhancement of various techniques
8 Gourav Garg, Poonam Sharma
International Journal of Innovations & Advancement in Computer Science
IJIACS
ISSN 2347 – 8616
Volume 3, Issue 4
July 2014
Figure 6: Entropy bar graph of image enhancement of various technique
Table 1: PSNR of various images
IMAGE HE CLAHE BBHE DSIHE BPDFHE NMHE
LENA 19.1347 18.8714 19.2751 19.3903 32.8156 26.0387
EINSTEIN 15.2397 17.8643 15.9589 16.2079 27.8884 21.3150
PEPPERS 20.5420 19.1508 20.9146 20.9014 36.9956 32.0912
HOUSE 17.6060 22.0949 17.3144 17.5636 28.2461 23.6592
Table 2: AMBE of various images
IMAGE HE CLAHE BBHE DSIHE BPDFHE NMHE
LENA 3.4437 7.1813 7.4376 4.3187 0.0297 11.5382
EINSTEIN 24.5969 17.8643 17.1839 14.1017 0.0217 11.8252
PEPPERS 4.4654 8.0643 2.2191 2.1136 0.0135 4.0654
HOUSE 10.6310 7.6559 13.1068 9.5043 0.0667 4.7692
Table 3: Entropy of various images
IMAGE HE CLAHE BBHE DSIHE BPDFHE NMHE
LENA 5.9690 7.8669 7.3478 7.3481 0.0058 7.2584
EINSTEIN 5.9664 7.7637 6.92 6.9141 0.0091 7.0311
PEPPERS 5.9778 7.8828 7.3554 7.3706 0.0 7.4060
HOUSE 5.4584 7.4624 6.25 6.2406 0.0072 6.1857
9 Gourav Garg, Poonam Sharma
International Journal of Innovations & Advancement in Computer Science
IJIACS
ISSN 2347 – 8616
Volume 3, Issue 4
July 2014
Table 1 contain the PSNR of various test images
after being enhanced by HE, CLAHE, BBHE,
DSIHE, BPDFHE and NMHE. After analysis of
table 1 we can show that the PSNR value of
BPDFHE is higher than other method, the
graphical representation of Table 1 is shown in
Figure 4. Table 2 represent various techniques
on the same image in term of AMBE. For all the
images value of BPDFHE is less than other
method in Table 2. The graphical represent of
Table 2 is shown in Figure 5. And same result
are shown in Table 3, entropy of the BPDFHE is
less than other method. The graphical represent
of Table 3 is shown in Figure 6.
Original
Image
1(a)
1(b)
1(c)
1(d)
HE
2(a)
2(b)
2(c)
2(d)
CLAHE
3(a)
3(b)
3(c)
3(d)
BBHE
4(a)
4(b)
4(c)
4(d)
DSIHE
5(a)
5(b)
5(c)
5(d)
10 Gourav Garg, Poonam Sharma
International Journal of Innovations & Advancement in Computer Science
IJIACS
ISSN 2347 – 8616
Volume 3, Issue 4
July 2014
BPDFHE
6(a)
6(b)
6(c)
6(d)
NMHE
7(a)
7(b)
7(c)
7(d)
Fig. 5: 1(a-d) represent original test images of Lena, Einstein, peppers and house respectively , 2(a-d)
represent enhance by HE, 3(a-d) represent enhance by CLAHE, 4(a-d) represent enhance by BBHE,
5(a-d) represent enhance by DSIHE, 6(a-d) represent enhance by BPDFHE , 7(a-d) represent
enhance by NMHE
It is analysis from the visual comparison that
BBHE exhibits better performance than HE due
to its partition-based enhancement. On the basic
of above result BPDFHE is best visual
performance compare than BBHE, DSIHE and
NMHE. For the AMBE quantitative test,
obviously the HE, BBHE and DSIHE methods
fail to preserve the original mean brightness.
Further these three methods tend to produce
intensity saturation and information loss.
Minimum AMBE is so that degree of brightness
preservation of BPDFHE, while both PSNR and
entropy of BPDFHE are employed to
quantitatively assess the degree of contrast
enhancement. The comparative study of
Histogram Equalization based methods shows
that the cases which require higher brightness
preservation and are not handled well by HE,
BBHE, DSIHE and NMHE have been properly
enhanced by BPDFHE, which are the extension
of HE method that provides maximal brightness
preservation. Though these methods can perform
good contrast enhancement hence it is observed
that NMHE and BPDFHE are better method for
enhancing the contrast and brightness
preserving.
5. Conclusion:
Histogram equalization (HE) is unable to
handle mean shift problem which is resolved
by BBHE and DSIHE. NMHE and BPDFHE
show better result visually. PSNR value of
NMHE and BPDFHE is better in comparison
to BBHE and DSIHE. BPDFHE outperforms
other methods on the basis of AMBE. NMHE
and BPDFHE achieve the best quality through
qualitative visual inspection and quantitative
accuracies of Peak Signal-to- Noise Ratio
(PSNR) and Absolute Mean Brightness Error
(AMBE) compared to other state-of-the-art
method.
References:
[1]. Rafael C. Gonzalez, and Richard E.
Woods “Digital Image Processing” Third
Edition Prentice Hall.
[2]. S.M. Pizer, R. E. Johnston, “Contrast-
Limited Adaptive Histogram Equalization:
11 Gourav Garg, Poonam Sharma
International Journal of Innovations & Advancement in Computer Science
IJIACS
ISSN 2347 – 8616
Volume 3, Issue 4
July 2014
Speed and Effectiveness”, IEEE Transactions
on Consumer Electronics, 1990.
[3]. yeong-Theg –kim,”contrast enhancement
using brightness preserving bi histogram
equalization”, IEEE trans.consum. Electron
Vol.43, no.1 (Feb 1997)
[4].Yu wang, quin chen Baomin zhang.
“Image enhancement based on equal area
dualistic sub image histogram equalization
method”, IEEE trans. consume
electron.Vol.45, no.1 (Feb1999)68-75.
[5]. S. Chen and A. R. Ramli, “Minimum
mean brightness error bi-histogram
equalization in contrast enhancement,” IEEE
Transactions on Consumer Electronics, vol.
49, no. 4, pp. 1310-1319, 2003.
[6]. S. D. Chen, and A. R. Ramli, “Contrast
enhancement using recursive mean-separate
histogram equalization for scalable brightness
preservation”, IEEE Trans. Consumer
Electronics, vol. 49, no. 4, pp. 1301-1309,
Nov. 2003.
[7] K. S. Sim, C. P. Tso, and Y. Y. Tan,
“Recursive sub- image histogram equalization
applied to gray-scale images”,IEEE Trans.
Consumer Electronics, 28, pp. 1209-1221,
July 2007.
[8] M. Kim, and M. G. Chung, “Recursively
separated and weighted histogram equalization
for brightness preservation and contrast
enhancement”, IEEE Trans. Consumer
Electronic, vol. 54, no. 3, pp. 1389-1397,
August 2008.
[9] S.Poddar, S.Tewary, “Non-parametric
modified histogram equalisation for contrast
enhancement”, I.E.T. , vol.7,no.7,pp. 641–652,
2013.
[10] D.Sheet, H.Garud, “Brightness
Preserving Dynamic Fuzzy Histogram
Equalization”, IEEE Trans. Consumer
Electronics, vol. 56, no. 4, Nov. 2010.