from morph import *
from MLab import transpose
a=transpose(mmreadgray('beef.tif'));
c = mmthreshad(a,uint8(10));
d = mmareaclose(c,200);
e = mmgradm(d,mmsecross(1),mmsebox(9));
f= mmero(d,mmsecross(95));
g = mmunion(e,f);
h = mmgradm(mmclose(a));
ws=uint8(mmcwatershed(h,g,mmsecross(),'regions'));
sur_in=mminpos(e,h);
sur_ex=mminpos(f,h);
msg=mmsurf(h);
ms=mmsurf(mmintersec(mmgray(mmneg(g)),h));
mmshow(ms,e,f);
mmshow(ms,mmthreshad(sur_in,0, 5),mmthreshad(sur_ex,0, 5));
Warning: Converting input image from int32 to uint8.
Warning: Converting input image from int32 to uint8.
Warning: Converting input image from int32 to uint8.
Warning: Converting input image from int32 to uint8.
mmshow(ms,mmthreshad(sur_in,0,12),mmthreshad(sur_ex,0,12));
Warning: Converting input image from int32 to uint8.
Warning: Converting input image from int32 to uint8.
Warning: Converting input image from int32 to uint8.
Warning: Converting input image from int32 to uint8.
mmshow(ws,mmthreshad(ws,1,1),mmthreshad(ws,2,2));
Warning: Converting input image from int32 to uint8.
Warning: Converting input image from int32 to uint8.
Warning: Converting input image from int32 to uint8.
Warning: Converting input image from int32 to uint8.