[hofig2s6] [Up] [hofig2s8] Chapter 2 - Binary Opening and Closing

hofig2s7
Restoration by opening

Description

This figure illustrates the use of opening for restoration of pepper noise.

Demo Script

.

from morph import *
from handson import *
from Numeric import shape
f=mmbinary(ones((200,100)))
f=mmpad(f,mmsebox(25))
n=mmbggmodel(shape(f),mmsedisk(2),3,0.001)
fbin=mmunion(f,n)
B=mmsedisk(7)
g = mmopen(fbin,B)
mmshow(fbin)
mmshow(mmseshow(B))
mmshow(g)
fbin mmseshow(B) g

[hofig2s6] [Up] [hofig2s8] http://www.python.org