Relationship Between Pixels
Relationship Between Pixels
Pixels
• Neighborhood
• Adjacency
• Connectivity
• Paths
• Regions and boundaries
(x-1,y+1) (x+1,y+1)
Adjacency
Let V be set of gray levels values used to define adjacency.
• 4-adjacency: Two pixels p and q with values from V are 4-adjacent if q
is in the set N4(p).
• 8-adjacency: Two pixels p and q with values from V are 8-adjacent if q
is in the set N8(p).
• m-adjacency: Two pixels p and q with values from V are m-adjacent if,
– q is in N4(P) or
– q is in 𝑁𝐷 (p) and the set [𝑵𝟒 (𝒑) ∩ 𝑵𝟒 (𝒒)] is empty
(has no pixels whose values are from V).
Connectivity
• To determine whether the pixels are adjacent. V = {1, 2}
• Let V be the set of gray-level values used to define
connectivity; then Two pixels p, q that have values
from the set V are:
• 4-connected, if q ∈N4(p) a b c
• 8-connected, if q ∈ N8(p)
• m-connected, iff
• q ∈ N4(p) or
• q ∈ ND(p) and the set
[𝑵𝟒 (𝒑) ∩ 𝑵𝟒 (𝒒)] is empty
Adjacency/Connectivity
• Pixel p is adjacent to pixel q if they are connected.
• Two image subsets S1 and S2 are adjacent if some pixel in S1 is adjacent to
some pixel in S2.
Paths & Path lengths
• A path from pixel p with coordinates (x, y) to pixel q with coordinates (s, t)
is a sequence of distinct pixels with coordinates:
• (x0, y0), (x1, y1), (x2, y2) … (xn, yn),
• where (x0, y0)=(x, y) and (xn, yn)=(s, t); (xi, yi) is adjacent to (xi-1, yi-1) ,
𝟏≤𝒊 ≤𝒏
• Here n is the length of the path.
• We can define 4-, 8-, and m-paths based on type of adjacency used.
Distance Measure of Path
If distance depend on the path between two pixels such as m-adjacency then the Dm
distance between two pixels is defined as the shortest m-path between the pixels.
0 0 1 q 0 0 1 q 0 1 1 q
0 1 0 p 1 1 0 1 1 0
p 1 0 0 p 1 0 0 p 1 0 0
1 2 1 1
1 0 1 2
(p)
Tasks done using neighbourhood processing
• Smoothing / averaging
• Noise removal / filtering
• Edge detection
• Contrast enhancement
Problem-1