[hofig2s11] [Up] [hofig2s13] Chapter 2 - Binary Opening and Closing

hofig2s12
Alternating sequential open-close filters

Description

This figure illustrates the use of the alternating sequential open-close filters.

Demo Script

.

from morph import *
from handson import *
from Numeric import shape, ones
f=mmbinary(ones((200,100)))
f=mmpad(f,mmsebox(25))
n_salt=mmbggmodel(shape(f),mmsedisk(2),4,0.001)
n_pepper=mmbggmodel(shape(f),mmsedisk(2),4,0.001)
fbin=mmintersec(mmunion(f,n_salt),mmneg(n_pepper))
f1=mmasf(fbin,'co',mmsedisk(2),1)
f3=mmasf(fbin,'co',mmsedisk(2),3)
f7=mmasf(fbin,'co',mmsedisk(2),7)
mmshow(fbin)
mmshow(f1)
mmshow(f3)
mmshow(f7)
fbin f1 f3 f7

[hofig2s11] [Up] [hofig2s13] http://www.python.org