[hofig7s11] [Up] [hofig7s13] Chapter 7 - Morphological Segmentation - Watershed

hofig7s12
Segmentation of overlapped blood cells

Description

This figure illustrates the segmentation of overlapped blood cells.

Demo Script

.

from morph import *
a  = mmreadgray('bloodcells.tif');
b  = mmareaopen(a, 200);
c  = mmcmp( uint8(0), '<=', b, '<=', uint8(140));
Warning: Converting input image from int32 to uint16.
Warning: Converting input image from int32 to uint16.
d  = mmopen(c,mmsedisk(2,'2D','EUCLIDEAN'));
e1 = mmdist(c, mmsebox(),'EUCLIDEAN');
e2 = mmsurf(e1);
e3 = mmregmax(e1);
e  = mmdil(e3);
f  = mmneg(e1);
fs = mmsurf(f);
g  = mmcwatershed( f, e, mmsebox());
h  = mmintersec(c,mmneg(g));
i  = mmedgeoff(h);
j  = mmgradm(i);
fig_a = c;
fig_b = mmunion(mmgray(e),e2);
fig_c = mmunion(e2,mmgray(g),mmgray(e));
fig_d = h;
mmshow(fig_a)
mmshow(fig_b)
mmshow(fig_c)
mmshow(fig_d)
fig_a fig_b
fig_c fig_d

[hofig7s11] [Up] [hofig7s13] http://www.python.org