Chapter 2 Pixel Relation
Chapter 2 Pixel Relation
Pixel Relation
By: Prof. (Dr.) Paramartha Dutta
Visva Bharati University
Santiniketan, West Bengal, India
Pixel Relationship
Pixel
Pixel Neighbourhood and Type of Neighbourhood
Pixel Connectivity
Connected Component
Different Distance Measure Techniques
Arithmetic/Logical Operator
Neighborhood Operation
N4(p) ∩ ND(p) = ᶲ
0 1 1 0 1 1 0 1 1 so ND(p) is not
0 1 0 0 1 0 taken
0 1 0
0 0 0 0 0 1 0 0 1
4 connected 8 connected M connected
Back to the chapter content
Click Here
Connected Component
Adjacency : Two pixel p & q are adjacent if they are connected
4 adjacency
8 adjacency
M adjacency
si
p sj
q
Connected Component
Path : A path from p(x,y) to q(s,t) is a sequence of
distinct pixel
(x0,y0), (x1,y1), …… , (xn,yn)
Where (x0,y0) = (x,y) and (xn,yn) = (s, t)
(xi,yi) is adacent to (xi-1 ,yi-1) for 1 ≤ I ≤ n
here n is the length of path
Connected Component
Let S I and p,q є S
Then p is connected to q in S if there is a path
from p to q consisting entirely of pixels in S
For any p є S, the set of pixel in S that are
connected to p is call a connected component of
S
r s Point p is connected to point
q and r but not connected
p
q with point k
k
Connected Component Labeling
Ability to assign different label to the various
disjoint connected components of an image
Connected component labeling is fundamental step
in automated image analysis
r
t p
1 2
1 2 3 3
1 1 1 1 4 4 4 4
1 1 4 4
5 1 4 4 4
5
1 1
1 1 3 3
1 1 1 1 3 3 3 3
1 1 3 3
1 1 3 3 3
1
Here two separate region/ group are identified YELLOE (1) region and
RED (3) region
Back to the chapter content
Click Here
Distance Measure
Take three pixel
p ≈ (x,y) q ≈ (s,t) z ≈ (u,v)
D is distance function if
D(p,q) ≥ 0 ; D(p,q) = 0 iff p = q (p & q is same pixel)
D(p,q) = D(q,p) (distance from p to q & q to p is
same)
D(p, z) ≤ D(p,q) + D(q,z)
Distance Measure Technique
Euclidean Distance
City Block Distance (Manhattan Distance)
Chess Board Distance
Euclidean distance between two point p(x,y) & q(s,t) is defined as
D(p,q) = [|x-s|2 +|y-t|2]1/2
q(s,t)
p(x,y)
Distance Measure Technique
City Block Distance
D4 distance or City Block (Manhattan) distance is defined as
D4 (p,q) = |x-s| + |y-t|
Point having city block distance from p less than or equal to r from
diamond center
3
3 2 3
3 2 1 2 3
3 2 1 p 1 2 3
3 2 1 2 3
3 2 3
3
Distance Measure Technique
Chess Board Distance
D8 distance or Chess Board Distance is defined as
D8 (p,q) = max( |x-s|, |y-t|)
Point with D8 = 1are 8 neighbour of p
3 3 3 3 3 3 3
3 2 2 2 2 2 3
3 2 1 1 1 2 3
3 2 1 P 1 2 3
3 2 1 1 1 2 3
3 2 2 2 2 2 3
3 3 3 3 3 3 3
Back to the chapter content
Click Here
Arithmetic/Logical Operator
If pixel p є I1 and q є I2 where I1 and I2 are two different images then
Arithmetic Operators are
p+q
p–q
p*q
p%q
Logical Operator
p.q (Logical AND)
p+q (Logical OR)
p’ (NOT)
Logical operators are only applied to binary image
Logical Operator
Z1 Z2 Z3
Z4 Z5 Z6
Z7 Z8 Z9
Averaging
Z = 1/9 (Z1+ Z2 + …….. + Z9 )
Neighbourhood Operation
More general form
Z1 Z2 Z3 W1 W2 W3
Z4 Z5 Z6 W4 W5 W6
Z7 Z8 Z9 W7 W8 W9
Z = W1 Z1+ W2 Z2 + …….. + W9 Z9
= ∑ Wi Zi for i = 1 to 9
It is useful for
Noise filtering
Edge Detection
Various important operation can be implemented by
proper selection of coefficient Wi
Back to the chapter content
Click Here