0% found this document useful (0 votes)
9 views44 pages

Shape and Boundaries

The document discusses different methods for representing and describing digital images including segmented pixels, external representations using boundaries or shape features, and internal representations using region properties. It also covers different techniques for describing shapes including chain codes, shape numbers, and Fourier descriptors.

Uploaded by

Nisa Zaira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views44 pages

Shape and Boundaries

The document discusses different methods for representing and describing digital images including segmented pixels, external representations using boundaries or shape features, and internal representations using region properties. It also covers different techniques for describing shapes including chain codes, shape numbers, and Fourier descriptors.

Uploaded by

Nisa Zaira
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 44

Representation and

Description

Digital Image Processing


Representation and Description
• Segmented pixels are usually represented and
described in two forms.
• External Representation
– Boundary (e.g. edges, chain-code)
– Describe using shape features
• Internal Representation
– Region (e.g. connected components)
– Describe using color, texture, or other regional features
• Feature descriptors should be insensitive to size,
translation, and rotation if possible.
Image shapes

• How do we tell if two objects have the


same shape?
• How can we classify shape?
• How can we describe the shape of an
object?
Chain Codes
• Represent a boundary by a connected sequence
of line segments of specified length and direction

4-directional 8-directional
Chain Codes

http://www.cs.unca.edu/~reiser/imaging/chaincode.htmls
Chain Codes

There are two problems with the definition of the


chain code as given in previous sections:
1.The chain code is dependent on the starting
pixel
2.The chain code is dependent on the orientation
of the object
Chain Codes Normalization
• Start point normalization
– Treat the chain code as a circular sequence of numbers
– Redefine the starting point so that the resulting sequence of
numbers forms an integer of minimum magnitude

10103322 (arbitrary starting point)


01033221 (after normalization)

• Rotation normalization
– Use the first difference of the chain code

01033221 (chain code)


31330303 (difference code)
Chain Codes
Chain Codes
Shape Numbers
We now consider the second problem from above:
defining a chain code that is independent of orientation of
the object.
Shape Numbers
Now suppose we rotate the shape so that it has
a different orientation

Even when normalized, the chain codes are different.


Shape Numbers
Shape Numbers
Shape Numbers
Polygonal Approximation
• A digital boundary can be approximated with
arbitrary accuracy by a polygon.
• The goal is to capture the essence of the
boundary shape with the fewest possible
polygonal segments.
Minimum Perimeter Polygons
Merging

Line fit
Splitting
Signatures
• 1-D functional representation of a boundary
• Examples
– Distance from the centroid to the boundary as a
function of angle
– Tangent angle at each point on the boundary
as a function a angle
• Need to normalized for starting point,
rotation, and scaling
Signatures
Boundary Segments
• Decompose a boundary into segments

Convex Hull
Skeletons
• Represent the structural shape of a plane region
• Skeleton is defined via medial axis transform
(MAT)
– Points in a region that have more than one closest
neighbor on the region boundary
Connected Component Labeling
• Binary image with 0 and 1 values
• Scan left to right, top to bottom
• If the value at p is 0, continue
• If p is 1, examine it’s top and left neighbors,
– If both are 0, assign p a new label, increment label count
– If only one of them is 1, assign that label to p
– If both are 1,
• If they have the same label, assign that label to p
• If they have different label, assign the smaller label to p, and
make a note that the two labels are equivalent (the two
components are connected through p)
• Do a second scan, make equivalent labels the same
Connected Component Labeling

1 1

1 1 1 1 1 2

1 1 1 1 1 1 2 3

1 1 1 1 1 1 1 2 2 2

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

1 1 1 1 1 1

1 1 4 4

1 1 1 4 4 4

After Labeling (4-connected)


Boundary Descriptors
• Simple descriptors
– Length
– Eccentricity
– Curvature
• Shape numbers
• Fourier descriptors
Boundary Length
• Number of boundary pixels as length
– 4-connected: overestimate
– 8-connected: underestimate
• Length from 8-directional chain-code
Length = (vertical and horizontal components) +
2
(diagonal components)
Eccentricity
• Eccentricity =
major axis length / minor axis length

Major Axis

Basic Rectangle Minor Axis


Curvature
• Rate of change of slope

Change of Slope
Shape Numbers
• The first difference of a chain-coded
boundary of smallest magnitude.
• Order of shape number is the number of
digits used to represent the codes.
Shape Numbers
Basic Rectangle
Fourier Descriptors

( x0 , y 0 ), ( x1 , y1 ), , x K 1 , y K 1 

( x k , y k )  x(k ), y (k ) 

s (k )  x(k )  jy (k )
Fourier Descriptors

1 K 1
  j 2uk 
a (u ) 
K

s 0
s ( k ) exp  K , u  0,1,  , K  1 DFT

K 1
 j 2uk 
s (k )   a (u ) exp   , k  0,1,2, , K  1 Reconstruction
u 0  K  of s(k)

P 1
 j 2uk  Approximation
sˆ(k )   a (u ) exp   , k  0,1,2,  , K  1
u 0  K  to s(k)
Regional Descriptors
• Simple descriptors
– Area
– Perimeter
– Compactness
– Gray-scale statistics
• Topological descriptors
• Texture
Simple Descriptors
• Area – number of pixels in the region
• Perimeter – region boundary length
• Compactness – (perimeter)2 / area
– Compactness of a disk = 1
• Gray-scale statistics
– Mean
– Median
– Min/Max
– Variance
Topological Descriptors
• Topology – study the properties of a figure that
are unaffected by any deformation (or rubber-
sheet distortion)

Hole (H)

Connected Component (C)

• Euler number (E) = C - H


Euler Number

E = 1-2 = -1
E = 1-1 = 0
Texture
• Measure smoothness, coarseness, and
regularity.
• Principal approaches
– Statistical
– Structural
– Spectral
Texture
Co-occurrence Matrix
• For n gray levels, let A be a nxn matrix
• Element aij in A is the number of times that points
with gray level zi occur (in the position specified
by P) relative to points with gray level zj
• P is the position operator
• A divided by the total number is called the co-
occurrence matrix
Co-occurrence Matrix

0 0 0 1 2 0 1 2
1 1 0 1 1 4 2 1  0
A   2 3 2 1
 
2 2 1 0 0

1 1 0 2 0 0 2 0 2

0 0 1 0 1

P = lower right
Example Texture Descriptors
• Maximum probability
max cij
i, j
 
• Element difference moment of order k

 i  j k
cij
i j

• Uniformity

 c 2ij
i j

• Entropy

  cij log 2 cij


i j

You might also like