[hofig7s6] [Up] [hofig7s9] Chapter 7 - Morphological Segmentation - Watershed

hofig7s8
Watershed segmentation of a cedar cross section

Description

This figure illustrates the watershed segmentation of a cedar cross section.

Demo Script

.

from morph import *
f=mmreadgray('cer_tr10.tif');
fneg = mmneg(f);
B8 = mmsebox();
ws=mmcwatershed(fneg,mmregmin(fneg,B8),B8);
ws_area=mmcwatershed(fneg,mmregmin(mmareaclose(fneg,100,B8),B8),B8);
ws_close=mmcwatershed(fneg,mmregmin(mmclose(fneg,mmsedisk()),B8),B8);
ws_h=mmcwatershed(fneg,mmregmin(mmhmin(fneg,20,B8),B8),B8);
mmshow(f);
mmshow(ws);
mmshow(ws_area);
mmshow(ws_close);
mmshow(ws_h);
f ws
ws_area ws_close
ws_h

[hofig7s6] [Up] [hofig7s9] http://www.python.org