Documente Academic
Documente Profesional
Documente Cultură
4, NOVEMBER 2005
Abstract Histogram equalization (HE) is a simple and undesirable artifacts. In theory, the mean brightness of its
effective image enhancing technique, however, it tends to output image is always the middle gray level regardless of the
change the mean brightness of the image to the middle level of input mean, because the desired histogram is flat. This is not
the permitted range, and hence is not very suitable for a desirable property in some applications where brightness
consumer electronic products, where preserving the original preservation is necessary.
brightness is essential to avoid annoying artifacts. This paper Brightness preserving Bi-Histogram Equalization (BBHE)
proposes a novel extension of histogram equalization, actually has been proposed to overcome that problem [3]. BBHE first
histogram specification, to overcome such drawback as HE. separates the input images histogram into two by its mean,
To maximize the entropy is the essential idea of HE to make and thus two non-overlapped ranges of the histogram are
the histogram as flat as possible. Following that, the essence obtained. Next, it equalizes the two sub-histograms
of the proposed algorithm, named Brightness Preserving independently. It has been analyzed that BBHE can preserve
Histogram Equalization with Maximum Entropy (BPHEME),
the original brightness to a certain extent when the input
tries to find, by the variational approach, the target histogram
histogram has a quasi-symmetrical distribution around its
that maximizes the entropy, under the constraints that the
mean. Later, equal area Dualistic Sub-Image Histogram
mean brightness is fixed, then transforms the original
histogram to that target one using histogram specification. Equalization (DSIHE) has been proposed, it claims that if the
Comparing to the existing methods including HE, Brightness separating level of histogram is the median of the input
preserving Bi-Histogram Equalization (BBHE), equal area images brightness, it will yield the maximum entropy after
Dualistic Sub-Image Histogram Equalization (DSIHE), and two independent sub-equalizations [4]. DSIHE will change the
Minimum Mean Brightness Error Bi-Histogram Equalization brightness to the middle level between the median level and
(MMBEBHE), experimental results show that BPHEME can the middle one of the input image.
not only enhance the image effectively, but also preserve the Nevertheless, neither BBHE nor DSIHE could preserve the
original brightness quite well, so that it is possible to be mean brightness. Then Minimum Mean Brightness Error Bi-
utilized in consumer electronic products1. Histogram Equalization (MMBEBHE) is proposed to preserve
the brightness optimally [5]. MMBEBHE is to perform the
Index Terms Image enhancement, histogram equalization, separation based on the threshold level, which would yield
histogram specification, maximum entropy, variational approach, minimum difference between input and output mean. This
mean brightness preserving.
threshold level is essentially chosen by enumeration.
Another scheme, named Recursive Mean-Separate
I. INTRODUCTION
Histogram Equalization (RMSHE), has been proposed to
Histogram is defined as the statistic probability distribution preserve the brightness [6]. RMSHE uses the BBHE
of each gray level in a digital image [1]. Histogram iteratively. First RMSHE separates the input histogram into
equalization (HE) is one of the well-known methods for two pieces, by the mean. Then, to each piece, it uses this
enhancing the contrast of given images, making the result operation many times to generate 2n-pieces histograms.
image have a uniform distribution of the gray levels [1]. It Finally, it equalizes each histogram piece independently. It is
flattens and stretches the dynamic range of the images claimed theoretically that when the iteration level n grows
histogram and results in overall contrast improvement. HE has larger, the output mean converges to the input mean, and thus
been widely applied when the image needs enhancement, such yields good brightness preservation. Actually, when n grows to
as medical images enhancement [2]. However, in consumer infinite, the output histogram is exactly the input histogram,
electronics such as TV, HE is rarely employed because it may and thus the input image will be output without any
significantly change the brightness of an input image and cause enhancement at all.
1
In the consumer electronics such as TV, the preservation of
C. Wang is with the Institute of Statistical Signal Processing, Department
of Electronic Engineering and Information Science, University of Science and brightness is highly demanded. The aforementioned algorithms
Technology of China (USTC), Hefei, Anhui, 230027, P.R.China (e- (HE, BBHE, DSIHE, MMBEBHE and RMSHE) preserve the
mail:chaowang@mail.ustc.edu.cn). brightness to some extent, however, they do not meet that
Z. Ye is the corresponding author with the Institute of Statistical Signal
Processing, Department of Electronic Engineering and Information Science,
desirable property quite well.
University of Science and Technology of China (USTC), Hefei, Anhui, In this paper, a novel enhancement method is proposed
230027, P.R.China, and he is also with the National Laboratory of Pattern which can yield the optimal equalization in the sense of
Recognition (NLPR), Institute of Automation, Chinese Academy of Sciences,
entropy maximization, under the constraint of the mean
Beijing, 100080, P.R.China. (e-mail: yezf@ustc.edu.cn).
Contributed Paper
Manuscript received October 9, 2005 0098 3063/05/$20.00 2005 IEEE
C. Wang and Z. Ye: Brightness Preserving Histogram Equalization with Maximum Entropy: A Variational Perspective 1327
brightness, called Brightness Preserving Histogram where S is the support set of input gray level r. (4) is called
Equalization with Maximum Entropy (BPHEME). SML (Single Mapping Law) in [7], and a general mapping law
BPHEME, together with the aforementioned algorithms, is (GML) is proposed in [7], to improve the accuracy of HS. In
essentially a kind of histogram specification [1] in general, this paper, we use SML, i.e., eq.(4), for its simplicity to realize.
except that different ideal histograms are employed in
B. Special Cases of Histogram Specification
different algorithms. In the next section, histogram
specification will be reviewed, and HE, BBHE, DSIHE, HS can approximately yield a desirable histogram, however
MMBEBHE will be quickly introduced as special cases of what is a desirable one? It is a problem deserving discussion.
histogram specification. In Section III, the proposed algorithm, The aforementioned algorithms such as HE, BBHE, DSIHE
BPHEME, will be presented, which is ideal in the sense of and MMBEBHE, are all histogram specification essentially,
maximum entropy with an invariant mean brightness. Section see Fig.1 for the general shape of their desirable histograms.
IV will list groups of experimental results to claim the Without loss of generality, we assume that r has been
performance of BPHEME, comparing with the ones of HE, normalized to the interval S=[0,1], with r=0 representing black
BBHE, DSIHE and MMBEBHE. Section V makes some and r=1 representing white.
concluding remarks.
r
If we choose T (r ) = p r ( w)dw like (1), it is not difficult to
0
s = T (r ) = p r ( w)dw (1)
0 find that the PDF of the output gray level z follows a uniform
where T is essentially the cumulative operator and s is the distribution ranging from 0 to 1. Or, we may say that the
cumulative histogram, i.e., the distribution function of the determination for the variable z at a given pixel will provide us
variable r. Suppose next that we define a random variable z the maximum information, because z equals to any gray level
with the property with equal probability, thus, it contains the most uncertainty.
z
G ( z ) = p z (t )dt = s (2) HE can be regarded as a special case of HS when we choose
0
the target output histogram as a uniform one, pz(z)=1, 0 z 1.
It then follows from these two equations that G(z)=T(r) and, 2) Brightness preserving Bi-Histogram Equalization
therefore, that z must satisfy the condition As mentioned before, the desired histogram of HE is
z = G 1 ( s ) = G 1 [T (r )] (3) uniform, and thus its desired mean brightness is 0.5, the
That is the theoretical case. In application, we would like to middle level of S. So the mean brightness can not be preserved
map each given input gray level r to an output one, z, which by HE.
yields the closest distance between the input and output BBHE [3] first separates the input histogram into two parts
cumulative histogram, i.e., based on its mean brightness, and then equalizes the two sub-
z (r ) = arg min z | T (r ) G ( z ) |, r S (4) histograms independently. Thus there is a step in the histogram
1328 IEEE Transactions on Consumer Electronics, Vol. 51, No. 4, NOVEMBER 2005
1
at the gray level x B = r = rp r (r )dr . The desirable cause a more comfortable perception. A further
0 comprehension is that a uniform distribution limited to a given
histogram of BBHE is a piecewise constant one as range gives the maximum information, measured by entropy!
1 xB So we would like to find an ideal histogram (PDF) as a
x 0 p r (r )dr , 0 z < xB
target one to perform the histogram specification. That ideal
p z ( z) = B (6)
1 1 histogram preserves the mean brightness of the input image,
p r (r )dr , x B z 1
1 x B xB and has the maximum entropy. That is the basic thought of our
proposed method. In this section we quickly introduce the
It is reported that BBHE can preserve the mean brightness,
entropy of a continuous variable first, then we give the
if the input histogram has a symmetrical distribution around its
corresponding functional extremum problem and solve it.
mean. However, that assumption is not the fact in many cases,
and thus BBHE can not always preserve the brightness well. A. Preliminary Information Theory [8]
3) Dualistic Sub-Image Histogram Equalization Definition 1: Let X be a random variable with cumulative
DSIHE [4] is very similar to BBHE, except that the distribution function F(x)=Pr(Xx). If F(x) is continuous, the
separating point xD is selected as the median gray level of the random variable is said to be continuous. Let f(x)=F(x) when
input image, i.e., xD satisfies +
xD the derivative is defined. If f ( x)dx = 1 , then f(x) is called
p r (r )dr = 0.5 (7)
0
the probability density function (PDF) for X. The set where
For the applicable case, it may be modified as f(x)>0 is called the support set of X.
x
x D = arg min x | p r (r )dr 0.5 | (8) Definition 2: The differential entropy h(X) of a continuous
0
random variable X with a density f(x) is defined as
The purpose of DSIHE is to find a separating point, based
on which the desired histogram (PDF) can obtain a maximum h( X ) = f ( x) log f ( x)dx (10)
S
entropy. And it has been proved that the brightness of the where S is the support set of the random variable.
output image is The differential entropy is a convex function over a convex
z = 0.5 (xD + 0.5) (9) set, and depends only on the probability density of the random
It is clear that DSIHE always pulls the output brightness variable, hence the differential entropy is sometimes written as
toward the input middle level from the input median level. h(f) rather than h(X).
4) RMSHE and MMBEBHE h(X) characterizes the randomness of the variable X, the
RMSHE [6] is to recursively implement BBHE to the more random (chaotic) the variable is, the more information it
histogram. Obviously, recursive separation on the histogram may provide, the more the differential entropy is.
will divide the histogram into very small pieces. If the Since we will not compare the randomness between
recursive level tends to infinite, equalization to each small continuous and discrete variables, we will not differentiate
piece will not change the whole histogram, and thus can between a continuous variables differential entropy and a
preserve the mean brightness. So an infinite recursive level discrete variables entropy. So in the following parts, h(X) is
results in the same output image as the input one. also named as the continuous variables entropy.
BBHE and DSIHE belong to two-piece-separating
histogram equalization algorithm, and so does HE in a broad B. BPHEME: Brightness Preserving Histogram
Equalization with Maximum Entropy
sense. MMBEBHE [5] is another modification to two-piece-
separating histogram equalization algorithm. MMBEBHE After the entropy of a continuous variable has been defined,
directly considers the gray level, based on which the input we can return to what we are discussing.
histogram is separated. It chooses the separating level that Since the preservation of the mean brightness is of high
produces the minimum absolute mean brightness error (AMBE) demands in consumer electronics such as TV, we may find an
to the original image. It really can preserve the brightness quite enhancement method with the mean brightness being
well. It is essentially an enumeration method though the constrained.
authors of [5] provided a recursive method to compute AMBE. As has been said in the preface of this section, let an image
Further more, this method fixed the type of desirable be enhanced optimally means that the histogram (PDF) may
histogram to a piecewise constant function with a step, this have the most entropy. Thus an optimal brightness preserving
choice does not seem to have a convincing theoretical stand. enhancement method using histogram transformation may be
to maximize the target histograms entropy under the
III. BRIGHTNESS PRESERVING HISTOGRAM EQUALIZATION constraints of brightness. Mathematically speaking, we want to
WITH MAXIMUM ENTROPY maximize h(f) over all probability densities f subject to some
Let us re-focus our attention on HE. As mentioned in constraints:
section II-B.1, HE is to make the output histogram as flat as
possible. A superficial reason for HE relies on that a flat
histogram makes all the gray levels uniform, and thus will
C. Wang and Z. Ye: Brightness Preserving Histogram Equalization with Maximum Entropy: A Variational Perspective 1329
s
c( s ) = f (t )dt
f ( s ) 0, s S 0
max f { f ( s ) log f ( s )ds}, s . t . f ( s )ds = 1 (11) s , if r = 0.5 (17)
S S 2 s
= e 1 s S
sf ( s )ds = r
S e 2 1 , if r (0,0.5) (0.5,1)
where S=[0,1] is the normalized support set of gray level, and Had f(s) or c(s) been given, we can specify the input images
1
r = rp r (r )dr is the mean brightness of the input image. histogram under the instruction of f(s) or c(s), using histogram
0
specification introduced in section II-A.
Because a whole white or a whole black image is not the input In applications, real-time processing is desired. It had better
image in general, we assume r (0,1) . not cost too much time in solving (16). Fortunately, r(2) is
Since h(f) has the convexity, we form the functional monotonically increasing, and we can pre-list a table that
1 1
J ( f ) = f ( s ) ln f ( s )ds + 1 [ f ( s )ds 1] designates a 2 to each r. It is not necessary to discretize r
0 0
(12) too delicately, since the following operation HS is
1
+ 2 [ sf ( s )ds r ] implemented to a discrete case, and is an approximation in
0
essence. Whats more, Fig.2 shows the relation r(2) is anti-
where 1, 2 are the undetermined parameters, and here we symmetrical about (r, 2)=(0,0.5), so the memory cost can be
specify the logarithmical function as the nature one. further reduced by half. The pre-listing table will not cost too
Using the variational approach, we can differentiate with much computing time and memory at all.
respect to f(s), the sth component of f, to obtain
J C. Discussions on Discrete Version of BPHEME
= ln f ( s ) 1 + 1 + 2 s = 0, s S (13)
f ( s ) The BPHEME scheme introduced in section III-B can be
thus easily implemented to the discrete image. However, in this
section we must clarify something related.
f ( s ) = e 1 1 e 2 s , sS (14)
The expression with maximum entropy is only suitable for
Using the second and third constraints in (11), we may find the continuous case. The histogram mapping methods,
1 , if r = 0 .5 including all the aforementioned methods, are likely to merge
f ( s ) = 2 e 2 s s S (15) some neighboring gray levels into a single one in the output
e 2 1 , if r (0,0.5) (0.5,1) image, and thus the processing of histogram mapping will
In (15), 2 can be determined. When r0.5, 2 is the decrease (or at most preserve) the discrete entropy of the
solution of equation histogram undoubtedly. So in a discrete case of BPHEME,
e 2 e 2 + 1 theoretically speaking, BPHEME may not maximize the
r = 2 (16) discrete entropy, the mean brightness preserving output image
2 (e 2 1)
with maximum discrete entropy is certainly the input one, and
and 2=0 when r=0.5. It is a single-valued function of r with thus the enhancement makes no sense. Though BPHEME does
respect to 2, as shown in Fig.2. So given a r (0,1) , there not maximize the discrete entropy, the continuous variables
exists the only 2 that generates the mean brightness as r. differential entropy defined by (10) can still be maximized by
BPHEME.
origin BPHEME HE
Fig.5 Histograms of each enhanced image bottle based on aforementioned algorithms in Fig.4. The line plot in each sub-figure is the desirable
histogram of BPHEME.
one. The whole contrast is much more interpretable using more uncertain than the input image, so the differential entropy
continuous variables differential entropy than using the of the output is larger than the input, and thus it may be an
discrete variable entropy, as shown in Fig.3. The input image enhanced version of the input image.
has the gray levels in a small interval, and the output image is
to stretch the gray levels in a larger interval. Thus they have IV. EXPERIMENTAL RESULTS
the same discrete entropy. However, the output is obviously
enhanced due to its larger dynamic range than the input. In a A. Experiments of HE, BBHE, DSIHE MMBEBHE and
continuous view, see the dotted line in Fig.3, the histogram of BPHEME
the output image is more flat and the gray level of a pixel is In this section, we present some experimental results of our
C. Wang and Z. Ye: Brightness Preserving Histogram Equalization with Maximum Entropy: A Variational Perspective 1331
origin BPHEME HE
origin BPHEME HE
origin BPHEME HE
outperforms the existing histogram processing methods in the In the view of visual quality, from Fig.4, Fig.7-Fig.10, it is
sense that BPHEME can preserve the mean brightness quite well, shown that BPHEME does enhance the original image, and it
which is very suitable for consumer electronics such as TV. is at least not worse than the existing methods.
C. Wang and Z. Ye: Brightness Preserving Histogram Equalization with Maximum Entropy: A Variational Perspective 1333
origin BPHEME HE
TABLE I
MEAN BRIGHTNESS OF THE EXPERIMENTAL RESULTS
TABLE II
DISCRETE ENTROPY OF THE EXPERIMENTAL RESULTS (:BITS)
Though the discrete entropy does not necessarily represent for these two test images, HE, BBHE and DSIHE lost the
the enhancement quality, it can depict the richness of details to mean brightness seriously.
some extent. In Table II, we presents the discrete entropy of
B. Potential Application of BPHEME
each results, which is defined as
255 The theory and experimental results show that BPHEME
ENT(q) = q(i ) log 2 q(i ) (bits) (20) preserves the mean brightness exactly, the minor error comes
i =0
from the discretizaion error and the non-cleavability of the
where q(i) is the normalized probability of the gray level i. histogram line. In applications, maybe there is some threshold
In Table II, we can see that for each source image, the of mean brightness change for peoples perception to bear.
resultant discrete entropy based on BPHEME is equal to, or That is, when enhancement is implemented, the mean
even slightly higher than MMBEBHE. When the source brightness is permitted to vary in a small interval [r - , r+].
images Einstein and house are considered, the discrete entropy This problem can also be solved using BPHEME with minor
of BPHEME falls behind HE, BBHE and DSIHE, however, modification. We modify the target mean brightness as
1334 IEEE Transactions on Consumer Electronics, Vol. 51, No. 4, NOVEMBER 2005