note | The No_Clip keyword prevents underflow or overflow conditions from occurring. |
Operation | Operands Required | Operation Performed |
---|---|---|
'+' | 2 | image + operand, (addition) |
'-' | 2 | image – operand, (subtraction) |
'*' | 2 | image x operand, (multiplication) |
'/' | 2 | image ÷ operand, (division) |
'#' | 2 | [image] x [operand], (matrix multiplication) |
'^' | 2 | (image)operand , (exponentiation) |
'<' | 2 | comparison of image and operand to find minimum |
'>' | 2 | comparison of image and operand to find maximum |
'AND' | 2 | image AND operand, (Boolean AND) |
'MOD' | 2 | image MOD operand, (modulo operator) |
'NOT' | 1 | compliment of image, (Boolean compliment) |
'OR' | 2 | image OR operand, (Boolean inclusive OR) |
'XOR' | 2 | image XOR operand, (Boolean exclusive OR) |
operation | Operands Required | Operation Performed |
---|---|---|
'ABS' | 1 | | image |, (absolute value) |
'ALOG' | 1 | ln image, (natural logarithm) |
'ALOG10' | 1 | log10 image, (logarithm to base 10) |
'COS' | 1 | cos(image), (cosine) |
'EXP' | 1 | eimage , (natural exponential function) |
'MAX' | 1 | maximum value of image |
'MEDIAN' | 1 | statistical median of the image values |
'MIN' | 1 | minimum value of image |
'MODE' | 1 | statistical mode of image |
'RANGE' | 1 | range of values in image |
'SIN' | 1 | sin(image), (sine) |
'SQRT' | 1 | (image)1/2 , (square root) |
'STDEV' | 1 | statistical standard deviation of image |
'TAN' | 1 | tan(image), (tangent) |
'VARIANCE' | 1 | statistical variance of image |
image = BYTARR(512,512)
OPENR, unit, !Data_Dir + 'mandril.img', /Stream, /Get_Lun
READU, unit, image
CLOSE, 1
FREE_LUN, unit
mask = BYTARR(512, 512)
mask(100:300, 250:300) = 255
result = IPMATH(image, 'AND', mask)
TVSCL, result
result = IPMATH(image, '+', 50, /No_Clip)
TVSCL, result
background = IMAGE_READ(!IP_Data + 'frame.tif')
result1 = IPMATH(image1, '-', background('pixels'), $
/Zero_Negatives)
result2 = IPMATH(image2, '-', background('pixels'), $
/Zero_Negatives)
result3 = IPMATH(image3, '-', background('pixels'), $
/Zero_Negatives)
; Display each image to see the object without the background.
TVSCL, result1
TVSCL, result2
TVSCL, result3
image = IMAGE_READ(!IP_Data + 'boulder_image.tif')
red_image = IPMATH(image('pixels'), '+', 10, Plane_Num = 0, $
Intleave = 'image')
; Display the “tinted” image.
TV, red_image, True = 3