Digital Image Processing_L8.ppt

download Digital Image Processing_L8.ppt

of 33

Transcript of Digital Image Processing_L8.ppt

  • 7/27/2019 Digital Image Processing_L8.ppt

    1/33

    Morphology

    Morphology deals with form and structure

    Mathematical morphology is a tool forextracting image components useful in:

    representation and description of region shape

    (e.g. boundaries)

    pre- or post-processing (filtering, thinning, etc.)

    Based on set theory

  • 7/27/2019 Digital Image Processing_L8.ppt

    2/33

    Morphology

    Sets represent objects in images

    Sets in binary images (x,y)

    Sets in gray scale images (x,y,g)

    Some morphological operations:

    Dilation & ErosionOpening & Closing

    Hit-or-Miss Transform

    Basic Algorithms

  • 7/27/2019 Digital Image Processing_L8.ppt

    3/33

    Basic Concepts of Set Theory

    A is a set in , a=(a1,a2) an element of A, aA If not, then aA

    : null (empty) set

    Typical set specification: C={w|w=-d, for d D}

    A subset of B: AB Union of A and B: C=AB

    Intersection of A and B: D=AB

    Disjoint sets: AB=

    Complement of A: Difference of A and B: A-B={w|w A, w B}=

    Reflection of B:

    Translation of A by z=(z1,z2):

    Z

    2

    Ac{w|w

    A

    B{w|wb,b

    (A)z{c|caz,a

  • 7/27/2019 Digital Image Processing_L8.ppt

    4/33

    Morphological Image Processing

  • 7/27/2019 Digital Image Processing_L8.ppt

    5/33

    Morphological Image Processing

  • 7/27/2019 Digital Image Processing_L8.ppt

    6/33

    Morphological Image Processing

  • 7/27/2019 Digital Image Processing_L8.ppt

    7/33

  • 7/27/2019 Digital Image Processing_L8.ppt

    8/33

    Dilation & Erosion

    Basic definitions:

    A,B: sets in Z2with components a=(a1

    ,a2

    )

    and b=(b1,b2)

    Translationof A by x=(x1,x2), denoted by (A)xis

    defined as:

    (A)x= {c| c=a+x, for aA}

  • 7/27/2019 Digital Image Processing_L8.ppt

    9/33

    Dilation & Erosion

    More definitions:

    Reflectionof B: = {x|x=-b, for bB}

    Complementof A: Ac= {x|xA}

    Differenceof A & B: A-B = {x|xA, x B} = ABc

    B

  • 7/27/2019 Digital Image Processing_L8.ppt

    10/33

    Dilation & Erosion

    Dilation:

    : empty set; A,B: sets in Z2

    Dilation of A by B:

    B{x|(B)xA

  • 7/27/2019 Digital Image Processing_L8.ppt

    11/33

    Dilation & Erosion

    Dilation:

    Obtaining the reflection of B about its origin and

    then shifting this reflection by x

    The dilation of A by B then is the set of all x

    displacements such that and A overlap by at

    least one nonzero element

    B

  • 7/27/2019 Digital Image Processing_L8.ppt

    12/33

    Dilation & Erosion

    Dilation:

    ])[(|{ ABxB x

    B is the structuring elementin dilation.

  • 7/27/2019 Digital Image Processing_L8.ppt

    13/33

    Morphological Image Processing

  • 7/27/2019 Digital Image Processing_L8.ppt

    14/33

    Morphological Image Processing

  • 7/27/2019 Digital Image Processing_L8.ppt

    15/33

    Dilation & Erosion

    Erosion:

    i.e. the erosion of A by B is the set of all points x

    such that B, translated by x, is contained in A.

    In general:ABA

    cc)(

    )(|{ BxBAx

  • 7/27/2019 Digital Image Processing_L8.ppt

    16/33

    Morphological Image Processing

  • 7/27/2019 Digital Image Processing_L8.ppt

    17/33

    Morphological Image Processing

  • 7/27/2019 Digital Image Processing_L8.ppt

    18/33

    Opening & Closing

    In essence, dilation expands an image anderosion shrinks it.

    Opening: generally smoothes the contour of an image,

    breaks isthmuses, eliminates protrusions.

    Closing: smoothes sections of contours, but it generally

    fuses breaks, holes, gaps, etc.

  • 7/27/2019 Digital Image Processing_L8.ppt

    19/33

    Opening & Closing

    Openingof A by structuring element B:

    BABA )(

    Closing:

    BABA )(

  • 7/27/2019 Digital Image Processing_L8.ppt

    20/33

    Morphological Image Processing

  • 7/27/2019 Digital Image Processing_L8.ppt

    21/33

    Morphological Image Processing

  • 7/27/2019 Digital Image Processing_L8.ppt

    22/33

    Morphological Image Processing

  • 7/27/2019 Digital Image Processing_L8.ppt

    23/33

    Morphological Image Processing

  • 7/27/2019 Digital Image Processing_L8.ppt

    24/33

    Hit-or-Miss Transform

    Morphological hit-or-miss transform is a

    basic tool for shape detection.

    Definitions:

    B (B1,B2)

    B1is the set of elements of B associated with an object

    B2is the set of elements of B associated with thecorresponding background.

  • 7/27/2019 Digital Image Processing_L8.ppt

    25/33

  • 7/27/2019 Digital Image Processing_L8.ppt

    26/33

    Hit-or-Miss Transform

    AB contains all the origin points at which,

    simultaneously:

    B1found a match (hit) in A and

    B2found a match in Ac.

    ()( 21 ABAB c

    or

    ()( 21 ABAB

  • 7/27/2019 Digital Image Processing_L8.ppt

    27/33

    Example Basic Morphological Algorithms

    Purpose:

    to extract image components that are useful in

    the representation and description of shape.

    Boundary Extraction:

    ()( AAA

  • 7/27/2019 Digital Image Processing_L8.ppt

    28/33

    Morphological Image Processing

  • 7/27/2019 Digital Image Processing_L8.ppt

    29/33

    Morphological Image Processing

  • 7/27/2019 Digital Image Processing_L8.ppt

    30/33

    Region Filling Examples

    k(X

    k1B)

  • 7/27/2019 Digital Image Processing_L8.ppt

    31/33

    Morphological Image ProcessingRegion Filling

  • 7/27/2019 Digital Image Processing_L8.ppt

    32/33

    Basic Morphological Algorithms

    Extraction of Connected Components:

    BXkk )( 1 k=1,2,3,

    Where X0=p

    when Xk=Xk-1the algorithm has converged.

  • 7/27/2019 Digital Image Processing_L8.ppt

    33/33

    Morphological Image Processing