Download as pdf or txt
Download as pdf or txt
You are on page 1of 54

Image Representation

and Description

Dr. A S Jalal
Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
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
Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Representation & Description
 Segmentation techniques yield raw data in the
form of pixels along a boundary or pixels
contained in a region.
 After segmentation, the image needs to be
described and interpreted.
 Representation: an object may be represented by its
boundary.
 Description: the object boundary may be described by
its length, orientation, or number of concavities...

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Representation
 An object can be represented by:

 Its
external characteristics, such as its
boundary.

 Orits internal characteristics, such as its


texture.

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
These objects are recognized by...…

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
These objects are recognized by…
Texture Color Context Shape

X X

X X

X X

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Description
 The features that represent the image are used
as descriptors.
 representation  boundary

 description  length of the boundary,


orientation of the straight line joining its
extreme points, and the number of concavities
in the boundary.

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Description …
 Descriptors should not be sensitive to variations
like :
– Size Change
– Translation
– Rotation

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
What are invariants?
Invariants are functionals defined on the
image space such that

 I(f) = I(D(f)) for all admissible D

 I(f1), I(f2) “different enough“ for different f1,


f2

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Discrimination power

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Boundary (Border) Following

Boundary as a sequence of connected points

The o/p of boundary (or border) following algorithm:


An ordered list of points representing the
boundary of an object

Consider an 8-connected image. The following


algorithm follows the boundary in an anti clockwise
direction for any closed contour.
Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Boundary (Border) Following …
Step 1: Start scanning row-wise from top left corner of the image
matrix.
Step 2: Mark the first object pixel obtained as the start pixel.
Step 3: Based on the previous pixel (p) visited & the currently pixel
(c) being visited, find the next pixel (n). n is found by
searching in the neighbourhood of c, clockwise starting
from position marked s up to the previous pixel p.
s p s p p s s
p c c c c c p c c c
s s s s p p p

Step 4: Mark the current pixel as previous pixel & the next pixel as
the current pixel.
Step 5: Go to step 3
Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Boundary (Border) Following …

1 1 1 1
1 1
1 1
1 1
1 1 1 1

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Chain Codes
Represent a boundary of a connected region
Why focus on a boundary?
The boundary is a good representation of an object shape
and also requires less memory.
Chain codes: represent an object boundary by a connected
sequence of straight line segments of specified length and
direction.
The direction of each segment is coded by using a
numbering scheme shown below

4-directional chain code 8-directional


Class Presentations on Image Processing And Analysis by Dr. Anand Singhchain
Jalal code
Chain Codes …
Trace the object outline -
follow pixels on boundary
Code directions of movement
Description is
position independent,
orientation dependent

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Chain Codes …

Find the 4 directional Chain


Code

1101101030332330322212

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Chain Codes …

Find the 8 directional


Chain Code

22120207656764443

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Chain Codes …
Unacceptable because
 the resulting chain of codes tends to be quite long

 any small disturbances along the boundary due to

noise or imperfect segmentation cause changes in


the code that may not be related to the shape of
the boundary

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Problems with the Chain Code
 Chain code representation is conceptually
appealing, yet has the following two problems
 Dependent on the starting point
 Dependent on the orientation

 To use boundary representation in object


recognition, we need to achieve invariance to
starting point and orientation
 Normalized codes
 Differential codes

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Normalization Strategy
to overcome the starting point problem

33001122

33001122 00112233
30011223 01122330
00112233 11223300 First row gives the
01122330 Sort 12233001 normalized chain code
11223300 rows 22330011 00112233
12233001 23300112
22330011 33001122
23300112 30011223

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
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:
difference - a chain code: 10103322
1 01 1 - The first difference = 3133030
02 2
- Treating a chain code as a
2 03 3
0 circular sequence, we get
23 1
20 2 the first difference = 33133030
3 21 3

The first difference is rotational invariant.


Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Differential Strategy
Normalization for rotation
 Counting (counterclockwise) the number of direction changes
that separate two adjacent element of the code
 Assuming the first difference code represents a closed path,
rotation normalization can be achieved by circularly shifting
the number of the code so that the list of numbers forms the
smallest possible integer.
90o

33001212 33010122
01011311
01011311 01131101
Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Shape Numbers

 The shape number of a boundary obtained from a


chain code is defined as the smallest magnitude of the
circular first difference.

 The order of the shape number is defined as the


number of digits in its representation.

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Shape Numbers …
Find the shape number & order of the given boundary.

4-direction chain code :03032211

First difference :3133030

Circular first difference :31330303

Shape number :03033133

Order :8
Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Shape Number …
1
Shape number of the boundary definition:
the first difference of smallest magnitude
2 0
The order n of the shape number:
the number of digits in the sequence
3

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Shape Number …
Shape numbers of order
4, 6 and 8

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Shape Number …

2. Find the smallest rectangle


that fits the shape

1. Original boundary

Chain code:
000030032232221211

First difference:
300031033013003130
4. Find the nearest
Shape No.
3. Create grid Grid.
000310330130031303
Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Polygon Approximation
Represent an object boundary by a polygon

Minimum perimeter
Object boundary
polygon
Minimum perimeter polygon consists of line segments that
minimize distances between boundary pixels.
Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Polygon Approximation:Splitting Techniques
1. Find the line joining
two extreme points
0. Object boundary
2. Find the
farthest points
from the line

