Professional Documents
Culture Documents
DIP
f (x,y) = i(x,y)r(x,y)
Where 0< i(x,y)<∞: determined by the light source
0< r(x,y)<1: determined by the characteristics of objects
Sampling and Quantization
Sampling and Quantization
N4(p) : 4-neighbors of p
N8(p) : 8-neighbors of p :
Is a combination of N4(p) and ND(p)
R=M
N C=N
Boundary Pixels
R=M
Regions N C=N
M
R=M
N C=N
S2
M
S1 (x-1, y)
S2
M
(x+1,
(x+1, y) (x+1, y+1)
y+1) N8(p)
ADJACENCY
(a) q is in N4(p), or
(b) q is in ND(p) and the set N4(p) П N4(q) has no pixels whose values are from V.
R=M
N C=N
S2
M
Are S1 and S2 adjacent over V = {1}
using N4(p) connectivity?
S1 (x-1, y)
For pixel p, q and z with coordinates (x, y), (s, t) and (v,
w) respectively
D is a distance function or metric if
p(x, y)
EUCLIDEAN DISTANCE
D(p, q)=
City-block distance: D4 distance
The path between the pixels based on a 4-connected
neighbors. Pixels whose edges touch are 1 unit apart;
pixel diagonally touching are 2 units apart.
D4(p,q) = |x – s| + |y – t |
Diamond centered at (x, y) D4 =1 are 4-neighbors of (x,
y)
Chessboard distance: D8 Distance
The path between the pixels based on an 8-neighborhood.
Pixels whose edges or corners touch are 1 unit apart.
Square centered at (x, y)
D8 (p, q) = Max (|x – s|, |y – t |)
Arithmetic Operations
D(p, q)
(a) D(p, q) ≥ 0 ; D(p, q) = 0 iff p=q
(b) D(p, q) = D(q, p) p(x, y)
(c) D(p, z) ≤ D(p, q) + D(q,z)
18
City-block distance:
D4 distance
• D4(p,q) = |x – s| + |y – t |
• Diamond centered at (x, y) D4 =1 are
4- neighbors of (x, y)
20
Chessboard distance:
D8 Distance
D8 (p, q) = max |x – s|, |y – t |
Square centered at (x, y)
21