SlideShare a Scribd company logo
pixelrelationships in image processing enhancement
DIGITAL IMAGE
PROCESSING
Prepared by
K.Indragandhi,AP(Sr.Gr.)/ECE
DIGITAL IMAGE
PROCESSING
Basic Relationships between Pixels
Neighbors of a Pixel
f(0,0) f(0,1) f(0,2) f(0,3) f(0,4) - - - - -
f(1,0) f(1,1) f(1,2) f(1,3) f(1,4) - - - - -
f(x,y) = f(2,0) f(2,1) f(2,2) f(2,3) f(2,4) - - - - -
f(3,0) f(3,1) f(3,2) f(3,3) f(3,4) - - - - -
I I I I I - - - - -
I I I I I - - - - -
Neighbors of a Pixel
 A Pixel p at coordinates ( x, y) has 4 horizontal and vertical neighbors.
 Their coordinates are given by:
(x+1, y) (x-1, y) (x, y+1) &
(x, y-1)
f(2,1) f(0,1) f(1,2)
f(1,0)
 This set of pixels is called the 4-neighbors of p denoted by N4(p).
 Each pixel is unit distance from ( x ,y).
f(0,0) f(0,1) f(0,2) f(0,3) f(0,4) - - - - -
f(1,0) f(1,1) f(1,2) f(1,3) f(1,4) - - - - -
f(x,y) = f(2,0) f(2,1) f(2,2) f(2,3) f(2,4) - - - - -
f(3,0) f(3,1) f(3,2) f(3,3) f(3,4) - - - - -
I I I I I - - - - -
I I I I I - - - - -
Neighbors of a Pixel
 A Pixel p at coordinates ( x, y) has 4 diagonal neighbors.
 Their coordinates are given by:
(x+1, y+1) (x+1, y-1) (x-1, y+1) &
(x-1, y-1)
f(2,2) f(2,0) f(0,2)
f(0,0)
 This set of pixels is called the diagonal-neighbors of p denoted by
ND(p).

