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