Top Banner
Tutorial on Histogram Processing for Contrast Enhancement of Digital Images Brightness Preserving Contrast Enhancement Hrushikesh Garud Senior Software Engineer Texas Instruments (India), Bangalore and School of Medical Science and Technology, Indian Institute of Technology, Kharagpur International Conference on Data Engineering and Communication Systems (ICDECS-2011) 30-31 December 2011 Bangalore, India Thanks: Mr. Debdoot Sheet School of Medical Science and Technology, Indian Institute of Technology, Kharagpur
37

Icdecs 2011

Jun 26, 2015

Download

Documents

garudht

Tutorial on Histogram Processing for Contrast Enhancement of Digital Images
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Icdecs 2011

Tutorial on

Histogram Processing for Contrast Enhancement of Digital Images

Brightness Preserving Contrast Enhancement

Hrushikesh GarudSenior Software Engineer

Texas Instruments (India), Bangaloreand

School of Medical Science and Technology, Indian Institute of Technology, Kharagpur

International Conference on Data Engineering and Communication Systems (ICDECS-2011)

30-31 December 2011 Bangalore, India

Thanks: Mr. Debdoot SheetSchool of Medical Science and Technology, Indian Institute of Technology, Kharagpur

Page 2: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 2

Outline

How do we distinguish objects from surroundings? What is contrast?

What is Subjective Contrast Enhancement? Why it is necessary?

Histogram Processing for Contrast Enhancement Histogram equalization - procedure, results and limitations Bi-histogram equalization - procedure and results Multi-histogram equalization

Brightness preserving dynamic fuzzy histogram equalization - procedure and results

Brightness Preserving Contrast Enhancement in Color Images Application: Brightness Preserving Contrast Enhancement

in Digital Pathology Conclusion

Page 3: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 3

How Do We Distinguish Objects from Their Surroundings? Difference in visual properties of an object or its

representation in an image make it distinguishable from other objects and the background Brightness, Color, Texture etc.

This difference in the visual properties of objects and their background are generally referred to as Contrast

Page 4: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 4

Subjective Contrast Enhancement It is the contrast enhancement of images to make them subjectively

look better Subjective contrast enhancement of an image is an important challenge

in the field of digital image processing These techniques find application in areas ranging from consumer

electronics, medical image processing to radar and sonar image processing.

Input Image Contrast Enhanced Image

Page 5: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 5

Histogram Processing for Contrast Enhancement In a poorly contrasted image a large number of pixels

occupy only a small portion of the available range of intensities.

Through histogram modification we reassign each pixel with a new intensity value so that the dynamic range of gray levels is increased.

Common histogram modification techniques [1] Histogram Equalization (HE)

Modifications: Locally Adaptive Histogram Equalization, Bi-histogram Equalization and Multi-histogram Equalization

Histogram Specification Histogram Hyperbolization

Page 6: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 6

Poorly Contrasted Image Contrast Enhanced Image

Page 7: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 7

Histogram Equalization [1] Histogram equalization (HE) is a technique of adjusting the gray scale

of the image such that the gray level histogram of the input image is mapped into a uniform histogram.

The assumption here is that the information conveyed by an image is related to the probability of occurrence of gray levels in the image.

Procedure: Consider a grayscale image with dimensions MxN Compute histogram H for the gray scales. Where value H(i) represents

the frequency of occurrence of the ith gray level in the image. Compute cumulative frequency Hcf(i) of the histogram. Then the equalized histogram EqH is obtained as

Here the EqH contains the new mapping of gray values. In the input image replace the each gray value i, by EqH(i) to obtain the

equalized image.

Page 8: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 8

Results

Input Image Contrast Enhanced Image

Page 9: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 9

Advantages and Limitations of Histogram Equalization Technique HE is a simple to implement and fast method of contrast enhancement It generally gives good performance over variety of images. However, it introduces major changes in the image gray level when the

spread of the histogram is not significant It cannot preserve the overall image-brightness which is critical to

