+ All Categories
Home > Documents > Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D...

Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D...

Date post: 22-Jan-2021
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
66
DTU Compute Image Analysis Plenty of slides adapted from Thomas Moeslunds lectures Rasmus R. Paulsen Tim B. Dyrby DTU Compute [email protected] http://www.compute.dtu.dk/courses/02502
Transcript
Page 1: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

Image Analysis

Plenty of slides adapted from Thomas Moeslunds lectures

Rasmus R. Paulsen

Tim B. Dyrby

DTU Compute

[email protected]

http://www.compute.dtu.dk/courses/02502

Page 2: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis2 DTU Compute, Technical University of Denmark

Lecture 4b – Morphology

0 0 1 1 1 0 0

0 1 1 1 1 1 0

1 1 1 1 1 1 1

1 1 1 1 1 1 1

1 1 1 1 1 1 1

0 1 1 1 1 1 0

0 0 1 1 1 0 0

Page 3: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis3 DTU Compute, Technical University of Denmark

What can you do after today?

Describe the similarity between filtering and morphology

Describe a structuring element

Compute the dilation of a binary image

Compute the erosion of a binary image

Compute the opening of a binary image

Compute the closing of a binary image

Apply compound morphological operations to binary images

Describe typical examples where morphology is suitable

Remove unwanted elements from binary images using morphology

Choose appropriate structuring elements and morphological operations based on image content

Page 4: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis4 DTU Compute, Technical University of Denmark

Morphology

The science of form, shape and structure

In biology: The form and structure of animals and plants

Common leaf morphologies

Page 5: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis5 DTU Compute, Technical University of Denmark

Mathematical morphology

Developed in 1964

Theoretical work done in Paris

Used for classification of minerals in cut stone

Initially used for binary images

Do not worry! We use a much less theoretical approach!

Page 6: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis6 DTU Compute, Technical University of Denmark

Relevance?

Point wise operations

Filtering

Thresholding

– Gives us objects that are separated by the background

Morphology

– Manipulate and enhance binary objects

Page 7: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis7 DTU Compute, Technical University of Denmark

What can it be used for?

Remove noise

– Small objects

– Fill holes

Isolate objects

Customized to specific shapes

Page 8: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis8 DTU Compute, Technical University of Denmark

How does it work?

Grayscale image

Preprocessing

– Inversion

Threshold => Binary image

Morphology

Page 9: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis9 DTU Compute, Technical University of Denmark

Filtering and morphology

Filtering

– Gray level images

– Kernel

– Moves it over the input image

– Creates a new output image

0 2 4

1 2 2

1 6 3

1 2 1

2 5 3

2 1 3

1 3 1

2 2 2

0 1 3

1 2 0

2 1 4

1 0 1

Page 10: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis10 DTU Compute, Technical University of Denmark

Filtering and morphology

Filtering

– Gray level images

– Kernel

– Moves it over the input image

– Creates a new output image

Morphology

– Binary images

– Structuring element (SE)

– Moves the SE over the input image

– Creates a new binary output image

Disk

Box

1

1 11

1

1

1 11

1

1

1

1

1

0

0 0

0

Page 11: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis11 DTU Compute, Technical University of Denmark

1D Morphology

1 0 0 0 1 1 1 0 1 1Input image

Structuring Element

(SE)

?Output Image

111

Page 12: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis12 DTU Compute, Technical University of Denmark

1D Morphology : The hit operation

1 0 0 0 1 1 1 0 1 1Input image

Structuring Element

(SE)

?Output Image

111

• If just one 1 in the SE match with the input

• output 1

• else

• output 0

1

Page 13: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis13 DTU Compute, Technical University of Denmark

1D Morphology : The fit operation

1 0 0 0 1 1 1 0 1 1Input image

Structuring Element

(SE)

?Output Image

111

• If all 1 in the SE match with the input

• output 1

• else

• output 0

0

Page 14: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis14 DTU Compute, Technical University of Denmark

1D Morphology : Dilation

Dilate : To make wider or larger

– Dansk : udvide

Based on the hit operation

Page 15: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis15 DTU Compute, Technical University of Denmark

1D Dilation example

1 0 0 0 1 1 1 0 1 1Input image

Structuring Element

1Output Image

111

• If just one 1 in the SE match with the input

• output 1

• else

• output 0

Hit

to make bigger

𝑔 𝑥 = 𝑓(𝑥)⨁𝑆𝐸

Page 16: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis16 DTU Compute, Technical University of Denmark

Example for Dilation

1 0 0 0 1 1 1 0 1 1Input image

Structuring Element

1 0Output Image

111

Page 17: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis17 DTU Compute, Technical University of Denmark

Example for Dilation

1 0 0 0 1 1 1 0 1 1Input image

Structuring Element

1 0 1Output Image

111

