Two-Dimensional Histogram Equalization and Contrast Enhancement Pattern Recognition Vol. 45, No. 10, 2012 Turgay Celik Presented by Ji-Heon Lee
School of Electrical Engineering and Computer Science Kyungpook National Univ.
Abstract Proposed method – Two dimensional histogram equalization(2DHE) • Utilizing contextual information to enhance contrast • Based on contrast observation in image − Improved by increasing gray-level
• Including global histogram algorithm − Special case of 2DHE
• Automatic parameter selection algorithm contained
2/35
Introduction Contrast enhancement – Useful in machine vision application – Not easy to choosing appropriate algorithm – Usually rely on proper parameter selection
Attribute of contrast enhancement algorithm – Transform-domain • Decomposing image into different subbands to modify, globally or locally • Magnitude of frequency components to using multiscale analysis • Complex algorithm and need to setting associated parameter
– Image-domain algorithm • Simplicity and satisfactory performance • Widely used in contrast enhancement 3/35
Previous method – Center-surround Retinex • • • •
Developed to achieve lightness and colour constancy in image Benefits of compressed dynamic range Benefit of color independent of spatial distribution of scene Halo effect in large uniform region
– Edge-avoiding wavelet based contrast enhancement(EAW) • Modifying in wavelet domain and inverse transforming • Both global and local contrast enhancement • Needing appropriate parameter setting
– Histogram equalization(HE) • Most popular techniques • Using cumulative distribution function(CDF)
4/35
• Mapped CDF of uniform distribution • Tend to over-enhance contrast with large peak of histogram − Resulting harsh and noisy appearance of output image
• Not always satisfactory enhancement
–
Local histogram equalization(LHE) • • • • •
Using small region to improve HE Small region histogram equalization Using gray level mapping for enhancement output image Need to proper size of region A lot of method − Brightness preserving bi-histogram equalization(BBHE) » Attempt to solve brightness preservation problem » Using Average grey level of input image − Dualistic sub-image HE(DSIHE) » Splitting image into two sub-histogram
5/35
− Minimum mean brightness error BHE(MMBEBHE) » Extension of BBHE » Providing maximal brightness preservation by searching for threshold level − Minimum within-class variance multi-HE(MWCVMHE) » Automatically partition input histogram into multiple subhistogram by minimizing variance
– Optimal algorithm • Flattest histogram specification with accurate brightness preservation(FHSABP) − Transforming input histogram to flattest histogram with mean and brightness constraints
• Histogram modification framework(HMF) − Minimizing cost function − Using different adaptive parameter, achieved different level of contrast enhancement
6/35
Proposed method – Two-dimension histogram equalization(2DHE) • Improving visual quality of input image • Based on contrast improved by increasing gray-level difference between pixel and neighbours • Having relationship between each pixel and its neighbouring pixels • Generalize form of HE
7/35
Proposed algorithm Grey-scale image enhancement – 2D histogram be expressed as = H x {hx ( m, n ) |1 ≤ m ≤ K ,1 ≤ n ≤ K }
(1)
where hx ( m, n ) ∈ R
– The hx(m,n) computed as = hx ( m , n )
[ w /2]
∑∑ ∑ ∀i
∀j k = − [ w /2]
φm ,n ( x (i, j ), x (i + k , j + l ))(| xm − xn | +1)
(2)
where w is odd integer number, φm ,n ( x (i, j ), x (i + k , j + l )) ∈ 0 is binary function xm , xn is spatial location 8/35
– The spatial location of (i,j) and (i+k,j+l) respectively, 0, if xm = x (i, j ) and xn = x (i + k , j + l ) (i, j ),(i + k , j + l ) = 1
(3)
– Elements of 2D histogram normalized to K
K
hx ( m, n ) = hx ( m, n ) / ∑∑ hx (i, j )
(4)
=i 1 =j 1
– Cumulative distribution as = x {= Px ( m ) | m 1,....K }
(5)
where m
K
Px ( m ) = ∑∑ hx (i, j ) =i 1 =j 1
9/35
– Normalized 2D histogram according to Eq. (4)
Fig 1. The input House image (a) and its normalized 2D histograms according to Eq. (4) using neighbourhoods of size1x1 (b),3x3 (c),5x5 (d),7x7 (e),9x9 (f), 11x11 (g),and13x13 (f).For display purpose, h(m,n) is shown in logarithmic scale.
10/35
– 2D uniform distributed target probability distribution function as = Ht {ht ( m ', = n ') 1 / L2 |1 ≤ m ' ≤ L,1 ≤ n ' ≤ L}
(6)
– Target probability distribution function defined as t {= = Pt ( m ') | m ' 1,.... K }
(7)
where, = Pt ( m ')
m'
K
ht (i, j ) ∑∑ =
=i 1 =j 1
m'
1 m' = L ∑ L2 L =i 1
(8)
11/35
– Grey-level mapped as = m ' arg min | Px ( m) − Pt (i ) |
(9)
i∈{1,2,..., L}
12/35
– Resultant enhanced House images
Fig 2. Enhancing the input image shown in (a) using different size of local neighbourhood. The first, second, and third rows are grey scale images, input(X) to output(Y) grey-level data mapping, and 1D-histogram of the corresponding grey-level image, respectively. (a)Input, (b) w=1, (c) w=3, (d) 13/35 w=5.
Automatic parameter selection – Discrete entropy(DE) of grey-levels as K
DE ( X ) = − ∑ p( xk ) log p( xk )
(10)
k =1
where p( xk ) is probability of pixel intensity x is estimated from normalized histogram
– Output image with L distance grey-levels defined as L
DE ( Yw ) = − ∑ p( yl ) log p( yl ) i =1
(11)
where p( yl ) is probability of pixel intensity
14/35
– Discrete entropy between input and output defined as DE N ( X , Yw ) =
1 (log(256) − DE ( Yw )) 1+ (log(256) − DE ( X ))
(12)
where log(256) is maximum value of entropy
– Contrast for pixel of image defined as c (i , j ) =
| x (i , j ) − e (i , j ) | | x (i , j ) + e (i , j ) |
(13)
where, the mean edgy grey level is e(i , j ) =
∑
( k ,l )∈
g (k , l ) x(k , l ) (i , j )
∑
( k ,l )∈
g (k , l )
(14)
(i , j )
15/35
– Computed average contrast value H
W
CM ( X ) = ∑∑ c(i, j ) HW =i 1 =j 1
(15)
– Contrast measure between input and output as CM N ( X , YW ) =
1 (1 − CM ( Yw )) 1+ (1 + CM ( X ))
(16)
where CM N ( X , Yw ) ∈ [0,1]
16/35
– Contrast measure using harmonic mean DECM N ( X , YW ) =
2 1 1 + DE N ( X , Yw ) CM N ( X , Yw )
(17)
– Maximum value of Eq.(17) result from w wo = alglocalmax DECM ( X , Yw ) ∀w∈[3,min( H ,W )/2]
(18)
Colour image enhancement – Using color space • To preserve chrominance value • Transforming RGB to CIELab • Luminance component processed for contrast enhancement
17/35
– Result from 2DHE
Fig 3. Enhancing the in put images shown in the first row by automatically selecting window parameter w according to Eq.(18) which utilizes metrics shown in the third row to produce the output images shown in the second row.(a) wo =5, (b) wo = 9, (c) wo = 9, (d) wo = 7. 18/35
Experimental result Quantitative measures – Normalized absolute mean AMBE N ( X , Y ) =
1 1+ | MB ( X ) − MB ( Y ) |
(19)
– Assessing histogram equalization capabillity p ( yk ) KL( p, q) = ∑ p ( yk ) log 2 ∀k q( yk )
(20)
19/35
– Contrast enhancement result image
Fig 4. Contrast enhancement results for image Plane. (a)Original image. Enhanced images obtained using:(b)HE; (c)MWCVMHE; (d)FHSABP; (e)HMF; (f)CEBGA; and (g) 2DHE. Input to output grey-level mapping functions of enhanced grey-scale images are shown in (h) where ‘‘NC’’ 20/35 refers to no-change mapping.
– Contrast enhancement result image
Fig 5. Contrast enhancement results for image Tank. (a)Original image. Enhanced images obtained using:(b)HE; (c)MWCVMHE; (d)FHSABP; (e)HMF; (f)CEBGA; and (g) 2DHE. Input to output greylevel mapping functions of enhanced grey-scale images are shown in (h) where ‘‘NC’’ refers to 21/35 nochange mapping.
– Contrast enhancement result image
Fig 6. Contrast enhancement results for image Cameraman. (a)Original image. Enhanced images obtained using:(b)HE; (c)MWCVMHE; (d)FHSABP; (e)HMF; (f)CEBGA; and (g) 2DHE. Input to output grey-level mapping functions of enhanced grey-scale images are shown in (h) where ‘‘NC’’ 22/35 refers to no-change mapping.
– Contrast enhancement result image
Fig 7. Contrast enhancement results for image Baboon. (a)Original image. Enhanced images obtained using:(b)HE; (c)MWCVMHE; (d)FHSABP; (e)HMF; (f)CEBGA; and (g) 2DHE. Input to output grey-level mapping functions of enhanced grey-scale images are shown in (h) where ‘‘NC’’ 23/35 refers to no-change mapping.
– Contrast enhancement result image
Fig 8. Contrast enhancement results for image Lighthouse. (a)Original image. Enhanced images obtained using:(b)HE; (c)MWCVMHE; (d)FHSABP; (e)HMF; (f)CEBGA; and (g) 2DHE. Input to output grey-level mapping functions of enhanced grey-scale images are shown in (h) where ‘‘NC’’ refers to no-change mapping. 24/35
– Contrast enhancement result image
Fig 9. Contrast enhancement results for image Cessna. (a)Original image. Enhanced images obtained using:(b)HE; (c)MWCVMHE; (d)FHSABP; (e)HMF; (f)CEBGA; and (g) 2DHE. Input to output grey-level mapping functions of enhanced grey-scale images are shown in (h) where ‘‘NC’’ refers to no-change mapping. 25/35
– Contrast enhancement result image
Fig 10. Contrast enhancement results for image Beach. (a)Original image. Enhanced images obtained using:(b)HE; (c)MWCVMHE; (d)FHSABP; (e)HMF; (f)CEBGA; and (g) 2DHE. Input to output grey-level mapping functions of enhanced grey-scale images are shown in (h) where ‘‘NC’’ refers to no-change mapping.
26/35
– Contrast enhancement result image
Fig 11. Contrast enhancement results for image Island. (a)Original image. Enhanced images obtained using:(b)HE; (c)MWCVMHE; (d)FHSABP; (e)HMF; (f)CEBGA; and (g) 2DHE. Input to output grey-level mapping functions of enhanced grey-scale images are shown in (h) where ‘‘NC’’ refers to no-change mapping. 27/35
– Visual assessment score Table 1. Subjective quality test score as mean opinion score(MOS)
Table 2. Quantitative measurement results as AMBEN.
28/35
– Visual assessment score Table 3. Quantitative measurement results as DEN
Table 4. Quantitative measurement results as CMN
29/35
– Visual assessment score Table 5. Average quantitative measurement results as AMBEN, DEN and CMN on 300test images from Berkeley image dataset [20].
Table 6. Kullback–Leibler (KL) distances between the grey-level distributions of the processed output images resulted from different algorithms and uniform distribution.
30/35
– Input and output histogram resulted from different algorithm (1)
31/35
– Input and output histogram resulted from different algorithm (2)
Fig 12. Histograms of input images (a) and enhanced images obtained using: (b) HE; (c) MWCVMHE; (d) FHSABP; (e) HMF ;(f) CEBGA; and(g) 2DHE. From top to bottom each row shows the results for Plane, Tank, Cameraman, Baboon, Cessna, Lighthouse, Beach and Island images, respectively. For colour images, the histograms are shown for luminance component (L* component). (For interpretation of the references to color in this figure caption, the reader is 32/35 referred to the web version of this article.)
– Contrast enhancement result
Fig 13. (b–k) Results of the proposed algorithm on an input image (a) from Kodak dataset for different values of spatial neighbourhood parameter w. (l) The average quantitative measurement results of the enhanced images of 24 test images from Kodak dataset using the proposed algorithm for different values of local neighbour support parameter w. For display purpose all measures are normalized to [0,1] by dividing each measure with the maximum measure. (a)Input, (b) w=3, (c)33/35 w=5, (d) w=7, (e) w=9, (f) w=11, (g) w=13, (h) w=15, (i) w=17, (j) w=19, (k) w=21 and(l).
– Contrast enhancement result
Fig 14. Contrast enhancement results for image Flower. (a,e) Original image. Enhanced images obtained using:(b,f) EAW with medium scale enhancement; (c,g)EAW with fine scale enhancement; and (d,h) 2DHE. 34/35
Conclusion Proposed method – – – –
Automatic image enhancement algorithm based 2DHE Applied to both grey-level and colour image General case of global histogram equalization Simple and effective for image contrast enhancement
35/35