consumer electronics applications.

Input ImageContrast Enhanced Image

Histogram EqualizationContrast Enhanced Image

Brightness Preserving Contrast Enhancement

Page 10: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 10

Bi-histogram Equalization[2] Bi-histogram equalization

techniques partition histograms in two sub-histograms and equalize them independently.

These techniques have been proposed to minimize the change in mean image brightness aftre histogram equalization

Several image parameters such as median, mean gray level or some sort of automatically selected grayscale threshold are used to partitioning of the histogram.

Procedure:1. Compute histogram H for the

gray scales. Where value H(i) represents the frequency of occurrence of the ith gray level in the image.

2. Split the histogram in to two sub-histograms

3. Equalize the two sub-histograms independently.

4. Let EqH contain the new mapping of gray values obtained after equalization.

5. In the input image replace the each gray value i, by EqH(i) to obtain the equalized image.

Page 11: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 11

Results

Input Image Contrast Enhanced Image

Page 12: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 12

Multi-histogram Equalization [7] Multi-histogram equalization

techniques partition histograms in multiple sub-histograms and equalize them independently.

These techniques have been proposed to further improve the mean image brightness preserving capabilities of the aftre histogram equalization

Several histogram features as local peak or valley points act as markers for partitioning of the histogram.

Thus valley portions between two consecutive peaks or peaks between two consecutive valley point form the sub-histograms for equalization

Procedure:1. Compute histogram H for the

gray scales. Where value H(i) represents the frequency of occurrence of the ith gray level in the image.

2. Split the histogram in to multiple sub-histograms

3. Equalize the each sub-histogram independently.

4. Let EqH contain the new mapping of gray values obtained after equalization.

5. In the input image replace the each gray value i, by EqH(i) to obtain the equalized image.

Page 13: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 13

Brightness Preserving Dynamic Fuzzy Histogram Equalization[10] The BPDFHE technique as shown in

Fig 2 comprises of four functional steps Fuzzy histogram computation with a

suitable membership function Partitioning of the histogram to create

sub-histograms, each comprising of a valley portion between two consecutive histogram peaks

Dynamic equalization of the histogram partitions

Normalization of image brightness to match mean image brightness of input and output images

The detailed description of each of the functional steps is given further in the presentation.

Fuzzy Histogram Computation

Partitioning of the Histogram

Dynamic Equalization of the Histogram Partitions

Normalization of Image Brightness

Low Contrast Image

Contrast Enhanced Image

BP

DF

HE

Sta

ges

Page 14: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 14

Step 1: Fuzzy Histogram Computation

1,...,1,0, Lvvh

Fuzzy histogram h(v) is the frequency of occurrence of gray levels ‘around v’

For an image F with the pixel gray value F(x,y) at location (x,y) the fuzzy histogram is computed as given in (2)

Where ξ F(x,y),ν is the fuzzy membership function defining membership of F(x,y) to the set of pixels with grayscale-value v

Fuzzy statistics of the digital images is used to effectively handle inexactness of the image data and to obtain a smooth histogram

i j

vjiFvhvh

,,~

vjiFvjiF

,1,0max

,,~

14

(1)

(2)

(3)

Page 15: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 15

Step 2: Histogram Partitioning

The fuzzy histogram now obtained is partitioned to obtain sub histograms which are to be dynamically equalized

The histogram partitioning involves two steps Local maxima detection: located using the first and second

order derivatives of the histogram

Creating partitions: Each valley portion between two consecutive local maxima is considered as a partition.

Let {m1, m2,··· mn} be the n local maxima points detected.

Then for a histogram with spread [Fmin, Fmax] the n+1sub-histograms obtained after partitioning are

{[Fmin,, m1], [m1, m2], ···[mn,Fmax] }

15

Page 16: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 16

Step 3 : Dynamic Equalization of Sub-histograms

The sub histograms obtained are individually equalized by DHE technique.

The step involves two operations Dynamic range mapping of sub-histograms:

