PIXELS RELATIONSHIP WITH NEIGHBOURS Notes | EduRev

Created by: Shalini Verma

: PIXELS RELATIONSHIP WITH NEIGHBOURS Notes | EduRev

 Page 1


Basic Relationships Between 
Pixels
• Neighborhood
• Adjacency
• Connectivity
• Paths  
• Regions and boundaries
Page 2


Basic Relationships Between 
Pixels
• Neighborhood
• Adjacency
• Connectivity
• Paths  
• Regions and boundaries
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 
P, and is denoted by N
4
(P).
• Each of them are at a unit distance from P.
Page 3


Basic Relationships Between 
Pixels
• Neighborhood
• Adjacency
• Connectivity
• Paths  
• Regions and boundaries
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 
P, and is denoted by N
4
(P).
• Each of them are at a unit distance from P.
• 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)
• This set is denoted by N
D
(P).
• Each of them are at Euclidean distance of 
1.414 from P.
Neighbors of a Pixel (Contd..)
Page 4


Basic Relationships Between 
Pixels
• Neighborhood
• Adjacency
• Connectivity
• Paths  
• Regions and boundaries
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 
P, and is denoted by N
4
(P).
• Each of them are at a unit distance from P.
• 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)
• This set is denoted by N
D
(P).
• Each of them are at Euclidean distance of 
1.414 from P.
Neighbors of a Pixel (Contd..)
• The points N
D
(P) and N
4
(P) are 
together known as 8-neighbors of the 
point P, denoted by N
8
(P).
• Some of the points in the N
4
, N
D 
and 
N
8
may fall outside image when P lies 
on the border of image.
Neighbors of a Pixel (Contd..)
Page 5


Basic Relationships Between 
Pixels
• Neighborhood
• Adjacency
• Connectivity
• Paths  
• Regions and boundaries
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 
P, and is denoted by N
4
(P).
• Each of them are at a unit distance from P.
• 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)
• This set is denoted by N
D
(P).
• Each of them are at Euclidean distance of 
1.414 from P.
Neighbors of a Pixel (Contd..)
• The points N
D
(P) and N
4
(P) are 
together known as 8-neighbors of the 
point P, denoted by N
8
(P).
• Some of the points in the N
4
, N
D 
and 
N
8
may fall outside image when P lies 
on the border of image.
Neighbors of a Pixel (Contd..)
Neighbors of a pixel
a. 4-neighbors of a pixel p 
are its vertical and 
horizontal neighbors 
denoted by N
4
(p)
b. 8-neighbors of a pixel p 
are its vertical 
horizontal and 4 
diagonal neighbors 
denoted by N
8
(p)
p
N
4
(p)
p
N
8
(p)
Neighbors of a Pixel (Contd..)
Read More
Offer running on EduRev: Apply code STAYHOME200 to get INR 200 off on our premium plan EduRev Infinity!