Function iasesum

namespace:morph
page:iasesum

Synopse

N-1 iterative Minkowski additions

  • NB = iasesum(B, N=1)
    • NB: Structuring Element
    • B: Structuring Element
    • N: Double
01. import numpy as np
02. 
03. def iasesum(B, N=1):
04.     from ia870 import iaisbinary, iabinary, iasedil
05. 
06.     if N==0:
07.         if iaisbinary(B): return iabinary([1])
08.         else:             return array([0],int32) # identity
09.     NB = B
10.     for i in range(N-1):
11.         NB = iasedil(NB,B)
12.     return NB

Description

iasesum creates the structuring element NB from N - 1 iterative Minkowski additions with the structuring element B.

Examples

Example 1

1. import ia870
2. 
3. b = ia870.iaimg2se( array([[1, 1, 1],
4.                            [1, 1, 1],
5.                            [0, 1, 0]],'bool'))
6. adshow(ia870.iaseshow(b, 'EXPAND'))
7. b3 = ia870.iasesum(b,3)
8. adshow(ia870.iaseshow(b3,'EXPAND'))

Example 2

1. import ia870
2. 
3. b = ia870.iasedisk(1,'2D','CITY-BLOCK');
4. adshow(ia870.iaseshow( b,'EXPAND'))
5. adshow(ia870.iaseshow( ia870.iasesum(b,2),'EXPAND'))

Equation

See Also

  • iasedisk - Generate disk structuring element