[hofig6s12] [Up] [hofig6s14] Chapter 6 - Morphological Processing of Gray-Scale Images

hofig6s13
Gray-scale morphological reconstruction by means of threshold decomposition

Description

This figure illustrates the gray-scale morphological reconstruction by means of threshold decomposition.

Demo Script

.

from morph import *
f=mmreadgray('bunch-seeds.jpg');
t1=100;t2=150;
f1=mmthreshad(f,t1);
Warning: Converting input image from int32 to uint8.
f2=mmthreshad(f,t2);
Warning: Converting input image from int32 to uint8.
m=mmsubm(f,f);
m[141,310]=255;
m=mmdil(m,mmsedisk(10));
g=mminfrec(m,f);
g1=mmthreshad(g,t1);
Warning: Converting input image from int32 to uint8.
g2=mmthreshad(g,t2);
Warning: Converting input image from int32 to uint8.
mmshow(mmunion(f,m))
mmshow(f1)
mmshow(f2)
mmshow(g)
mmshow(g1)
mmshow(g2)
mmunion(f,m) f1
f2 g
g1 g2

[hofig6s12] [Up] [hofig6s14] http://www.python.org