Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
19 views30 pages

M 5 Boundry Representation and Desicion

Uploaded by

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

M 5 Boundry Representation and Desicion

Uploaded by

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

Lecture 18

Representation and description I

1. Boundary representation
1
2. Boundary descriptors
What is representation
• What is representation
– After segmentation, we obtain binary image with interested
regions (objects) high-lighted.
– Presentation is to represent the interested regions in a format
which is convenient to process by human or computer program.
• How to represent regions: 2 ways
– In terms of its external characteristics (its boundary),
f
focusing
i on shape
h characteristics
h t i ti
– In terms of its internal characteristics (its region)
focusing on regional properties
properties, e
e.g.,
g color
color, texture
– Or use both
Description
• Description: describes the region using certain features
based on the chosen representation
• Feature selected should be as insensitive as possible
to variations in
– size
– translation
– rotation
• Example
– Representation > boundary
– Description > length of the boundary, orientation of the straight
line joining its extreme points
points, and the number of concavities in
the boundary.

3
Moors boundary tracking algorithm
• Given 0/1 binary image, in which objects are labeled 1 and background is
labeled 0. Given a region R, i.e., a set of connected pixels with label 1.
S te p 1 . L e t th e s ta rt p o in t b 0 b e th e u p p e rm o s t a n d le ftm o s t p o in t o f R
L e t c 0 b e th e w e s t n e ig h b o r o f b 0 .
S te p 2 . E x a m in e th e 8 -n e ig h b o r o f b i
s ta rtin g a t c i in c lo c k w is e d ire c tio n . L e t b i + 1 b e th e firs t p o in t w ith
la b le 1 , a n d c i + 1 b e th e p ro c e d in g b i + 1 in th e s e q u e n c e .
S to re b i + 1
S te p 3 . R e p e a t S te p 2 w h ile n o t ( b i + 1 = b 0 a n d b i + 2 = b1 )
S te p 5 . O u tp u t b 0 , ..., b i + 1

4
Chain codes
• Chain codes are used to represent a boundary by a connected
sequence of straight line segments of special length and direction.
• Freeman chain code: based on 4- or 8-connectivity of segments
segments.
The direction is coded using a number scheme.
• Drawbacks: long and sensitive to disturbances
– Solution: Resample by large grid spacing
Normalized chain codes
• Normalize for starting point: treat the chain code as a
circular sequence of direction numbers and redefine the
starting point so that the resulting sequence of numbers
forms an integer of minimum magnitude
• Normalize for rotation: use the first different chain code
instead, difference = the number of direction changes in a
counterclockwise direction

• Example
– code 10103322
– different is 3133030
– circular chain code: 33133030

6
Example

• 8-direction Freeman chain code of the simplified boundary:


0000606666666644444424222202202
• The first difference:
0006260000000600000620000620626
Polygonal Approximations
• Boundary can be approximated with arbitrary accuracy by a
polygon, try to capture the essence of the boundary shape with the
fewest possible polygonal segments.
• Minimum-perimeter polygon (MPP)
– Cellular complex to enclose a boundary
– Idea: rubber band constrained by the inner and outer walls of
bounding region
– if each cell encompass only one point on the boundary error is at
most be 2d , d is the minimum possible distance between
different pixels

8
MPP algorithm
1. Obtain the cellular complex
2. Obtain the region internal to the cellular complex
3. Use function boundaries to obtain the boundary of the region in step 2 as a 4-
connected, clockwise sequence of coordinates
4. Obtain the Freeman chain code of the sequence
5. Obtain the convex (white) concave (black) vertices from the chain code
6 From an initial polygon using the convex vertices and delete any concave vertices
6.
that outside the polygon
7. Form a polygon with the remaining convex and concave vertices.
8. Delete all black dots that are concave
9. Repeat 7-8 until all changes cease. The remaining vertices are the vertices of MPP
Example
Other polygonal approximation approaches
• Merging techniques
– based on average error or other criteria, merge points along the
bo ndar until
boundary ntil the least sq
square
are error line fit of the points merged
so far exceeds a preset threshold
• Splitting techniques
– find the major axis
– find minor axes which perpendicular to major axis and has
distance ggreater than a threshold
– repeat until we can’t split anymore
Signature
• A 1-D function representing a boundary.
Example
Boundary Segments

