# 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
6 b = MT.iasedisk(13)
7 d = MT.iaseunion(MT.iasedil(b,MT.iaseline(12)),MT.iasedil(b,MT.iaseline(12,180)))
8
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