Binary Image Analysis: Skeleton Finding Via Distance Transform
Binary Image Analysis: Skeleton Finding Via Distance Transform
1
Binary Image Analysis
Skeleton finding via distance transform
Image topology: connectivity and Euler
number
Boundary representation
Chain codes, shape numbers, Fourier descriptors*
Skeleton representation
String codes, tree grammar*, automata*
Applications
Character/barcode/handwriting recognition
2
From Processing to Analysis
Localized perspective in binary image processing
Low-level vision
PHIL
High-level vision
3
High-level Vision Questions
……
4
Image Topology
Topology is the study of properties of a figure that are unaffected
by rubber-sheet distortions
5
Connectivity
X’
Y’
Y
6
Connectivity Properties
4-neighbors 8-neighbors
7
Finding Connected
Component
Xk=(Xk-1B)A, k=1,2,3…
8
Connected Component
Labeling 1
2 3
4 5
9
Image Example
X label2rgb(y)
>y=bwlabel(x);
>imshow(label2rgb(y));
10
Objects With Holes
11
Image Examples
EN=0 EN=-1
EN=-3
12
Binary Image Analysis
X X
X=X-(X _ B) or X=(X + B) – B
14
Chain Codes Boundary
Representation
15
Two 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
16
Normalization Strategy
33001122
33001122 00112233
30011223 01122330
00112233 11223300
First row gives the
01122330 Sort 12233001
normalized chain code
11223300 rows 22330011
12233001 23300112 00112233
22330011 30011223
23300112 33001122
17
Differential Strategy
90o
33001212 33010122
normalize normalize
00121233 01012233
Differential coding:
18
Shape Numbers= Normalized
Differential Chain Codes
33001212 33010122
Differential code: differentiate differentiate
dk=ck-ck-1 (mod 4) 10101131 10113110
normalize normalize
01011311 01011311
Note that the shape numbers of two objects related by 90o rotation
are indeed identical
19
Exercise
20
Binary Image Analysis
22
String Codes
23
Tree Grammar*
G={N, , P, r, S}
N={X1,X2,X3,S} nonterminals
={a,b,c,d,e} terminals
S: start symbol
r: ranking function
P: a set of productions
Expansive production example
X k
X1 Xn
X2 …
24
Example
1) S a 2) X b
1
X1 X1
3) X1 c 4) X d
2
X2 X3
X2
5) X a
2
6) X e
3
7) X X3
3 a
25
Automata as String
Recognizer*
0 1
Examples
0 1
1
S1 S2
0
start accept
state state
010
Recognizable string
(0*1*)*1 0011
26
Applications of Binary Image
Processing and Analysis
Optical Character Recognition (OCR)
Tax form processing, Google Books, …
Barcode recognition
Grocery shopping
Handwriting recognition
Biometrics, forensics
Fingerprint recognition
Biometrics, forensics
27
Bank Note Character
Recognition American Banker’s
Association E-13B
Font character set:
14 characters
9-by-7 grid
Distinct 1D signature
is generated as the
reading head moves
from left to right and
detects the change
of ink area under the
head
28
Fourier Descriptor*
z(k)=x(k)+j y(k)
DFT
N
1
a ( n)
N
z
k 1
( k ) e j 2nk / N
Fourier IDFT
descriptors
N
{x(k),y(k)}, k=1,2,..,N 1
z (k )
N
a
n 1
( n ) e j 2nk / N
29
Numerical Example
P
1
zˆ (k )
N
a
n 1
( n ) e j 2nk / N
30
31
32
33
34
35
36
37
38
39
40
41
42
43