Y.-T.
Kim Contrast Enhancement Using Brightness Preserving Bi-Histogram Equalization 1
Contrast Enhancement Using Brightness Preserving Bi-Histogram
Equalization
YEONG-TAEG
KIM, MEMBER, IEEE
Signal Processing R&D Center, Samsung Electronics Co., Suwon, IKorea
(voice) $82-331-200-3186, (fax) +82-331-200-3147, (e-mail) kimyt [Link]
ABSTRACT radar image processing [3, 41. In general, histogram
equalization flats the density distribution of the re-
Histogram equalization is widely used for contrast
sultant image and enhances the contrast of the image
enhancement in a variety of applications due to its
as a consequence, since histogram equalization has an
simple function and effectiveness. Examples include
effect of stretching dynamic range.
medical image processing and radar signal process-
In spite of its high performance in enhancing con-
ing. One drawback of the histogram equalization can
trasts of a given image, however, it is rarely employed
be found on the fact that the brightness of an im-
in consumer electronics such as TV since the straight
age can be changed after the histogram equalization,
use of histogram equalization may change the origi-
which is mainly due to the flattening property of the
nal brightness of an input image, deteriorate visual
histogram equalization. Thus, it is rarely utilized in
quality, or, introduce some annoying artifacts. Note
consumer electronic products such as T V where pre-
that the mean brightness of the resultant output im-
serving original input brightness may necessary in or-
age approaches to the middle gray level as the output
der not to introduce unnecessary visual deterioration.
density of the histogram equalizer uniforms. In the-
This paper proposes a novel extension of histogram
ory, it can be shown for the histogram equalization of
equalization to overcome such drawback of the his-
an analog image that the mean of the equalized image
togram equalization. The essence of the proposed
is the middle gray level regardless of the input mean,
algorithm is to utilize independent histogram equal-
which is not a desirable property in some applications
izations separately over two subimages obtained by
where mean preserving is necessary.
decomposing the input image based on its mean with
a constraint that the resulting equalized subimages In this paper, a novel extension of the histogram
are bounded by each other around the input mean. equalization, which will be referred to as the mean
It will be shown mathematically that the proposed al- preservzng bz-hzstogram equalzzatzon (BBHE) [5], is
gorithm preserves the mean brightness of a given im- proposed to overcome the aforementioned problems
age significantly well compared to typical histogram of the typical histogram equalization. The ultimate
equalization while enhancing the contrast and, thus, goal of the proposed algorithm is to preserve the mean
provides much natural enhancement that can be uti- brightness of a given image while the contrast is en-
lized in consumer electronic products. hanced.
The BBHE firstly decomposes an input image into
Keywords: Histogram equalization, contrast enhance- two subimages based on the mean of the input image.
ment, image enhancement, bihistogram equalization. One of the subimages is the set of samples less than
or equal to the mean whereas the other one is the set
of samples greater than the mean. Then the BBHE
1. INTRODUCTION equalizes the subimages independently based on their
respective histograms with the constraint that the
Histogram equalization is the one of the well-known samples in the formal set are malpped into the range
methods for enhancing the contrast of given images in from the minimum gray level to the input mean and
accordance with the sample distribution of an image the samples in the latter set are mapped into the
[l, 21. Useful applications of the histogram equal- range from the mean t o the maximum gray level. In
ization scheme include medical image processing and other words, one of the subimages is equalized over
Contributed Paper
Manuscript received October 30, 1996 0098 3063t97 $10.00 @ 1997 IEEE
2 IEEE Transactions on Consumer Electronics, Vol. 43, No. 1, FEBRUARY 1997
Figure 1: The original image couple and the result of histogram equalization.
the range up to the mean and the other subimage histogram of the input image which represents the
is equalized over the range from the mean based on number of pixels that have a specific intensity [Link]
the respective histograms. Thus, the resulting equal- fact, a plot of nk vs. Xk is known as the histogram
ized subimages are bounded by each other around the of X . Based on the probability density function, we
input mean, which has an effect of preserving mean define the cumulative density function as
brightness.
In what follows, typical histogram equalization for
digital input image is reviewed in Section 2, and the
details of the BBHE with mathematical formulation
is followed in Section 3 . Section 4 establishes math- where xk = z, for k = 0, l , . . . , L - 1. Note that
ematical analysis on the mean brightness of the out- c ( X ~ - l=
) 1 by definition. Histogram eqaulization is
put of the BBHE. To illustrate the performance and a scheme that maps the input image into the entire
the property of the BBHE, experimental results are dynamic range, ( X o ,X L - ~ )by
, using the cumulative
drawn in Section 5. density function as a transform function. That is,
let ns define a transfom function f(x) based on the
2. H I S T O G R A M E Q U A L I Z A T I O N cumulative density function as
Let X = { X ( i ,j ) } denote a given image composed of
L discrete gray levels denoted as { X O X , I ,. . ' , X L - ~ } ,
where X ( i ,j ) represents an intensity of the image at then the output image of the histogram equalizat*ion,
the spatial location ( i , j ) and X ( i , j ) E {XO,X1, Y = { Y ( i j, ) } , can be expressed as
X L - ~ } .For a given image X , the probability density
function p ( X k ) is defined as y = f(X) (4)
= { f ( X ( i j, ) ) I V X ( i , j ) E X I . (5)
One example of the histogram equalization is ii-
lustrated in Fig. 1, where the first image is an orig-
for IC = 0 , 1 , . . . , L - 1, where nk represents the num- inal image couple and the second one is the result
ber of times that the levele X k appears in the input of the histogram equalization. This result shows the
image X and n is the total number of samples in the high performance of the histogram equalization in en-
input image. Note that p ( X k ) is associated with the hancing the contrast of an image as a consequence of
3
Figure 2: The respective histograms of the images shown in Fig. 1.
the dynamic range expansion, which can be easily un- ages before and after the equalization, one can ob-
derstood by comparing the respective histograms of serve that the contrasts around the letters and the
those images shown in Fig. 2. emblem on the airplane are degraded. The reason for
As addressed previously, histogram equalization such limitations of the histogram equalization for this
can introduce a significant change in brightness of example can be easily understood from Fig. 6. Note
an image, which hesitates the direct application of that the bright gray levels are mapped to relatively
the histogram equalization schme in consumer elec- much dark gray levels by the histogram equalizata-
tronics. For instance, Fig. 3 shows an original im- tion, which is simply due to the fact that the input
age hands and the resultant image of the histogram image has a high density over bright gray levels as
equalization which are composed of 256 gray levels. can be seen from the first histogram shown in Fig 5.
Observe here that the histogram equalized image is More fundamental reason behind the such limi-
much brighter than the input image. It can be also tations of the histogram equalzat,ion is that the his-
observed that the overall contrast of the input image toram equalzation does not take the mean brightness
is degraded after the histogram equalization. This is a of an image into account. In the subsequent sec-
direct consequence of the excessive change in bright- tions, a new contrast enhancement algorithm is for-
ness by the histogram equalization when the image mally proposed based on the histogram equalization.
has a high density over low gray levels. Note that the The proposed algorithm utilizes the mean brightness
histogram equalization maps its input gray to a gray which is the one of the important statistics of an im-
level which is proportional to the cumulative density age.
up to the input gray level regardless of the input gray
level. 3. BRIGHTNESS PRESERVING
Another example which shows the limitation of BI-HISTOGRAM EQUALIZATION
the histogram equalization is illustrated in Fig. 4,
where the first image is a given original image F16 Denote by X , the mean of the irnage X and assume
and the second one is the result of histogram equal- that X , E { X O , X ~ , . . . .,]Based
XL-~ on}the mean,
ization. The respective histograms of those images the input image is decomposed into two subimages
are shown in Fig. 5 and the transform function as- XL and Xu as
sociated with (3) is depicted in Fig. 6. First, un-
natural enhancement can be seen from this example
around the cloud after the histogram equalization.
In other words, one would perceive totally different where
visual recognition around the cloud after the equal-
ization. Moreover, if we investigate closely the im-
IEEE Transactions on Consumer Electronics, Vol. 43, No. 1, FEB:RUARY 1997
Figure 3: The original image hands and the result of histogram equalization.
and where X k = 2 . Note that C L ( X ~=)1 and c u ( X ~ - l )=
1 by definition.
Xu = { X ( i , j ) l X ( i , j )> X m , ' d X ( i , j )E X ) . (8) Similar to the case of histogram equalization where
a cumulative density function is used as a transform
Note that the subimage XL is composed of {XO,X I , function, let us define the following transform func-
. . . , X,} and the other subimage Xu is composed of
tions exploiting the cumulative density functions
{ x m + 1~X m + 2 , . . . , XL-I}.
Next, define the respective probability density func-
tions of the subimages XL and Xu as
and
p ~ ( X k ) =-,4 where k = O , l , . . . , m , (9)
nL
and Based on these transform functions, the decomposed
subimages are equalized independently and ithe com-
pu(X,) = -,
n: where IC = m + l , m + 2 , . . . , L - 1, position of the resulting equalized subimages consti-
nu tutes the output of the BBHE. That is, the output
(10)
image of the BBHE, Y , is finally expressed as
in which n i and nb represent the respective numbers
of Xk in {X}, and {X},, and n L and nu are the
total numbers of samples in {X}L and {X}u, respec-
L-1
tively. Note that n L = Crzo n i , nu = Ck=m+l TI&,
+
and R = n~ nu. The respective cumulative density where
functions for {X}L and {X}u are then defined as
and
and
If we note that 0 5 c ~ ( z ) , c u ( z ) 5 1, it is easy to
see that f~(x~)equalizes the subimage XL over the
Y.-T. Kim Contrast Enhancement Using Brightness Preserving Bi-Histogram Equalization 5
Figure 4: The original image F16 and the result of histogram equalization.
0.03-
t
0.025 -
0'02
0.015
gray level gray levc
Figure 5: The respective histograms of the images shown in Fig. 4.
6 IEEE Transactions on Consumer Electronics, Vol. 43, No. 1, FEBRUARY 1997
w
Histogram Histogram
1 Computation I Splitter
__51
lFrame -
Mean
c f
Frame
Memory
X Mapper
J
Figure 6: The transform function associated with (3) Figure 7: The functional block diagram of the BBHE
for F16. for H/W realization.
4. ANALYSIS ON THE BRIGHTNESS
range (XO, X,) whereas f u ( X ~equalizes
) the subim- CHANGE BY THE BBHE
age Xu over the range ( X , + ~ , X L - ~ )As
. a conse-
quence, the input image X is equalized over the entire Suppose that X is a continuous random variable, i.e.,
dynamic range (Xo,X L - ~ )with the constraint that L = CO, then the output of the histogram equaliza-
tion, Y is also regarded as a random variable. It is
the samples less than the input mean are mapped to
well known that the histogram equalization produces
(XO,X,) and the samples greater than the mean are
an image whose gray levels have a uniform density,
mapped to (X,+l, XL-1).
i.e.,
The functional block diagram for realizing the pro- p ( z ) = l/(XL-l - XO) (20)
posed algorithm in H/W is shown in Fig. 7, in which
the histogram computation unit counts and stores for X O 5 z 5 X L - ~[a]. Thus, it is easy to show
the respecitve numbers of occurrences nk for k = that the mean brightness of the output image of the
0 , 1 , . . . , L - 1, the histogram splitter then splits the histogram equalization is the middle gray level since
number of occurrences as (no,...,n,) and (n,+l, XL-1
. . . , n~-1),the respective and independent cumula- (21)
tive density functions CL(.) and CU(.) are then com-
puted b a s e d o n ( n o , n l , . . . , n , ) a n d ( n , + l , . . . , n L - l ) ,
respectively, and where the mapper outputs Y (i, j ) as
Y ( i , j )= xo + ( X , - XO)CL(Z),
ifzLX,
X,t1 + (&-I - X,+l)cu(~),
else where E ( . ) denotes a statistical expectation. It should
(19) be emphasized here that the output mean of the his-
which is based on the equation (16). Note that the togram equalization has nothing to do with the input
computations of the histograms and mean typically image. That i s , it i s always the middle gray level
need to be done during one frame period; thus, a no matter how much the input image is bright/dark.
frame memory to store the image being processed is Clearly, this property is not desirable in many appli-
necessary as shown in Fig. 7. However, it is also cations.
possible to reject the frame memory if we note that Turning our attention to the mean change by the
there usually exists high correlation in video signal BBHE, suppose that X is a random variable which
between adiacent frames. This is also claimed in b l . ~ L-J
has a symmetric distribution around its mean X,.
Y.-T. Kim Contrast Enhancement Using Brightness Preserving Bi-Histogram Equalization 7
If we note that the subimages are equalized inde- results clearly show that the proposed algorithm out-
pendently, the mean brightness of the output of the performs the typical histogram equalization in points
BBHE can be expressed as that it preserves the mean brightness of a given image
while enhancing the contrast, and consequentially it
E(Y) = E(YIX 5 X,)Pr(X 5 X,) results in more natural enhancement.
+E(YIX > X,)PT(X > X,)
1
= -{E(YIX 5 X,)
2
+E(YIX > Xm)} (24) II -I
where we used P r ( X 5 X,) = P r ( X > X,) = ?j-
since X is assumed to have a symmetric distribution
around X,. With the similar discussion used t o ob-
tain (22), it can be easily shown that
and
E(YIX > X,) =(X, + X~.-i)/2. (26)
The use of (24) and (25) in (23) results in
gray level
1
E ( Y )= 2 ( x m -k XG), (27)
Figure 9: The histogram of F1B after enhanced by
where the BBHE.
XG =
xo + XL-1 ) (28)
2
is the middle gray level, which implies that the mean 6. CONCLUSION
brightness of the equalized image by the BBHE lo-
cates in the middle of the input mean and the middle In this paper, a newly developed contrast enhance-
gray level. Note that the output mean of the BBHE is ment algorithm referred t o as the rzghtness preservzng
a function of the input mean brightness X , . This fact bz-hzstogrum equalzzatzon (BBHE:) is proposed. The
clearly indicates that the BBHE preserves the bright- BBHE is a novel extension of a typical histogram
ness compared to the case of typical histogram equal- equalization, which utilizes independent histogram equal-
ization where the output mean is always the middle izations over two subimages obtained by decomposing
gray level. the input image based on its mean. The ultimate goal
behind the BBHE is to preserve the mean brightness
5 . SIMULATION RESULTS of a given image while enhancing the contrast of a
given image. Analysis on the (output mean of the
To demonstrate the performance of the proposed al- BBHE for a given analog image having symmetric
gorithm, simulation results of the BBHE for the given distribution is also established mathematically, which
images shown in Figs. 3 and 4 are presented in Fig. indicates that the BBHE is capable of preserving the
8. Observe that the brightness of the original im- mean brightness of a given image. Simulation re-
ages are preserved well compared to the results of sults also demonstrate the brightness-preserving func-
the histogram equalization shown in Figs. 3 and 4. tion of the BBHE while enhanciing contrasts. Hence,
Also observe that the BBHE results in more natural many applications can be made possible by utilizing
enhancement around the cloud than the typical his- the proposed algorithm in the field of consumer elec-
togram equalization. The contrasts around the letters tronics, such as TV, VTR, or, camcorder. In the view
on the tail-wing of the F16 are enhanced whereas the point of H/W implementation, however, the proposed
typical histogram equalization is failed as discussed algorithm requires more complicated H/W than the
previously. The output histogram of the BBHE for typical histogram equalization. For effective use of
the image F16 is depicted in Fig. 9. The simulation the proposed algorithm in applications, an effort to
8 IEEE Transactions on Consumer Electronics, Vol. 43, No. 1, FEBRUARY 1997
Figure 8: The results of the BBIIE for the original images shown in Figs. 3 and 4
reduce the complexity should be made such as the [B] Yeong-Taeg Kim, “Method and circuit for video
method introduced in [6] which makes use of quan- enhancement based on the quantized mean sep-
tized probability density functions. arate histogram equalization,” filed an a Korean
patent, March 9, 1996, Appl. No. 6220.
7. REFERENCES
[l] J . S. Lim, Two-Dimensional Signal and Image
Processing, Prentice Hall, Englewood Cliffs, New
Jersey, 1990.
Yeong-Taeg Kim was born
[a] R. C. Gonzalez and P. Wints, Digital Image Pro- in November 13, 1962 in Seoul,
cessing, 2nd Ed., Addison-Wesley Publishing Co., Korea. In 1988, he received
Reading, Massachusetts, 1987. the B.E. degree in electron-
ics in the Department of Elec-
[3] J . Zimmerman, S. Pizer, E. Staab, E. Perry, tronics from Yonsei Univer-
W. McCartney, and B. Brenton, “Evaluation of sity, Seoul, Korea. l?rom 1589
the effectiveness of adaptive histogram equalization t o 1993, he joined the grad-
uate program in Edectrical
for contrast enhancement,” IEEE Tr. on Medical
Engineering a t the Univer-
Imaging, pp. 304-312, Dec. 1988.
sity of Delaware, Newark,
Delaware, where he received the M.S.E.E. and [Link]. de-
[4] Y. Li, W. Wang, and D. Y. Yu, “Application of
grees in January 1992 and August 1593, respective1.y. His
adaptive histogram equalization to x-ray chest im-
research interests include nonlinear signal processing, sta-
age,” Proc. of the SPIE, pp. 513-514, vol. 2321, tistical signal processing, adaptive filtering, image pro-
1994. cessing, and applications of signal processing in digital
communications. He is with the Signal Processing R & D
[5] Yeong-Taeg Kim, “Method and circuit for video
Center, Samsung Electronics Co., Suwon, Korea, where he
enhancement based on the mean separate his- is a senior engineer working on signal and image process-
togram equalization,” f i l e d in a Korean patent, ing problems in digital camcoders and HDTV systems.
March 9, 1996, Appl. No. 6219.