Function iaunion

namespace:morph
page:iaunion

Synopse

Union of images.

  • y = iaunion(f1, f2, f3=NULL, f4=NULL, f5=NULL)
    • y: Image
    • f1: Image
    • f2: Image Or constant
    • f3: Image Or constant.
    • f4: Image Or constant.
    • f5: Image Or constant.
1. from numpy import *
2. 
3. def iaunion(f1, f2, *args):
4. 
5.     y = maximum(f1,f2)
6.     for f in args:
7.         y = maximum(y,f)
8.     return y.astype(f1.dtype)

Description

iaunion creates the image y by taking the pixelwise maximum between the images f1, f2, f3, f4, and f5. When f1, f2, f3, f4, and f5 are binary images, y represents the union of them.

Examples

Example 1

1. from ia870 import iaunion
2. 
3. 
4. f=uint8([255, 255,  0,  10,   0, 255, 250])
5. print 'f=', f
6. g=uint8([  0,  40, 80, 140, 250,  10,  30])
7. print 'g=', g
8. print iaunion(f, g)
9. print iaunion(f, 255)
f= [255 255   0  10   0 255 250]
g= [  0  40  80 140 250  10  30]
[255 255  80 140 250 255 250]
[255 255 255 255 255 255 255]

Example 2

1. a = mmreadgray('form-ok.tif')
2. b = mmreadgray('form-1.tif')
3. c = iaunion(a,b)
4. mmshow(a)
5. mmshow(b)
6. mmshow(c)

Example 3

1. g = mmreadgray('tplayer1.tif')
2. h = mmreadgray('tplayer2.tif')
3. i = mmreadgray('tplayer3.tif')
4. j = iaunion(g,h,i)
5. mmshow(g)
6. mmshow(h)
7. mmshow(i)
8. mmshow(j)

Equation