f(0,0) f(0,1) f(0,2) f(0,3) f(0,4) - - - - -
f(1,0) f(1,1) f(1,2) f(1,3) f(1,4) - - - - -
f(x,y) = f(2,0) f(2,1) f(2,2) f(2,3) f(2,4) - - - - -
f(3,0) f(3,1) f(3,2) f(3,3) f(3,4) - - - - -
I I I I I - - - - -
I I I I I - - - - -
Adjacency, Connectivity
Adjacency: Two pixels are adjacent if they are neighbors and
their intensity level ‘V’ satisfy some specific criteria of
similarity.
e.g. V = {1}
V = { 0, 2}
Binary image = { 0, 1}
Gray scale image = { 0, 1, 2, ------, 255}
In binary images, 2 pixels are adjacent if they are neighbors &
have some intensity values either 0 or 1.
In gray scale, image contains more gray level values in range 0
to 255.
Adjacency, Connectivity
4-adjacency: Two pixels p and q with the values from set ‘V’
are 4-adjacent if q is in the set of N4(p).
e.g. V = { 0, 1}
1 1 2
1 1 0
1 0 1
p in RED color
q can be any value in GREEN color.
Adjacency, Connectivity
8-adjacency: Two pixels p and q with the values from set ‘V’
are 8-adjacent if q is in the set of N8(p).
e.g. V = { 1, 2}
0 1 1
0 2 0
0 0 1
p in RED color
q can be any value in GREEN color
Adjacency, Connectivity
m-adjacency: Two pixels p and q with the values from set ‘V’
are m-adjacent if
(i) q is in N4(p) OR
(ii) q is in ND(p) & the set N4(p) n N4(q) have no pixels
whose values are from ‘V’.
e.g. V = { 1 }
0 a 1 b 1 c
0 d 1 e 0 f
0 g 0 h 1 i
Adjacency, Connectivity
m-adjacency: Two pixels p and q with the values from set ‘V’
are m-adjacent if
(i) q is in N4(p)
e.g. V = { 1 }
(i) b & c
0 a 1 b 1 c
0 d 1 e 0 f
0 g 0 h 1 I
Adjacency, Connectivity
m-adjacency: Two pixels p and q with the values from set ‘V’
are m-adjacent if
(i) q is in N4(p)
e.g. V = { 1 }
(i) b & c
0 a 1 b 1 c
0 d 1 e 0 f
0 g 0 h 1 I
Soln: b & c are m-adjacent.
Adjacency, Connectivity
m-adjacency: Two pixels p and q with the values from set ‘V’
are m-adjacent if
(i) q is in N4(p)
e.g. V = { 1 }
(ii) b & e
0 a 1 b 1 c
0 d 1 e 0 f
0 g 0 h 1 I
Adjacency, Connectivity
m-adjacency: Two pixels p and q with the values from set ‘V’
are m-adjacent if
(i) q is in N4(p)
e.g. V = { 1 }
(ii) b & e
0 a 1 b 1 c
0 d 1 e 0 f
0 g 0 h 1 I
Soln: b & e are m-adjacent.
Adjacency, Connectivity
m-adjacency: Two pixels p and q with the values from set ‘V’
are m-adjacent if
(i) q is in N4(p) OR
e.g. V = { 1 }
(iii) e & i
0 a 1 b 1 c
0 d 1 e 0 f
0 g 0 h 1 i
Adjacency, Connectivity
m-adjacency: Two pixels p and q with the values from set ‘V’
are m-adjacent if
(i) q is in ND(p) & the set N4(p) n N4(q) have no pixels
whose values are from ‘V’.
e.g. V = { 1 }
(iii) e & i
0 a 1 b 1 c
0 d 1 e 0 f
0 g 0 h 1 I
Adjacency, Connectivity
m-adjacency: Two pixels p and q with the values from set ‘V’
are m-adjacent if
(i) q is in ND(p) & the set N4(p) n N4(q) have no pixels
whose values are from ‘V’.
e.g. V = { 1 }
(iii) e & i
0 a 1 b 1 c
0 d 1 e 0 f
0 g 0 h 1 I
Soln: e & i are m-adjacent.
Adjacency, Connectivity
m-adjacency: Two pixels p and q with the values from set ‘V’
are m-adjacent if
(i) q is in N4(p) OR
(ii) q is in ND(p) & the set N4(p) n N4(q) have no pixels
whose values are from ‘V’.
e.g. V = { 1 }
(iv) e & c
0 a 1 b 1 c
0 d 1 e 0 f
0 g 0 h 1 I
Adjacency, Connectivity
m-adjacency: Two pixels p and q with the values from set ‘V’
are m-adjacent if
(i) q is in N4(p) OR
(ii) q is in ND(p) & the set N4(p) n N4(q) have no pixels
whose values are from ‘V’.
e.g. V = { 1 }
(iv) e & c
0 a 1 b 1 c
0 d 1 e 0 f
0 g 0 h 1 I
Soln: e & c are NOT m-adjacent.
Adjacency, Connectivity
Connectivity: 2 pixels are said to be connected if their exists a path
between them.
Let ‘S’ represent subset of pixels in an image.
Two pixels p & q are said to be connected in ‘S’ if their exists a path
between them consisting entirely of pixels in ‘S’.
For any pixel p in S, the set of pixels that are connected to it in S is
called a connected component of S.
Paths
Paths: A path from pixel p with coordinate ( x, y)
with pixel q with coordinate ( s, t) is a sequence of
distinct sequence with coordinates (x0, y0), (x1, y1),
….., (xn, yn) where
(x, y) = (x0, y0)
& (s, t) = (xn, yn)
Closed path: (x0, y0) = (xn, yn)
Paths
Example # 1: Consider the image segment shown in figure.
Compute length of the shortest-4, shortest-8 & shortest-m paths
between pixels p & q where,
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
Paths
Example # 1:
Shortest-4 path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
Paths
Example # 1:
Shortest-4 path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
Paths
Example # 1:
Shortest-4 path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
Paths
Example # 1:
Shortest-4 path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
Paths
Example # 1:
Shortest-4 path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
Paths
Example # 1:
Shortest-4 path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
So, Path does not exist.
Paths
Example # 1:
Shortest-8 path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
Paths
Example # 1:
Shortest-8 path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
Paths
Example # 1:
Shortest-8 path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
Paths
Example # 1:
Shortest-8 path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
Paths
Example # 1:
Shortest-8 path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
Paths
Example # 1:
Shortest-8 path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
So, shortest-8 path = 4
Paths
Example # 1:
Shortest-m path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
Paths
Example # 1:
Shortest-m path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
Paths
Example # 1:
Shortest-m path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
Paths
Example # 1:
Shortest-m path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
Paths
Example # 1:
Shortest-m path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
Paths
Example # 1:
Shortest-m path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
Paths
Example # 1:
Shortest-m path:
V = {1, 2}.
4 2 3 2 q
3 3 1 3
2 3 2 2
p 2 1 2 3
So, shortest-m path = 5
Regions & Boundaries
Region: Let R be a subset of pixels in an image. Two regions Ri
and Rj are said to be adjacent if their union form a connected set.
Regions that are not adjacent are said to be disjoint.
We consider 4- and 8- adjacency when referring to regions.
Below regions are adjacent only if 8-adjacency is used.
1 1 1
1 0 1 Ri
0 1 0
0 0 1
1 1 1 Rj
1 1 1
Regions & Boundaries
Boundaries (border or contour): The boundary of a region
R is the set of points that are adjacent to points in the
compliment of R.
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
RED colored 1 is NOT a member of border if 4-connectivity is
used between region and background. It is if 8-connectivity is
used.
Example:
pixelrelationships in image processing enhancement
pixelrelationships in image processing enhancement
pixelrelationships in image processing enhancement
pixelrelationships in image processing enhancement
pixelrelationships in image processing enhancement
pixelrelationships in image processing enhancement
(1=2)
pixelrelationships in image processing enhancement
(3=4)
pixelrelationships in image processing enhancement
pixelrelationships in image processing enhancement
(1=5)
pixelrelationships in image processing enhancement
pixelrelationships in image processing enhancement
Distance Measures
Distance Measures: Distance between pixels p, q & z with
co-ordinates ( x, y), ( s, t) & ( v, w) resp. is given by:
a) D( p, q) ≥ 0 [ D( p, q) = 0 if p = q] …………..called
reflexivity
b) D( p, q) = D( q, p) .………….called
symmetry
c) D( p, z) ≤ D( p, q) + D( q, z) ..………….called
transmitivity
Euclidean distance between p & q is defined as-
De( p, q) = [( x- s)2
+ (y - t)2
]1/2
Distance Measures
City Block Distance: The D4 distance between p & q is
defined as
D4( p, q) = |x - s| + |y - t|
In this case, pixels having D4 distance from ( x, y) less than or
equal to some value r form a diamond centered at ( x, y).
2
2 1 2
2 1 0 1 2
2 1 2
2
Pixels with D4 distance ≤ 2 forms the following contour of
constant distance.
Distance Measures
Chess-Board Distance: The D8 distance between p & q is
defined as
D8( p, q) = max( |x - s| , |y - t| )
In this case, pixels having D8 distance from ( x, y) less than or
equal to some value r form a square centered at ( x, y).
2 2 2 2 2
2 1 1 1 2
2 1 0 1 2
2 1 1 1 2
2 2 2 2 2
Pixels with D8 distance ≤ 2 forms the following contour of
constant distance.
Set operations
Logical operations
 The AND operator is usually used to mask out
