This figure illustrates the difference between the connected and the nonconnected filters.
.
from morph import *
from Numeric import shape
A=mmreadgray('tools.tif');
B=mmsebox(5);
A1=mmopen(A,B);
A2=mmopenrec(A,B);
mmshow(A)
mmshow(A1)
mmshow(A2)
f=mmreadgray('astablet.tif');
f=f[:,:shape(f)[1]/2 +10];
f1=mmopen(f,B);
f2=mmopenrec(f,B);
mmshow(f)
mmshow(f1)
mmshow(f2)