Toolbox ia870 | List of Figures | Fig. 7.9 | Fig. 7.11

Figure 7.10 - Geodesic SKIZ

Description

If the geodesic distance is used to define the Voronoi diagram instead of the Euclidean distance, then the boundaries of the geodesic influence zones form the geodesic SKIZ . An example of the geodesic SKIZ is given in Fig. 7.10, where we want to find the influence zones of the seeds in a fruit cross section: (a) input image overlaid by seeds, (b) geodesic distance of the points in the fruit to the seeds, and (c) watershed lines as the geodesic SKIZ overlaid on the input image.

Demo Script

 1 import ia870 as MT
 2 import ia636 as ia
 3 
 4 aux = adreadgray('MVBook/pinha.png')
 5 f = MT.iaareaclose(MT.iaareaopen(MT.iathreshad(MT.iaasf(aux,'oc',MT.iasecross(),1),61),30),100)
 6 aux = aux.astype('uint8')
 7 
 8 center = MT.iaareaopen(MT.iasubm(MT.iaclohole(f),f),1000)
 9 aux_seeds = MT.iaunion(f,center)
10 seeds = MT.iasubm(MT.iaclohole(aux_seeds),aux_seeds)
11 g = MT.iaunion(f,seeds)
12 
13 d = MT.iagdist(g,seeds,MT.iasebox())
14 ws = MT.iacwatershed(d,MT.iaregmin(d))
15 fig_a = MT.iaunion(MT.iagray(f),MT.iagray(seeds,'uint8',200))
16 fig_b = d % 6;
17 fig_c = MT.iaintersec(MT.ianeg(ws),f)
18 
19 adshow(MT.iapad(MT.ianeg(fig_a)),'(a)')
20 adshow(ia.ianormalize(MT.ianeg(fig_b)),'(b)')
21 adshow(MT.iapad(MT.ianeg(fig_c)),'(c)')

(a)

(b)

(c)