In this step the output dynamic range for individual partitions is computed using input dynamic range and number of pixels in the partition

With output dynamic range of all the sub-histograms available, smallest and largest gray levels for all partitions are computed

i

n

i ii

kkkk

Plowhigh

PlowhighLRange

10

1

1

10

log

log1

1

1

1k

iik RangeStart

k

iik RangeStop

1

Page 17: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 17

Step 3 : Dynamic Equalization of sub-histograms (contd.)

Histogram equalization of sub-histograms: Equalization technique used is similar to that used for HE. For gray level value v in input image F, the corresponding new

gray value v’ in equalized image is obtained as

1,| 1

nn

v

Starti kkk

mmvnkwhere

P

ihRangeStartv

k

F

Page 18: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 18

Step 4: Normalization of Image Brightness

FGF

F

The output image obtained after DHE of each sub histogram has mean brightness slightly different than that of the input image.

If and are the mean brightness of the input and DHEed output images then the brightness normalized output image G is obtained as

F F

Page 19: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 19

Results

Page 20: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 20

Co

mp

ari

so

n (

HE

, BB

HE

, BP

DF

HE

)

Orig

inal

BB

HE

HE

BP

DF

HE

Page 21: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 21

Co

mp

ari

so

n (

HE

, BB

HE

, BP

DF

HE

)

Orig

inal

BB

HE

HE

BP

DF

HE

Page 22: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 22

Objective Evaluation of Contrast Enhancement and Brightness Preservation Capabilities

Image contrast enhancement without altering its brightness is a restrained goal of this technique.

Thus the performance of the algorithms needs to be evaluated objectively

Thus two parameters that can be used are Brightness preserving capability

Luminance distortion (LD) measure is used to evaluate an algorithm’s brightness preserving capability measure.

Contrast enhancement capability Contrast from Fuzzy Gray Level Co-occurrence Matrix

(FGLCM) is used as contrast enhancement evaluation metric

Page 23: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 23

This is the measure of closeness of mean luminance of two images being compared.

For the pair of reference image F and enhanced image G, having the mean brightness μF and μG respectively, the LD measure Q is given below.

Here LD measure Qimage is computed as a mean of local LD values Q(x,y) computed at every pixel 7x7 location considering the neighborhood surrounding it.

Luminance Distortion[11]

22

2

GF

GFQ

(9)

(10)

1

0

1

0

,1 X

i

Y

jimage

jiQYX

Q

Image ID HE BBHE BPDFHE

5.2.08 0.9199 --- 0.9950

TABLE I: LUMINANCE DISTORTION*

• Mo

re r

esu

lts

ava

ilab

le i

n [

10]

an

d [

13]

Page 24: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 24

Contrast from Fuzzy- GLCM [12]

1d,135°,0°,45°,90°=

,,,

dFmvumM LL

This measure evaluates the local contrast in image. Fuzzy co-occurrence matrix on image is determined with pyramidal

membership function By averaging four symmetrical co-occurrence matrices computed

with different values of θ, we compute rotational invariant FGLCM (M’)

The rotational invariant FGLCM (M’) is normalized (M’norm) and contrast is determined.

jiC Mji norm

L

i

L

j

,'

1

0

1

0

2

vyxFuyxF d

dyxvu

,

