logarithm
[ XITE Reference Manual | XITE home ]
Name
logarithm, fftDisplay - Take logarithm of BIFF band (compress
dynamic range)
Syntax
#include <xite/arithmetic.h>
int logarithm( IBAND in_band, IBAND out_band,
double eps, double offset, double scale,
double minimum );
#include <xite/fft.h>
int fftDisplay( IBAND in_band, IBAND out_band,
double scale );
Description
Takes the logarithm of the magnitude of the pixelvalues of a
real or complex band according to the algorithm
out_pix = (log10(eps + |in_pix|) + offset) * scale
out_pix = (out_pix >= minimum) ? out_pix : minimum
This mapping will compress the dynamic range of an image and
make small pixelvalues better visible (e.g. used to display
Fourier transform magnitude).
eps equal to DOUBLE_MIN gives the default value
eps = 1 / (10 * xsize * ysize)
offset equal to DOUBLE_MAX gives the default value
offset = -log10(eps)
scale equal to 0.0 gives the default value 20.0.
minimum equal to DOUBLE_MAX gives the default value
-10.0 * scale.
For an integral output pixeltype, the resulting pixel-values
are rounded. The pixelvalues are limited to fit within the
range of the output pixeltype.
fftDisplay is retained for compatibility with previous XITE
versions. It is a macro call to logarithm with eps equal
to DOUBLE_MIN, offset equal to DOUBLE_MAX and minimum equal
to -DOUBLE_MAX. This will give the default values for eps and
offset mentioned above. The call to logarithm is followed
by a call to shift_band.
See also
logarithm(1), power(3), phase(3), real(3), imag(3),
absValue(3)
Restrictions
Input band may be any pixeltype, output may be double, real or
unsigned byte.
Return value
1 - bands have different xsize
2 - bands have different ysize
3 - out_band has wrong pixeltype
4 - in_band has unknown pixeltype
Author
Trond Sørensen (wrote fftDisplay).
Modified
Svein Bøe (added output pixeltype real and double, fixed bug
for input pixeltype real, added lots of more input pixeltypes)
when converting from fftDisplay to logarithm.
Id
$Id: logarithm.c,v 1.42 1997/05/27 14:44:03 svein Exp $