[hofig1s14] [Up] [hofig1s16] Chapter 1 - Binary Erosion and Dilation

hofig1s15
Structuring element decomposition

Description

.

Demo Script

Image reading

from morph import *
from handson import *
A=mmreadgray('leaf_bin.tif')
mmshow(A)
A

Structuring element B1

B1=mmsedisk(7)
mmshow(mmseshow(B1))
mmseshow(B1)

Composition of two dilations

C1=mmero(A,B1)
C2=mmero(C1,B1)
mmshow(A,C1,C2)
A,C1,C2

Composition of two structuring elements

B1_2=mmsesum(B1,2)
mmshow(mmseshow(B1_2))
mmseshow(B1_2)

Illustration 1

C1s=mmunion(mmgradm(A),C1)
mmshow(C1s)
C1s

Illustration 2

C2s=mmunion(mmgradm(A),mmgradm(C1),C2)
mmshow(C2s)
C2s

[hofig1s14] [Up] [hofig1s16] http://www.python.org