,,,~,~

),(),(1,0max,0max

Image ID Original HE BBHE BPDFHE

5.2.08 301.0 888.6 --- 348.9

TABLE II: CONTRAST FROM FUZZY CO -OCCURRENCE MATRIX*

* M

ore

res

ult

s av

aila

ble

in

[10

] an

d [

13]

Page 25: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 25

Brightness Preserving Contrast Enhancement in Color Images [13]

The brightness preserving contrast enhancement process uses Brightness Preserving Dynamic Fuzzy Histogram Equalization for contrast enhancement Images are processed in CIE L*a*b* color

space where contrast enhancement is performed on the L* channel while keeping chroma information unaltered

The BPDFHE technique manipulates image histogram to redistribute gray-level values in the valley portions between two consecutive histogram peaks and keep histogram peaks unaffected

Color Space Conversion (RGB to CIEL*a*b*)

Contrast Enhancement in L* Channel

Color Space Conversion (CIEL*a*b* to RGB)

Contrast Enhanced Color Image

Low Contrast Color Image

Page 26: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 26

Results

Page 27: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 27

Some State of the Art Bi-histogram Equalization Techniques:

Contrast Enhancement Using Brightness Preserving Bi-Histogram Equalization[2]

Minimum Mean Brightness Error Bi-Histogram Equalization in Contrast Enhancement[3]

Image Enhancement Based On Equal Area Dualistic Sub-Image Histogram Equalization Method[4]

Contrast enhancement using recursive MeanSeparate histogram equalization for scalable brightness preservation[5]

Multi-histogram Equalization Techniques

Multi-Histogram Equalization Methods for Contrast Enhancement and Brightness Preserving[6]

A Dynamic Histogram Equalization for Image Contrast Enhancement[7] Brightness Preserving Dynamic Histogram Equalization for Image Contrast

Enhancement[8] Brightness Preserving Histogram Equalization with Maximum Entropy: A

Variational Perspective[9] Brightness Preserving Dynamic Fuzzy Histogram Equalization[10]

Page 28: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 28

Application of Brightness Preserving Contrast Enhancement Techniques Digital Pathology[12]

Digital pathology is an image-based environment that enables acquisition, management and interpretation of the information generated from a digitized glass slide.

Brightfield microscopy, commonly used in pathological investigations produces low contrast images for most biological samples as few absorb light to a large extent. Thus, tissue staining is used for introduction of contrast.

Nevertheless a majority of the images in digital pathology require adjustments to optimize brightness, contrast, and image visibility.

Here we present study on application of Brightness Preserving Dynamic Fuzzy Histogram Equalization (BPDFHE) technique in digital pathology to achieve balance between two important attributes of the image quality contrast and image brightness.

Page 29: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 29

Experiments Multiple oral and breast histopathology slides stained with

Hematoxylin and Eosin (H&E) and vanGieson (VG) stains have been used as the imaging objects.

The digital images of different field-of-views at low and high magnifications were obtained using a digital microscope¶.

Fig. 4. Test image 1(H & E stained oral biopsy sample, 10 x objective magnification)

Fig. 5. Luminance (L*) channel of test image 2 (H & E stained breast biopsy sample, 10 x objective magnification)

¶ Ze

iss

Axi

o O

bse

rve

r.Z

1 f

itte

d w

ith A

xio

Ca

m M

Rc

cam

era

Page 30: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 30

Results• H & E stained oral biopsy sample with 10 x objective

magnification.

(a)Test image 1(b) HEd, (c) CLAHEd (d) BPDFHEd output image.

( a ) ( b )

( c ) ( d )

30

Page 31: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 31

Results• H & E stained breast biopsy sample with 10 x objective

magnification. Fig. 7.

(a)Test image 2(b) HEd, (c) CLAHEd [] (d) BPDFHEd output image.

( a ) ( b )

( c ) ( d )

31

Page 32: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 32

Observations for Brightness preserving Contrast Enhancement in Digital Pathology Even though the contrast enhancement capability of BPDFHE limits

when trying to preserve brightness, performance is still comparable and often better than that of the HE technique.

By virtue of operating on the global statistics of images BPDFHE is computationally more efficient than CLAHE.

CLAHE, though able to increase the contrast more than other techniques compared, it introduces large changes in the pixel gray levels. This may lead to introduction of the processing artifacts and affect the decision making process.

The study of the effects of image contrast enhancement on diagnostic value of pathological images by organ, diseases and feature specific categories through involvement of domain experts will be an important aspect for future development.

Page 33: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 33

Conclusions Histogram equalization (HE) has been a simple yet

effective image enhancement technique.

However, it tends to change the brightness of an image significantly, causing annoying artifacts andunnatural contrast enhancement.

Brightness preserving contrast enhancement by use of bi-histogram equalization and multi-histogram equalization techniques can overcome this limitation very effectively.

Multi-histogram techniques are generally better than bi-histogram equalization techniques in brightness preservation over wide variety of images.

Page 34: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 34

Image Sources USC SIPI Image Database- Miscellaneous

http://sipi.usc.edu/database/database.php?volume=misc 4.2.03 Mandrill (a.k.a. Baboon) 7.1.02 Airplane

School of Medical Science and Technology IIT Kharagpur Private Image Archieves Oral Histopathology Image Breast Histopathology Image

Page 35: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 35

References1) T. Acharya and A. K. Ray Image Processing Principles and Applicatins, John

