0% found this document useful (0 votes)
2 views

Digital Image Processing3

The document discusses the fundamental concepts of digital image processing, focusing on pixel relationships, adjacency, connectivity, and distance measures. It explains the definitions of 4-neighbors, 8-neighbors, and various types of adjacency, along with the concepts of regions, boundaries, and edges in images. Additionally, it presents different distance measures and provides problems for practical understanding of these concepts.

Uploaded by

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

Digital Image Processing3

The document discusses the fundamental concepts of digital image processing, focusing on pixel relationships, adjacency, connectivity, and distance measures. It explains the definitions of 4-neighbors, 8-neighbors, and various types of adjacency, along with the concepts of regions, boundaries, and edges in images. Additionally, it presents different distance measures and provides problems for practical understanding of these concepts.

Uploaded by

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

Digital Image Processing

Code : CSE7001

Piyush Vashistha
Assistant Professor

Dept. of Computer Engineering and Applications


Basic Relationship between Pixels
 An image is denoted by a function f(x,y).
 Each element f(x,y) at location (x,y) is called a pixel.
 There exist some basic but important relationships
between pixels.

f(x, y)
Basic Relationship between Pixels
 A pixel p at location (x,y) has two horizontal and two
vertical neighbors.

 This set of four pixels is called 4-neighbors of p=N4(p).


 Each of these neighbors is at a unit distance from p.
 If p is a boundary pixel then it will have less number of
neighbors.
Basic Relationship between Pixels
 A pixel p has four diagonal neighbors=ND(p)

 The points of N4(p) and ND(p) together are called 8-


neighbors of p.
 N8(p) = N4(p) U ND(p)
 If p is a boundary pixel then both ND(p) and and N8(p) will
have less number of pixels.
Basic Relationship between Pixels
 Two pixels are said to be connected if they are adjacent in
some sense
 They are neighbors(N ,N or N ) and
4 D 8
 Their intensity values (gray levels) are similar

 For a binary image B, two points p and q will be


connected if q Є N(p) or p Є N(q) and B(p) = B(q).
Basic Relationship between Pixels
 Neighborhood
 Adjacency (X-1,Y-1) (X-1,Y) (X-1,Y+1)
 Connectivity
 Paths (X,Y-1) (X,Y) (X,Y+1)
 Regions and boundaries
(X+1,Y-1) (X+1,Y) (X+1,Y+1)
Adjacency
 Let V be the set of intensity values
 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
(i) q is in the set N4(p), or
(ii) q is in the set ND(p) and the set N4(p) ∩ N4(q) is
empty (has no pixels whose values are from V).
Examples: Adjacency and Path

Find 8-adjacency & m-adjacency of


the pixel in the centre.
Note: V = {1}
Examples: Adjacency and Path

V = {1}
Fig (b) shows the ambiguity in 8-adjacency
Path
 A (digital) path (or curve) from pixel p with coordinates
(x0, y0) to pixel q with coordinates (xn, yn) is a sequence of
distinct pixels with coordinates
(x0, y0), (x1, y1), …, (xn, yn)
Where (xi, yi) and (xi-1, yi-1) are adjacent for 1 ≤ i ≤ n.
 Here n is the length of the path.
 If (x0, y0) = (xn, yn), the path is closed path.
 We can define 4-, 8-, and m-paths based on the type of
adjacency used.
Connectivity
 Connected in S
Let S represent a subset of pixels in an image. Two pixels
p with coordinates (x0, y0) and q with coordinates (xn, yn)
are said to be connected in S if there exists a path

(x0, y0), (x1, y1), …, (xn, yn)


Region, Boundary and Edge
 Region
 We call R a region of the image if R is a connected set
 Boundary
 The boundary of a region R is the set of pixels in the
region that have one or more neighbors that are not in R
 Edge
 Pixels with derivative values that exceed a preset
threshold
Distance Measures
 Given pixels p, q and z with coordinates (x, y), (s, t),
(u, v) respectively, the distance function D has following
properties:
1. D(p, q) ≥ 0 [D(p, q) = 0, iff p = q]

2. D(p, q) = D(q, p)

3. D(p, z) ≤ D(p, q) + D(q, z)


Distance Measures …
The following are the different Distance
measures:
Euclidean Distance :
De(p, q) = [(x-s)2 + (y-t)2]1/2

City Block Distance:


City Block Distance
D4(p, q) = |x-s| + |y-t|

Chess Board Distance:


D8(p, q) = max(|x-s|, |y-t|)
Chess Board Distance
Problems
1. When you enter a dark theater on a bright day, it takes an
appreciable interval of time before you can see well enough
to find an empty seat. Which of the visual process is at play
in this situation?
2. Consider the two image subsets, S1 and S2, shown in the
following figure. For V={1}, determine whether these two
subsets are a) 4-adjacent, b) 8-adjacent, or c) m-adjacent.
S1 S2
0 0 0 0 0 0 0 1 1 0
1 0 0 1 0 0 1 0 0 1
1 0 0 1 0 1 1 0 0 0
0 0 1 1 1 0 0 0 0 0
0 0 1 1 1 0 0 1 1 1
Problems
1. S1 and S2 are not 4-connected because q is not in the set
N4(p);
2. S1 and S2 are 8-connected because q is in the set N8(p);
3. S1 and S2 are m-connected because (i) q is in ND(p), and
(ii)the set N4(p) ∩ N4(q) is empty.
S1 S2
0 0 0 0 0 0 0 1 1 0
1 0 0 1 0 0 1 0 0 1
1 0 0 1 0 1 1 0 0 0
0 0 1 1 1 0 0 0 0 0
0 0 1 1 1 0 0 1 1 1
Problems …
3. Consider the image segment shown
a) Let V={0,1} and compute the length of the shortest 4-,8-,
and m-path between p and q. if a particular path does not exist
between these two points, explain why.
b) Repeat for V={1,2}

3 1 2 1 (q)
2 2 0 2
1 2 1 1
(p) 1 0 1 2
3 1 2 1 (q)
2 2 0 2
Problems … 1 2 1 1
(p) 1 0 1 2
3. Consider the image segment shown
a) When V = {0,1}, 4-path does not exist between p and q
because it is impossible to get from p to q by traveling along
points that are both 4-adjacent and also have values from V .

b) Repeat for V={1,2}

You might also like