3. Draw a polygon
Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Distance-Versus-Angle Signatures
Represent an 2-D object boundary in term of a 1-D function
of radial distance with respect to q.

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Fourier Descriptor
Fourier descriptor: view a coordinate (x,y) as a complex number
(x = real part and y = imaginary part) then apply the Fourier
transform to a sequence of boundary points.
Let s(k) be a coordinate
of a boundary point k : s(k )  x(k )  jy(k )

1 K 1
Fourier descriptor : a (u)   s(k )e 2uk / K
K k 0

Reconstruction formula

1 K 1
s(k )   a (u )e2uk / K
K k 0

Boundary
points
Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Example: Fourier Descriptor
Examples of reconstruction from Fourier descriptors

1 P 1
sˆ(k )   a (u )e2uk / K
K k 0

P is the number of
Fourier coefficients
used to reconstruct
the boundary

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Eccentricity
 Ratio of the major to the minor axis
 Major axis = the line connecting the two extreme
points that comprise the diameter
 Minor axis = the line perpendicular to the major
axis

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Statistical Moments
Definition: the nth moment
K 1
n ( r )   ( ri  m)n g ( ri )
i 0
Example of moment:
where K 1 The first moment = mean
m   ri g ( ri ) The second moment = variance
i 0

Boundary
segment
1D graph

1. Convert a boundary segment into 1D graph


2. View a 1D graph as a PDF function
3. Compute the nth order moment of the graph
Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Regional Descriptors

Purpose: to describe regions or “areas”


 Area
 Perimeter
 Compactness
 Topological descriptors
 Texture

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Regional Descriptors …
- area of the region: the number of pixels in the region
- perimeter = length of its boundary
- Compactness
A( R)
C 2
P ( R)

where A(R) and P(R) = area and perimeter of region R

Example: a circle is the most compact shape with C = 1/4

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Topological Descriptors
Use to describe holes and connected components of the region

Euler number (E):


E CH

C = the number of connected


components
H = the number of holes

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Example: Euler number

E = -1

E=0

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Texture Descriptors
Purpose: to describe “texture” of the region.

Texture is a description of the


spatial arrangement of color or
intensities in an image or a
selected region of an image.

Images containing repeating


patterns

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Texture Descriptors …

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Texture Descriptors …

repetition

stochastic

both

fractal
Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Co-occurrence Matrix

A co-occurrence matrix is a 2D array C in which

• Both the rows and columns represent a set of possible


image values.

• C (i,j) indicates how many times value i co-occurs with


value j in a particular spatial relationship d.

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Co-occurrence Matrices
 The intensity histogram is very limited in describing a texture
(f.e - checkerboard versus white-black regions.
 Use higher-level statistics: Pairs distribution.
0 1 2 3
Example:
0 0 1 1 0 2 2 1 0
•co-occurrence matrix of 0
I(x,y) and I(x+1,y)  0 1 1 
1 0 2 0 0

 
•Normalize the matrix to 0 2 2 2 2 0 0 3 2
get probabilities.    
2 2 3 3 3 0 0 0 1 

 From this matrix, generate a list of features:


 Energy
 Entropy (can also be used as a measure for “textureness”).
 Homogeneity ( )
 N (i, j )1 | i  j |
i, j

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Co-occurrence Matrix …
 What do these measure?

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Statistical Approaches for Texture Descriptors
We can use statistical moments computed from an image histogram:
K 1 z = intensity
n ( z )   ( zi  m) p( zi ) n
p(z) = PDF or histogram of z
i 0
where K 1
m   zi p( zi )
1
R( z )  1 
i 0
1   2 ( z)

Example: The 2nd moment = variance  measure “smoothness”


The 3rd moment  measure “skewness”
The 4th moment  measure “uniformity” (flatness)

A
B
C

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Projection matching
• Projection matching
• Horizontal & vertical projection: Each row and each
column become a bin in the histogram. The count that is
stored in a bin is the number of 1-pixels that appear in
that row or column.
• Diagonal projection: An alternative is to define the
bins from the top left to the bottom right of the shape.

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Horizontal and vertical projections

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Elongatedness
 The ratio of the height and width of a rotated
minimal bounding box. In other words, rotate a
rectangle
 so that it is the smallest rectangle in which the shape
fits. Then compare its height to its width.

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Rectangularity
 How rectangular a shape is (how much it fills its
minimal bounding box): area of object/area of
bounding box.

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Moments of Two-D Functions

(p + q) - the order of the moment


In terms of pixels in a image f(x,y) having size
M, N
M 1 N 1
mp,q  
x 0 y 0
f ( x, y ) x p y q

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Moments of
The moment of order p + q
Two-D Functions …
m01
m pq   x p y q f ( x, y ) x
m10 y
x y m00 m00
The central moments of order p + q

 pq   ( x  x ) p ( y  y ) q f ( x, y )
x y

00  m00 01  10  0


11  m11  x m01  m11  ym10
20  m20  x m10 02  m02  ym01
21  m21  2 xm11  ym20  2 x 2m01 30  m30  3xm20  2 x 2m10
12  m12  2 ym11  xm02  2 y 2m10 03  m03  3 ym02  2 y 2m01
Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Moments of Two-D Functions …

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Moments of Two-D Functions …

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal
Example: Invariant Moments of Two-D Functions

1. Original image 2. Half size 3. Mirrored

4. Rotated 2 degree 5. Rotated 45 degree

Class Presentations on Image Processing And Analysis by Dr. Anand Singh Jalal

You might also like