Function iaclose

namespace:morph
page:iaclose

Synopse

Morphological closing.

  • y = iaclose(f, b=ia_secross(NULL))
    • y: Image
    • f: Image
    • b: Structuring Element
01. from numpy import *
02. 
03. def iaclose(f, b=None):
04.     from iaero import iaero
05.     from iadil import iadil
06.     from iasecross import iasecross
07.     if b is None:
08.         b = iasecross()
09. 
10.     y = iaero( iadil(f,b),b)
11. 
12.     return y

Description

iaclose creates the image y by the morphological closing of the image f by the structuring element b. In the binary case, the closing by a structuring element B may be interpreted as the intersection of all the binary images that contain the image f and have a hole equal to a translation of B. In the gray-scale case, there is a similar interpretation taking the functions umbra.

Examples

Example 1

01. from ia870 import iaclose
02. from ia870 import iaimg2se
03. from ia870 import iagradm
04. 
05. 
06. f=mmreadgray('blob.tif')
07. bimg=mmreadgray('blob1.tif')
08. b=iaimg2se(bimg)
09. mmshow(f)
10. mmshow( iaclose(f,b))
11. mmshow( iaclose(f,b),iagradm(f))

Example 2

1. from ia870 import iasedisk
2. 
3. 
4. f = mmreadgray('form-1.tif')
5. mmshow(f)
6. y = iaclose(f,iasedisk(4))
7. mmshow(y)

Example 3

1. f = mmreadgray('n2538.tif')
2. mmshow(f)
3. y = iaclose(f,iasedisk(3))
4. mmshow(y)

Equation