[mmaddm] [Up] [mmsubm] | Operations |
Implemented in Python.
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:
|
f4 | Image Gray-scale (uint8 or uint16) or binary image.
Or constant. Default:
|
f5 | Image Gray-scale (uint8 or uint16) or binary image.
Or constant. Default:
|
y | Image |
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.
>>> 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: Converting input image from int32 to uint8. [0 0 0 0 0 0 0]
>>> a = mmreadgray('form-ok.tif')
>>> b = mmreadgray('form-1.tif')
>>> c = mmintersec(a,b)
>>> mmshow(a)
>>> mmshow(b)
>>> mmshow(c)
![]() |
![]() |
|
a | b |
![]() |
|
c |
def mmintersec(f1, f2, f3=None, f4=None, f5=None): from Numeric import minimum y = minimum(f1,f2) if f3 != None: y = minimum(y,f3) if f4 != None: y = minimum(y,f4) if f5 != None: y = minimum(y,f5) y = y.astype(f1.typecode()) return y
[mmaddm] [Up] [mmsubm] | ![]() |
Copyright (c) 2003, Roberto A. Lotufo, UNICAMP-University of Campinas; Rubens C. Machado, CenPRA-Renato Archer Research Center. |