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

Chapter 2 Pixel Relation

This chapter discusses pixel relationships and neighborhood concepts in digital images. It defines what a pixel is and different types of pixel neighborhoods, including 4-neighbor, 8-neighbor, and boundary pixels that have fewer neighbors. Pixel connectivity and connected components are described, along with algorithms for connected component labeling. Different distance measures for quantifying pixel relationships, such as Euclidean, city block, and chessboard distances, are presented. Arithmetic and logical operators that can be used for pixel-level operations on multiple images are also introduced.

Uploaded by

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

Chapter 2 Pixel Relation

This chapter discusses pixel relationships and neighborhood concepts in digital images. It defines what a pixel is and different types of pixel neighborhoods, including 4-neighbor, 8-neighbor, and boundary pixels that have fewer neighbors. Pixel connectivity and connected components are described, along with algorithms for connected component labeling. Different distance measures for quantifying pixel relationships, such as Euclidean, city block, and chessboard distances, are presented. Arithmetic and logical operators that can be used for pixel-level operations on multiple images are also introduced.

Uploaded by

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

Chapter 2

Pixel Relation
By: Prof. (Dr.) Paramartha Dutta
Visva Bharati University
Santiniketan, West Bengal, India
Pixel Relationship
 Pixel
 Pixel Neighbourhood and Type of Neighbourhood
 Pixel Connectivity
 Connected Component
 Different Distance Measure Techniques
 Arithmetic/Logical Operator
 Neighborhood Operation

Back to Course Content Page


Click Here
What is Pixel?
 After sampling we get no. of analog samples and
each sample have intensity value which can be
Quantized as final step of digitization
 Quantized to discrete label
 8bit for black and white image
 24bit for colour image
 A matrix element is called pixel.
 For 8 bit a pixel can have value between 0 to 256
Back to the chapter content
Click Here
Neighbourhood
 A pixel p at location (x,y) has 2 horizontal and 2
vertical neighbour. In total a pixel p has four
neighbour.
(x-1, y)
(x, y-1) P (x, y) (x, y+1)
(x+1, y)

 This set of four pixel is called 4 neighbour of p = N4(p)


 Each of this neighbour is at a unit distance from p
 If p is a boundary pixel then it will have less neighbours.
Neighbourhood Cont..
 Boundary Pixel
p Boundary pixel has
only two neighbour

 A pixel p has four diagonal neighbour ND(p)


(x-1,
(x-1, y-1)
y+1)
P (x, y)
(x+1, y- (x+1,
1) y+1)
 The point of N4(p) and ND(p) together are called 8 neighbourof p
N8(p) = ND(p) U ND(p)
Back to the chapter content
Click Here
Pixel Connectivity
 Pixel connectivity is very useful for establishing
object boundary and defining image component/
region etc.
If f(x,y) > Th (threshold)
Assign 1
(x,y) є object
else Assign 0
(x,y) є background

Here pixel connected to 1 belongs to one object


Pixel Connectivity Cont..
 Two pixel are said to be connected if they are
adjacent in same sense
 They are neighbour (N4 ND or N8 ) and
 Their intensity value (gray level) are similar
 Example: For a binary image B two points p and q will be
connected if q є N(p) are p є N(q) and B(p) = B(q)

P p Here p and q are


q q p q connected iff their
intensity value are
same
Define Connectivity in Gray Level
 Let v be the set of gray level used to define
connectivity for two points (p,q) є v
 Three type of connectivity are defined
 4 connectivity → p,q є v & p є N4(q)
 8 connectivity → p,q є v & p є N8(q)
 M connectivity (Mixed Connectivity) p,q є v are m
connected if
 q є N4(p) or

q є ND(p) and N4(p) ∩ ND(p) = ᶲ
Mixed Connectivity
 Mixed connectivity is modification of 8 connectivity
 Only inclusion of concept is eliminating the multiple path often
arises with 8 connectivity
 Example V = {1}
Multiple path

N4(p) ∩ ND(p) = ᶲ
0 1 1 0 1 1 0 1 1 so ND(p) is not
0 1 0 0 1 0 taken
0 1 0
0 0 0 0 0 1 0 0 1
4 connected 8 connected M connected
Back to the chapter content
Click Here
Connected Component
 Adjacency : Two pixel p & q are adjacent if they are connected
 4 adjacency

 8 adjacency

 M adjacency

 Depending on type of connectivity used two image subset si and


sj are adjacent If p є si and q є sj such that p and q are
adjacent

si
p sj
q
Connected Component
 Path : A path from p(x,y) to q(s,t) is a sequence of
distinct pixel
(x0,y0), (x1,y1), …… , (xn,yn)
Where (x0,y0) = (x,y) and (xn,yn) = (s, t)
(xi,yi) is adacent to (xi-1 ,yi-1) for 1 ≤ I ≤ n
here n is the length of path
Connected Component
 Let S I and p,q є S
 Then p is connected to q in S if there is a path
