Toolbox ia870 | List of Figures | Fig. 6.17 | Fig. 6.20

Figure 6.18 - Disjunctive and conjunctive reconstructive opening

Description

This figure 6.18 illustrates the disjunctive and conjunctive reconstructive openning. using vertical and diagonal structuring elements: (a) input image; (b) reconstructive opening by vertical structuring element; (c) reconstructive opening by diagonal structuring element; (d) disjunctive opening; and (e) conjunctive opening.

Demo Script

 1 import ia870 as MT
 2 import numpy as np
 3 
 4 f = adreadgray('keyb.tif');
 5 f = f[155:,:210];
 6 
 7 Bh = MT.iaimg2se(MT.iabinary(np.ones((16,2))));
 8 Bd = MT.iaserot(MT.iaimg2se(np.ones((2,10))),-45);
 9 
10 f1 = MT.iaopen(f,Bh)
11 f2 = MT.iaopen(f,Bd)
12 f1r = MT.iaopenrec(f,Bh)
13 f2r = MT.iaopenrec(f,Bd)
14 f3 = MT.iaunion(f1r,f2r)
15 f4 = MT.iaintersec(f1r,f2r)
16 
17 adshow(f, '(a)')
18 adshow(f1, '(b)')
19 adshow(f2, '(c)')
20 adshow(f3, '(d)')
21 adshow(f4, '(e)')

(a)

(b)

(c)

(d)

(e)