[hofig2s12] [Up] [hofig2s14] Chapter 2 - Binary Opening and Closing

hofig2s13
Illustration of the opening property of Eq. 2.16

Description

This figure illustrates the opening property of Eq. 2.16.

Demo Script

.

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))
mmseshow(b) 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_a fig_d
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)
fig_f fig_g
fig_h

[hofig2s12] [Up] [hofig2s14] http://www.python.org