[hofig4s7] [Up] [hofig4s9] Chapter 4 - Hit-or-Miss Transform

hofig4s8
Thinning and pruning

Description

This figure illustrates the thinning and pruning.

Demo Script

.

from morph import *
S=mmreadgray('scissors.tif')
T=mmthin(S,mmhomothin())
P=mmthin(T,mmendpoints())
P15=mmthin(T,mmendpoints(),15)
fig_a=mmunion(mmgray(S,'uint8',150),mmgray(T))
fig_b=mmunion(mmgray(T,'uint8',150),mmgray(P15))
fig_c=mmunion(mmgray(T,'uint8',150),mmgray(P))
mmshow(fig_a)
mmshow(fig_b)
mmshow(fig_c)
fig_a fig_b
fig_c

[hofig4s7] [Up] [hofig4s9] http://www.python.org