digital image processing lecture 15: morphological algorithms

23
Digital Image Processing Lecture 15: Morphological Algorithms Prof. Charlene Tsai

Upload: lawson

Post on 22-Jan-2016

85 views

Category:

Documents


2 download

DESCRIPTION

Digital Image Processing Lecture 15: Morphological Algorithms. Prof. Charlene Tsai. Before Lecture …. Solution to previous quiz: all erosions. Overview. Extracting image components that are useful in the representation and description of shape. We ’ ll consider: Boundary extraction - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Digital Image Processing Lecture 15:  Morphological Algorithms

Digital Image ProcessingLecture 15: Morphological Algorithms

Prof. Charlene Tsai

Page 2: Digital Image Processing Lecture 15:  Morphological Algorithms

2

Before Lecture …

Solution to previous quiz: all erosions

Page 3: Digital Image Processing Lecture 15:  Morphological Algorithms

3

Overview

Extracting image components that are useful in the representation and description of shape.

We’ll consider: Boundary extraction Region filling Extraction of connected components Skeletonization

Page 4: Digital Image Processing Lecture 15:  Morphological Algorithms

4

Boundary Extraction Denote the boundary of set A by Step1: eroding A by the structuring

element B Step2: taking the difference between A

and its erosion.

A

BAAA

Page 5: Digital Image Processing Lecture 15:  Morphological Algorithms

5

Another Illustration

Using B as the structuring element, so boundary is 1 pixel thick.

Page 6: Digital Image Processing Lecture 15:  Morphological Algorithms

6

Region Filling

A is a set containing a subset whose elements are 8-connected boundary points of a region.

Goal: fill the entire region with 1’s.

Page 7: Digital Image Processing Lecture 15:  Morphological Algorithms

7

Region Filling (con’d)

ckk ABXX 1

Terminate when Xk=Xk-1

Final

Page 8: Digital Image Processing Lecture 15:  Morphological Algorithms

8

Some Remarks The dilation process would fill the entire area if left

unchecked. limits the result to inside the region of interest. Conditional dilation Applicable to any finite number of such subsets,

assuming that a point inside each boundary is given.

cA

Page 9: Digital Image Processing Lecture 15:  Morphological Algorithms

9

Connected Components Extraction of connected components in a binary

image is central to many automated image analysis applications.

Let Y be a connected component in set A and p a point of Y.

ABXX kk 1

Page 10: Digital Image Processing Lecture 15:  Morphological Algorithms

10

Application of Connected Component

Page 11: Digital Image Processing Lecture 15:  Morphological Algorithms

11

Skeletonization

We have seen some algorithms for skeletonization when discussing topology.

Review: skeleton of a binary object is a collection of lines and curves that describe the size and shape of the object.

Different algorithms and many possible different skeletons of the same object.

Here we use a combination erosion and opening operations

Page 12: Digital Image Processing Lecture 15:  Morphological Algorithms

12

(con’d)

Formulation:

with

where

The big K is the last iterative step before A erodes to an empty set.

ASAS k

K

k 0

BBBAkBA ......

BkBAkBAASk

k time

Page 13: Digital Image Processing Lecture 15:  Morphological Algorithms

13

Skeletonization: Demo

Final skeleton

Page 14: Digital Image Processing Lecture 15:  Morphological Algorithms

14

Grayscale Morphology – Dilation (Advance)

General formulation:

where f is the grayscale image and b is the structuring element.

In other words, the value of dilation at (x,y) is the maximum of the sum of f and b in the interval spanned by b.

bDtstsbtysxfyxbf , |,,max,

Page 15: Digital Image Processing Lecture 15:  Morphological Algorithms

15

Example

10 20 20 20 30

20 30 30 40 50

20 30 30 50 60

20 40 50 50 60

30 50 60 60 70

1 2 3 4 5 (x)

1

2

3

4

5

(y)

1 2 3

4 5 6

7 8 9

-1 0 1

-1

0

1

fb

What is ? 3,4bf

Page 16: Digital Image Processing Lecture 15:  Morphological Algorithms

16

Effect of Dilation

Two effects: If all values of the structuring element are positive,

the output image tends to be brighter. Dark details either are reduced or eliminated,

depending on how their values and shapes relate to the structuring element.

Page 17: Digital Image Processing Lecture 15:  Morphological Algorithms

17

Grayscale Morphology - Erosion bDtstsbtysxfyxbf , |,,min,

10 20 20 20 30

20 30 30 40 50

20 30 30 50 60

20 40 50 50 60

30 50 60 60 70

1 2 3 4 5 (x)

1

2

3

4

5

(y)

1 2 3

4 5 6

7 8 9

-1 0 1

-1

0

1

fb

What is ? 3,4bf

Page 18: Digital Image Processing Lecture 15:  Morphological Algorithms

18

Demo

Page 19: Digital Image Processing Lecture 15:  Morphological Algorithms

19

Opening & Closing

bbfbf

bbfbf

Opening:

Closing:

Page 20: Digital Image Processing Lecture 15:  Morphological Algorithms

20

Demo

original

Page 21: Digital Image Processing Lecture 15:  Morphological Algorithms

21

Application: Granulometry

Definition: determining the size distribution of particles in an image Useful when objects are overlapping and

clustered. Detection of individual particles are hard.

Page 22: Digital Image Processing Lecture 15:  Morphological Algorithms

22

(con’d)

Opening operations with structuring elements of increasing size are performed on the original image.

Motivation: opening operations of a particular size have the most effect on regions containing particles of similar size.

Method: For every structuring element, compute the difference btw

the Im-1 and Im, where m is the index of the structuring element.

At the end, normalize the differences => a histogram of particle-size distribution

Page 23: Digital Image Processing Lecture 15:  Morphological Algorithms

23

Demo