.
from morph import *
from handson import *
from MLab import rand
from Numeric import shape
A=mmreadgray('linha.tif')
A=mmpad(A,mmsebox(10))
mmshow(A)
B=mmsedisk(10)
C=mmdil(A,B)
mmshow(C,A);
rnd = mmbinary(rand(shape(C)[0],shape(C)[1]) > 0.99)
Ba=mmintersec(A,rnd)
Bg=mmdil(Ba,mmimg2se(mmgradm(mmpad(mmseshow(B),mmsebox()))))
Bg=mmunion(mmdil(Ba,mmsecross(2)),Bg)
mmshow(A,Bg)
AC=mmsymdif(mmunion(mmgray(A,'uint8',2),mmgray(C,'uint8',1)),mmgray(Bg,'uint8',1))
mmshow(AC)