Title: 3-D Computer Vision CSc 83020
13-D Computer VisionCSc 83020
- Binary Images
- Horn (Robot Vision) pages 46-64.
2Binary Images
- Binary Image b(x,y) Obtained from Gray-Level (or
other image) g(x,y) - By Thresholding.
- Characteristic Function
- 1 g(x,y) lt T
- b(x,y)
- 0 g(x,y) gt T
- Geometrical Properties
- Discrete Binary Images
- Multiple objects
- Sequential and Iterative Processing.
3Selecting the Threshold (T)
g(x,y)
h(i)
BIMODAL
HISTOGRAM
T
i (intensity)
b(x,y)
4Histogram Thresholding
T
5Geometric Properties
b(x,y)
Assume 1) b(x,y) is continuous 2) Only one
object
y
x
6Geometric Properties
b(x,y)
Assume 1) b(x,y) is continuous 2) Only one
object
y
x
Area
(Zeroth Moment)
7Geometric Properties
b(x,y)
Assume 1) b(x,y) is continuous 2) Only one
object
y
x
Area
(Zeroth Moment)
Position Center (x,y) of Area
(First Moment)
8Orientation
Difficult to define! We use axis of least second
moment
y
axis
(x,y)
r
?
x
?
9Orientation
Difficult to define! We use axis of least second
moment For mass distribution Axis of minimum
Inertia.
y
axis
(x,y)
r
?
x
?
Minimize
10Orientation
Difficult to define! We use axis of least second
moment For mass distribution Axis of minimum
Inertia.
y
axis
(x,y)
r
?
x
?
Minimize
Equation of Axis ymxb ??? 0lt m lt
infinity We use (?, ?) finite. Find (?,
?) that minimize E for a given b(x,y)
11We can show that
So
12We can show that
So
Using dE/d?0 we get
13We can show that
So
Using dE/d?0 we get
Note Axis passes through center (x,y)!! So,
change coordinates xx-x, yy-y
14We can show that
So
Using dE/d?0 we get
Note Axis passes through center (x,y)!! So,
change coordinates xx-x, yy-y We get
Second Moments w.r.t. (x, y)
15We can show that
So
Using dE/d?0 we get
Note Axis passes through center (x,y)!! So,
change coordinates xx-x, yy-y We get
Second Moments w.r.t. (x, y)
Mistake in your handout.
16Using dE/d?0, we get tan(2?)b/(a-c)
b
2?
a-c
17Using dE/d?0, we get tan(2?)b/(a-c) So
b
2?
a-c
18Using dE/d?0, we get tan(2?)b/(a-c) So S
olutions with positive sign may be used to find ?
that minimizes E (why??). Emin/Emax -gt (ROUDNESS
of the OBJECT).
b
2?
a-c
19Discrete Binary Images
bij value at pixel in row i column j.
j (y) m
O
i (x) n
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
20Discrete Binary Images
bij value at pixel in row i column j. Assume
pixel area is 1. Area Position (Center of
Area)
j (y) m
O
i (x) n
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
21Discrete Binary Images
bij value at pixel in row i column j. Assume
pixel area is 1. Area Position (Center of
Area)
j (y) m
O
i (x) n
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Second Moments.
22Discrete Binary Images (cont)
Note a,b,c are second moments w.r.t
ORIGIN a,b,c (w.r.t center) can be found from
(a,b,c,x,y,A). Note UPDATE
(a,b,c,x,y,A) during RASTER SCAN.
23Multiple Objects
Need to SEGMENT image into separate COMPONENTS
(regions). Connected Component Maximal Set of
Connected Points
B
A
Points A and B are connected Path exists between
A and B along which b(x,y) is constant.
24Connected Components
4-way connected
8-way connected
Label all pixels that are connected
25Region Growing Algorithm(Connected Component
Labeling)
- Start with seed point where bij1.
- Assign LABEL to seed point.
- Assign SAME LABEL to its NEIGHBORS (b1).
- Assign SAME LABEL to NEIGHBORS of NEIGHBORS.
Terminates when a component is completely
labeled. Then pick another UNLABELED seed point.
26What do we mean by NEIGHBORS?
Connectedness
8-Connectedness (8-c)
Neither is perfect!
4-Connectedness (4-c)
27What do we mean by NEIGHBORS?
Jordans Curve Theorem Closed curve -gt 2
connected regions
B1
O1
B1
0
1
0
1
1
0
O2
O3
B2
1
0
0
O4
B1
B1
(4-c) Hole without closed curve!
28What do we mean by NEIGHBORS?
Jordans Curve Theorem Closed curve -gt 2
connected regions
B1
O1
B1
B
O
B
0
1
0
1
1
0
O2
O3
B2
O
O
B
(8-c) Connected background with closed ring!
1
0
0
O4
B1
B1
O
B
B
(4-c) Hole without closed curve!
29Solution Introduce Assymetry
Use
or
(a)
(b)
Using (a)
Two separate line segments.
B
O1
B
0
1
0
1
1
0
O2
O1
B
1
0
0
O2
B
B
Hexagonal Tesselation
Above assymetry makes SQUARE grid like HEXAGONAL
grid.
30Sequential Labeling Algorithm
Raster Scan
B
D
C
A
Note B,C,D are already labeled
31Sequential Labeling Algorithm
Raster Scan
B
D
C
A
Note B,C,D are already labeled
Label(A) background
X
X
a.
X
0
Label(A) label(D)
X
D
b.
X
1
32Sequential Labeling Algorithm
Raster Scan
B
D
C
A
Note B,C,D are already labeled
Label(A) label(C)
0
0
c.
C
1
Label(A) label(B)
B
0
d.
0
1
If Label(B) label(C ), then Label(A)Label(B)
Label(C)
B
0
d.
C
1
33Sequential Labeling Algorithm
Raster Scan
B
D
C
A
Note B,C,D are already labeled
Label(A) background
X
X
a.
X
0
Label(A) label(D)
X
D
b.
X
1
Label(A) label(C)
0
0
c.
C
1
Label(A) label(B)
B
0
d.
0
1
If Label(B) label(C ), then Label(A)Label(B)
Label(C)
B
0
d.
C
1
34Sequential Labeling (Cont.)
What if B C are labeled but label(B)
label(C) ?
35Sequential Labeling (Cont.)
What if B C are labeled but label(B)
label(C) ?
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
1
1
1
1
1
1
1
1
2
2
2
2
2
2
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
?
36Sequential Labeling (Cont.)
Solution Let Label(A)Label(B) 2
create an EQUIVALENCE TABLE. Resolve
Equivalences in SECOND PASS.
2
1
7
3,6,4