[hofig2s5] [Up] [hofig2s7] Chapter 2 - Binary Opening and Closing

hofig2s6
Effects of digital opening and closing

Description

This figure illustrates the effects of opening and closing.

Demo Script

.

from morph import *
S=mmreadgray('g.tif')
E =mmbinary([[0, 0, 0],
             [0, 1, 1],
             [0, 1, 1]])
T=mmopen(S,E)
U=mmclose(S,E)
frame=mmunion(S,1)
Warning: Converting input image from int32 to binary uint8.
mmshow(mmbshow(frame,S))
mmshow(mmseshow(E,'EXPAND'))
mmshow(mmbshow(frame,T))
mmshow(mmbshow(frame,U))
mmbshow(frame,S) mmseshow(E,'EXPAND') mmbshow(frame,T)
mmbshow(frame,U)

[hofig2s5] [Up] [hofig2s7] http://www.python.org