0% found this document useful (0 votes)
32 views16 pages

Relationship Between Pixels

- Pixels have 4-neighbors that are horizontally and vertically adjacent. Diagonal neighbors are also considered for 8-neighborhood. - Two pixels are 4-adjacent if their neighbor is in the 4-neighborhood set. They are 8-adjacent if in the 8-neighborhood set. - A path between pixels is a sequence of adjacent pixels, and path length is the number of pixels in the sequence. Distance measures include Euclidean, city block, and chessboard distances based on neighborhood.

Uploaded by

hydrotech429
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views16 pages

Relationship Between Pixels

- Pixels have 4-neighbors that are horizontally and vertically adjacent. Diagonal neighbors are also considered for 8-neighborhood. - Two pixels are 4-adjacent if their neighbor is in the 4-neighborhood set. They are 8-adjacent if in the 8-neighborhood set. - A path between pixels is a sequence of adjacent pixels, and path length is the number of pixels in the sequence. Distance measures include Euclidean, city block, and chessboard distances based on neighborhood.

Uploaded by

hydrotech429
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Basic Relationships Between

Pixels
• Neighborhood
• Adjacency
• Connectivity
• Paths
• Regions and boundaries

Conventional indexing method


Neighbors of a Pixel
• Any pixel p(x, y) has two vertical and two horizontal neighbors, given by
(x+1, y), (x-1, y), (x, y+1), (x, y-1)
• This set of pixels are called the 4-neighbors of (x,y-1)

• P, and is denoted by N4(P).


(x-1,y) p (x+1,y)
• Each of them are at a unit distance from P.
(x,y+1)
4-neighborhood relation considers only vertical and horizontal neighbors.
Note: q N4(p) implies p N4(q)
Neighbors of a Pixel (Contd..)
• The four diagonal neighbors of p(x,y) are given by,
(x-1, y-1), (x+1, y+1), (x+1, y-1), (x-1, y+1), (x-1,y-1) (x+1,y-1)

This set is denoted by 𝑁𝐷 (P).


• Each of them are at Euclidean distance of 1.414 from P. p

(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

Dm( p , q ) = 2 Dm( p , q ) = 3 Dm( p , q ) = 4


Path Length
Find the shortest 4-, 8-, m-path
(q)
between p and q for
3 1 2 1
V= {0, 1} and V={1, 2}
2 2 0 2

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

• Consider the two image subsets, 𝑆1 and 𝑆2 , shown in the following


figure. For V={1}, determine whether these two subsets are
a) 4-adjacent
b) 8-adjacent
q
c) m-adjacent
p
Solution
1. S1 and S2 are not 4-connected because q is not in the set 𝑁4 (p)
2. S1 and S2 are 8-connected because q is in the set 𝑁8 (p)
3. S1 and S2 are m-connected because
a) q is in 𝑁4 (p), (or)
b) q is in 𝑁𝐷 (p) (and) q

c) the set 𝑁4 (p) ∩ 𝑁4 (q) is empty. p


Distance measures
• Given pixels p, q and z with coordinates
(x, y), (s, t), (u, v)
respectively, the distance function D has following properties:
a. D(p, q) ≥0 ; [D(p, q) = 0, iff p = q]
b. D(p, q) = D(q, p)
c. D(p, z) ≤ D(p, q) + D(q, z)
Distance measures
• The following are the different Distance measures:

Euclidean Distance : 𝑫𝒆 (p, q) = SQRT[(𝒙 − 𝒔)𝟐 + (𝒚 − 𝒕)𝟐 ]


Distance measures
• City Block Distance:

𝐃𝟒 (p, q) = |x-s| + |y-t|


Distance measures
• Chess Board Distance:

𝐃𝟖 (p, q) = max(|x-s|, |y-t|)

You might also like