Toolbox ia870 | List of Figures | Fig. 1.19 | Fig. 2.2

Figure 2.1 - Opening


The opening of image by image is denoted by and is defined as a composition of erosion and dilation by

The functional notation for opening is , and the command for opening in the MT is iaopen(A,B). For a better appreciation of the role of opening in processing, we state an equivalent formulation:

Demo Script

 1 import numpy as np
 2 import ia870 as MT
 3 import ia636 as ia
 4 from handson.lib import draw_se_axis
 6 B = MT.iasedisk(20)
 7 adshow(MT.ianeg(draw_se_axis(MT.iaseshow(B))), '(a) Structuring element')
 9 F = MT.iapad(MT.iabinary(np.ones((100,65))))
10 adshow(MT.ianeg(F), '(b) input image')
12 E = MT.iaero(F,B)
13 adshow(MT.iapad(MT.ianeg(E)), '(c) erosion')
15 O = MT.iaopen(F,B)
16 adshow(MT.iapad(MT.ianeg(O)), '(d) opening')

(a) Structuring element

(b) input image

(c) erosion

(d) opening