You are on page 1of 33

305434

Digital Image Processing


Chapter3
Intensity Transformation
and Spatial Filtering
Part 1

Spatial Domain

image plane ( x-y plane )

pixel

Spatial Domain


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

f(x, y) input image


g(x, y) output image
T f (x, y)

Basic implementation
on a single image

(Figure from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 3rd Edition.

f(x, y)
(100,150)

T compute
the average
intensity of the 3x3
neighborhood

g(x, y) = (20+55+62+34+70+77+67+72+74)/9
(Figure from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 3rd Edition.

Gray-Level Transformation

Pixels (x, y) 1 x 1

s = g(x, y) r = f(x, y)

s = T(r)

intensity (gray-level mapping)


transformation function

intensity transformation function

a) Contrast stretching function


b) Thresholding function
(Figure from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 3rd Edition.

Basic intensity transformation functions

Linear (negative and identity


transformation)
Logarithmic (log and inverse-log
transformation)
Power-Law (nth power and nth root
transformation)

(Figure from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 3rd Edition.

Image Negatives

gray level [0, L-1]


Negative transformation

s=L-1-r

image 8 bits 2x2


negative transformation

(0, 0) s = L 1 r
= 256 1 0 = 255
(0, 1) s = L 1 r
= 256 1 10 = 245
(1, 0) s = L 1 r
= 256 1 200 = 55
(1, 1) s = L 1 r
= 256 1 255 = 0

image negatives

(Figure from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 3rd Edition.


negative

Log Transformation

gray level [0, L-1] log


transformation

s = c * log (1 + r)

c r >= 0

Figure 3.3
pixel

pixel
Fourier spectrum ( 4)
0 106

pixel 106
c = 1
s = c * log (1 + r)
= 1 * log (1 + 106 )
= 6


0-255 c
255/6

Log Transformations

Fourier Spectrum

0 1.5x106
(Figure from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 3rd Edition.

log transformation
0
c = 1
6.2
8

Power-Law (Gamma) Transformations

gray level [0, L-1]


power-law transformation

s=

c*r

(Figure from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 3rd Edition.



power law

MRI image

(Figure from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 3rd Edition.

0.4

(Figure from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 3rd Edition.

3 4

Piecewise-Linear Transformation
Functions



contrast stretching, intensity
slicing, bit-plane slicing

Contrast Stretching




low-contrast images

sensor

Contrast Stretching

700 electron microscope

(Figure from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 3rd Edition.

Figure 3.10(a)
contrast stretching (r1, s1) (r2, s2)
transformation function

r1 = s1 r2 = s2 linear function

r1 = r2 , s1 = 0 s2 = L-1
threshold function binary image

Intensity-level slicing

Gray-level slicing

(Figure from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 3rd Edition.

highlight

(Figure from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 3rd Edition.

Bit-plane slicing


8 8 0
( ) 7 ()

(Figure from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 3rd Edition.

bit plane,
194 11000010
bit plane

(Figure from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 3rd Edition.

bit plane 4
original image
higher-order bit plane
nth plane 2n-1 bit plane 8
128 bit plane 7 64 bit plane
8 7

bit plane 8 =1 bit plane 7 = 1


(1*128)+(1*64) = 192

(Figure from Rafael C. Gonzalez and Richard E.


Wood, Digital Image Processing, 3rd Edition.

You might also like