Toolbox ia870 | List of Figures | Fig. 3.13 | Fig. 3.15

Figure 3.14 - Labeling letters and words

Description

Figure 3.14 Labeling: (a) input image, (b) letter labeling, with square structuring element, (c) word labeling, with E_68 disk, (d) E_68 structuring element.

Demo Script

 1 import numpy as np
 2 import ia870 as MT
 3 
 4 A = MT.iadil(MT.iaconcat('H',MT.iatext('One word'),
 5                   MT.iatext('Labeling')),
 6      MT.iabinary(np.ones(2)))
 7 
 8 L = uint8(MT.ialabel(A,MT.iasebox()))
 9 
10 adshow(A, '(a)')
11 adshow(MT.iaglblshow(L), '(b)')
12 
13 Bw = MT.iasedisk(4)
14 
15 W = MT.ialabel(A,Bw)
16 adshow(MT.iaglblshow(W),'(c)')
17 
18 adshow(MT.iapad(MT.ianeg(MT.iaseshow(Bw,'EXPAND'))), '(d)')

(a)

(b)

(c)

(d)