part of an image.
 Parts of another image can be added with a
logical OR operator.
Result of AND Result of OR
OR
pixelrelationships in image processing enhancement

More Related Content

Similar to pixelrelationships in image processing enhancement (20)

PPT
Lecture4.ppt
SivaSankar306103
 
PDF
Ip unit 1
Dr. Radhey Shyam
 
PPT
digTop.ppt
mohammadhaqqi3
 
PPT
Digital image processing for relationship of pixels
Anupama Raina
 
PDF
Biomedical engineering 20230918-Fundamentals.pdf
LeiLavina
 
PPT
Image_Processing-ch2surface r_part_2.ppt
Praveen Kumar
 
PDF
Pixel Relationships Examples
Marwa Ahmeid
 
PPTX
Image Acquisition and Representation
Amnaakhaan
 
PDF
2. IP Fundamentals.pdf
DrNVaijayanthiDeanRD
 
PDF
Lecture 4 Relationship between pixels
VARUN KUMAR
 
DOCX
The Digital Image Processing Q@A
Chung Hua Universit
 
PDF
Digital image processing fundamental explanation
Tirusew1
 
PPTX
Digital Image Processing
PreethiPreethi28
 
PPT
Chapter 2 Image Processing: Pixel Relation
Varun Ojha
 
PPTX
Digital-Image-processing-fundamenntal.pptx
prostation0
 
PPT
03 digital image fundamentals DIP
babak danyal
 
PDF
bstract Point processing uses only the information in individual pixels to pr...
NALESVPMEngg
 
