[hofig7s12] [Up] [hofig7s14] Chapter 7 - Morphological Segmentation - Watershed

hofig7s13
Segmentation of keys using watershed transform with inner and outer markers

Description

This figure illustrates the segmentation of keys using watershed transform with inner and outer markers.

Demo Script

.

from morph import *
a = mmreadgray('keyb.tif');
b = mmgradm(a, mmsebox());
c = mmopenth(a,mmsebox(5));
d = mmthreshad(c, uint8(150));
e = mmdil(d, mmsebox(3));
f = mmwatershed(mmdist(mmneg(e),mmsebox(),'EUCLIDEAN'));
g = mmunion(e,f);
h = mmcwatershed(b,g,mmsebox());
mmshow(a)
mmshow(c)
mmshow(e)
mmshow(f,e)
mmshow(b,g)
mmshow(h)
a c
e f,e
b,g h

[hofig7s12] [Up] [hofig7s14] http://www.python.org