Digital Image Processing-6
Digital Image Processing-6
Opening is defined as :
Closing
Closing smoothes the object contour, fuses narrow
connections, eliminates small holes and gaps.
Extraction of Connected Components
Begin with a point P inside the connected component,
iterate:
Until Xk = Xk-1
Initially X0 = P
Connected Component Extraction
Convex Hull
A set is said convex if the straight line connecting any two
points of the set lies entirely within A.
Convex Hull of set S is the smallest convex set A that
contains S
The set difference A-S is called the convex deficiency of S
Computing Convex Hull
Let Bi for i=1,2,3,4 represent the structuring elements
shown below
Convex Hull
Repeat the following equation until converge
with
4
Assuming Convex Hull is C ( A) D i
i 1
Example (Convex Hull)
Improving Convex Hull Algorithm
The algorithm can be improved by limiting the growth of the
algorithm beyond the maximum dimensions of the original
set.
Thinning and Thickening
Thinning is an image-processing operation in which binary
valued image regions are reduced to lines
The purpose of thinning is to reduce the image components
to their essential information for further analysis and
recognition
Thickening is changing a pixel from 1 to 0 if any neighbors of
the pixel are 1.
Thickening followed by thinning can be used for filling
undesirable holes.
Thinning followed by thickening is used for determining
isolated components and clusters.
Thinning
Thinning is defined in terms of hit or miss as
or
Thickening Example
Skeleton
The informal definition of a skeleton is a line representation
of an object that is:
one-pixel thick,
through the "middle" of the object, and,
preserves the topology of the object.
Skeleton
Skeleton is defined by
where
Thinning
Find the end points
Erosion is given by
Extension to Gray Level (2D Case)
Dilation
Erosion
Morphological Operations in MATLAB
To create structuring element use strel(.)
SE = strel(shape, parameters)
Examples:
SE = strel('arbitrary', NHOOD)
SE = strel('diamond', R)
SE = strel('disk', R, N)
SE = strel('line', LEN, DEG)
SE = strel('octagon', R)
SE = strel('pair', OFFSET)
SE = strel('periodicline', P, V)
SE = strel('rectangle', MN)
SE = strel('square', W)
Morphological Operations in MATLAB
SE=strel(NHOOD) is also a valid call for the function
Use imerode(Im,SE) and imdialte(Im,SE) for erosion and
dilation respectively
Use imopen(Im,SE) and imcolose(Im,SE) for openning and
closing
For hit-or-miss use bwhitmiss(.)
BW2 = bwhitmiss(BW1,SE1,SE2)
BW2 = bwhitmiss(BW1,INTERVAL)
Hit or Miss Example
Questions?