2008 International Conference on BioMedical Engineering and Informatics
A Novel Approach for Contrast Enhancement in Biomedical Images Based on Histogram Equalization Ali Ziaei1, Hojatollah Yeganeh2, Karim Faez3, Saman Sargolzaei4 Electrical Engineering Department, Amirkabir University of Technology, Tehran, Iran 1
[email protected],
[email protected],
[email protected],
[email protected] mentioned that histogram based techniques are much less expensive in compare to the other methods [1]. Histogram Equalization (HE) based algorithms are also used in other applications for example speech recognition and other areas [2] [3] [4] [5]. Histogram based techniques for image enhancement is mostly based on equalizing the histogram of the image and increasing the dynamic range corresponding to the image. Histogram Equalization (HE) method has two main disadvantages which affect efficiency of this method. These two main disadvantages are followed: - Histogram Equalization (HE) assigns one gray level into two different neighbor gray levels with different intensities. - If most of an image includes a gray level, Histogram Equalization (HE) assign a gray level with higher intensity to that gray level and it causes a phenomenon as we called it washed out. Figure 1 shows this effect.
Abstract This paper presents a novel technique to increase the quality of medical images based on Histogram Equalization. In the proposed method first we have applied a noise reduction method and then we apply some suitable preprocessing on histogram of the medical images and after that histogram equalization has been applied on the new histogram. Our proposed method in despite of its simplicity has better results in compare to other usual methods based on histogram equalization. The quality of resulted images after applying our proposed methods has been tested on a database (medical images) with a confirmed criterion by viewer. Also we have considered a mathematical criterion for comparing our proposed algorithm with other available methods for contrast enhancement. Results show the better efficiency of the proposed method.
1. Introduction Medical imaging is one of the best techniques for monitoring the person’s health condition which is used widely nowadays. Also some of diseases can be detected using medical imaging methods. One of the problems that physicians encounter with it using medical images is low quality of the medical images. This low quality is caused to difficulty in diagnosis. So it is necessary to improve the quality of the medical images. There are so many methods for medical image enhancement to make a better perception from medical images. Various methods have been suggested for increasing medical image’s quality in recently years. Histogram processing is one of the most important digital image processing techniques and it is widely used for increasing medical image’s quality. Because the simplicity and better efficiency of the histogram based algorithms, these algorithms are widely used for contrast enhancement of images. Also it should be
978-0-7695-3118-2/08 $25.00 © 2008 IEEE DOI 10.1109/BMEI.2008.300
Figure 1. Effect of washed out after histogram equalization There are so many ways for decreasing the effect of the mentioned problems [6] [7] [8]. Bi Histogram Equalization (BHE) is one of these ways for obtaining better results using histogram equalization. Bi Histogram Equalization (BHE) first divides histogram
855
of the input image to two segments based on the average of the histogram and then applies Histogram Equalization (HE) algorithm on each segment separately [9] [10]. One of the improved histogram based methods is Dualistic Sub Image Histogram Equalization (DSIHE). In this method, first histogram is divided to segments based on entropy and then histogram equalization method is applied on each segment separately [11]. Despite the mentioned methods can often increase contrast of the image but they make undesirable effects in the image. In this paper we have proposed an efficient method for increasing contrast of the medical images based on histogram equalization without any undesirable effect. At the follow, basics of Histogram Equalization (HE) and Bi Histogram Equalization (BHE) are stated in detail and then our proposed algorithm is considered.
2. Histogram Equalization (HE) Bi Histogram Equalization (BHE)
Gray level S k ’s changes can be computed in usual histogram equalization method:
ΔS k = ( L − 1 ) × P ( rk )
Equation (4) means that distance between S k and
S k + 1 has direct relation with PDF of the input image at gray level rk . Undesirable effects of the usual histogram equalization method (HE) are resulted from equation (2) because of the quantization operation and summarizing properties of this equation.
2.2. Bi Histogram Equalization (BHE) Bi Histogram Equalization is considered as an improved histogram equalization (HE) method for contrast enhancement in this section. BHE first finds average point in histogram of the image and then divides histogram to two segments based on this point. After that histogram equalization operation is applied on each segment. There are two cumulative distribution functions for two segments. Gray level ( r k ) under the average point are pointed
and
Histogram Equalization (HE) and Bi Histogram Equalization (BHE) methods are considered as methods for contrast enhancement of the images in this section of the paper. HE and BHE are fully presented at [1] [9] [12].
to the new gray level ( S k ) as it can be seen in equation (5). S k = ( L1 ) × C1 ( rk )
2.1. Histogram Equalization (HE)
C1 ( rk ) = (
Consider a digital image with gray levels in the range [ 0, L − 1 ] , Probability Distribution Function of the image can be computed as equation (1):
P(rk ) =
nk N
k = 0,..., L − 1
j =0
∑ ni ) / (∑ n j );
∑ P (rk ) * rk
(6 )
k =0
r k ) above the average point are pointed to the new gray level ( S k ) as it can be seen in Gray level (
i=k
(2 )
equation (7). S k = ( L − 1 − L1 ) × C2 ( rk ) + L1
k = 0,..., L − 1 , 0 ≤ C ( rk ) ≤ 1
C2 ( rk ) = (
∑
ni ) / (
i = L1 +1
equation (2). So we have:
(7 )
L −1
k
Histogram Equalization (HE) appropriates gray level S k to gray level rk of the input image using
S k = ( L − 1 ) × C ( rk )
i =0
(5 )
L −1
L1 =
Cumulative Distribution Function (CDF) can also be computed as followed:
i =0
L1
Where L1 is the average of gray levels of the histogram and it can be computed as in equation (6).
(1 )
r k is the kth gray level and nk is the number of pixels in the image having gray level r k .
∑ P (ri )
k
k = 0,1,..., L1
Where
C ( rk ) =
(4 )
∑
n j );
j = L1 +1
k = L1 + 1,...., L − 1
(3 )
Results of applying BHE method comparing to HE and our proposed method are depicted in results section.
856
pixels of every gray level is the average of the number of pixels corresponding to gray levels around this gray level, so there won’t be quick changes in the number of pixels corresponding to gray levels. Figure 2 shows a histogram before and after applying proposed algorithm.
3. Proposed Algorithm Our new method is considered for decreasing the mentioned undesirable effects in this section. Our proposed method first applies a few preprocessing on histogram of the image and equalizes the resulted PDF and then the new image is constructed based on the new PDF. Our proposal method first finds a gray level with maximum number of pixels in an image’s histogram. Now we make a new histogram which in it number of pixels corresponding to each gray level is equal to the average of the number of pixels of gray levels around that point. Then we normalized the values in new histogram such that adding of the new values is equaled to 1. After that we have applied histogram equalization on the new histogram and the new image is constructed based on this new histogram. We should mention some important points about using the proposed method: 1. Making new histogram starts at a gray level with maximum number of pixels and then expands into the right side or left side or into the both sides around this gray level. 2. The gray level corresponding to maximum number of pixels may represents background of the image. In this situation gray levels after and before the background gray level don’t contain any important information for us. So expanding histogram in this situation can be resulted inversely and can be caused in undesirable effects. For overcoming on this problem, we should apply proposed algorithm once on the left side of the average gray level and once on the other side and also on both sides once time. After reconstructing three images from above, the best one is selected. 3. We have considered a quantitative criterion for comparing the methods and selecting the best image. This quantity is used in [13 [14]: PixDis =
L −2 L −1 1 ∑ ∑ H (i)H ( j)( j − i) N pix ( N pix − 1) i =0 j =i +1
fori, j∈[0, L−1]
Figure 2. Result of applying proposed algorithm. Above histogram: before applying, down histogram: after applying.
3. Experiments and Results We applied our proposed algorithm on a database which includes 220 medical images. Also we should mention that we have subtracted background manually where the number of background pixels is more than other pixels. Figure 3 shows an example of applying the proposed algorithm and also the results of applying HE and BHE algorithm.
(a) Primary image after noise suppression
(b) After applying HE (PixDis=41.2)
(8 )
Where H (i ) represents the number of pixels in the image which their gray levels is i and
N pix is the
total number of pixels in the image. Larger amount of this criterion exhibits better contrast enhancement in the image. Using the proposed method the mentioned undesirable effects do not occur and a better improvement is resulted comparing to HE and BHE. Because in the proposed algorithm the number of
(c) After applying BHE (PixDis=35.19)
(d) After applying proposed algorithm (PixDis=45.86)
Figure 3. Comparing HE, BHE and our method
857
BHE is an improved version of HE and for comparing BHE method with our proposed method we have defined a parameter known as improvement measure: Pixdist( method ) - Pixdist HE × 100 Pixdist( method )
5. References [1]R. C. Conzalez and R. E. Woods, Digial Image Processing. New Jersey: Prentice-Hall, Inc., 2001. [2] S. C. Pei, Y. C. Zeng, and C. H. Chang, “Virtual restoration of ancient chinese paintings using color contrast enhancement and lacuna texture synthesis,” IEEE Trans. Image Processing, vol. 13, pp. 416–429, Mar. 2004. [3] W. A., S. H. Chin, and E. C. Tan, “Novel approach to automated fingerprint recognition,” IEE Proceedings Vision, Image and Signal Processing, vol. 145, pp. 160–166, 1998. [4] A. de la Torre, A. M. Peinado, J. C. Segura, J. L. PerezCordoba, M. C. Benitez, and A. J. Rubio, “Histogram equalization of speech representation for robust speech recognition,” IEEE Trans. Speech Audio Processing, vol. 13, pp. 355–366, May 2005. [5] S. M. Pizer, “The medical image display and analysis group at the university of north carolina: Reminiscences and philosophy,” IEEE Trans. Med. Imag., vol. 22, pp. 2–10, Jan. 2003. [6] S. Lau, “Global image enhancement using local information,” Electronics Letters, vol. 30, pp. 122–123, Jan. 1994. [7] Y. T. Kim, “Quantized bi-histogram equalization,” in IEEE Conf. on Acoustics, Speech, and Signal Processing, vol. 4, Apr. 1997, pp. 2797– 2800. [8] Y. J. Zhan, “Improving the accuracy of direct histogram specification,” Electronics Letters, vol. 28, pp. 213–214, Jan. 1992. [9] Y. T. Kim, “Contrast enhancement using brightness preserving bihistogram equalization,” IEEE Trans. Consumer Electron., vol. 43, pp. 1–8, Feb. 1997. [10] Y. T. Kim, “Quantized bi-histogram equalization,” in IEEE Conf. on Acoustics, Speech, and Signal Processing, vol. 4, Apr. 1997, pp. 2797– 2800. [11] Y. Wan, Q. Chen, and B. M. Zhang, “Image enhancement based on equal area dualistic sub-image histogram equalization method,” IEEE Tran .Consumer Electron., vol. 45, no. 1, pp. 68–75, Feb. 1999. [12] S. D. Chen and A. R. Ramli, “Contrast enhancement using recursive mean-separate histogram equalization for scalable brightness preservation,” IEEE Trans. Consumer Electron., vol. 49, no. 4, pp. 1301–1309, Nov. 2003. [13] ZhiYu Chen,Besma R. Abidi, David L. Page, M and Mongi A. Abidi” Gray-Level Grouping (GLG): An Automatic Method for Optimized Image Contrast Enhancement—Part I: The Basic Method” IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 15, NO. 8, AUGUST 2006 [14] ZhiYu Chen,Besma R. Abidi, David L. Page, M and Mongi A. Abidi” Gray-Level Grouping (GLG): An Automatic Method for Optimized Image Contrast Enhancement—Part II: The Variations” IEEE Transactions on Image Processing, VOL 15, No.8, August 2006.
(9 )
Table 1 shows results of applying BHE and our proposed method on database and comparing these two methods based on improvement measure parameter. Table 1: comparing BHE method and our method for better improvement in contrast of medical images Method BHE Proposed method
Minimum Improvement -18.7 %
Maximum Improvement 93.91 %
Average
-2.86 %
95. 32%
18.2 %
7.41 %
As it can be seen our proposed method has better results comparing to BHE method. Also we have compared the efficiency of BHE and our proposed method in noisy images by adding Gaussian noise with mean 0 and variance 0.001 to the images. Table 2 shows the results after adding noise. Table 2: comparing BHE method and our method for better improvement in contrast of noisy medical images Method BHE Proposed method
Minimum Improvement -9.7 %
Maximum Improvement 90.91 %
Average
-0.86 %
92. 32%
15.2 %
5.41 %
As it can be seen our proposed method has better results comparing to BHE method even after adding noise to the images.
4. Conclusion and Future work This paper presents a new method for contrast enhancement in medical images for better perception. The proposed method is based on histogram processing before histogram equalization. The results were promising better efficiency of the proposed method comparing to other usual methods for contrast enhancement. Automatic subtraction of background before applying proposed method can increase the efficiency of the method in future.
858