Toolbox ia870 | List of Figures | Fig. 1.12 | Fig. 1.14

Figure 1.13 - Dilation for digital images

Description

Using the image and structuring element of Fig. 1.9, we illustrate digital dilation using the Minkowski addition formulation of Eq. (1.12). The structuring element is translated to all image pixels, and the resulting structuring element translations are unioned

Demo Script

 1 import numpy as np
 2 import ia870 as MT
 3 
 4 S = MT.iabinary([
 5   [0, 0, 0, 0, 0, 0, 0],
 6   [0, 0, 1, 0, 1, 0, 0],
 7   [0, 0, 1, 1, 0, 1, 0],
 8   [0, 0, 1, 1, 1, 0, 0],
 9   [0, 0, 0, 0, 0, 0, 0]])
10 
11 adshow(MT.ianeg(MT.iaseshow(S,'expand')), '(a) input image S')
12 
13 E = MT.iabinary([
14   [0, 0, 0],
15   [0, 1, 0],
16   [0, 1, 1]])
17 
18 adshow(MT.ianeg(MT.iaseshow(E,'expand')), '(b) structuring element E')
19 
20 T = MT.iadil(S,MT.iaimg2se(E))
21 adshow(MT.ianeg(MT.iaseshow(T,'expand')), '(c) dilation between S and E')

(a) input image S

(b) structuring element E

(c) dilation between S and E