Pattern Recognition Letters 19 (1998) 1207±1212
A gray-level transformation-based method for image enhancement A. Raji a
a,* ,
A. Thaibaoui a, E. Petit a, P. Bunel a, G. Mimoun
b
Laboratoire d'Etudes et de Recherche en Instrumentation, Signaux et Syst emes, Universit e Paris 12 Val de Marne, F-94010 Cr eteil, France b Clinique Universitaire d'Ophtalmologie, Centre Hospitalier Inter-communal, F-94010 Cr eteil, France Received 6 May 1998; received in revised form 17 July 1998
Abstract In this paper, we present a gray-level modi®cation method which allows us to enhance the image contrast as well as to improve the homogeneity of the regions in the image. It is based on an optimal classi®cation of the image gray-levels, followed by a local parametric gray-level transformation applied to the obtained classes. By means of two parameters representing, respectively a homogenization coecient (r) and a desired number (n) of classes in the output image, we introduce a new family of monotonic gray-level transformations ranging from the simple linear transformation of the input histogram to the multi-level thresholding function. The proposed method is compared to the usual image enhancement methods. Ó 1998 Elsevier Science B.V. All rights reserved. Keywords: Image enhancement; Parameter-dependent transformation; Thresholding; Classi®cation
1. Introduction In many vision computing applications such as medical imaging, the produced images are often characterized by low contrast. Some enhancement algorithms are generally needed prior to using such images for interpretation and diagnosis. In the literature, many histogram based techniques have been proposed to enhance poorly contrasted images (Bhattacharya and Yan, 1995; Malladi and Sethian, 1996; Gauch, 1992). The simplest method consists in stretching the original histogram linearly to occupy the full available intensity range. Another popular contrast enhancing technique is
* Corresponding author. Tel.: 33 1 45 17 14 75; fax: 33 1 45 17 14 92; e-mail:
[email protected].
the histogram equalization (Gauch, 1992), where the transformed histogram is almost uniformly distributed over the entire intensity range. However, even if these techniques provide generally good visual enhancement with higher gray-level dynamic, the frontiers between the original histogram modes are not always preserved in the transformed image, which decreases the homogeneity inside the regions of the image. Such an eect is undesirable if a subsequent segmentation phase is needed. Among image segmentation techniques (Pal and Pal, 1993), some methods are based only on the gray-level information in the image. For example, local minima of the gray-level histogram can be used to segment the image by thresholding (Sahoo et al., 1988). However, for unimodal histograms a gray-level modi®cation is necessary to ®nd the threshold levels (Tsai, 1995; Yan, 1996).
0167-8655/98/$ ± see front matter Ó 1998 Elsevier Science B.V. All rights reserved. PII: S 0 1 6 7 - 8 6 5 5 ( 9 8 ) 0 0 1 0 9 - 3
1208
A. Raji et al. / Pattern Recognition Letters 19 (1998) 1207±1212
In the present paper, we propose a new graylevel modi®cation technique for image enhancement. Our approach is based on an optimal classi®cation of the image gray-levels, followed by a local parametric gray-level transformation applied to the obtained classes. The contrast enhancement is achieved by a monotonic transformation which conserves the same order relationships between original gray-levels, preserving thus the natural appearance of the image. Furthermore, the transformation partitions the input gray-levels into a given number of classes representing homogeneous regions. The idea is to transform the original gray-levels in such a way that it enhances the global image contrast as well as improves the homogeneity inside the regions of the image. 2. Contrast enhancement and region homogenization
f
x axr b;
x P 1; r P 1; r Yi =
Xi1
Xir ,
1 aXir .
ÿ b Yi ÿ with a
Yi1 ÿ For example, by uniform partitioning of the input gray-levels into n classes of the same width DX
Xmax ÿ Xmin =n, we obtain for dierent values of r a family of gray-level transformations, as illustrated in Fig. 1. For ecient numerical implementation, i.e. for minimal computational error, the transformations (1) are performed in (0; Xi1 ÿ Xi ! 0; Yi1 ÿ Yi ) before being translated to (Xi ; Xi1 ! Yi ; Yi1 ). The case r 1 (8n) corresponds to the linear gray-level stretching. For very large values of r (r 1) the transformation tends towards a thresholding function, with a single threshold level if n 2 and a multi-level thresholding if n > 2. Thus, the analytic expression (1) de®nes a wide class of gray-level transformations ranging from the linear stretching to the thresholding transformation.
2.1. Gray-level transformation
2.2. Optimal classi®cation and region homogenization
We consider the transformation of the interval of gray-levels Xmin ; Xmax to Ymin ; Ymax by a monotonic function f
x. Firstly, the input graylevels are partitioned into n classes Xi ; Xi1 ; i 0; . . . ; n ÿ 1. Then, each class Xi ; Xi1 is mapped into a new class Yi ; Yi1 . In order to make easier the theoretical study and optimization of the transformation, we consider only functions f
x that have analytical expressions and are continuous. We consider the transformations of the type
Actually, given the parameter n representing the desired number of classes, we use the mean square error criteria to ®nd the best classi®cation, based on the probability density function p
x of the input gray-levels. This consists of an optimal nonuniform quantization of the input gray-levels Xmin ; Xmax , where the quantizing intervals Xi ; Xi1 ; i 0; . . . ; n ÿ 1, and the quantization levels Gi are chosen such that the mean square error given by
Fig. 1. Transformation of the gray-levels [35,135] to [0,255] with uniform partitioning (r 1; 3; 5; 7; 10; 20; 50; 100).
A. Raji et al. / Pattern Recognition Letters 19 (1998) 1207±1212 n Z X
1209
Xi
E
i1
2
x ÿ Gi p
x dx
2
Xiÿ1
is minimized, with X0 Xmin , Xn Xmax . By dierentiating E with respect to the Xi 's and Gi 's and setting the derivatives equal to zero, we obtain (Shanmugan and Breipohl, 1988) R Xi1
Xi
Gi Gi1 =2;
x p
x dx
Gi RXiXi1 Xi
p
x dx
;
Fig. 2. Transformation of the gray-levels [Xi 30, Gi 60, Xi1 70] to [50, 90].
3
which implies that Gi is the centroid of Xi ; Xi1 . Eq. (3) cannot be solved in closed form for an arbitrary p
x. For a speci®c p
x, a method of solving Eq. (3) is to pick G1 and calculate the succeeding Xi 's and Gi 's using (3). If G1 is chosen correctly, then at the end of the iteration, Gn will be the centroid of the interval Xnÿ1 ; Xn . If it is not the case, then a dierent choice of G1 is made and the procedure is repeated until a suitable set of Xi 's and Gi 's is reached. The idea then is to transform the gray-levels of the class Xi ; Xi1 into a new class Yi ; Yi1 in such a way that it improves the homogeneity of this class, while the bounds (Yi ; Yi1 ; i 0; . . . ; n ÿ 1; are chosen to increase the global image contrast. The homogeneity improvement is achieved by using a monotonic transformation which is concave in the interval Xi ; Gi and convex in the interval Gi ; Xi1 with an in¯exion point at
Gi ; Yim
Yi Yi1 =2 in order to concentrate the transformed gray-levels around Yim . Expression (1) de®nes the convex part of the transformation. The concave part of the transformation is obtained from the corresponding convex function (1) using the same coecient r, by rotation and translation. This is illustrated in Fig. 2. Thus, we obtain a familly of transformations parametrized by r, ranging from the linear transformation (r 1) to the multi-level thresholding (or quantization) process (r 1). The higher the value of r, the more the transformed gray levels are concentrated around Yim , increasing in this way the homogeneity of the class Xi ; Xi1 . The asymptotic case r 1 corresponds to concentrating all the gray levels of Xi ; Xi1 in one level Yim .
As a result of the optimal partitioning followed by the homogenization step, we obtain an enhanced image with homogeneous regions, which can be either exploited by a segmentation operator or directly interpreted by the human visual system. In order to obtain the maximum output image contrast, the bounds of the output classes Yi ; i 0; . . . ; n ÿ 1; are equidistantly set on the full available gray-level range. 3. Results and discussion We consider the retinal angiographic image of Fig. 3. The diagnosis here relies on the detection of drusen representing retinal pathologic deposits, which are clinical manifestations of age-related maculopathy. If the image is suciently contrasted, an easy visual interpretation can be made. Otherwise, an enhancement algorithm is needed. Assume that the gray levels are to be classi®ed into two classes representing drusen and image background. Images (b) and (c) in Fig. 3 show the results of the linear histogram streching and the histogram equalization, respectively. Although these images are well-contrasted, the corresponding histograms are still unimodal, and the separation between gray-levels belonging to the drusen and those of the retinal tissue seems hard either from the images or from the gray-level histograms. The images obtained by the proposed gray-level modi®cation method are shown in Fig. 4. The corresponding transformations are represented in Fig. 5. We obtain an enhanced image with improved visual quality compared to the results of
1210
A. Raji et al. / Pattern Recognition Letters 19 (1998) 1207±1212
Fig. 3. Drusen detection by classical methods.
the linear stretching and equalization methods. Furthermore, the drusen are well-detected as homogeneous regions in the transformed images. Hence, a subsequent segmentation phase can be expected to be more eective if applied to images of Fig. 4 than if it is applied to the original image or to images (b) or (c) of Fig. 3. We deduce from these examples that an important value of r allows to enhance the contrast and facilitates considerably the classi®cation step. This is illustrated in Fig. 4(c) where the resulting image is clearly bimodal as shown in the corresponding histogram. Gray-level transformations with smaller values of r can be useful if the classi®cation has to be achieved by a later separate segmentation operator. In this case, the obtained transformed image is rich in terms of used gray-levels, but the new graylevel distribution provides an improved contrast on the one hand, and contains homogeneous sets of gray-levels on the other hand, allowing easier subsequent segmentation.
Multi-level thresholding aspect of the proposed method is illustrated by the images (a,b,c) of Fig. 6, where it has been assumed to detect second, third and fourth classes, respectively. This can be useful for example prior to segmenting the image by a fuzzy-logic based operator for which the images with n > 2 can represent good entries with gray-levels surely to the image background and to the drusen and intermediate gray-levels to be affected to one of these classes based on a given criteria (for example taking into account the spatial information of a drusen). For the image of Fig. 7 several methods are generally used to detect the region representing the cavity of the myocard. Since the minimum and the maximum of the gray-level dynamic are already used in the original image, the histogram stretching does not give any improvement of the image quality. The histogram equalization improves the visual quality of the image but not without loss of
A. Raji et al. / Pattern Recognition Letters 19 (1998) 1207±1212
1211
Fig. 4. Drusen detection by the proposed technique.
information. For example, the homogeneity of the region representing the right ventricle is deteriorated in the transformed image. In image (d) we can see that our method gives satisfactory results in terms of contrast enhancement and region homogenization.
4. Summary and conclusions Fig. 5. Gray-level transformations corresponding to images of Fig. 4.
Fig. 6. Multi-level thresholding aspect.
We presented in this article a new gray-level transformation-based method for image enhancement. The transformation is achieved by a partitioning step followed by a homogeneity improvement inside each of the obtained classes. By means of two parameters representing respectively a homogenization coecient r and a desired number n of classes in the output image, we set a general analytic expression describing a wide family of monotonic gray-level transformations ranging from the simple linear transformation of the input histogram to the multi-level thresholding
1212
A. Raji et al. / Pattern Recognition Letters 19 (1998) 1207±1212
function. The presented method results in an enhanced contrast with increased homogeneity inside the regions of the image. We illustrated the eectiveness of the technique by experiments on some examples of medical images. References
Fig. 7. Myocardial cavity detection in echocardiographical images.
Bhattacharya, P., Yan, Y.K., 1995. Iterative histogram modi®cation of gray images. SMC 25 (3), 521±523. Gauch, M., 1992. Investigations of image contrast space de®ned by variations on histogram equalization. GMIP 54 (4), 269±280. Malladi, R., Sethian, J.A., 1996. A uni®ed approach to noise removal, image enhancement, and shape recovery. IP 5 (11), 1554±1568. Pal, N.R., Pal, S.K., 1993. A review on image segmentation techniques. PR 26, 1277±1294. Sahoo, P.K., Soltani, S., Wong, A.K.C., Chen, Y.C., 1988. A survey of thresholding techniques. CVGIP 41 (2), 233±260. Shanmugan, K.S., Breipohl, A.M., 1988. Random Signals, Detection, Estimation and Data Analysis. Wiley, New York, pp. 196±202. Tsai, D.M., 1995. A fast thresholding selection procedure for multimodal and unimodal histograms. Pattern Recognition Letters 16 (6), 653±666. Yan, H., 1996. Uni®ed formulation of a class of image thresholding techniques. PR 29 (12), 2025±2032.