Function iaopen

namespace:morph
page:iaopen

Synopse

Morphological opening.

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

Description

iaopen creates the image y by the morphological opening of the image f by the structuring element b. In the binary case, the opening by the structuring element B may be interpreted as the union of translations of B included in f. In the gray-scale case, there is a similar interpretation taking the functions umbra.

Examples

Example 1

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

Example 2

1. from ia870 import iasebox
2. 
3. 
4. a=iabinary( mmreadgray('pcb1bin.tif'))
5. b=iaopen(a,iasebox(2))
6. c=iaopen(a,iasebox(4))
7. mmshow(a)
8. mmshow(b)
9. mmshow(c)

Example 3

1. from ia870 import iasedisk
2. 
3. 
4. a=mmreadgray('astablet.tif')
5. b=iaopen(a,iasedisk(18))
6. mmshow(a)
7. mmshow(b)

Equation

Algorithm

function y=iaopen_equ( f, b )
  y = iadil(iaero(f,b),b);