from p to q consisting entirely of pixels in S
 For any p є S, the set of pixel in S that are
connected to p is call a connected component of
S
r s Point p is connected to point
q and r but not connected
p
q with point k
k
Connected Component Labeling
 Ability to assign different label to the various
disjoint connected components of an image
 Connected component labeling is fundamental step
in automated image analysis

Two disjoint connected component connected component labeling


Algorithm (Group identification)
 Scan image from Left to Right and Top to Bottom
 Assume 4 connectivity
 P be a pixel at any step in the scanning process

r
t p

 Before p point r and t are scanned i.e before p its neighbours


are scanned
 The purpose of this algorithm is to assign identification no.
Algorithm Steps
 I(p) : pixel at position p
 L(p): label assigned to pixel location p
 If I(p) = 0, move to next scanning position
 If I(p) = 1, and I(r) = I(t) = 0
 Then assign a new label to position p

 If I(p) =1 and only one of two neighbour is 1


 Then assign its label to p

 If I(p) =1 and both r and t are 1


 Then

 If L(r) = L(t) then L(p) = L(r)


 If L(r) ≠ L(t) then assign one of the label to p
Algorithm Steps Cont..
 At the end of scan all pixel with value 1 are labeled
 Some label are equivalent
 Equivalent label make a pais
 During second pass process equivalent pairs to
form equivalent classes
 Assign different label to each class
 In the second pass through the image replace each
label by label assign to its equivalent class
Algorithm Demo
First Pass

1 2
1 2 3 3
1 1 1 1 4 4 4 4
1 1 4 4
5 1 4 4 4
5

2 3 1 Assign 1 Assign new


1 1 4 4 5 1 because its left label (say 2) as
neighbour is 1 I(r) = I(t) = 0
(1,2) , (4,3) and (5,1) are
equivalent pair
Algorithm Demo
Second Pass : In the second pass through the image replace each label by
label assign to its equivalent class

1 1
1 1 3 3
1 1 1 1 3 3 3 3
1 1 3 3
1 1 3 3 3
1

Here two separate region/ group are identified YELLOE (1) region and
RED (3) region
Back to the chapter content
Click Here
Distance Measure
 Take three pixel
 p ≈ (x,y) q ≈ (s,t) z ≈ (u,v)
 D is distance function if
 D(p,q) ≥ 0 ; D(p,q) = 0 iff p = q (p & q is same pixel)
 D(p,q) = D(q,p) (distance from p to q & q to p is
same)
 D(p, z) ≤ D(p,q) + D(q,z)
Distance Measure Technique
 Euclidean Distance
 City Block Distance (Manhattan Distance)
 Chess Board Distance
 Euclidean distance between two point p(x,y) & q(s,t) is defined as
D(p,q) = [|x-s|2 +|y-t|2]1/2

q(s,t)
p(x,y)
Distance Measure Technique
 City Block Distance
 D4 distance or City Block (Manhattan) distance is defined as
D4 (p,q) = |x-s| + |y-t|
 Point having city block distance from p less than or equal to r from
diamond center
3
3 2 3
3 2 1 2 3
3 2 1 p 1 2 3
3 2 1 2 3
3 2 3
3
Distance Measure Technique
 Chess Board Distance
 D8 distance or Chess Board Distance is defined as
D8 (p,q) = max( |x-s|, |y-t|)
 Point with D8 = 1are 8 neighbour of p

3 3 3 3 3 3 3
3 2 2 2 2 2 3
3 2 1 1 1 2 3
3 2 1 P 1 2 3
3 2 1 1 1 2 3
3 2 2 2 2 2 3
3 3 3 3 3 3 3
Back to the chapter content
Click Here
Arithmetic/Logical Operator
 If pixel p є I1 and q є I2 where I1 and I2 are two different images then
 Arithmetic Operators are
 p+q
 p–q
 p*q
 p%q
 Logical Operator
 p.q (Logical AND)
 p+q (Logical OR)
 p’ (NOT)
 Logical operators are only applied to binary image
Logical Operator

Image A NOT (A ) (A ) AND (B)

Image B (A ) XOR (B)


Back to the chapter content
Click Here
Neighbourhood Operation
 The value assigned to a pixel is a function of its
gray label and the gray label of its neighbours

Z1 Z2 Z3
Z4 Z5 Z6
Z7 Z8 Z9

 Averaging
Z = 1/9 (Z1+ Z2 + …….. + Z9 )
Neighbourhood Operation
 More general form
Z1 Z2 Z3 W1 W2 W3
Z4 Z5 Z6 W4 W5 W6
Z7 Z8 Z9 W7 W8 W9

Z = W1 Z1+ W2 Z2 + …….. + W9 Z9
= ∑ Wi Zi for i = 1 to 9
It is useful for
Noise filtering
Edge Detection
Various important operation can be implemented by
proper selection of coefficient Wi
Back to the chapter content
Click Here

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy