Toolbox ia870 | List of Figures | Fig. 6.18 | Fig. 6.21

Figure 6.20 - Connected pyramid

Description

The main property of the connected filter is that every flat zone of the input image is included in a flat zone of the output image. The flat zones of reconstructive alternating sequential filters of increasing sizes constitute a connected pyramid. A flat zone from a higher size filter contains flat zones of lower size filters. Figure 6.20 illustrates this property. The top row shows the original image (a) and (b), (c), (d) the images processed by reconstructive close-open ASFs of stages 2, 4 and 16. The bottom row shows the labeling of corresponding flat zones. (e) The original image has 35,335 regions and the simplified image (f) have 21,647 (stage 2), (g) 18,490 (stage 4) and (h) 9,460 (stage 16) regions. Notice how the shapes are well preserved along the scale space.

Demo Script

 1 import ia870 as MT
 2 import numpy as np
 3 import ia636 as ia
 4 
 5 aux   = adreadgray('lenina.tif')
 6 adshow(aux, '(a)')
 7 
 8 a1    = log(aux+1)
 9 a1max = max(a1.flat)
10 a1min = min(a1.flat)
11 
12 b = MT.iaasfrec(aux,'CO',MT.iasebox(),MT.iasebox(),2)
13 adshow(b, '(b)')
14 
15 c = MT.iaasfrec(aux,'CO',MT.iasebox(),MT.iasebox(),4)
16 adshow(c, '(c)')
17 
18 d = MT.iaasfrec(aux,'CO',MT.iasebox(),MT.iasebox(),16)
19 adshow(d, '(d)')
20 
21 a_lab = MT.ialabelflat(aux,MT.iasebox())
22 b_lab = MT.ialabelflat(b,MT.iasebox())
23 c_lab = MT.ialabelflat(c,MT.iasebox())
24 d_lab = MT.ialabelflat(d,MT.iasebox())
25 
26 adshow(MT.iaglblshow(a_lab), '(e)')
27 adshow(MT.iaglblshow(b_lab), '(f)')
28 adshow(MT.iaglblshow(c_lab), '(g)')
29 adshow(MT.iaglblshow(d_lab), '(h)')

(a)

(b)

(c)

(d)

(e)

(f)

(g)

(h)