Chapter 11
Chapter 11
24 May 2014
chain code
Gonzalez and Richard E.
Object Boundary
boundary vertices
(resampling)
4-directional 8-directional
chain code chain code
Partitioned boundary
Object boundary
pi to Lupper
ntains more than 2 points and the last 3
in Lupper do not make a right turn
elete the middle point
Turn
of the last 3 poin
Turn Left
Turn
Right NOK!
Right
OK!
OK!
Convex Hull Algorithm (cont.)
side of a convex hull
nts pn and pn-1 in a list Llower with pn as the
down to 1
d pi to Llower
contains more than 2 points and the las
Llower do not make a right turn
delete the middle point of the last 3 poin
e first and the last points from Llower
wer
to Lupper resulting in the list L
Turn
Turn Right
Right OK!
Turn
OK!
Left
NOK!
Skeletons
Obtained from thinning or skeletonizing processes
Step 1. Mark pixels for deletion if the following conditions are true.
a) 2 N ( p1 ) 6
(Apply to all border pixels) p9 p2 p3
b) T(p1) =1
p p p 0 p8 p1 p4
c) 2 4 6
p7 p6 p5
d) p4 p6 p8 0
Step 2. Delete marked pixels and go to Step 3.
Step 3. Mark pixels for deletion if the following conditions are true.
a) 2 N ( p1 ) 6
(Apply to all border pixels)
b) T(p1) =1
c) p2 p4 p8 0
d) p2 p6 p8 0
Step 4. Delete marked pixels and repeat Step 1 until no change
occurs.
Example: Skeletons Obtained from the Thinning Alg.
Skeleton
2. Shape number
3. Fourier descriptor
4. Statistical moments
Shape Number
Shape number of the boundary definition: 1
the first difference of smallest magnitude
The order n of the shape number: 2 0
the number of digits in the sequence
3
Chain code:
000030032232221211
First difference:
300031033013003130
K1
1
Fourier descriptor : a (u )
K
s
k 0
( k ) e 2uk / K
Reconstruction formula
K1
1
s(k )
K
a
k 0
( u ) e 2uk / K
Boundary
points (Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Example: Fourier Descriptor
Examples of reconstruction from Fourier descriptors
P 1
1
sˆ( k )
K
a (
k 0
u ) e 2uk / K
P is the number of
Fourier coefficients
used to reconstruct
the boundary
K1
where
m ri g ( ri )
i 0
Boundary
segment 1D graph
2. Topological Descriptors
3. Texture
4. Moments of 2D Functions
Example: Regional Descriptors
% of white pixels
Region no. compared to the
total white pixels
1 20.4%
2 64.0%
3 4.9%
4 10.7%
Infrared image of America at night (Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Topological Descriptors
Use to describe holes and connected components of the region
E = -1
V Q F C H E
The largest
After thinning
connected
area
(8479 Pixels)
(Hudson river)
B C
A
where K1
m zi p( zi )
i 0
A
B
C
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Fourier Approach for Texture Descriptor
Concept: convert 2D spectrum into 1D graphs
Fourier
Original FFT2D Divide into areas
coefficient
image +FFTSHIFT by angles
image
R0
S ( ) Sr ( )
r 1
Sum all pixels
S ( r ) S ( r )
in each area 0
Fourier Approach for Texture Descriptor
Original 2D Spectrum
image (Fourier Tr.)
S(r) S()
Let x [ x1 x2 ... xn ]T
K
1
Mean: m x E{x}
K
x
k 1
k
K
1
Covariance matrix C x E{( x m x )( x m x )T }
K
k k x x
x x
k 1
T
m mT
Hotelling transformation
Let y A ( x m x )
Where is a constant
6 spectral images
from an airborne
Scanner.
Component
1 3210
2 931.4
3 118.5
4 83.88
5 64.00
6 13.40
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Example: Principal Components (cont.)