Representation and Description
Representation and Description
Chapter 11:
1
Image Representation and Description?
Objective:
To represent and describe information embedded in
an image in other forms that are more suitable than the
image itself.
Benefits:
- Easier to understand
- Require fewer memory, faster to be processed
- More “ready to be used”
What kind of information we can use?
- Boundary, shape
- Region
- Texture
- Relation between regions 2
Shape Representation by Using Chain Codes
Why we focus on a boundary?
The boundary is a good representation of an object shape
and also requires a few memory.
Chain codes: represent an object boundary by a connected
sequence of straight line segments of specified length
and direction.
Object Boundary
boundary vertices
(resampling)
4-directional 8-directional
chain code chain code
4
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
The First Difference of a Chain Codes
Problem of a chain code:
a chain code sequence depends on a starting point.
Solution: treat a chain code as a circular sequence and redefine the
starting point so that the resulting sequence of numbers forms an
integer of minimum magnitude.
The first difference of a chain code: counting the number of direction
change (in counterclockwise) between 2 adjacent elements of the code.
Example: Chain code : The first Example:
1 difference - a chain code: 10103322
01 1 - The first difference = 3133030
2 0 02 2 - Treating a chain code as a
03 3 circular sequence, we get
3 23 1 the first difference = 33133030
20 2
21 3 The first difference is rotational
5
invariant.
Polygon Approximation
3. Draw a polygon 7
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Distance-Versus-Angle Signatures
Represent an 2-D object boundary in term of a 1-D function
of radial distance with respect to .
8
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Boundary Segments
Concept: Partitioning an object boundary by using vertices
of a convex hull.
Partitioned boundary
Object boundary
9
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Convex Hull Algorithm
points on a cornea boundary
points on a boundary of a convex hull of
s by x-coordinate to get a sequence p1, p
de of a convex hull
p1 and p2 in a list Lupper with p1 as the firs
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! 10
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 11
NOK!
Skeletons
Obtained from thinning or skeletonizing processes
12
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Thinning Algorithm
Concept: 1. Do not remove end points
“Prairie fire” 2. Do not break connectivity
3. Do not cause excessive erosion
Apply only to contour pixels: pixels “1” having at least one of its 8
neighbor pixels valued “0”
Notation:
p9 p2 p3 Neighborhood
arrangement
Let p 8 p 1 p 4 =
for the thinning
p7 p6 p5 algorithm
Example
Let N ( p1 ) p2 p3 p8 p9 0 0 1
T(p1) = the number of transition 0-1 in 1 p1 0
the ordered sequence p2, p3, … 1 0 1
, p8, p9, p2. N(p1) =134
T(p ) = 3
Thinning Algorithm (cont.)
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. 14
Example: Skeletons Obtained from the Thinning Alg.
Skeleton
15
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Boundary Descriptors
1. Simple boundary descriptors:
we can use
- Length of the boundary
- The size of smallest circle or box that can totally
enclosing the object
2. Shape number
3. Fourier descriptor
4. Statistical moments
16
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
17
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Shape Number (cont.)
18
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Example: Shape Number
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 20
(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
21
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Fourier Descriptor Properties
22
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Statistical Moments
Definition: the nth moment Example of moment:
K1 The first moment = mean
n ( r ) ( ri m)n g ( ri ) The second moment = variance
i 0
2. Topological Descriptors
3. Texture
4. Moments of 2D Functions
24
Regional Descriptors
• Area: # of pixels within the boundary
• Perimeter: length of boundary
– Compactness is:
• Dimensionless, and thus insensitive to scale changes
• Insensitive to orientation
25
Regional Descriptors
• Principal axes:
26
Regional Descriptors
• Other descriptors:
27
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%
28
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
29
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Topological Descriptors (cont.)
E = -1
V Q F C H E
E = -2 30
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Example: Topological Descriptors
ginal image:
ared image After intensity
Washington Thresholding
. area (1591 connected
components
with 39 holes)
Euler no. = 1552
The largest
After thinning
connected
area
(8479 Pixels)
(Hudson river)
31
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Texture Descriptors
Purpose: to describe “texture” of the region.
Examples: optical microscope images:
B C
A
where K1
m zi p( zi )
i 0
A
B
C
39
(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 ) 40
in each area 0
Fourier Approach for Texture Descriptor
Original 2D Spectrum
image (Fourier Tr.)
S(r) S()
44
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Example: Invariant Moments of Two-D Functions
45
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Principal Components for Description
Purpose: to reduce dimensionality of a vector image while maintaining
information as much as possible.
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
46
Hotelling transformation
Let y A ( x m x )
Where is a constant
48
Example: Principal Components
6 spectral images
from an airborne
Scanner.
49
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Example: Principal Components (cont.)
Component
1 3210
2 931.4
3 118.5
4 83.88
5 64.00
6 13.40
50
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Example: Principal Components (cont.)
52
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Relational Descriptors
53
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Relational Descriptors
54
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Relational Descriptors
55
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Relational Descriptors
56
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Relational Descriptors
57
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Structural Approach for Texture Descriptor
58
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.