Function iaintersec

Synopse

Intersection of images.

  • y = iaintersec(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 iaintersec(f1, f2, *args):
4. 
5.     y = minimum(f1,f2)
6.     for f in args:
7.         y = minimum(y,f)
8.     return y.astype(f1.dtype)

Description

iaintersec creates the image y by taking the pixelwise minimum between the images f1, f2, f3, f4, and f5. When f1, f2, f3, f4, and f5 are binary images, y is the intersection of them.

Examples

Example 1

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

Example 2

1. a = adreadgray('form-ok.tif')
2. b = adreadgray('form-1.tif')
3. c = iaintersec(a,b)
4. adshow(a)
5. adshow(b)
6. adshow(c)

Example 3

1. d = adreadgray('tplayer1.tif')
2. e = adreadgray('tplayer2.tif')
3. f = adreadgray('tplayer3.tif')
4. g = iaintersec(d,e,f)
5. adshow(d)
6. adshow(e)
7. adshow(f)
8. adshow(g)

Equation

See Also