[hofig1s15] [Up] [hofig1s17] Chapter 1 - Binary Erosion and Dilation

hofig1s16
Effects of structuring element order

Description

.

Demo Script

Image reading

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

Structuring element B1

B1=mmsedisk(8)
mmshow(mmseshow(B1))
mmseshow(B1)

Structuring element B2

B2=mmsebox(7);
mmshow(mmseshow(B2))
mmseshow(B2)

Composition of structuring elements

B3=mmsedil(B1,B2)
mmshow(mmseshow(B3))
mmseshow(B3)

Dilation by B1

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

Dilation by the composed structuring element

C3=mmero(A,B3)
C3s=mmunion(mmgradm(A),C3)
mmshow(C3s)
C3s

[hofig1s15] [Up] [hofig1s17] http://www.python.org