Toolbox ia870 | List of Figures | Fig. 3.30 | Fig. 3.32

Figure 3.31 - Family of disks

Description

This figure illustrates three families of disks using the Euclidean, the chessboard, and the city-block metrics.

Demo Script

 1 import ia870 as MT
 2 import ia636 as ia
 3 import numpy as np
 4 
 5 f = MT.iabinary(np.ones((129,129)))
 6 f[64,64]=0
 7 
 8 d8 = MT.iadist(f,MT.iasebox())
 9 d4 = MT.iadist(f,MT.iasecross())
10 dE = MT.iadist(f,MT.iasebox(),'EUCLIDEAN')
11 d8m = MT.iaintersec(d8,mmgray(mmthreshad(d8,0,64)))
12 
13 d4m = MT.iaintersec(d4,MT.iagray(MT.iathreshad(d4,0,64)))
14 dEm = MT.iaintersec(dE,MT.iagray(MT.iathreshad(dE,0,64)))
15 
16 adshow(ia.ianormalize(MT.ianeg(dEm % 6)), '(a) Euclidean')
17 adshow(ia.ianormalize(MT.ianeg(d8m % 6)), '(b) chessboard')
18 adshow(ia.ianormalize(MT.ianeg(d4m % 6)), '(c) city-block')

(a) Euclidean

(b) chessboard

(c) city-block

See Also