Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel...

20
01/31/2002 Image Enhancement 1 Image Enhancement Reading: Chapter 3 (Spatial domain) Chapter 4 (Frequency domain)

Transcript of Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel...

Page 1: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 1

Image Enhancement

Reading: Chapter 3 (Spatial domain)Chapter 4 (Frequency domain)

Page 2: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 2

Image Enhancement

� Basic gray level transformations� Histogram Modification� Average and Median Filtering� Frequency domain operations� Homomorphic Filtering� Edge enhancement

Page 3: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 3

Image Enhancement

Inputimage

Enhancementtechnique �Better� image

Application specific

- No general theory

Spatial domain Frequency domainManipulate pixel intensity directly Modify the Fourier transform

Page 4: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 4

Spatial domain techniques

g(x,y) = T[ f (x,y) ]

y

.

x

(x,y)

Simplest case: Neighbourhood is (x,y)

[ g(.) depends only on the value of f at (x,y) ]

Page 5: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 5

Contrast Stretching

Example:

s = T (r) s = T(r)

r

T(r)

s, r : Gray levels

Example of contrast stretching.

s

r

s = T(r)

Thresholding

There are all point operations

hence referred to as point processing.

Page 6: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 6

Figure 3.3

Page 7: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 7

Frequency domain techniques

g (x,y) = h (x,y) * f (x,y)G (u,v) = H (u,v) F (u,v)

g(x,y) = F-1 { H (u,v) F (u,v) }

h (x,y) Spatial convolution mask

Convolution Masks Vs Spatial masks

Involves flippingabout origin

No flipping

Page 8: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 8

Gray level transformations

( a ) Negative image: Example: g (x,y) = 255 - f (x,y)

Page 9: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 9

Contrast Stretching

( b ) Contrast stretching

(r1, s1)

(r2, s2)L-1

s

L-1r

T (r)

r1 = s1r2 = s2

no change

r1 = r2 s1 = 0s2 = L-1

Thresholdingat r1

Page 10: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 10

Log Transformation

( c ) Compressing dynamic ranges = c log (1 + |r| ) c Scaling factor

Example: Displaying the Fourier Spectrum

Page 11: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 11

Power-Law Transformations

s crγ=C and \gamma are positive constants.

Often referred to as �gamma correction�.

CRT �intensity-to-voltage response follows a power function (typical value of gamma in the range 1.5-2.5.)

Page 12: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 12

Gamma correction

\gamma=1, 0.7, 04. 0.1

Page 13: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 13

Gamma correction (cont.)

\gamma=1, 2, 5.

Page 14: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 14

Figure 3.6

Page 15: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 15

In Matlab

� Checkout the imadjust function.� Adjust image intensity values or colormap

SyntaxJ = imadjust(I,[low_in high_in],[low_out high_out],gamma)newmap = imadjust(map,[low_in high_in],[low_out high_out],gamma)RGB2 = imadjust(RGB1,...)

Page 16: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 16

Point Processing (contd.)

( d ) Gray level slicing ( Intensity level slicing)

A B

s

r

Highlights only the range [ A - B ]

s

rA

B

Preserves other intensities

Page 17: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 17

Bit plane slicing

( e ) Bit plane slicing

7 ............ 2 1 0

Highlights contributions made by specific bits

Page 18: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 18

MSB plane: an example

Threshold at 128

Page 19: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 19

Figure 3.13: bit plane slicing

Page 20: Reading: Chapter 3 (Spatial domain) Chapter 4 …...Spatial domain Frequency domain Manipulate pixel intensity directly Modify the Fourier transform 01/31/2002 Image Enhancement 4

01/31/2002 Image Enhancement 20

Figure 3.14: bit planes