Toolbox ia870 | List of Figures | Fig. 2.12 | Fig. 2.14

Figure 2.13 - Illustration of the opening property of Eq. 2.16

Description

As noted previously, if an image is formed from a union of translations of some shape primitive , then the opening of by yields ; that is .

In such a case we say that is open with respect to is is invariant when filtered by the opening with structuring element invariant when opened by , but unions of translations of  are the only images invariant when opened by . Examples abound—perhaps the most important one being that a disk is always open relative to a disk possessing a smaller radius.

A union of translations of an image is, in fact, a dilation of the image. Thus, the preceding formulation of -openness can be reformulated: is -open if and only if there exists some image such that . This formulation proves to be useful when we wish to construct granulometries (see Chapter 8).

Demo Script

 1 import numpy as np
 2 import ia870 as MT
 3 from handson.lib import iabggmodel, draw_se_axis
 4 
 5 a = MT.iaedgeoff(adreadgray('blob.tif'))
 6 b = MT.iasedisk(13)
 7 d = MT.iaseunion(MT.iasedil(b,MT.iaseline(12)),MT.iasedil(b,MT.iaseline(12,180)))
 8 
 9 adshow(MT.ianeg(draw_se_axis(MT.iaseshow(b))),  '(a)')
10 adshow(MT.ianeg(draw_se_axis(MT.iaseshow(d))),  '(b)')
11 adshow(MT.ianeg(draw_se_axis(MT.iaseshow(d))),  '(c)')
12 
13 fig_a = a
14 fig_d = MT.iaunion(MT.iagray(MT.iaopen(a,b)),MT.iagray(MT.iagradm(a),'uint8',100))
15 fig_e = MT.iaunion(MT.iagray(MT.iaopen(a,d)),MT.iagray(MT.iagradm(MT.iaopen(a,b)),'uint8',100))
16 
17 adshow(MT.iapad(MT.ianeg(fig_a)), '(d)')
18 adshow(MT.iapad(MT.ianeg(fig_d)), '(e)')
19 adshow(MT.iapad(MT.ianeg(fig_e)), '(g)')
20 
21 fig_f = a
22 fig_g = MT.iaunion(MT.iagray(MT.iaopen(a,d)), MT.iagray(MT.iagradm(a),'uint8',100))
23 fig_h = MT.iaopen(a,d)
24 
25 adshow(MT.iapad(MT.ianeg(fig_f)), '(g)')
26 adshow(MT.iapad(MT.ianeg(fig_g)), '(h)')
27 adshow(MT.iapad(MT.ianeg(fig_h)), '(i)')

(a)

(b)

(c)

(d)

(e)

(g)

(g)

(h)

(i)