Toolbox ia870 | List of Figures | Fig. 3.8 | Fig. 3.10

Figure 3.9 - Reconstruction from markers

Description

This figure illustrates the morphological reconstruction from markers.

Demo Script

 1 import numpy as np
 2 import ia870 as MT
 3 
 4 a = adreadgray('blob3.tif')
 5 a = MT.iaedgeoff(a)
 6 Bc = MT.iasecross()
 7 m = MT.iasubm(a,a)
 8 m[:,shape(m)[1]/2]=1 #marker
 9 m = MT.iadil(m)
10 m = MT.iaintersec(a,m)
11 r = MT.iacdil(m,a,Bc,100)
12 b = MT.iaunion(MT.iagray(m,'uint8',255), MT.iagray(a,'uint8', 100))
13 c = MT.iaunion(MT.iagray(r,'uint8',255), MT.iagray(a,'uint8', 100))
14 
15 adshow(MT.iapad(MT.ianeg(a)), '(a) input image')
16 adshow(MT.iapad(MT.ianeg(b)), '(b) marker')
17 adshow(MT.iapad(MT.ianeg(c)), '(c) reconstructed image')

(a) input image

(b) marker

(c) reconstructed image