Wiley & Sons, Inc., Hoboken, New Jersey, 20052) Y. T. Kim, “Contrast Enhancement Using Brightness Preserving Bi-Histogram

Equalization”, IEEE Trans., Consumer Electronics, vol. 43, no. 1, pp. 1-8, 1997.

3) S. D. Chen and A. R. Ramli, “Minimum Mean Brightness Error Bi-Histogram Equalization in Contrast Enhancement”, IEEE Trans.,Consumer Electronics, vol. 49, no. 4, pp. 1310-1319, Nov. 2003.

4) Yu Wan, Qian Chen and Bao-Min Zhang., “Image Enhancement Based On Equal Area Dualistic Sub-Image Histogram Equalization Method,” IEEE Trans Consumer Electronics, vol. 45, no. 1, pp. 68-75, Feb. 1999.

5) S.-D. Chen and A. Ramli, “Contrast enhancement using recursive MeanSeparate histogram equalization for scalable brightness preservation,” IEEE Trans. on Consumer Electronics, vol. 49, no. 4, pp. 1301-1309, Nov. 2003.

6) D. Menotti, L. Najman, J. Facon, and A.A. Araújo, “Multi-Histogram Equalization Methods for Contrast Enhancement and Brightness Preserving”, IEEE Transactions on Consumer Electronics, Vol. 53, No. 3, AUGUST 2007.

7) M. Abdullah-Al-Wadud, et al, “A Dynamic Histogram Equalization for Image Contrast Enhancement”, IEEE Trans., Consumer Electronics, vol.53, no. 2, pp. 593–600, May 2007.

Page 36: Icdecs 2011

December 30, 2011 ICDECS – 2011 : Tutorials 36

References (Continued)8) H. Ibrahim, and N. S. P. Kong, “Brightness Preserving Dynamic

Histogram Equalization for Image Contrast Enhancement”, IEEE Trans.,Consumer Electronics, vol. 53, no. 4, pp. 1752–1758, Nov. 2007.

9) C. Wang and Z. Ye, “Brightness Preserving Histogram Equalization with Maximum Entropy: A Variational Perspective”, IEEE Trans., Consumer Electronics, vol. 51, no. 4, pp. 1326-1334, Nov. 2005.

10) D. Sheet, H. Garud, A. Suveer, M. Mahadevappa, and J. Chatterjee, “Brightness preserving dynamic fuzzy histogram equalization,” Cons. Elect. IEEE Trans. on, vol. 56, no. 4, pp. 2475 –2480, Nov. 2010.

11) Z. Wang and A. C. Bovik, “A universal image quality index,” IEEE Signal Processing Letters, vol. 9, no. 3, pp. 81–84, Mar 2002.

12) C. V. Jawahar and A. K. Ray, “Incorporation of gray-level imprecision in representation and processing of digital images,” Pattern Recognition Letters, vol. 17, no. 5, pp. 541–546, 1996.

13) H. Garud et. al. “Brightness Preserving Contrast Enhancement in Digital Pathology” Proceedings of the ICIIP -2011, Shimla, India. (To be indexed on IEEExplore Digital Library)

Page 37: Icdecs 2011

Thank You!

[email protected]

Hrushikesh Garud