• Decompose a boundary into segment.


• Example:
p Find the convex hull H of an arbitrary y set S. The set different
H-S is called convex deficiency D of the set S, which can be
computed by the boundary segmentation.

15
Skeletons
• Reduce a plane region shape to a graph.
• As the result of thinning: obtained by thinning operation, but may not keep
the skeleton connected
• Skeleton defined by medial axis: points in the region has more than one
closest neighbors
• Medial Axis Transformation (MAT):
– MAT of region R with border B is as follows.
for each point p in R, we find its closet neighbor in B.
if p has more than one such neighbor, it is said to belong to the medial axis
of R
closest depends on the definition of a distance
Using thinning

iteratively deleting edge points of a region with constraints


1. does not remove end points
2. does not break connectivity
3 does not cause excessive erosion of the region
3.

17
Skeleton Algorithm by thinning
Assume region points have value 1 and background points have value 0
Step 1: flag a contour point p1 for deletion if the following conditions are satisfied:
(a) 2 ≤ N(pi ) ≤ 6, (b) T(p1 ) = 1, (c) p2 ⋅ p4 ⋅ p6 = 0, (d) p4 ⋅ p6 ⋅ p8 = 0
where N ( p1 ) = p2 + p3 + K + p8 + p9
N(pi ) is the number of nonzero neighbors of pi
contour point is any pixel with value 1 and having at least one 8-neighbor valued 0.
After step 1 has marked every boundary points satisfy all 4 conditions, delete those
pixels.
step 2: remain condition (a) and (b) but change conditions (c) and (d) to follows
(c)′ p2 ⋅ p4 ⋅ p8 = 0, (d)′ p2 ⋅ p6 ⋅ p8 = 0
flagged the remain border points for deletion. then delete the marked points

repeat step 1) and 2) until no more points to delete


Example
2. Boundary Descriptors
1. length of a boundary
2. diameters
3. eccentricity
4. curvature
5. shape numbers
6. Fourier descriptors
7
7. Statistical moments

20
Length of a boundary and Diameters
• Length of a boundary : the number of pixels along a
boundary, give a rough approximation of its length

• Diameters: Diam( B ) = max[ D ( pi , p j )]


i, j

D is a distance measure, pi and pj are points on the


boundaryy B

21
Eccentricity, Curvature
• 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

• Curvature
– The rate of change of slope
• difficult to do as digital boundaries tend to be locally ragged
• using the difference between the slopes of adjacent
boundary segments (which represented as straight lines)
• use Merging and Splitting to create adjacent boundary
segments
• concave,, convex and coner

22
Shape numbers

The number of digits in its representation

23
Fourier Descriptors

boundary = (x0,y0), … , (xK-1,yk-1)

s ( k ) = x ( k ) + jy ( k ) for k = 0 ,1 ,...,K-
K- 1
24
Fourier Descriptors

Fourier transformation (DFT)


K −1
1
ar (u ) =
K
∑ s ( k )e
k =0
− j 2πuk / K
for u = 0 ,1,...,K-1

a(u) : Fourier coefficients (Fourier Descriptors)

Inverse Fourier transformation


K −1
st ( k ) = ∑ a
k =0
( u ) e j 2 π ukk / K
for k = 0 ,1,...,K- 1

25
Invariant

26
P Coefficient of Fourier Descriptors
P −1
sˆ ( k ) = ∑ a
k =0
( u ) e j 2 π uk / K
for k = 0 ,1,...,K
K- 1

approximation to s(k)

descriptors => P number of coefficients

27
29
Statistical moments
• The shape of boundary segments can be described by statistical
moments such as mean, variance, higher-order moments.
• Assume the segmentation is represented by 1-D funciton g(r) g(r).
• p(vi), I = 0, 1, 2, …, A-1, A is the number of discrete amplitude
increments
A −1
μ n (v ) = ∑
i= 0
(vi − m )n p (vi )
A −1
w h e re m = ∑i=0
vi p (vi )

You might also like