Function iasecross


Diamond structuring element and elementary 3x3 cross.

  • B = iasecross(r=1)
    • B: Structuring Element
    • r: Double (radius).
01. from numpy import *
03. def iasecross(r=1):
04.     from iasesum import iasesum
05.     from iabinary import iabinary
07.     B = iasesum( iabinary([[0,1,0],
08.                            [1,1,1],
09.                            [0,1,0]]),r)
10.     return B


iasecross creates the structuring element B formed by r successive Minkowski additions of the elementary cross (i.e., the 3x3 cross centered at the origin) with itself. If r=0, B is the unitary set that contains the origin. If r=1, B is the elementary cross itself.


Example 1

1. from ia870 import iasecross, iaseshow
3. b1 = iasecross()
4. print iaseshow(b1)
5. b2 = iasecross(2)
6. print iaseshow(b2)
[[False  True False]
 [ True  True  True]
 [False  True False]]
[[False False  True False False]
 [False  True  True  True False]
 [ True  True  True  True  True]
 [False  True  True  True False]
 [False False  True False False]]

See Also