Professional Documents
Culture Documents
Digital Image Processing: Lect # 4
Digital Image Processing: Lect # 4
(x,y)
Pixel adjacency or
connectivity
Pixels: p(x,y) and q(s,t)
•
• V = {1} – set of intensity values used to define
adjacency
• 4-adjacency: p and q with values from V, are 4-
adjacent if they are 4 neighbors
• 8-adjacency: p and q with values from V, are 8-
adjacent if they are 8 neighbors
• m-adjacency (mixed adjacency): p and q with values
from V, are m-adjacent if:
• q is 4-neighbor of p, or
• Q is diagonal neighbor of p and there is no common 4-
neighbor fro p and q, that is, N4(p)⋂ N4(q) = Φ
Question:
• For the binary image [1 1 1 0 1 1; 0 1 1 0 0 1;1 1 0 0 0
1;1 1 0 0 1 1; 1 1 0 1 1 1], if objects are identified as
V={0}
• Determine the number of objects in the image.
• Determine the number of pixels in each object.
• Determine the pixel length of the boundary of each object.
• Steps:
1. Start reading row wise.
2. For each white pixel
a. label it
b. find the connected neighbours and give them same label
c. if not connected with any previous label but belongs to
foreground, give the next label.
Connectivity, Regions & Boundaries
• Euclidean distance
the points with distance ‘d’ are contained in a disk of radius ‘d’ centered
at (x, y).
Pixel Distances (Contd.)
• TheD4 distance (also called city-block distance) between p and q is
0 1 0 1 1 1
0 1 1 1 1 1
1 1 1
Dm = 2 Dm = 3 Dm = 4
Find the number of objects in the
given image using (i) 4-connectivity
(ii) 8-connectivity and (iii) m-
connectivity
Find the number of objects in the
given image using (i) 4-connectivity
(ii) 8-connectivity and (iii) m-
connectivity
Find the number of objects in the
given image using (i) 4-connectivity
(ii) 8-connectivity and (iii) m-
connectivity
Find the boundary length( in terms of
number of pixels) for each object with 8-
connectivity used.
Boundary with 8-connectivity Boundary with 4-connectivity
Find the boundary length( in terms of
number of pixels) for each object with 8-
connectivity used.
Boundary with 8-connectivity Boundary with 4-connectivity