Docsity

Computer Vision and Digital Image Processing - Lecture Slides | ECE 582, Study notes of Electrical and Electronics Engineering

Toggle sidebar
bg1
1
Image Spatial Enhancement
Lecture 4
EE582
Computer Vision & Digital Image
Processing
Image Enhancement
Purposes
Process an image so that the result will be more suitable for
a specific application
Applications
Human Visual: subjective, no standard
Machine Perception: objective, better recognition results
Domains
Spatial: manipulation of pixel values in an image
Spectral: modifying of Fourier transform of an image
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Computer Vision and Digital Image Processing - Lecture Slides | ECE 582 and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Image Spatial Enhancement

Lecture 4

EE

Computer Vision & Digital Image

Processing

Image Enhancement

„ Purposes „ Process an image so that the result will be more suitable for a specific application „ Applications „ Human Visual: subjective, no standard „ Machine Perception: objective, better recognition results „ Domains „ Spatial: manipulation of pixel values in an image „ Spectral: modifying of Fourier transform of an image

Image Spatial Enhancement

„ Pixel Processing „ Linear (Piece-wise) transformation, lookup table „ Nonlinear transform: Logarithm and Power-law „ Gamma Correction „ Histogram Processing „ Histogram normalization, Equalization „ Histogram Matching (Specification) „ Area Processing „ Linear Filters: smoothing and sharpening „ Nonlinear Filters: max, min, median „ Thresholding „ Binary map

3 basic gray-level

transformation functions

„ Linear function „ Negative and identity transformations „ Logarithm function „ Log and inverse-log transformation „ Power-law function „ n th^ power and n th root transformations Input gray level, r

Output gray level, s

Negative

Log

nth root

Identity

nth power

Inverse Log

8 bit planes

Bit-plane 6

Bit- plane 0

Bit- plane 1

Bit- plane 2

Bit- plane 3

Bit- plane 4

Bit- plane 5

Bit-plane 7

Histogram Processing

„ Basic for numerous spatial domain

processing techniques

„ Used effectively for image enhancement

„ Information inherent in histograms also

is useful in image compression and

segmentation

Example r k

h(r (^) k ) or p(r (^) k )

Dark image

Bright image

Components of histogram are concentrated on the low side of the gray scale.

Components of histogram are concentrated on the high side of the gray scale.

Example

Low-contrast image

High-contrast image

histogram is narrow and centered toward the middle of the gray scale

histogram covers broad range of the gray scale and the distribution of pixels is not too far from uniform, with very few vertical lines being much higher than the others

r

s T(r ) pr (w)dw

a random variable s

characterized by

a uniform probability

function

yields

0

1

s

Ps (s)

Discrete

transformation function

„ The probability of occurrence of gray

level in an image is approximated by

„ The discrete version of transformation

=

=

= =

k

j

j

k

j

k k r j

where k , , ..., L- n

n

s T(r ) p(r )

0

0

0 1 1

where k 0 , 1 , ..., L- 1

n

n

p r (rk) = k =

Histogram Equalization

before after Histogram equalization

Example

before after Histogram equalization

The quality is not improved much because the original image already has a broaden gray-level scale

Example

Output image Gray scale = [0,9] Histogram equalization

0 1

1

2

2

3

3

4

4

5

5

6

6

7 8 9

No. of pixels

Gray level

Histogram Matching

(Specification)

„ Histogram equalization has a disadvantage

which is that it can generate only one type

of output image.

„ With Histogram Specification, we can specify

the shape of the histogram that we wish the

output image to have.

„ It doesn’t have to be a uniform histogram

Consider the continuous domain

Let p (^) r(r) denote continuous probability density function of gray-level of input image, r

Let pz(z) denote desired (specified) continuous probability density function of gray-level of output image, z

Let s be a random variable with the property

= = ∫

r s T(r) pr (w)dw 0

Where w is a dummy variable of integration

Histogram equalization

Next, we define a random variable z with the property

s = T(r) = G(z)

We can map an input gray level r to output gray level z

thus

g(z) p (t)dt s

z = (^) ∫ z = 0 Where t is a dummy variable of integration

Histogram equalization

Therefore, z must satisfy the condition

z = G-1^ (s) = G-1^ [T(r)]

Assume G-1^ exists and satisfies the condition (a) and (b)

Example

Assume an image has a gray level probability density function pr(r) as shown.

0 1 2

1

2

Pr(r)

0 ;elsewhere

2 r 2 ;0 r 1

pr(r)

0

∫^ =

r

pr (w)dw

r

Example

We would like to apply the histogram specification with the desired probability density function pz (z) as shown.

0 1 2

1

2

Pz (z)

z

⎩

⎨

⎧ ≤ ≤

0 ;elsewhere

2 z ;0 z 1 p (^) z(z)

0

∫^ =

z

pz (w)dw

Step 1:

(^0 )

1

s=T(r)

r (^) r r

w w

( w )dw

s T(r) p(w)dw

r

r

r r

2

0

2

0

0

∫

∫

Obtain the transformation function T(r)

One to one mapping function

Step 2:

2 0

2

0

G (z) ( 2 w)dw z z

z z = (^) ∫ = =

Obtain the transformation function G(z)