Page 18: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis18 DTU Compute, Technical University of Denmark

Example for Dilation

1 0 0 0 1 1 1 0 1 1Input image

Structuring Element

1 0 1 1Output Image

111

Page 19: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis19 DTU Compute, Technical University of Denmark

Example for Dilation

1 0 0 0 1 1 1 0 1 1Input image

Structuring Element

1 0 1 1 1Output Image

111

Page 20: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis20 DTU Compute, Technical University of Denmark

Example for Dilation

1 0 0 0 1 1 1 0 1 1Input image

Structuring Element

1 0 1 1 1 1Output Image

111

Page 21: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis21 DTU Compute, Technical University of Denmark

Example for Dilation

1 0 0 0 1 1 1 0 1 1Input image

Structuring Element

1 0 1 1 1 1 1Output Image

111

Page 22: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis22 DTU Compute, Technical University of Denmark

Example for Dilation

1 0 0 0 1 1 1 0 1 1Input image

Structuring Element

1 0 1 1 1 1 1 1Output Image

111

The object gets bigger and holes are filled!

Page 23: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis23 DTU Compute, Technical University of Denmark

1D Morphology : Erosion

Erode : To wear down (Waves eroded the shore)

– Dansk : tære, gnave

Based on the fit operation

Page 24: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis24 DTU Compute, Technical University of Denmark

Example for Erosion

1 0 0 0 1 1 1 0 1 1Input image

Structuring Element

0Output Image

111

12 2 SESE _ _ _

• If all 1 in the SE match with the input

• output 1

• else

• output 0

Fit

to make smaller

𝑔 𝑥 = 𝑓(𝑥)⊖ 𝑆𝐸

Page 25: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis25 DTU Compute, Technical University of Denmark

Page 26: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis26 DTU Compute, Technical University of Denmark

Page 27: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis27 DTU Compute, Technical University of Denmark

Page 28: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis28 DTU Compute, Technical University of Denmark

Example for Erosion

1 0 0 0 1 1 1 0 1 1Input image

Structuring Element

0 0 0 0 1 0 0 0Output Image

111

The object gets smaller

Page 29: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis29 DTU Compute, Technical University of Denmark

Structuring Element (Kernel)

1 1 1

1 1 1 1 1

1 1 1 1 1 1 1

1 1 1 1 1 1 1

1 1 1 1 1 1 1

1 1 1 1 1

1 1 1

Structuring Elements can have varying sizes

Usually, element values are 0 or 1, but other values are possible (including none!)

Structural Elements have an origin

Empty spots in the Structuring Elements are don’t cares!

Disk Box

0 1 0

1 1 1

0 1 0

1 1 1

1 1 1

1 1 1

Page 30: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis30 DTU Compute, Technical University of Denmark

Structuring Element Origin

The origin is not always the center of the SE

0 1 0

1 1 1

0 1 0

1 1 1

1 1 1

1 1 1

Page 31: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis31 DTU Compute, Technical University of Denmark

Special structuring elements

0 0 0 0 0 1 1

0 0 1 1 1 0 0

1 1 0 0 0 0 0

Structuring elements can be customized to a specific problem

LineDiamond

0 0 0 1 0 0 0

0 0 1 1 1 0 0

0 1 1 1 1 1 0

1 1 1 1 1 1 1

0 1 1 1 1 1 0

0 0 1 1 1 0 0

0 0 0 1 0 0 0

Page 32: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis32 DTU Compute, Technical University of Denmark

Dilation on images - diskHoles are closed

SE

Object is bigger𝑔 𝑥, 𝑦 = 𝑓(𝑥, 𝑦)⨁𝑆𝐸

Page 33: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis33 DTU Compute, Technical University of Denmark

Page 34: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis34 DTU Compute, Technical University of Denmark

Page 35: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis35 DTU Compute, Technical University of Denmark

Page 36: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis36 DTU Compute, Technical University of Denmark

Dilation – the effect of the SE

Page 37: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis37 DTU Compute, Technical University of Denmark

Dilation Example

0 0 1 1 1 0 0

0 1 1 1 1 1 0

1 1 1 1 1 1 1

1 1 1 1 1 1 1

1 1 1 1 1 1 1

0 1 1 1 1 1 0

0 0 1 1 1 0 0

• Round structuring element (disk)

• Creates round corners

Page 38: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis38 DTU Compute, Technical University of Denmark

Page 39: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis39 DTU Compute, Technical University of Denmark

Page 40: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis40 DTU Compute, Technical University of Denmark

Page 41: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis41 DTU Compute, Technical University of Denmark

Erosion on images - disk

SE

Object is smaller𝑔 𝑥, 𝑦 = 𝑓(𝑥, 𝑦) ⊖ 𝑆𝐸

Page 42: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis42 DTU Compute, Technical University of Denmark

