Professional Documents
Culture Documents
02 - Pixel Connectivity PDF
02 - Pixel Connectivity PDF
Pixel Relationships
ND(p)
N8 ( p ) = N D ( p ) N 4 ( p )
m-Connectivity
0 1 1
0 1 0
0 0 1
0 1 1
0 1 0
0 0 1
0 1 1
0 1 0
0 0 1
4-connected
8-connected
m-connected
(i) q is in N4(p) or
(ii) q is in ND(p) and N4(p) N4(q) is empty.
copyright 2002H. R. Myler
4/28/2008
( x0 , y0 ) = ( x, y ) and ( xn , yn ) = ( s, t )
where
and pixels ( xi , yi ) and ( xi +1 , yi +1 ) are connected for 1 i n
In this case, n is the length of the path.
4/28/2008
Usually, 8connectivityy is
used when
talking about
boundary
4/28/2008
Component Labeling
Scan image, left to right and
examine all pixels that meet the
membership requirement (value
u
set, V).
)
If you seek 4-connected components:
4/28/2008
Clustering
Clustering is the process of counting and labeling
of objects within an image.
Clusters consist of pixel groupings that are
related to one another by a predetermined
measure. This measure can be defined as a
distance between clusters or a similarity measure
such as pixel value, or it may be a complex set of
identifiers
and
constraints
that
define
membership in a cluster. The cluster may
ultimately be mapped into a binary image as a
unique object.
copyright 2002H. R. Myler
10
4/28/2008
11
Algorithm
i,j,k
n
Image[][]
Num_of_Rows
Num_of_Cols
clustx[]
clusty[]
new_clust
edist
clust_size
Loop variables.
Cluster count variable.
2-D array containing binary image.
Rows in Image
Columns in Image
Temporary storage for x-coordinate
of last pixel in cluster [].
See clustx.
Flag for new cluster.
Euclidean distance.
Size of clusters to be found.
12
4/28/2008
13
14
4/28/2008
15
Distance Measures
For pixels p, q, and z,
with coordinates (x,y),
(x y) (s,t)
(s t) and (u,v),
(u v)
D is a distance function or metric if:
a) D(p,q) 0 (D(p,q) = 0 iff p = q),
b) D(p,q) = D(q,p) and
c) D(p,z) D(p,q) + D(q,z)
p
z
copyright 2002H. R. Myler
16
4/28/2008
euclidean
De (p,q) = [(x-s)2 + (yt)2]1/2
city-block
D4 (p,q) = | x-s| + |y-t|
checkerboard
D8 (p,q) = max(| x-s| , |yt|)
copyright 2002H. R. Myler
17
Arithmetic Operations
18
4/28/2008
Addition
19
Subtraction
- 25
=
20
10
4/28/2008
Not
21
11