[hofig7s8] [Up] [hofig7s10] Chapter 7 - Morphological Segmentation - Watershed

hofig7s9
Voronoi diagram from watershed of the distance transform

Description

This figure illustrates the construction of the Voronoi diagram from the watershed of the distance transform.

Demo Script

.

from morph import *
from MLab import rand
a=mmbinary(rand(256,256) > 0.999);
d=mmdist(mmneg(a),mmsebox(),'EUCLIDEAN');
ws=mmcwatershed(d,mmregmin(d));
mmshow(mmdil(a));
mmshow(mmsurf(d));
mmshow(mmunion(ws,mmdil(a)));
mmdil(a) mmsurf(d)
mmunion(ws,mmdil(a))

[hofig7s8] [Up] [hofig7s10] http://www.python.org