Docsity

Morphological Image Processing-Digital Image Processing-Lecture 15 Slides Slides-Electrical and Computer Engineering, Slides of Digital Image Processing

Toggle sidebar
bg1
Dr. D. J. Jackson Lecture 15-1Electrical & Computer Engineering
Computer Vision &
Digital Image Processing
Morphological Image Processing II
Dr. D. J. Jackson Lecture 15-2Electrical & Computer Engineering
Opening and Closing
•Morphological opening generally
–Smoothes the contour of an object
–Breaks narrow isthmuses
–Eliminates thin protrusions
•Morphological closing generally
–Smoothes contour sections
–Fuses narrow breaks and long thins gulfs
–Eliminates small holes
–Fills gaps in a contour
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Morphological Image Processing-Digital Image Processing-Lecture 15 Slides Slides-Electrical and Computer Engineering and more Slides Digital Image Processing in PDF only on Docsity!

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 15-

Computer Vision &

Digital Image Processing

Morphological Image Processing II

Opening and Closing

  • Morphological opening generally
    • Smoothes the contour of an object
    • Breaks narrow isthmuses
    • Eliminates thin protrusions
  • Morphological closing generally
    • Smoothes contour sections
    • Fuses narrow breaks and long thins gulfs
    • Eliminates small holes
    • Fills gaps in a contour

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 15-

Opening and Closing

  • The opening of set A by structuring element B ,

denoted A B , is defined as

  • A B = ( A B ) ⊕ B
  • Thus, opening is defined as the erosion of A by B

followed by a dilation of the result by B

  • The closing of set A by structuring element B ,

denoted A • B , is defined as

  • A • B = ( A ⊕ B ) B
  • Thus, opening is defined as the dilation of A by B

followed by a erosion of the result by B

Opening: Geometric Interpretation

  • Suppose the structuring element, B , is viewed as a rolling ball
  • The boundary of A B is established by all points in B that reach the farthest into the boundary of A as B is rolled about the inside of this boundary
  • The opening of A by B is obtained by taking the union of all translates of B that fit into A - A B = ∪ {( B ) z | ( B ) z ⊆Α}

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 15-

Morphological Filtering

  • Morphological operators can be used to construct filters

similar in concept to spatial filters

  • If the filtering objective in question is to eliminate noise and

distort data of interest as little as possible, then a

morphological filter consisting of an opening followed by a

closing can be used

  • Recall from the definitions of opening and closing that the

more primitive operations of erosion and dilation are used

  • Opening Closing
  • A B = ( A B ) ⊕ B A • B = ( A ⊕ B ) B

erode dilate dilate erode

Morphological Filtering Example

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 15-

Hit-or-Miss Transform

  • The morphological hit-or-miss transform is a basic tool for shape detection
  • The basic intent is to find the location of a known shape within a set of shapes
  • Assume a set A consists of a set of shapes (subsets) C , D , and E
  • It is desired to find the location of one of the shapes, D
  • Let the origin of each shape be its center of gravity

Hit-or-Miss Transform

  • Let D be enclosed by a small window, W
  • The local background of D with respect to W

is defined as the set difference ( W-D )

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 15-

Boundary Extraction

  • The boundary of a set A , denoted β( A ), is obtained by first eroding A by B and then performing the set difference between A and its erosion - β( A ) = A – ( A B )
  • B , as always, is a suitable structuring element

Shaded elements are 1’s and white elements are 0’s

Boundary Extraction

  • Although a 3x3 structuring element is commonly

used, it is not unique

  • A 5x5 structuring element of 1’s would result in a

boundary between 2 and 3 pixels thick

  • When the origin of the structuring element, B , is on

the edges of the set, part of B may be outside the

image

  • The normal treatment of this condition is to assume that

values outside the borders of the image are 0

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 15-

Boundary Extraction

Region Filling

  • Assume A denotes a set containing a subset whose elements are 8- connected boundary points of a region.
  • Beginning with a point p inside the boundary, the object is to fill the entire region (with 1’s)
  • Adopt the convention that all nonboundary (background) points are labeled 0 and assign a value of 1 to p to begin
  • The following procedure fills the region with 1’s
    • Xk = ( Xk-1 ⊕ B ) ∩ Ac^ k = 1, 2, 3, …
  • Where X 0 = p and B is the symmetric structuring element:
  • The algorithm terminates at step k if Xk=Xk- 1
  • The set Xk ∪ A contains the filled set and its boundary
B =

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 15-

Extraction of Connected Components

  • Concepts of connectivity and connected

components are used

  • Let Y represent a connected component in a set A

and assume that a point p of Y is known

  • The following expression yields all the elements of

Y

  • Xk = ( Xk-1 ⊕ B ) ∩ A k = 1, 2, 3, …
  • Where X 0 = p and B is a suitable structuring element
  • If Xk=Xk- 1 , the algorithm has converged and Y = Xk

Extraction of Connected Components

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 15-

Extraction of Connected Components

  • This process is similar to region filling except that

we use A instead of Ac^ in the process

  • The difference arises because all of the elements

sought (the elements of the connected component)

are labeled 1

  • The intersection with A at each step eliminates

dilations that are centered on elements labeled 0

  • The shape of the structuring element assumes 8-

connectivity between pixels

Extraction of Connected Components

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 15-

Convex Hull

  • Now let Di^ =Xik , where there is convergence in the sense that

Xik = Xik- 1

  • The convex hull of A is
  • In other words, the procedure consists of iteratively applying

the hit-or-miss transform to A with B^1

  • When no further changes occur, we perform the union with A

and call the set D^1

  • Sets D^2 , D^3 and D^4 are generated in a similar manner
  • The union of the four sets is the convex hull of A

U

i

i

C A D

Convex Hull

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 15-

Convex Hull

  • One obvious shortcoming of the procedure is that the convex

hull can grow beyond the minimum dimensions required to

guarantee convexity

  • One approach to reduce this effect is to limit the growth of

the convex hull such that it does not extend beyond the

horizontal and vertical dimensions of the original set

Thinning

  • The thinning of a set A by a structuring element B , denoted

A ⊗ B , can be defined in terms of the hit-or-miss transform

  • A more useful expression for thinning A symmetrically is

based on a sequence of structuring elements:

  • { B }={ B^1 , B^2 , B^3 ,…, B n}

c A A B

A B A A B

( )

( )

= ∩ ∗

⊗ = − ∗

{ } (( (( ) ) ) ) 1 2 n A ⊗ B = K A ⊗ B ⊗ B K ⊗ B

Electrical & Computer Engineering Dr. D. J. Jackson Lecture 15-

Thickening

  • Thickening is the morphological dual of thinning and is

defined by the expression

– A · B = A ∪ ( A * B )
  • Where B is a structuring element suitable for thickening
  • As with thinning, thickening can be defined as a sequential

operation

  • The structuring elements for thickening have the same form

as those for thinning, but with all 1’s and 0’s interchanged

1 2 n

A ⋅ B = K A ⋅ B ⋅ B K⋅ B

Thickening

  • A separate algorithm for thickening is not absolutely

required

  • In practice, we can thin the background of the set in

question and complement the result

  • In other words, to thicken set A , we form C=Ac , thin

C , and then form Cc

  • Depending on the nature of A , this procedure may

result in some disconnected points

  • Therefore, thickening is commonly followed with a

post-processing step to remove disconnected points

Thickening