2. Content
• Basic Relationship between pixels.
• Pixel adjacency
• Pixel connectivity
• Pixel region
• Region adjacency
• Region boundary.
3. Neighbors of pixels.
• A pixel p at location (x , y) has two horizontal and two vertical
neighbors.
• This set of four pixels (vertical & horizontal) is called 4 neighbors of
pixel. p=N4(p)
• If the p is boundary pixel then it will have less number of neighbor
pixels.
p(x , y-1)
p(x -1 , y) p(x , y) p(x+1 , y)
P(x , y+1)
4. Neighbors of pixel
• A pixel p at location ( x ,y ) has 4 diagonal neighbors. P=ND(p)
• If p is neighbor pixel then it will have less number of neighbor pixels.
p(x-1 , y+1) p(x+1 , y-1)
P(x , y)
p(x-1 , y-1) P(x+1 , y+1)
5. Neighbors of pixels
• Union of all 4 (vertical & horizontal ) and 4 ( diagonal ) neighbors is
called 8 neighbors.
• N8(p) =N4(p) U PD(p)
• If p is boundary pixel then it will have less number of neighbor pixels.
p(x-1 , y+1) p(x , y-1) p(x+1 , y-1)
p(x-1 , y) p(x , y) p(x+1 , y)
p(x-1 , y-1) p(x , y+1) P(x+1 , y+1)
6. Adjacency
4-Adjacency:-
• Two pixels are adjacent if they have same intensity value and they are
neighbors in set of p = N4(p).
• In binary image two pixels are adjacent if they are neighbors and have
same intensity either 0 or 1.
1 0 0
0 0 1
1 1 1
7. Adjacency
Two pixels are adjacent if they have same intensity value and they are
neighbors in set of p = N8(p).
1 0 0
0 0 1
1 1 1
8. Connectivity
• Two pixels are said to be connected if a path exist between them.
• Pixel connectivity based on 4 connectivity
9. Pixel Region & Region adjacency
• Region can be a subset image made by pixels.
• Region can be grow according to your need.
• impixelregion is function to set pixel region in an image.
11. Pixel Region and Region Adjacency
Region adjacency
• R1 and R2 will said to be Region adjacent if their union form a
connected set.
• Regions that are not adjacent are called disjoint.
• There can be two type of region adjacency 4&8 adjacency.
12. Pixel Region and Region Adjacency
EXAMPLE:
R1
R2
Above regions are adjacent using only 8-adjacency.
1 1 1
0 0 1
0 1 0
0 0 1
0 0 1
0 1 0
13. Boundary of Region
• The boundary of the region R is the set of pixels in the region that
have one or more neighbors that are not in R.
0 0 0 0 0
1 0 1 0 1
0 1 0 1 0
1 0 1 0 0
1 0 1 1 1
0 1 0 1 0