PPT
digital image processing chapter two, fundamentals
KNaveenKumarECE
 
PPTX
Basics of pixel neighbor.
raheel rajput
 
PDF
Manuscript document digitalization and recognition: a first approach
Servicio de Difusión de la Creación Intelectual (SEDICI)
 
Lecture4.ppt
SivaSankar306103
 
Ip unit 1
Dr. Radhey Shyam
 
digTop.ppt
mohammadhaqqi3
 
Digital image processing for relationship of pixels
Anupama Raina
 
Biomedical engineering 20230918-Fundamentals.pdf
LeiLavina
 
Image_Processing-ch2surface r_part_2.ppt
Praveen Kumar
 
Pixel Relationships Examples
Marwa Ahmeid
 
Image Acquisition and Representation
Amnaakhaan
 
2. IP Fundamentals.pdf
DrNVaijayanthiDeanRD
 
Lecture 4 Relationship between pixels
VARUN KUMAR
 
The Digital Image Processing Q@A
Chung Hua Universit
 
Digital image processing fundamental explanation
Tirusew1
 
Digital Image Processing
PreethiPreethi28
 
Chapter 2 Image Processing: Pixel Relation
Varun Ojha
 
Digital-Image-processing-fundamenntal.pptx
prostation0
 
03 digital image fundamentals DIP
babak danyal
 
bstract Point processing uses only the information in individual pixels to pr...
NALESVPMEngg
 
digital image processing chapter two, fundamentals
KNaveenKumarECE
 
Basics of pixel neighbor.
raheel rajput
 
Manuscript document digitalization and recognition: a first approach
Servicio de Difusión de la Creación Intelectual (SEDICI)
 

More from ssuser1ecccc (20)

PPTX
Biometrics and its applications in Medical
ssuser1ecccc
 
PDF
DIP-Introduction Lecture 13-10-14 image analysis
ssuser1ecccc
 
PDF
Chap_9_Representation_and_Description.pdf
ssuser1ecccc
 
PPTX
Biometrics and its applications for system Analysis
ssuser1ecccc
 
PPTX
Biometrics and its applications for system
ssuser1ecccc
 
PDF
Project formulation in image analysis in various methods
ssuser1ecccc
 
PPTX
2 R ladder architecture analysis for image
ssuser1ecccc
 
DOCX
Existing method used for analysis of images
ssuser1ecccc
 
DOCX
Histogram analysis of image using wavelet
ssuser1ecccc
 
DOCX
Structure_of_How_to_Write_a_Journal.docx
ssuser1ecccc
 
PPTX
Knowledge representation and reasoning in AI
ssuser1ecccc
 
PPTX
Artificial Intelligence and Machine Learning
ssuser1ecccc
 
PPTX
Intro class. U1 M1.pptx
ssuser1ecccc
 
PPT
NGP BME Final.ppt
ssuser1ecccc
 
PPTX
ES.pptx
ssuser1ecccc
 
PPTX
TASK Sixth Sensor Technology.pptx
ssuser1ecccc
 
PPTX
4.-personal-productive-equipment.pptx
ssuser1ecccc
 
PPTX
5.-accident-causation-theories-accident-reporting.pptx
ssuser1ecccc
 
PPTX
unit-3-osha-hcs-dot.pptx
ssuser1ecccc
 
PPTX
unit-iv-facility-safety.pptx
ssuser1ecccc
 
Biometrics and its applications in Medical
ssuser1ecccc
 
DIP-Introduction Lecture 13-10-14 image analysis
ssuser1ecccc
 
Chap_9_Representation_and_Description.pdf
ssuser1ecccc
 
Biometrics and its applications for system Analysis
ssuser1ecccc
 
Biometrics and its applications for system
ssuser1ecccc
 
Project formulation in image analysis in various methods
ssuser1ecccc
 
2 R ladder architecture analysis for image
ssuser1ecccc
 
Existing method used for analysis of images
ssuser1ecccc
 
Histogram analysis of image using wavelet
ssuser1ecccc
 
Structure_of_How_to_Write_a_Journal.docx
ssuser1ecccc
 
Knowledge representation and reasoning in AI
ssuser1ecccc
 
Artificial Intelligence and Machine Learning
ssuser1ecccc
 
Intro class. U1 M1.pptx
ssuser1ecccc
 
NGP BME Final.ppt
ssuser1ecccc
 
ES.pptx
ssuser1ecccc
 
