Lossless compact histogram representation for multi - GIPSA-Lab

Lossless compact histogram representation for multi-component
images : application to histogram equalization.
JOCELYN CHANUSSOTA
ALAIN CLEMENTB
A Signals & Images Laboratory
LIS / INPG
BP 46 - 38402 St Martin d’Heres Cedex Fr.
[email protected]
BERTRAND VIGOUROUXB
B Laboratoire d’Ingénierie des Systèmes Automatisés
LISA - IUT d’Angers
BP 42018 - 49016 Angers Cedex - France
{alain.clement ; bertrand.vigouroux}@univ-angers.fr
Abstract— In this paper, the problem of histogram
representation is addressed. In the case of multi-component
images, this problem is not trivial : the theoretical “naïve”
required memory space goes exponentially beyond todays
technical capacities. To overcome this problem, we present a
lossless compact representation of vector histograms. It is based
on the use of a space filling curve to index the data space. The
application of this representation to vector histogram
equalization is then considered.
I.
INTRODUCTION
Many basic image processing algorithms for remote
sensing are based on the use of the image histogram. The
representation and handling of the histogram is easy and
straightforward in most of the cases. But, when it comes to
multi-component image processing, the memory space required
for the storage of classical multi-dimensional image histograms
increases dramatically. In most of the applications, this
phenomenon prevents the use of the exact vector histogram.
For instance, let us consider an image with the following
characteristics : M.N pixels, P components, each value being
coded on Q bits. The “naïve” histogram of such an image is a
table with P dimensions containing 2(P.Q) cells. Each cell can
contain a number ranging from 0 to M.N and thus requires
log2(M.N) bits. Therefore, the memory size a priori required to
encode the histogram is : 2(P.Q). log2(M.N) bits
This number rapidly increases as the parameters of the
image increase. In particular, there is an exponential growth
of the memory requirement both with respect to P and Q.
More and more multi-spectral images are used in satellite
remote sensing, therefore P tends to increase (up to several
tenths in the case of hyper-spectral images…). Furthermore,
the sensors used for the acquisition are more and more precise,
leading to an increase of Q. Finally, the size of the images also
tend to grow (M.N is increasing). As a consequence, the
classical “naïve” representation to encode an histogram cannot
be used. For example, the histogram of a 3 component
1024.1024 image, each pixel being encoded with 16 bits would
require a 7.108 Mo large memory !
2Q . P. log2(M.N) bits. This method does not take into account
the inter-correlation between the different components and is
therefore not satisfactory.
(ii) The re-quantization of each spectral component on a
lower number of levels enables the reduction of the memory
size to 2P.q . log2(M.N) bits, with q<Q. But this method is not
satisfactory either since it induces the loss of a lot of
information.
In section II, we present an other approach enabling the
construction and handling of a lossless compact histogram. In
section III, we discuss how this compact representation can be
used to perform multi-component histogram equalization. The
proposed method is tested on multi-spectral Landsat images
and is compared with the results provided by other algorithms.
II.
LOSSLESS COMPACT MULTI-SPECTRAL HISTOGRAMS
It is important to note that at least 2(P.Q)- M.N cells of the
“naïve” representation are empty (meaning : no pixel of the
image has the corresponding vector value). In the above
mentioned example, that represents over 99% of the cells…
This sparseness of the histogram enables the design of a
lossless compact representation. This problem is addressed in
[1] where a fast and efficient implementation is proposed. It is
based on the use of a bijective scalar representation of the Pdimensional data space. This scalar representation is equivalent
to the definition of a space filling curve (SFC) [3] : the Pdimensional vector representing the value of any multicomponent pixel can be represented by the scalar number
corresponding to its curvilinear abscissa along the SFC. This is
also equivalent to the definition of a total ordering on the
vector data space. In [1], the lexicographic order has been used.
In this frame, the histogram can be represented by a simple
table with two columns : the first column contains the
curvilinear abscissas of the non empty cells, the second column
gives the corresponding population (i.e. the number of pixels in
the image who have the vector value corresponding to the
curvilinear abscissa). An upper bound of the memory size
required for the corresponding histogram is given by :
To overcome this problem, two strategies are commonly used:
M.N. (P.Q.log2(M.N)) bits
(i) the mono-dimensional histogram of each spectral
component can be handled separately. The growth with respect
to P of the memory size is not exponential anymore but linear :
0-7803-7929-2/03/$17.00 (C) 2003 IEEE
JEREMIE CHABODA
The growths in size with respect to P and Q are now both
linear. In all the practical cases, the final size of the histogram
is much smaller than this upper bound that corresponds to the
3940
0-7803-7930-6/$17.00 (C) 2003 IEEE
worse case (all the pixels in the image have a different value).
With this representation, the choice of the SFC is indifferent :
the change of curve simply induces a permutation of the
different lines. This choice is only guided by implementation
constraints : given a P-dimensional vector, the computation of
the corresponding curvilinear abscissa along the chosen SFC
has to be easy and fast, as well as the invert transform.
Figure 1-a- presents a very simple case of study but the
generalization to any dimension is straightforward : it
represents the histogram of a 2 component image. Each axis
corresponds to one component (Note that this plot does not
represent the image plane but the data space with P=2) and
there are 8+6+1+1 = 16 pixels on the picture. Figure 2-apresents the corresponding “naïve” histogram. Figure 1-bpresents the same data with only the non empty cells remaining
and the lexicographic SFC. Figure 2-b- presents the
corresponding compact histogram.
0
8
0
0
8
0
0
0
0
0
0
1
0
1
0
0
6
1
6
8
1
1
6
1
-a-b-cFigure 1 : histogram & space filling curves
a- First component :
0123012301230123
Second component : 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3
Number of pixels :
0061001000000800
b- position on the curve :
2 3 6 13
number of pixels :
6 1 1 8
c- number of zeros :
2 0 2 6
7 0 0 0
number of pixels :
6 1 1 8
8 6 1 1
(lexico.)
(Lebesgue)
Using these approaches, we constructed exact histograms
of high dimensional vector data using a reduced memory
space (less than 3% of the “naïve” size). Computation time is
less than a second for the first method and a minute for the
second. (Note that with the second method, we loose the direct
equivalence between an abscissa and the vector value : the
abscissa has first to be computed by cumulating the previous
rows of zeros).
III.
APPLICATION : HISTOGRAM EQUALIZATION
Histogram equalization is a very classical image
processing. Theoretically aiming at maximizing the entropy of
the data, it practically leads to a strong enhancement of the
contrast enabling a better visualization. This can be interpreted
as a non linear rescaling of the range. In this section, we
discuss how the compact representations can be used to
compute vector histogram equalizations. A first strategy
consists in working directly with the compact representation :
equalization can be performed by redistributing the non empty
cells along the SFC. To obtain a “uniform” density all over the
data space, a number of zeros is introduced between two non
empty cells with a length proportional to the sum of the
populations of these 2 cells. This implementation is very easy
using the last compact representation presented in the previous
section. But this strategy leads to a visually non satisfactory
result. Two close peaks of the histogram in the euclidean space
can become extremely distant (“euclideanly” speaking) after
equalization on the SFC resulting in a “noisy” aspect. Netto’s
theorem proves that this phenomenon cannot be avoided :
THEOREM (Netto, 1879) [3] : Any bijective map between two
manifolds with different dimensions is discontinuous. This
lost discontinuity induces a distortion of the space topology.
Figure 2 : histogram representations
This representation can be modified using the following
strategy : the first column of the compact histogram does not
represent the curvilinear abscissa but the number of zeros (i.e.
empty cells) that are between the considered non-empty cell
and the previous one. The first number is initialized as the
number of empty cells before the first non empty one (starting
from the origin). The obtained histogram is presented fig 2-cwith the lexicographic order (fig 1-b-). With this
representation, the choice of the curve is not indifferent. Pixels
having neighboring values form clusters in the data space. If
the used SFC is highly convoluted, it will remain a “long time”
in these clusters and will therefore gives small values for the
“zero gaps”, these values being encoded using less bits. Fig 2c- presents the result obtained on example fig 1-c- using the
Lebesgue SFC [3]. For this kind of purpose, this curve is
considered to be the best one [4].
It is especially important to understand that we do not try to
compact an existing histogram (this histogram cannot be
constructed nor handled nor allocated), we directly build a
0-7803-7929-2/03/$17.00 (C) 2003 IEEE
compact representation of the histogram. Therefore, adding an
entropic coding of the result, or using the LZW algorithm can
further reduce the size of the histogram, but this cannot be
introduced during the construction of the histogram itself.
A second strategy consists in a hybrid approach : the
compact representation is used to compute and handle the
vector histogram with no loss, but the equalization itself is
done in the “Euclidean” data space (meaning, not on the 1D
representation using SFC) using the “histogram explosion”
proposed in [2]. It consists in performing a 1D equalization of
the data in any possible direction starting from the centroid of
the data cluster.
Results obtained on Landsat data are presented and discussed
on the next page.
REFERENCES
[1]
[2]
[3]
[4]
A. Clément & B. Vigouroux, « Un histogramme compact pour l’analyse
d’images multi-composantes », 18th GRETSI Colloquium on Signal and
Image Processing, Sept. 2001, Toulouse, France, vol.1, pp. 305-307
P. Mlsna & J. Rodriguez, « A multivariate contrast enhancement
technique for multispectral images », IEEE Trans. on Geoscience and
Remote Sensing, vol. 33, n°1, January 1995, pp. 212-216
H. Sagan, « Space filling curves », Springer Verlag, New York, 1994.
J. Chanussot, « Approches vectorielles ou marginales pour le traitement
d’images multi-composantes », Ph D Thesis, Savoie University, 1998
http://ava.univ-savoie.fr/francais/LAMII/
3941
0-7803-7930-6/$17.00 (C) 2003 IEEE
a- Original Landsat images.
Color representation using 3 bands
(bands 2,4 & 7) and corresponding 3D
histogram : the range is very badly
used (almost all the data space is
empty) and there is a strong
correlation between the different
spectral bands (elongated narrow
shape of the histogram cluster).
b- Component wise equalization.
Color representation of the result and
corresponding 3D histogram. Each
component is equalized separately.
This algorithm is the one implemented
in many softwares (for instance :
Gimp). Due to the strong correlation
of the data, the range remains badly
occupied, but the contrast is nicely
enhanced.
c- Photoshop Equalization.
Color representation of the result and
corresponding 3D histogram. In terms
of color, the “hue” is preserved,
whereas the saturation and the
luminance are component wisely
equalized. This leads to an interesting
constrast enhancement with a
preservation of the realative weight of
each component (the picture remains
mainly blue), the range still remains
rather badly occupied.
d- Direct equalization with compact
representation (color image and
corresponding histogram). The range
is nicely occupied (the data space is
uniformely filled), but the topological
distortions induced by the 1D
representation of this data space gives
a “noisy” appearance of the picture.
e- Equalization with the hybrid
approach
(color
image
and
corresponding
histogram).
The
histogram is computed and handled
using
the
proposed
compact
representation. The equalization is
done with an histogram « explosion »
in the euclidean space. This gives a
nice occupation of the range and a
strong enhancement of the picture, but
with a preserved continuity.
Figure 3 : Equalizations results.
0-7803-7929-2/03/$17.00 (C) 2003 IEEE
3942