Function iaero

namespace:morph
page:iaero

Synopse

Erode an image by a structuring element.

  • y = iaero(f, b=ia_secross(NULL))
    • y: Image
    • f: Image
    • b: Structuring Element

Description

iaero performs the erosion of the image f by the structuring element b. Erosion is a neighbourhood operator that compairs locally b with f, according to an inclusion rule. Since erosion is a fundamental operator to the construction of all other morphological operators, it is also called an elementary operator of Mathematical Morphology. When f is a gray-scale image , b may be a flat or non-flat structuring element.

Examples

Example 1

01. from ia870 import iaero
02. from ia870 import iabinary
03. 
04. 
05. f=iabinary([
06.    [1, 1, 1, 0, 0, 1, 1],
07.    [1, 0, 1, 1, 1, 0, 0],
08.    [0, 0, 0, 0, 1, 0, 0]])
09. b=iabinary([1, 1, 0])
10. iaero(f,b)
11. f=uint8([
12.    [ 0,   1,  2, 50,  4,  5],
13.    [ 2,   3,  4,  0,  0,  0],
14.    [12, 255, 14, 15, 16, 17]])
15. iaero(f,b)

Example 2

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

Example 3

1. from ia870 import iasedisk
2. 
3. 
4. f=mmreadgray('pcb_gray.tif')
5. b=iasedisk(3)
6. mmshow(f)
7. mmshow( iaero(f,b))

Example 4

1. from ia870 import iasedil, iabinary, iaero
2. 
3. B = array([1,1,1],bool)
4. y = iasedil( iabinary([1]),B)
5. print 'y=',y
6. b1= iabinary(y>=0)
7. b0= iaero(y,B)
8. print 'b0=',b0
9. #y = iabshow(b1,y,b0)
y= [[ True  True  True]]
b0= [[ True  True  True]]

Equation

Where