TASK Sixth Sensor Technology.pptx
ssuser1ecccc
 
4.-personal-productive-equipment.pptx
ssuser1ecccc
 
5.-accident-causation-theories-accident-reporting.pptx
ssuser1ecccc
 
unit-3-osha-hcs-dot.pptx
ssuser1ecccc
 
unit-iv-facility-safety.pptx
ssuser1ecccc
 
Ad

Recently uploaded (20)

PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PDF
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
PPTX
Quarter1-English3-W4-Identifying Elements of the Story
FLORRACHELSANTOS
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PDF
1, 2, 3… E MAIS UM CICLO CHEGA AO FIM!.pdf
Colégio Santa Teresinha
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PDF
community health nursing question paper 2.pdf
Prince kumar
 
PPTX
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
PPTX
Views on Education of Indian Thinkers J.Krishnamurthy..pptx
ShrutiMahanta1
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PDF
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
PPTX
How to Manage Promotions in Odoo 18 Sales
Celine George
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
How to Manage Access Rights & User Types in Odoo 18
Celine George
 
PDF
CHILD RIGHTS AND PROTECTION QUESTION BANK
Dr Raja Mohammed T
 
PPTX
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PPTX
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
Quarter1-English3-W4-Identifying Elements of the Story
FLORRACHELSANTOS
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
1, 2, 3… E MAIS UM CICLO CHEGA AO FIM!.pdf
Colégio Santa Teresinha
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
community health nursing question paper 2.pdf
Prince kumar
 
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
Views on Education of Indian Thinkers J.Krishnamurthy..pptx
ShrutiMahanta1
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
How to Manage Promotions in Odoo 18 Sales
Celine George
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
How to Manage Access Rights & User Types in Odoo 18
Celine George
 
CHILD RIGHTS AND PROTECTION QUESTION BANK
Dr Raja Mohammed T
 
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
Dimensions of Societal Planning in Commonism
StefanMz
 
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
Ad

