signDiff

[ XITE Reference Manual | XITE home ]

Name

signDiff - signed difference between two images

Syntax

 signDiff <input1> <input2> <output>
        [-scale <f>] [-offset <r>]

Description

signDiff calulates the signed difference between two input images pixel by pixel:

 output = (input1 - input2)*scale + offset

For complex and double-complex bands, the result is

 output(x,y).re =
     (input1(x,y).re-input2(x,y).re)*scale + offset
 output(x,y).im =
     (input1(x,y).im-input2(x,y).im)*scale + offset

If the result is outside the pixeltype range, the result is truncated. Within the pixeltype range, the result is rounded to the nearest possible pixelvalue.

Default argument values:
 scale = 1.0
 offset = 0.0

Restrictions

Corresponding bands in each input image must be of the same type. Only the largest rectangle common to two corresponding bands is processed.

See also

signDiff(3), absDiff(1), addw(1), multiply(1), divide(1)

Author

Tor Lønnestad, BLAB, ifi, UiO

Revised

Svein Bøe, Ifi, UiO. Implemented for all pixel types, not only unsigned byte.

Examples

 signDiff mona1.img mona2.img monaDiff.img
 signDiff m1.img m2.img mdiff.img -scale 1.0 -offset 0

Id

$Id: signDiff.c,v 1.32 1997/05/27 12:36:39 svein Exp $