Professional Documents
Culture Documents
Lecture2 Basic Relationship Between Pixels
Lecture2 Basic Relationship Between Pixels
Processing
Lecture 2
Basic Relationship Between Pixels
Note book & Lab Report
• Proper notebook to keep record of each lecture.
• Lab report for each task you perform
Basic Relationships Between Pixels
• Neighborhood
• Adjacency
• Paths
• Connectivity
• Regions
• Boundaries
Neighbors of a pixel - N4(p)
• Any pixel p(x, y) has two vertical and two
horizontal neighbors, given by
x , y+1
(x+1, y),
(x-1, y),
(x, y+1),
(x, y-1)
• This set of pixels are called the 4-
x-1 , y x,y x+1 , y
x , y-1
Neighbors of a pixel - ND(p)
• Any pixel p(x, y) has four diagonal
neighbors, 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 ND(p).
x,y
• We call all the points in Ru the foreground and all the points in (Ru)c
the background
Boundary
• The boundary (border or contour) of a region R is the set of points that are
adjacent to the points in the complement of R.
• Set of pixels in the region that have at least one background neighbor.
• 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.
• Inner Border: Border of Foreground
• Outer Border: Border of Background
• If R happens to be entire Image?
• There is a difference between boundary and edge in Digital Image Paradigm.
The author refers this discussion to chapter 10.
Distance Measures
• Euclidean Distance: De(p, q) = [(x-s)2 + (y-t)2]1/2
4 3 2 3 4
3 2 1 2 3
2 1 0 1 2
3 2 1 2 3
• City Block Distance: D4(p, q) = |x-s| + |y-t| 4 3 2 3 4
2 2 2 2 2
2 1 1 1 2
2 1 0 1 2
2 1 1 1 2
• Chess Board Distance: D8(p, q) = max(|x-s|, |y-t|)
2 2 2 2 2
Sample Problem from exercise