Toolbox ia870 | List of Figures | Fig. 3.20 | Fig. 3.22

Figure 3.21 - Logical opening

Description

Conjunction and disjunction can be combined to form a more general form of reconstructive opening, called a logical opening

The logical opening

Figure 3.21 Logical opening: (a) input image, (b) first conjunctive opening: letters with both vertical and horizontal features, (c) second conjunctive opening: letters with both diagonal features, (d) union of both conjunctive openings

Demo Script

 1 import ia870 as MT
 2 
 3 A = adreadgray('MVBook/text2.png') > 0
 4 B11 = MT.iasedil(MT.iasebox(),MT.iaserot(MT.iaseline(20),90))
 5 C = MT.iaopenrec(A,B11,MT.iasebox());
 6 B12 = MT.iasedil(MT.iasebox(),MT.iaseline(15))
 7 D = MT.iaopenrec(A,B12,MT.iasebox())
 8 E = MT.iaintersec(C,D)
 9 B21 = MT.iasedil(MT.iasebox(),MT.iaserot(MT.iaseline(10),45))
10 F = MT.iaopenrec(A,B21,MT.iasebox())
11 B22 = MT.iasedil(MT.iasebox(),MT.iaserot(MT.iaseline(10),-45))
12 G = MT.iaopenrec(A,B22,MT.iasebox())
13 H = MT.iaintersec(F,G)
14 I = MT.iaunion(E,H)
15 
16 adshow(MT.iapad(MT.ianeg(A)), '(a)')
17 adshow(MT.iapad(MT.ianeg(E)), '(b)')
18 adshow(MT.iapad(MT.ianeg(H)), '(c)')
19 adshow(MT.iapad(MT.ianeg(I)), '(d)')

(a)

(b)

(c)

(d)