33
EE 4780 Image Enhancement

EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Embed Size (px)

Citation preview

Page 1: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

EE 4780

Image Enhancement

Page 2: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 2

Image Enhancement The objective of image enhancement is to process an

image so that the result is more suitable than the original image for a specific application.

There are two main approaches: Image enhancement in spatial domain: Direct

manipulation of pixels in an image Point processing: Change pixel intensities Spatial filtering

Image enhancement in frequency domain: Modifying the Fourier transform of an image

Page 3: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 3

Image Enhancement by Point Processing

Intensity Transformation

Page 4: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 4

Image Enhancement by Point Processing Contrast Stretching

Page 5: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 5

Image Enhancement by Point Processing Contrast Stretching

( ) log(1 )T r c r

Page 6: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 6

Image Enhancement by Point Processing

Intensity Transformation

Matlab exercise

Page 7: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 7

Image Enhancement by Point Processing Intensity Transformation

Page 8: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 8

Image Enhancement by Point Processing Intensity Transformation

Page 9: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 9

Image Enhancement by Point Processing Gray-Level Slicing

Page 10: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 10

Image Enhancement by Point Processing Histogram

0 255

Number of pixels with intensity ( )

Total number of pixels

rp r

( )p r

r

Page 11: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 11

Histogram Specification

( )s T r

Intensity mapping

Assume T(r) is single-valued and monotonically increasing.

The original and transformed intensities can be characterized by their probability density functions (PDFs)

0 ( ) 1 and 0 1T r r

( )rp r

( )sp s

Page 12: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 12

Histogram Specification

1 ( )

( ) ( )s rr T s

drp s p r

ds

The relationship between the PDFs is

0

( ) ( )r

r

w

s T r p w dw

0

( ) ( )r

r r

w

ds dp w dw p r

dr dr

Consider the mapping

Cumulative distribution function of r

1 ( )

1( ) ( ) 1, 0 1

( )s rr r T s

p s p r sp r

Histogram equalization!

( ) ( ) 1s rp s ds p r dr

Page 13: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 13

Image Enhancement by Point Processing Histogram Equalization

Number of pixels with intensity ( ) 255

Total number of pixels

i rT r round

0 255r

0

255 ( )r

i

round p i

0

Number of pixels with intensity 255

Total number of pixels

r

i

iround

Page 14: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 14

Image Enhancement by Point Processing Histogram Equalization Example

Intensity 0 1 2 3 4 5 6 7

Number of pixels 10 20 12 8 0 0 0 0

Intensity 0 1 2 3 4 5 6 7

Number of pixels 0 10 0 0 20 0 12 8

(0) 10 / 50 0.2p (1) 20 / 50 0.4p (2) 12 / 50 0.24p (3) 8 / 50 0.16p

( ) 0 / 50 0, 4,5,6,7p r r

0

( ) 7 ( )r

i

T r round p i

(0) 7* (0) 7*0.2 1T round p round (1) 7* (0) (1) 7*0.6 4T round p p round (2) 7* (0) (1) (2) 7*0.84 6T round p p p round (3) 7* (0) (1) (2) (3) 7T round p p p p

( ) 7, 4,5,6,7T r r

Page 15: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 15

Image Enhancement by Point Processing Histogram Equalization

Page 16: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 20

Local Histogram Processing

Histogram processing can be applied locally.

Page 17: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 21

Image Subtraction

The background is subtracted out, the arteries appear bright.

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

Page 18: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 22

Image Averaging

( , ) ( , ) ( , )g x y f x y n x y

Original

imageNoiseCorrupted

image

Assume n(x,y) a white noise with mean=0, and variance 2 2 ( , )E n x y

If we have a set of noisy images ( , )ig x y

The noise variance in the average image is1

1( , ) ( , )

M

ave ii

g x y g x yM

2

2 22

1 1

1 1 1( , ) ( , )

M M

i ii i

E n x y E n x yM M M

Page 19: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 23

Image Averaging

Page 20: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 24

Spatial Filtering

1 1 11

1 1 19

1 1 1

1 1 1

1 8 1

1 1 1

A low-pass filter

A high-pass filter

Page 21: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 25

Spatial Filtering

Median Filter

10 20 10

25 10 75

90 85 100

Sort: (10 10 10 20 25 75 85 90 100)

100 100 100 100 10 10 10 10 10

Example

Original signal:

100 103 100 100 10 9 10 11 10Noisy signal:

101 101 70 40 10 10 10Filter by [ 1 1 1]/3:

100 100 100 10 10 10 10Filter by 1x3 median filter:

Page 22: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 26

Spatial Filtering

Median filters are nonlinear. Median filtering reduces noise without blurring edges and

other sharp details. Median filtering is particularly effective when the noise

pattern consists of strong, spike-like components. (Salt-and-pepper noise.)

Page 23: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 27

Spatial Filtering

Original

3x3 averaging

filter

Salt&Pepper noise added

3x3 median filter

Page 24: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 28

Spatial Filtering

Page 25: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 29

Wiener Filter

WXY

YXwx

x22

2

ˆ

Wiener Filter

Original

imageNoiseNoisy

image

Noise varianceSignal variance

Page 26: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 30

Wiener Filter

222ˆ wx y

2x is estimated by

Since variance is nonnegative, it is modified as

],0max[ˆ 222wx y

2 2 22

1ˆ max[0, ]x i w

i

yN

Estimate signal variance locally:

N

N

Page 27: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 31

Wiener Filter

Noisy, =10 Denoised (3x3neighborhood)Mean Squared Error is 56

wiener2 in Matlab

Page 28: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 35

Spatial Filtering

1 1 1

1 8 1

1 1 1

Page 29: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 36

Spatial Filtering

High-boost or high-frequency-emphasis filter Sharpens the image but does not remove the low-frequency

components unlike high-pass filtering

Page 30: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 37

Spatial Filtering

High-boost or high-frequency-emphasis filter

High pass = Original – Low pass

High boost = (Original) + K*(High pass)

Page 31: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 38

Spatial Filtering

1 1 1

1 8 1

1 1 1

A high-pass filter A high-boost filter

1 1 1

1 9 1

1 1 1

Page 32: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 39

Spatial Filtering

High-boost or high-frequency-emphasis filter

Page 33: EE 4780 Image Enhancement. Bahadir K. Gunturk2 Image Enhancement The objective of image enhancement is to process an image so that the result is more

Bahadir K. Gunturk 40

Spatial Filtering