divide

[ XITE Reference Manual | XITE home ]

Name

divide - divide two images pixel by pixel

Syntax

 divide [-s <scale>] [-t <title>]
     <input1> <input2> <output>

Description

divide divides, pixel by pixel, for each pair of bands, input1 on input2, and multiplies with scale.

 output(x,y) = input1(x,y) / input2(x,y) * scale

If divisor is zero, we look at dividend. If dividend is zero, result is set to zero, otherwise result is set to "max".

All pixel types are accepted, as long as the two input images have the same pixel type for each pair of bands. The output image will be of the same type. Resulting values outside the domain of the actual pixel type is truncated to the nearest legal value.

Default <scale> value is 1.0. <title> is optional title of image. Default is "Image division".

See also

multiply(1), scale(1)

Restrictions

Only the largest rectangle common to each pair of bands in the two input images is divided.

Author

Tor Lønnestad, BLAB, Ifi, UiO

Examples

 divide mona1.img mona2.img monaDiv.img

Id

$Id: divide.c,v 1.34 1997/05/27 14:47:50 svein Exp $