You are on page 1of 38

DIGITAL IMAGE

PROCESSING
E
C
E
D
E
P
A
R CONNECTED
T
M COMPONENT LABELING
E
N
T
ALGORITHM

Processing of Images which are Digital in nature by


means of Digital Computer
Connected Component Labeling
E
C
E  Ability to assign different labels to various
D disjoint component of an image is called
E
P connected component labeling.
A
R
T
M  This labeling is a fundamental step in
E
N automated image analysis:
T a) Shape
b) Area
c) Boundary

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 2


Basic Scanning Method
E
C
 Scan the image from left to right and top to
E bottom.
D
E  Assume 4-adjacency.
P
A  Let p be a pixel at any step in the scanning
R
T process.
M
E  Before p the pixel r and t are scanned.
N
T
r
t p

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 3


Labeling Algorithm
E
C
E
 This algorithm makes two passes over the image:
D
E
P 1. The first pass to assign temporary labels and
A
R record equivalence classes.
T
M
E
N
2. The second pass to replace each temporary
T label by the smallest label of its equivalence
class.

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 4


Steps in First Pass
E Conditions to check:
C
E 1. Does the pixel to the left (West) have the same value as
D the current pixel?
E
P Yes – We are in the same region. Assign the same
A label to the current pixel
R
T No – Check next condition
M
E
2. Do both pixels to the North and West of the current pixel
N have the same value as the current pixel but not the same
T label?
Yes –Assign the current pixel the minimum of the
North and West labels, and record their
equivalence relationship
No – Check next condition
CENTURION INSTITUTE OF TECHNOLOGY, JATNI 5
Steps in First Pass..
E
C
E
3. Does the pixel to the left (West) have a different
D value and the one to the North the same value
E
P as the current pixel?
A
R
Yes – Assign the label of the North pixel to
T the current pixel
M
E No – Check next condition
N
T 4. Do the pixel's North and West neighbors have
different pixel values than current pixel?
Yes – Create a new label id and assign it to
the current pixel

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 6


Steps in Second Pass
E
C
E  In the First pass we record some equivalence
D relationships.
E
P  In Second Pass:
A
R 1. Process Equivalence pairs to form
T
M equivalent classes.
E
N 2. Re-label the element with the label
T
assigned to its equivalent classes.

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 7


E
C
E
D
E
P
A
R
T
M
E
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 8


E
C
E
D
E
P
1
A
R
T
M
E
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 9


E
C
E
D
E
P
1 2
A
R
T
M
E
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 10


E
C
E
D
E
P
1 2
A
R 1
T
M
E
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 11


E
C
E
D
E
P
1 2
A
R 1 2
T
M
E
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 12


E
C
E
D
E
P
1 2
A
R 1 2 3
T
M
E
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 13


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T
M
E
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 14


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T 1
M
E
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 15


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T 1 1
M
E
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 16


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T 1 1 1
M
E
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 17


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T 1 1 1 1 (1,2) equivalent
M relation
E
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 18


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T 1 1 1 1 4
M
E
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 19


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T 1 1 1 1 4 3 (3,4) equivalent
M relation
E
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 20


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T 1 1 1 1 4 3 3
M
E
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 21


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T 1 1 1 1 4 3 3 3
M
E
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 22


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T 1 1 1 1 4 3 3 3
M
E 1
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 23


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T 1 1 1 1 4 3 3 3
M
E 1 1
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 24


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T 1 1 1 1 4 3 3 3
M
E 1 1 3
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 25


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T 1 1 1 1 4 3 3 3
M
E 1 1 3 3
N
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 26


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T 1 1 1 1 4 3 3 3
M
E 1 1 3 3
N 5
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 27


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T 1 1 1 1 4 3 3 3
M
E 1 1 3 3
N 5 1 (1,5) equivalent
T relation

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 28


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T 1 1 1 1 4 3 3 3
M
E 1 1 3 3
N 5 1 3
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 29


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T 1 1 1 1 4 3 3 3
M
E 1 1 3 3
N 5 1 3 3
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 30


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T 1 1 1 1 4 3 3 3
M
E 1 1 3 3
N 5 1 3 3 3
T

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 31


E
C
E
D
E
P
1 2
A
R 1 2 3 3
T 1 1 1 1 4 3 3 3
M
E 1 1 3 3
N 5 1 3 3 3
T
5

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 32


E
C
E
D
E
P 1<= 1,2,5
1 1
A
R 1 2 3 3
T 1 1 1 1 4 3 3 3
M
E 1 1 3 3
N 5 1 3 3 3
T
5

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 33


E
C
E
D
E
P
1 1
A
1 1 3 3 1<= 1,2,5
R
T 1 1 1 1 4 3 3 3
M
E 1 1 3 3
N 5 1 3 3 3
T
5

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 34


E
C
E
D
E
P
1 1
A
R 1 1 3 3
T 1 1 1 1 3 3 3 3 3<= 3,4
M
E 1 1 3 3
N 5 1 3 3 3
T
5

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 35


E
C
E
D
E
P
1 1
A
R 1 1 3 3
T 1 1 1 1 3 3 3 3
M
E 1 1 3 3
N 1 1 3 3 3 1<= 1,2,5
T
5

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 36


E
C
E
D
E
P
1 1
A
R 1 1 3 3
T 1 1 1 1 3 3 3 3
M
E 1 1 3 3
N 1 1 3 3 3
T
1 1<= 1,2,5

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 37


E
C
E
D
E
P
1 1
A
R 1 1 3 3
T 1 1 1 1 3 3 3 3
M
E 1 1 3 3
N 1 1 3 3 3
T
1

Here we observed that the image contain two distinct class of regions

CENTURION INSTITUTE OF TECHNOLOGY, JATNI 38

You might also like