Toolbox ia870 | List of Figures | Fig. 6.8 | Fig. 6.12

Figure 6.10 - Gray-scale morphological reconstruction

Description

This figure illustrates the gray-scale morphological reconstruction.

Demo Script

 1 import ia870 as MT
 2 import ia636 as ia
 3 
 4 f = adreadgray('MVBook/ggray.png')
 5 
 6 m = MT.iaintersec(f,0)
 7 m[19,19]=f[19,19]
 8 
 9 f4 = MT.iacdil(m,f,MT.iasecross(),4)
10 f28 = MT.iacdil(m,f,MT.iasecross(),28)
11 finf = MT.iacdil(m,f,MT.iasecross(),500)
12 
13 adshow(MT.iapad(MT.ianeg(f)))
14 adshow(MT.iapad(MT.ianeg(m)))
15 adshow(MT.iapad(MT.ianeg(f4)))
16 adshow(MT.iapad(MT.ianeg(f28)))
17 adshow(MT.iapad(MT.ianeg(finf)))
18 
19 adshow(ia.ianormalize(MT.ianeg(MT.iapad(MT.iagsurf(f)))), '(a)')
20 adshow(ia.ianormalize(MT.ianeg(MT.iapad(MT.iagsurf(m)))), '(b)')
21 adshow(ia.ianormalize(MT.ianeg(MT.iapad(MT.iagsurf(f4)))), '(c)')
22 adshow(ia.ianormalize(MT.ianeg(MT.iapad(MT.iagsurf(f28)))), '(d)')
23 adshow(ia.ianormalize(MT.ianeg(MT.iapad(MT.iagsurf(finf)))), '(e)')

(a)

(b)

(c)

(d)

(e)