0% found this document useful (0 votes)
63 views32 pages

Img Mod1 Session5 PDF

The document discusses pixel connectivity and relationships in digital images. It defines 4-connectivity and 8-connectivity as ways that pixels can be connected to their neighbors. Adjacency refers to two pixels being connected based on these definitions. Connected components are subsets of pixels within an image that are all connected to each other by paths solely through pixels in the subset. Identifying connected components allows segmentation of an image into meaningful regions.

Uploaded by

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

Img Mod1 Session5 PDF

The document discusses pixel connectivity and relationships in digital images. It defines 4-connectivity and 8-connectivity as ways that pixels can be connected to their neighbors. Adjacency refers to two pixels being connected based on these definitions. Connected components are subsets of pixels within an image that are all connected to each other by paths solely through pixels in the subset. Identifying connected components allows segmentation of an image into meaningful regions.

Uploaded by

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

CSE4019 Image Processing

Module1
Dr.G.Malathi
Associate Professor Senior,
Imaging and Computer Vision Research Group Chair
School of Computing Science and Engineering
Vellore Institute of Technology, Chennai

1
Syllabus
Module1: Introduction, Digital Image, its
Representations 6 hours
Image Representation and image processing
Paradigm – Elements of digital image processing
– image model – Sampling and quantization –
relationships between pixels – connectivity,
distance measures between pixels – color
image(overview, various color models) – various
image formats –bmp, jpeg, tiff,pnd, gif, etc

2
3
Pixel Connectivity
• 4 connectivity

4
Pixel Connectivity
• 4 connectivity

5
Pixel Connectivity
• 8 connectivity

NW N NE
W C E
SW S SE

6
Pixel Relationship

7
Pixel Relationship
After digitization of pixels, the image can be represented
as a matrix.
Each point in a matrix is called as pixel.

Important relationship exist between those pixels:

1. Neighborhood
2. Connectivity
3. Adjacency
4. Distance Measures

8
Previous Col Current Col Next Col
Y-1 Y Y+1

Previous Row
(X-1, Y) X-1

(X, Y-1) P(X,Y) (X, Y+1) Current Row


X

Next Row
(X+1, Y) X+1

A pixel P at location (X,Y) has two horizontal and two vertical


neighbours
This set of four pixels is called 4-neighbors of P = N4(P)
9
Each of these neighbor is at a unit distance from P.
If P is a boundary pixel, then it will have less no. of
neighborhood pixels.

P X

10
We can find four other points in the diagonal direction
Previous Col Current Col Next Col
Y-1 Y Y+1
(x-1,y+1) Previous Row
(x-1,y-1)
X-1

P(X,Y) Current Row


X

(X+1,Y+1) Next Row


(X+1,Y-1))
X+1

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 N4(P) will have less
11
Number of pixels
N8(P) = N4(P) U ND(P)
Previous Col Current Col Next Col
Y-1 Y Y+1
(x-1,y+1) Previous Row
(x-1,y-1) (X-1, Y) X-1

(X, Y-1) P(X,Y) (X, Y+1) Current Row


X

(X+1,Y+1) Next Row


(X+1,Y-1)) (X+1, Y) X+1

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 N4(P) will have less
12
Number of pixels
Connectivity of points in an image is used to find
the region properties of an image or the
properties of particular region within
an image

It is used for the


Establishment of object boundaries
Defining image components/regions etc.

11111
11111

13
If F(x,y) > Threshold
(x,y) ϵ Object
Else
(x,y) ϵ Background

11111 11111
11111 11111
000000000000
0 00000000000

14
WHAT IS CONNECTIVITY
Two pixels are said to be connected if they are adjacent
in some sense
They are neighbors N4(P) , N8(P) and ND(P)
Their intensity values (gray levels) are similar

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

q q
P P P q

15
CONNECTIVITY
Let V be the set of gray levels used to define connectivity for two
points (P)(q) ϵV,
Three types 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


