05 histogram processing DIP

16
Histogram Processing : 1 Histograms Histograms Histogram Discrete function h(r k ) showing the number of occurrences n k for the k th gray level r k Normalized Histogram Gives estimate of probability of occurrence of gray level r k (probability distribution function) () k k hr n 1 0 ( ) / , ()1 L k k k pr n n pr

description

Digital image Processing

Transcript of 05 histogram processing DIP

Page 1: 05 histogram processing DIP

Histogram Processing : 1

HistogramsHistograms

Histogram

Discrete function h(rk) showing the number of occurrences nk for the kth gray level rk

Normalized Histogram

Gives estimate of probability of occurrence of gray level rk (probability distribution function)

( )k kh r n

1

0

( ) / , ( ) 1L

k k kp r n n p r

Page 2: 05 histogram processing DIP

Histogram Processing : 2

Histograms: ExampleHistograms: Example

Page 3: 05 histogram processing DIP

Histogram Processing : 3

Histogram EqualizationHistogram Equalization

High-contrast images are often desirable from a visual perspective

High-contrast images have histograms where the components cover a wide dynamic range

Distribution of pixels are close to a uniform distribution

Intuitively, low-contrast images can be enhanced by transforming its pixel distribution into a uniform distribution to achieve high contrast

Page 4: 05 histogram processing DIP

Histogram Processing : 4

Histogram EqualizationHistogram Equalization

Let p(r) and p(s) denote the probability density functions of r and s

For s=T(r), p(s) can be expressed as,

Since we want to transform the input image such that the pixel distribution is uniform,

( ) ( )dr

p s p rds

( ) 1 , 0 1p s s

Page 5: 05 histogram processing DIP

Histogram Processing : 5

Histogram EqualizationHistogram Equalization

What transformation will give you a uniform distribution for s?

Cumulative distribution function (CDF)

Why?

0( ) ( )

rs T r p w dw

0( )

( )

rd p w dwds

p rdr dr

1( ) ( ) 1

( )p s p r

p r

Page 6: 05 histogram processing DIP

Histogram Processing : 6

Histogram EqualizationHistogram Equalization

Page 7: 05 histogram processing DIP

Histogram Processing : 7

Histogram EqualizationHistogram Equalization

For discrete case,

1

0

( ) / , ( ) 1L

k k kk

p r n n p r

( ) ( )k

k k jj o

s T r p r

Page 8: 05 histogram processing DIP

Histogram Processing : 8

Histogram Equalization: ExampleHistogram Equalization: Example

Page 9: 05 histogram processing DIP

Histogram Processing : 9

Local Histogram EqualizationLocal Histogram Equalization

Global approach good for overall contrast enhancement

However, there may be cases where it is necessary to enhance details over small areas in image

Solution: perform histogram equalization over a small neighborhood

Page 10: 05 histogram processing DIP

Histogram Processing : 10

Local Histogram Equalization:Local Histogram Equalization:ExampleExample

Page 11: 05 histogram processing DIP

Histogram Processing : 11

Enhancement Using Arithmetic/Logic Enhancement Using Arithmetic/Logic OperationsOperations

Performed on a pixel-by-pixel basis between two or more images

( , ) ( , ) ( , )g x y f x y h x y

Page 12: 05 histogram processing DIP

Histogram Processing : 12

Enhancement Using AND Operation: ExampleEnhancement Using AND Operation: Example

Page 13: 05 histogram processing DIP

Histogram Processing : 13

Enhancement Using OR Operation: ExampleEnhancement Using OR Operation: Example

Page 14: 05 histogram processing DIP

Histogram Processing : 14

Enhancement Using Subtraction Operation: Enhancement Using Subtraction Operation: ExampleExample

Page 15: 05 histogram processing DIP

Histogram Processing : 15

Enhancement Using Subtraction Operation: Enhancement Using Subtraction Operation: ExampleExample

Page 16: 05 histogram processing DIP

Histogram Processing : 16

Noise reduction by Image AveragingNoise reduction by Image Averaging