[mmaddm] [Up] [mmsubm] Operations

mmintersec
Intersection of images.

Synopsis

y = mmintersec ( f1 , f2 , f3 = Null, f4 = Null, f5 = Null )

Input

f1 Image Gray-scale (uint8 or uint16) or binary image

f2 Image Gray-scale (uint8 or uint16) or binary image

Or constant.

f3 Image Gray-scale (uint8 or uint16) or binary image

Or constant.

Default: Null

f4 Image Gray-scale (uint8 or uint16) or binary image

Or constant.

Default: Null

f5 Image Gray-scale (uint8 or uint16) or binary image

Or constant.

Default: Null

Output

y Image

Description

mmintersec 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

Numerical example:
f=uint8([255,  255,    0,   10,    0,   255,   250])
g=uint8([ 0,    40,   80,   140,  250,    10,    30])
print mmintersec(f, g)
[ 0 40  0 10  0 10 30]
print mmintersec(f, 0)
Warning: upcasting image from scalar to uint8
[0 0 0 0 0 0 0]
Binary image:
a = mmreadgray('form-ok.tif')
b = mmreadgray('form-1.tif')
c = mmintersec(a,b)
mmshow(a)
mmshow(b)
mmshow(c)
a b
c
Gray scale image:
d = mmreadgray('tplayer1.tif')
e = mmreadgray('tplayer2.tif')
f = mmreadgray('tplayer3.tif')
g = mmintersec(d,e,f)
mmshow(d)
mmshow(e)
mmshow(f)
mmshow(g)
d e f
g

Equation

intersection:
generalized intersection:

See also

mmfreedom Control automatic data type conversion.
mmunion Union of images.
[mmaddm] [Up] [mmsubm]