[hofig3s8] [Up] [hofig3s10] Chapter 3 - Morphological Processing of Binary Images

hofig3s9
Reconstruction from markers

Description

This figure illustrates the morphological reconstruction from markers.

Demo Script

.

from morph import *
from Numeric import shape
a=mmreadgray('blob3.tif')
a=mmedgeoff(a)
Bc=mmsecross()
m=mmsubm(a,a)
m[:,shape(m)[1]/2]=1 #marker
m=mmdil(m)
m=mmintersec(a,m)
r=mmcdil(m,a,Bc,100)
b=mmunion(mmgray(m,'uint8',255), mmgray(a,'uint8', 100))
c=mmunion(mmgray(r,'uint8',255), mmgray(a,'uint8', 100))
mmshow(a)
mmshow(b)
mmshow(c)
a b c

[hofig3s8] [Up] [hofig3s10] http://www.python.org