digital image processing - Çankaya Üniversitesi › uploads › files › file › digital...

35
Morphological Image Processing (2) Digital Image Processing

Upload: others

Post on 27-Jan-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

  • Morphological Image Processing (2)

    Digital Image Processing

  • Topics

    Morphological Operations

    Connected Component Extraction

    Convex Hull

    Thinning

    Thickening

    Skeleton

    Pruning

    Extension to gray level images

    Matlab Examples

  • Dilation and Erosion

    Dilation and Erosion are two basic operations in

    morphological processing.

    Dilation of a set A in Z2 by a set B in Z2 is denoted by A B

    and given by

  • Dilation

    The dilation of A by B is the set of all displacements such that

    A and overlap with at least one point

    B is called structuring element

  • Dilation

  • Erosion

    Erosion of a set A in Z2 by a set B in Z2 is denoted by

    and given by:

    Erosion of A by B is the set of all points z such that B

    translated by z is contained in A

  • Erosion

  • Opening

    Opening smoothes the outer contours, breaks narrow

    connections, and eliminates small protrusions.

    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

    is the Hit-or-Miss operator

    Assuming Convex Hull is 4

    1

    )(

    i

    iDAC

  • 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

    where B is a sequence of structuring elements like

    {B} = {B1, B2, B3, …, Bn} and the operation can be given as

  • Thinning

    Sample set of structuring elements

  • Thinning Example

  • Thickening

    Thickening is the morphological dual of thinning and defined

    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

    k is the last iterative step before A erodes to an empty set

  • Skeleton Example

  • Pruning Thinning and skeletonizing algorithms need a clean-up post-

    processing

    The following steps are used for pruning:

    Thinning

    Find the end points

    Dilate end points

    Find the union of X1 and X3

  • Pruning Example

    Original image and structuring elements

  • Pruning Example

    Result of thinning and end points detected

  • Pruning Example

    Dilation of end points and the pruned image

  • Extension to Gray Level

    Dilation is expressed in 1D as

    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?