pixelrelationships in image processing enhancement

  • 4. Neighbors of a Pixel f(0,0) f(0,1) f(0,2) f(0,3) f(0,4) - - - - - f(1,0) f(1,1) f(1,2) f(1,3) f(1,4) - - - - - f(x,y) = f(2,0) f(2,1) f(2,2) f(2,3) f(2,4) - - - - - f(3,0) f(3,1) f(3,2) f(3,3) f(3,4) - - - - - I I I I I - - - - - I I I I I - - - - -
  • 5. Neighbors of a Pixel  A Pixel p at coordinates ( x, y) has 4 horizontal and vertical neighbors.  Their coordinates are given by: (x+1, y) (x-1, y) (x, y+1) & (x, y-1) f(2,1) f(0,1) f(1,2) f(1,0)  This set of pixels is called the 4-neighbors of p denoted by N4(p).  Each pixel is unit distance from ( x ,y). f(0,0) f(0,1) f(0,2) f(0,3) f(0,4) - - - - - f(1,0) f(1,1) f(1,2) f(1,3) f(1,4) - - - - - f(x,y) = f(2,0) f(2,1) f(2,2) f(2,3) f(2,4) - - - - - f(3,0) f(3,1) f(3,2) f(3,3) f(3,4) - - - - - I I I I I - - - - - I I I I I - - - - -
  • 6. Neighbors of a Pixel  A Pixel p at coordinates ( x, y) has 4 diagonal neighbors.  Their coordinates are given by: (x+1, y+1) (x+1, y-1) (x-1, y+1) & (x-1, y-1) f(2,2) f(2,0) f(0,2) f(0,0)  This set of pixels is called the diagonal-neighbors of p denoted by ND(p).  f(0,0) f(0,1) f(0,2) f(0,3) f(0,4) - - - - - f(1,0) f(1,1) f(1,2) f(1,3) f(1,4) - - - - - f(x,y) = f(2,0) f(2,1) f(2,2) f(2,3) f(2,4) - - - - - f(3,0) f(3,1) f(3,2) f(3,3) f(3,4) - - - - - I I I I I - - - - - I I I I I - - - - -
  • 7. Adjacency, Connectivity Adjacency: Two pixels are adjacent if they are neighbors and their intensity level ‘V’ satisfy some specific criteria of similarity. e.g. V = {1} V = { 0, 2} Binary image = { 0, 1} Gray scale image = { 0, 1, 2, ------, 255} In binary images, 2 pixels are adjacent if they are neighbors & have some intensity values either 0 or 1. In gray scale, image contains more gray level values in range 0 to 255.
  • 8. Adjacency, Connectivity 4-adjacency: Two pixels p and q with the values from set ‘V’ are 4-adjacent if q is in the set of N4(p). e.g. V = { 0, 1} 1 1 2 1 1 0 1 0 1 p in RED color q can be any value in GREEN color.
  • 9. Adjacency, Connectivity 8-adjacency: Two pixels p and q with the values from set ‘V’ are 8-adjacent if q is in the set of N8(p). e.g. V = { 1, 2} 0 1 1 0 2 0 0 0 1 p in RED color q can be any value in GREEN color
  • 10. Adjacency, Connectivity m-adjacency: Two pixels p and q with the values from set ‘V’ are m-adjacent if (i) q is in N4(p) OR (ii) q is in ND(p) & the set N4(p) n N4(q) have no pixels whose values are from ‘V’. e.g. V = { 1 } 0 a 1 b 1 c 0 d 1 e 0 f 0 g 0 h 1 i
  • 11. Adjacency, Connectivity m-adjacency: Two pixels p and q with the values from set ‘V’ are m-adjacent if (i) q is in N4(p) e.g. V = { 1 } (i) b & c 0 a 1 b 1 c 0 d 1 e 0 f 0 g 0 h 1 I
  • 12. Adjacency, Connectivity m-adjacency: Two pixels p and q with the values from set ‘V’ are m-adjacent if (i) q is in N4(p) e.g. V = { 1 } (i) b & c 0 a 1 b 1 c 0 d 1 e 0 f 0 g 0 h 1 I Soln: b & c are m-adjacent.
  • 13. Adjacency, Connectivity m-adjacency: Two pixels p and q with the values from set ‘V’ are m-adjacent if (i) q is in N4(p) e.g. V = { 1 } (ii) b & e 0 a 1 b 1 c 0 d 1 e 0 f 0 g 0 h 1 I
  • 14. Adjacency, Connectivity m-adjacency: Two pixels p and q with the values from set ‘V’ are m-adjacent if (i) q is in N4(p) e.g. V = { 1 } (ii) b & e 0 a 1 b 1 c 0 d 1 e 0 f 0 g 0 h 1 I Soln: b & e are m-adjacent.
  • 15. Adjacency, Connectivity m-adjacency: Two pixels p and q with the values from set ‘V’ are m-adjacent if (i) q is in N4(p) OR e.g. V = { 1 } (iii) e & i 0 a 1 b 1 c 0 d 1 e 0 f 0 g 0 h 1 i
  • 16. Adjacency, Connectivity m-adjacency: Two pixels p and q with the values from set ‘V’ are m-adjacent if (i) q is in ND(p) & the set N4(p) n N4(q) have no pixels whose values are from ‘V’. e.g. V = { 1 } (iii) e & i 0 a 1 b 1 c 0 d 1 e 0 f 0 g 0 h 1 I
  • 17. Adjacency, Connectivity m-adjacency: Two pixels p and q with the values from set ‘V’ are m-adjacent if (i) q is in ND(p) & the set N4(p) n N4(q) have no pixels whose values are from ‘V’. e.g. V = { 1 } (iii) e & i 0 a 1 b 1 c 0 d 1 e 0 f 0 g 0 h 1 I Soln: e & i are m-adjacent.
  • 18. Adjacency, Connectivity m-adjacency: Two pixels p and q with the values from set ‘V’ are m-adjacent if (i) q is in N4(p) OR (ii) q is in ND(p) & the set N4(p) n N4(q) have no pixels whose values are from ‘V’. e.g. V = { 1 } (iv) e & c 0 a 1 b 1 c 0 d 1 e 0 f 0 g 0 h 1 I
  • 19. Adjacency, Connectivity m-adjacency: Two pixels p and q with the values from set ‘V’ are m-adjacent if (i) q is in N4(p) OR (ii) q is in ND(p) & the set N4(p) n N4(q) have no pixels whose values are from ‘V’. e.g. V = { 1 } (iv) e & c 0 a 1 b 1 c 0 d 1 e 0 f 0 g 0 h 1 I Soln: e & c are NOT m-adjacent.
  • 20. Adjacency, Connectivity Connectivity: 2 pixels are said to be connected if their exists a path between them. Let ‘S’ represent subset of pixels in an image. Two pixels p & q are said to be connected in ‘S’ if their exists a path between them consisting entirely of pixels in ‘S’. For any pixel p in S, the set of pixels that are connected to it in S is called a connected component of S.
  • 21. Paths Paths: A path from pixel p with coordinate ( x, y) with pixel q with coordinate ( s, t) is a sequence of distinct sequence with coordinates (x0, y0), (x1, y1), ….., (xn, yn) where (x, y) = (x0, y0) & (s, t) = (xn, yn) Closed path: (x0, y0) = (xn, yn)
  • 22. Paths Example # 1: Consider the image segment shown in figure. Compute length of the shortest-4, shortest-8 & shortest-m paths between pixels p & q where, V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3
  • 23. Paths Example # 1: Shortest-4 path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3
  • 24. Paths Example # 1: Shortest-4 path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3
  • 25. Paths Example # 1: Shortest-4 path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3
  • 26. Paths Example # 1: Shortest-4 path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3
  • 27. Paths Example # 1: Shortest-4 path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3
  • 28. Paths Example # 1: Shortest-4 path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3 So, Path does not exist.
  • 29. Paths Example # 1: Shortest-8 path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3
  • 30. Paths Example # 1: Shortest-8 path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3
  • 31. Paths Example # 1: Shortest-8 path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3
  • 32. Paths Example # 1: Shortest-8 path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3
  • 33. Paths Example # 1: Shortest-8 path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3
  • 34. Paths Example # 1: Shortest-8 path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3 So, shortest-8 path = 4
  • 35. Paths Example # 1: Shortest-m path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3
  • 36. Paths Example # 1: Shortest-m path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3
  • 37. Paths Example # 1: Shortest-m path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3
  • 38. Paths Example # 1: Shortest-m path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3
  • 39. Paths Example # 1: Shortest-m path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3
  • 40. Paths Example # 1: Shortest-m path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3
  • 41. Paths Example # 1: Shortest-m path: V = {1, 2}. 4 2 3 2 q 3 3 1 3 2 3 2 2 p 2 1 2 3 So, shortest-m path = 5
  • 42. Regions & Boundaries Region: Let R be a subset of pixels in an image. Two regions Ri and Rj are said to be adjacent if their union form a connected set. Regions that are not adjacent are said to be disjoint. We consider 4- and 8- adjacency when referring to regions. Below regions are adjacent only if 8-adjacency is used. 1 1 1 1 0 1 Ri 0 1 0 0 0 1 1 1 1 Rj 1 1 1
  • 43. Regions & Boundaries Boundaries (border or contour): The boundary of a region R is the set of points that are adjacent to points in the compliment of R. 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 RED colored 1 is NOT a member of border if 4-connectivity is used between region and background. It is if 8-connectivity is used.
  • 51. (1=2)
  • 53. (3=4)
  • 56. (1=5)
  • 59. Distance Measures Distance Measures: Distance between pixels p, q & z with co-ordinates ( x, y), ( s, t) & ( v, w) resp. is given by: a) D( p, q) ≥ 0 [ D( p, q) = 0 if p = q] …………..called reflexivity b) D( p, q) = D( q, p) .………….called symmetry c) D( p, z) ≤ D( p, q) + D( q, z) ..………….called transmitivity Euclidean distance between p & q is defined as- De( p, q) = [( x- s)2 + (y - t)2 ]1/2
  • 60. Distance Measures City Block Distance: The D4 distance between p & q is defined as D4( p, q) = |x - s| + |y - t| In this case, pixels having D4 distance from ( x, y) less than or equal to some value r form a diamond centered at ( x, y). 2 2 1 2 2 1 0 1 2 2 1 2 2 Pixels with D4 distance ≤ 2 forms the following contour of constant distance.
  • 61. Distance Measures Chess-Board Distance: The D8 distance between p & q is defined as D8( p, q) = max( |x - s| , |y - t| ) In this case, pixels having D8 distance from ( x, y) less than or equal to some value r form a square centered at ( x, y). 2 2 2 2 2 2 1 1 1 2 2 1 0 1 2 2 1 1 1 2 2 2 2 2 2 Pixels with D8 distance ≤ 2 forms the following contour of constant distance.
  • 64.  The AND operator is usually used to mask out part of an image.
  • 65.  Parts of another image can be added with a logical OR operator.
  • 66. Result of AND Result of OR OR