You are on page 1of 34

Apex Institute of Technology

Department of Computer Science & Engineering


Bachelor of Engineering (Computer Science & Engineering)
DIGITAL IMAGE PROCESSING– (20CST-481)
Prepared By: MR. Aadi Partap Singh (E15043)

DISCOVER . LEARN . EMPOWER


04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels 1
DIGITAL IMAGE
PROCESSING
Course Objective:
During the course, students will be able :

CO
Title Level
Number Will be covered in
To Understand the fundamental of digital Understand this lecture
CO1 image processing with python.
To acquire the knowledge to apply various
CO2 Understand
image processing techniques and tools.
To learn the practical applications of
CO3 image processing steps to real world Understand
problem.

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels 2


DIGITAL IMAGE
PROCESSING
Course Outcome:
Upon successful completion of this course, students will be able to:

CO
Title Level
Number
Fundaments and techniques implemented in
CO1 Understand
digital image processing technologies
Will be covered in
Understanding the various filters applications,
CO2 smoothing applications and techniques by Understand this lecture
image processing implementation by python
Acquiring knowledge on various compression
CO3 and segmentation techniques, for image Understand
enhancement methods.

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels 3


Recap of Previous session
In previous session we tried understanding the below concept :
Colour spaces
Image formats

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels 4


Welcome to the session of

Unit-1: Fundamentals of Image processing

Chapter-1: Introduction to Image Processing

Lecture: 7 Relationship between pixel

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels 5


CONTENTS

This presentation covers:

 Relation ship between pixel


 Neighborhood
 Adjacency
 Connectivity
 Paths
 Regions and boundaries

Link: https://medium.com/futframe-ai/fundamental-steps-of-digital-image-processing-d7518d6bb23c

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels 6


Basic Relationships Between Pixels

 Neighborhood
 Adjacency
 Connectivity
 Paths
 Regions and
boundaries

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Basic Relationships Between Pixels
Neighbors of a pixel p at coordinates (x,y)

 4-neighbors of p, denoted by N4(p): (x-1, y), (x+1,


y), (x,y-1), and (x, y+1).

 4 diagonal neighbors of p, denoted by ND(p): (x-1, y-1),


(x+1, y+1), (x+1,y-1), and (x-1, y+1).

 8 neighbors of p, denoted N8(p) 8

N8(p) = N4(p) U ND(p)

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Basic Relationships Between Pixels

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).
43

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels 9


Basic Relationships Between Pixels

Adjacency
Let V be the set of intensity values

 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(p) has no pixels whose values are from V.

44

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels 10


Basic Relationships Between Pixels

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.


11
 We can define 4-, 8-, and m-paths based on the type of adjacency used.

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Examples: Adjacency and Path
V = {1, 2}
0 1 1 0 1 1 0 1 1
0 2 0 0 2 0 0 2 0
0 0 1 0 0 1 0 0 1

12

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Examples: Adjacency and Path
V = {1, 2}
0 1 1 0 1 1 0 1 1
0 2 0 0 2 0 0 2 0
0 0 1 0 0 1 0 0 1
8-adjacent

13

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Examples: Adjacency and Path
V = {1, 2}
0 1 1 0 1 1 0 1 1
0 2 0 0 2 0 0 2 0
0 0 1 0 0 1 0 0 1
8-adjacent m-adjacent

14

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Examples: Adjacency and Path
V = {1, 2}
0
1,1 1 1 1,2 1,3 0 1 1 0 1 1
0
2,1 2 0 2,2 2,3 0 2 0 0 2 0
0
3,1 0 1 3,2 3,3 0 0 1 0 0 1
8-adjacent m-adjacent
The 8-path from (1,3) to (3,3): The m-path from (1,3) to (3,3):
(i) (1,3), (1,2), (2,2), (3,3) (1,3), (1,2), (2,2), (3,3)
(ii) (1,3), (2,2), (3,3)

15

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Basic Relationships Between Pixels

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)


Where i, 0  i  n,(x i , yi )  S

16

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Basic Relationships Between Pixels

Let S represent a subset of pixels in an image

For every pixel p in S, the set of pixels in S that are connected to p is called a
connected component of S.

If S has only one connected component, then S is called Connected Set.

We call R a region of the image if R is a connected set

Two regions, Ri and Rj are said to be adjacent if their union forms a connected set.
Regions that are not to be adjacent are said to be disjoint. 17

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Basic Relationships Between Pixels

Boundary (or border)

 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.
 If R happens to be an entire image, then its boundary is defined as the set of pixels in the first and last
rows and columns of the image.

Foreground and background

 An image contains K disjoint regions, Rk, k = 1, 2, …, K. Let Ru denote the union of all the K regions,
