This figure illustrates the opening property of Eq. 2.16.
.
from morph import *
from handson import *
from Numeric import shape, ones
a=mmedgeoff(mmreadgray('blob.tif'))
b=mmsedisk(13)
d=mmseunion(mmsedil(b,mmseline(12)),mmsedil(b,mmseline(12,180)))
mmshow(mmseshow(b))
mmshow(mmseshow(d))
fig_a=a
fig_d=mmunion(mmgray(mmopen(a,b)),mmgray(mmgradm(a),'uint8',100))
fig_e=mmunion(mmgray(mmopen(a,d)),mmgray(mmgradm(mmopen(a,b)),'uint8',100))
mmshow(fig_a)
mmshow(fig_d)
mmshow(fig_e)
fig_f=a
fig_g=mmunion(mmgray(mmopen(a,d)),mmgray(mmgradm(a),'uint8',100))
fig_h=mmopen(a,d)
mmshow(fig_f)
mmshow(fig_g)
mmshow(fig_h)