ldnormal(3)

LIBRARY ROUTINE
ldnormal - Normalize Data

LIBRARY CALL
#include "vinclude.h"
int
ldnormal ( image, minimum, maximum, norm_type, process_dir)
struct xvimage *image;
int    process_dir, norm_type;
float  minimum, maximum;

INPUT

image
    pointer to VIFF structure containing image data to be processed.

minimum
    minimum value of normalizeed data.

maximum
    maximum value of normalizeed data.

norm_type
    type of normalization to be performed. 0 indicates standard normalization by dividing the magnitude of each data point by the magnitude of the largest value. 1 indicates adjusting the magnitude by scaling and shifting it so that it fits into a specified range.

procdir
    process direction: 0 indicated vector oriented processing, 1 indicates band oriented processing.

OUTPUT

image
    pointer to VIFF structure containing image data after processing.

Return Value:
    1 on success, 0 on failure.

MODIFICATIONS

Jeremy Worley 22-Jul-90
    modifications made to call and declaration of dload_vector to conform to new character oriented definition.

Jeremy Worley 23-Jul-90
    changed normalize value to a min and max value so that normalize can take place on a range of values.

Jeremy Worley 06-Oct-90
    modifications to lcnormalize to correct for magnitude errors.

Jeremy Worley 22-Apr-91
    corrected a bug in the complex case due to vcabs() not being properly declared. also added the conventional normalization mode.

DESCRIPTION
Normalizes the magnitude of the input data. This often minimizes roundoff errors in future processing. When conventional normalization is selected (i.e. -t 0, which is the default), ldnormal scales the magnitude of the data by the magnitude of the largest value in the data set. In the alternate mode of operation (-t 1), ldnormal computes the scale factor to force the most positive value in the data record to be equal to the user selected value, and shifts it according to minimum value specified. The result is a signal that ranges from the minimum value specified to the maximum. The resulting image has only its "appearance" preserved.

In the second mode of operation described above, if the minimum value specified is less than zero and ldnormal is operating on a complex sequence, then it will reset the minimum value to 0. Furthermore, if the maximum value is negative, and it is operating on a complex sequence, the maximum will be reset to its absolute value.

In the default mode of operation, phase is not disturbed. This is not guaranteed if the scale and shift mode is enabled.

SEE ALSO
dnormal(1), intro(3), vipl(3), verror(3), vutils(3) ldscale (3), dspl (3)

RESTRICTIONS
Operates on real and complex data only.

AUTHOR
Jeremy Worley, Ramiro Jordan

COPYRIGHT
Copyright 1992, University of New Mexico. All rights reserved.