Page 43: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis43 DTU Compute, Technical University of Denmark

Page 44: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis44 DTU Compute, Technical University of Denmark

Page 45: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis45 DTU Compute, Technical University of Denmark

Erosion on images – box (square)

SE

1

2

3

4

1

2

3

4

𝑔 𝑥, 𝑦 = 𝑓(𝑥, 𝑦) ⊖ 𝑆𝐸

Page 46: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis46 DTU Compute, Technical University of Denmark

Erosion example

Page 47: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis47 DTU Compute, Technical University of Denmark

Counting Coins

Counting these coins is difficult because they touch each other!

Solution: Threshold and Erosion separates them!

More on counting next time!

Page 48: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis48 DTU Compute, Technical University of Denmark

Compound operations

Compound

– made of two or more separate parts or elements

Combining Erosion and Dilation into more advanced operations

– Finding the outline

– Opening

Isolate objects and remove small objects (better than Erosion)

– Closing

Fill holes (better than Dilation)

Page 49: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis49 DTU Compute, Technical University of Denmark

Finding the outline

1. Dilate input image (object gets bigger)

2. Subtract input image from dilated image

3. The outline remains!

𝑔 𝑥, 𝑦 = 𝑓 𝑥, 𝑦 ⨁𝑆𝐸 − 𝑓(𝑥, 𝑦)

Page 50: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis50 DTU Compute, Technical University of Denmark

Opening

Motivation: Remove small objects BUT keep original size (and shape)

Opening = Erosion + Dilation

– Use the same structuring element!

– Similar to erosion but less destructive

Math:

Opening is idempotent: Repeated operations has no further effects!

_𝑔 𝑥, 𝑦 = 𝑓 𝑥, 𝑦 ∘ 𝑆𝐸 = (𝑓(𝑥, 𝑦) ⊖ 𝑆𝐸)⊕ 𝑆𝐸

𝑓 𝑥, 𝑦 ∘ 𝑆𝐸 = (𝑓 𝑥, 𝑦 ∘ 𝑆𝐸) ∘ 𝑆𝐸

Page 51: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis51 DTU Compute, Technical University of Denmark

Opening

Original Eroded Dilated

SEOpening = erosion+dilation

𝑔 𝑥, 𝑦 = (𝑓(𝑥, 𝑦) ⊖ 𝑆𝐸)⊕ 𝑆𝐸

Page 52: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis52 DTU Compute, Technical University of Denmark

Opening Example

9x3 and 3x9 Structuring Elements

Page 53: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis53 DTU Compute, Technical University of Denmark

Opening example

Size of structuring element should fit into the smallest object to keep

Structuring Element: 11 pixel disc

Page 54: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis54 DTU Compute, Technical University of Denmark

Page 55: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis55 DTU Compute, Technical University of Denmark

Page 56: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis56 DTU Compute, Technical University of Denmark

Page 57: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis57 DTU Compute, Technical University of Denmark

Closing

Motivation: Fill holes BUT keep original size (and shape)

Closing = Dilation + Erosion

– Use the same structuring element!

– Similar to Dilation but less destructive

Math:

Closing is idempotent: Repeated operations has no further effects!

_𝑔 𝑥, 𝑦 = 𝑓 𝑥, 𝑦 𝑆𝐸 = 𝑓 𝑥, 𝑦 ⊕ 𝑆𝐸 ⊖ 𝑆𝐸

𝑓 𝑥, 𝑦 ∘ 𝑆𝐸 = (𝑓 𝑥, 𝑦 ∘ 𝑆𝐸) ∘ 𝑆𝐸

Page 58: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis58 DTU Compute, Technical University of Denmark

Closing

Original

SE

Dilated Eroded

Closing = dilation + erosion

𝑔 𝑥, 𝑦 = 𝑓 𝑥, 𝑦 ⊕ 𝑆𝐸 ⊖ 𝑆𝐸

Page 59: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis59 DTU Compute, Technical University of Denmark

Closing Example

Closing operation with a 22 pixel disc

Closes small holes

Page 60: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis60 DTU Compute, Technical University of Denmark

Page 61: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis61 DTU Compute, Technical University of Denmark

Page 62: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis62 DTU Compute, Technical University of Denmark

Page 63: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis63 DTU Compute, Technical University of Denmark

Page 64: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis64 DTU Compute, Technical University of Denmark

Page 65: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis65 DTU Compute, Technical University of Denmark

Page 66: Image Analysis...DTU Compute 23 DTU Compute, Technical University of Denmark Image Analysis 2020 1D Morphology : Erosion Erode : To wear down (Waves eroded the shore) – Dansk : tære,

DTU Compute

2021Image Analysis66 DTU Compute, Technical University of Denmark

Next week: Blob Analysis and object classification


Recommended