and let (Ru)c denote its complement. 18
All the points in Ru is called foreground; All the points in (Ru)c is called
background.

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Question

In the following arrangement of pixels, are the two regions (of 1s) adjacent? (if 8-
adjacency is used)
1 1 1
Region 1
1 0 1
0 1 0
Region 2
0 0 1
1 1 1
1 1 1

19

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Question

In the following arrangement of pixels, are the two parts (of 1s) adjacent? (if 4-
adjacency is used)
1 1 1
Part 1
1 0 1
0 1 0
Part 2
0 0 1
1 1 1
1 1 1

20

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


In the following arrangement of pixels, the two regions (of 1s) are disjoint (if 4-adjacency is
used)

1 1 1
Region 1
1 0 1
0 1 0
Region 2
0 0 1
1 1 1
1 1 1

21

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


In the following arrangement of pixels, the two regions (of 1s) are disjoint (if 4-
adjacency is used)

1 1 1
foreground
1 0 1
0 1 0
0 0 1 background

1 1 1
1 1 1

22

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Question

In the following arrangement of pixels, the circled point is part of the boundary of
the 1-valued pixels if 8-adjacency is used, true or false?

0 0 0 0 0
0 1 1 0 0
0 1 1 0 0
0 1 1 1 0
0 1 1 1 0
0 0 0 0 0

23

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Homework: Question 1

In the following arrangement of pixels, the circled point is part of the boundary of
the 1-valued pixels if 4-adjacency is used, true or false?

0 0 0 0 0
0 1 1 0 0
0 1 1 0 0
0 1 1 1 0
0 1 1 1 0
0 0 0 0 0

24

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Distance Measures
Given pixels p, q and z with coordinates (x, y), (s, t), (u, v) respectively, the
distance function D has following properties:

a. D(p, q) ≥ 0 [D(p, q) = 0, iff p = q]

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

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


25

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Distance Measures
The following are the different Distance measures:

a.Euclidean Distance : De(p, q) = [(x-s)2 + (y-


t)2]1/2

b. City Block Distance:


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

c.Chess Board Distance: D8(p, q) = max(|x-


26
s|, |y-t|)

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Question
In the following arrangement of pixels, what’s the value of the chessboard distance
between the circled two points?
0 0 0 0 0
0 0 1 1 0
0 1 1 0 0
0 1 0 0 0
0 0 0 0 0
0 0 0 0 0

27

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Homework: Question 2

In the following arrangement of pixels, what’s the value of the city-block distance
between the circled two points?
0 0 0 0 0
0 0 1 1 0
0 1 1 0 0
0 1 0 0 0
0 0 0 0 0
0 0 0 0 0

28

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Homework: Question 3

In the following arrangement of pixels, what’s the value of the length of the m-
path between the circled two points?
0 0 0 0 0
0 0 1 1 0
0 1 1 0 0
0 1 0 0 0
0 0 0 0 0
0 0 0 0 0

29

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Homework: Question 4

In the following arrangement of pixels, what’s the value of the length of the m-
path between the circled two points?
0 0 0 0 0
0 0 1 1 0
0 0 1 0 0
0 1 0 0 0
0 0 0 0 0
0 0 0 0 0

30

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels


Summary
In todays session we tried understanding the below concept :
 Relation ship with pixels
 Neighbourhood activity

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels 31


References:

 https://www.simplilearn.com/how-facebook-is-using-big-data-article?source=CTAexp
 https://www.icas.com/ca-today-news/10-companies-using-big-data
 https://www.bernardmarr.com/default.asp?contentID=1076
 Bryant, R.E., Katz, R.H., Lazowska, E.D.: Big-Data Computing: Creating Revolutionary Breakthroughs in
Commerce, Science and Society
 Sathi, A.: Implementation section (book 1). In: Big Data Analytics: Disruptive Technologies for Changing the
Game, 1st ed. MC Press Online (2012)
 R. Gonzalez and R. Woods, “Digital Image Processing – 2 Editi on”, Prenti ce Hall, 2 0 0 2
nd

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels 32


Assessment Pattern
S.No. Item Number/semester Marks
1 MSTs 2 20 per each
2 Quiz 2 per unit 4 per each quiz
3 Time bound surprise test 3 (one per unit) 12 per each test

4 Assignments 3 (one per unit) 10 per each Assignment

Engagement task (non


5 One per each topic depends
gradable)
Attendance +
6 Above 90% 2
Engagement score
Internal (division as mentioned above points 1-6) 40

External 60

Total 100

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels 33


THANK YOU

For queries
Email: aadi.e15043@cumail.in

04/10/2024 Unit1-Chapter1_Lecture 1.7_Relationship B/W pixels 34

You might also like