Toolbox ia870 | List of Figures | Fig. 3.31 | Fig. 3.33

Figure 3.32 - Distance transform

Description

This figure illustrates the distance transform.

Demo Script

 1 import ia870 as MT
 2 import ia636 as ia
 3 
 4 f = adreadgray('blob.tif')
 5 dE = MT.iadist(f,MT.iasebox(),'EUCLIDEAN')
 6 d8 = MT.iadist(f,MT.iasebox())
 7 d4 = MT.iadist(f,MT.iasecross())
 8 
 9 adshow(MT.ianeg(f), '(a) input image')
10 adshow(ia.ianormalize(MT.ianeg(dE % 6)), '(b) Euclidean')
11 adshow(ia.ianormalize(MT.ianeg(d8 % 6)), '(c) chessboard')
12 adshow(ia.ianormalize(MT.ianeg(d4 % 6)), '(d) city-block')

(a) input image

(b) Euclidean

(c) chessboard

(d) city-block