Toolbox ia870 | List of Figures | Fig. 4.7 | Fig. 4.9

Figure 4.8 - Thinning and pruning

Description

In Fig. 4.8(a) we see a thinned scissors image with some extraneous pixels attached, a common occurrence in typical thinning transforms. Using 15 pruning cycles eliminates the fuzz [Fig. 4.8(b)]. If the pruning cycles are repeated until no further changes are made, then we get the pruned result of Fig. 4.8(c), where the two loops of the scissors handle are joined together, removing all ending points of the skeleton.

Demo Script

 1 import ia870 as MT
 2 import ia636 as ia
 3 
 4 S  = adreadgray('scissors.tif') > 0
 5 T = MT.iathin(S, MT.iahomothin())
 6 P =  MT.iathin(T, MT.iaendpoints())
 7 P15 =  MT.iathin(T, MT.iaendpoints(),15)
 8 
 9 fig_a =  MT.iaunion(MT.iagray(S,'uint8',150),MT.iagray(T))
10 fig_b = MT.iaunion(MT.iagray(T,'uint8',150),MT.iagray(P15))
11 fig_c = MT.iaunion(MT.iagray(T,'uint8',150),MT.iagray(P))
12 
13 adshow(MT.ianeg(fig_a), '(a)')
14 adshow(MT.ianeg(fig_b), '(b)')
15 adshow(MT.ianeg(fig_c), '(c)')

(a)

(b)

(c)