(i) Q ϵ N4(P) or
(ii) Q ϵ ND(P) and N4(P) ∩ N4(q) = φ

N4(P) ∩ N4(q) -> set of pixels that are 4-neighbors of both P and q
and whose Values are from V.
16
Connectivity

Mixed connectivity is a modification of 8-connectivity

-Eliminates multiple path connections that often arise with


8-connectivity

Ex: V= { 1 }

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

4 - connected 8 - connected m - connected


17
ADJACENCY
Two pixels p and q are adjacent if they are connected
4-adjacency
8- adjacency
m- adjacency

Depending on type of connectivity used.


Two pixels are connected if they are neighbors and
their gray levels satisfy some specified criterion
of similarity.

For example, in a binary image two pixels are connected


if they are 4-neighbors and have same value (0/1).
18
Adjacency / Connectivity
Two image subsets Si and Sj are adjacent if P ϵ Si and
q ϵ Sj such that P and q are adjacent
Two image subsets S1 and S2 are adjacent if some
pixel in S1 is adjacent to some pixel in S2
Si
Sj

P
q

Si and Sj Must appear one after the other i.e adjacent


19
Path
A path between two points P and Q
A path exists from a point P(x,y) having coordinate x,y to a point q(s,t)
having Coordinate s,t if there exist a sequence of distinct pixels.

Where

(xo,yo) = (x,y), (xn,yn) = (s,t) where


(xi,yi) is adjacent to (xi-1, yi-1)

For 1 ≤ I ≤ n
N= length of the path

All the points traversed between p and q we say that they are
adjacent. 20
Connected Component

Let
S ⊆ I and p,q ϵ S
where S is a subset of Image I, and two points p,q which
also belongs to the subset 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 pixels in S that are connected to p is called a


Connected Component of S

21
A This is the entire image A.
Within this image I take a subimage say S.
Q
We have a point P

Take any other point Q within the S


If there exist a path from p to q consisting
P
Of all other intermediate points which
S Must also belong to say image subset S
There exist a path between P and Q
consisting of intermediate point in S we
say P and Q are connected

If there a number of such points to which a path exists from the point P in S, then the set
Of all these points are said to be connected to P and they form connected component of S
What can I do with this connected component?
I can identify a region in an image

22
Region
A subset R of pixels in an image is
called a Region of the image if R is a
connected set.

23
Boundary
The boundary of the region R is the
set of pixels in the region that have
neighbors that are not
in R.

24
Connected Component Labelling

Ability to assign different labels to various disjoint connected


components of an Image.

25
Connected Component Labelling

Connected Component labelling is a


fundamental step in a automated image
analysis
• Shape of that particular region.
• Area of the particular region
• Boundary of the particular region
• Shape / Area / Boundary based
features…

26
How to find the group identification for the particular region

Scan the 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 point p is scanned r,t are scanned

27
Steps
l(p) = Pixel value at position p
L(p) = Label assigned to pixel location p.
If l(p)=0, move to next scanning position
If l(p)=1 and l(l)=l(t)=0 then
Assign a new label to position p
If l(p) = 1 and only one of the two neighbor is 1 then
Assign its label to p
If l(p) = 1 and both r and t are 1’s then
If L(r) = L(t) then L(p) = L(r)
If L(r) ≠ L(t) then assign one of the labels to p and make a note
that the two labels are equivalent

At the end of the scan all pixels with value 1 are labelled

Some labels are equivalent.


28
Steps
During the second pass process equivalent pairs to form
equivalent classes.

Assign a different label to each class.


In the second pass through the image replace each label by the
label assigned to its equivalence class

Region belongings of a particular pixel.

29
(1,2) , (3,4) , (1,5)

30
Equivalent Class: (1,2) , (3,4) , (1,5)

Replacing (1,2) , (1,5) by level 1


(3,4) by level 3
31
Relationship between pixels
• Distance Measures
• Arithmetic and Logical Operations on image
• Neighborhood Operations on Images

32

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