lvdetilt(3)

LIBRARY ROUTINE
lvdetilt - Remove an illumination gradient from an image by subtracting a best-fit plane.

LIBRARY CALL
#include "vinclude.h"
int
lvdetilt(img1,img2,mflg,pflg)
struct xvimage *img1,*img2;
int  mflg, pflg;

INPUT

img1
    (struct xvimage) - input/output image structure

img2
    (struct xvimage) - gating mask image

mflg
    (int) - a flag set (equal 1) if gating image mask available

    The input images must be of the same data type and size.

OUTPUT

img1
    (struct xvimage) - holds the result of the detilt operation. The output data type is the same as the input data type.

MODIFICATIONS

John Rasure, Marcelo Teran, Ron E. Neher

Mon Jun 11 15:59:36 MDT 1990 Donna Koechner - updated to ghostwriter

Wed Mar 20 12:36:43 MET 1991 Jean Pierre Guerin - Fixed incorrect tilt center point calculation

26-Sep-91 Scott Wilson - Fixed undocumented change in the lib source (not recorded in vdetilt.prog) that had incorrect checks for the successful completion of the tilt computation routines. For the float case, success was incorrectly detected as failure, resulting in bogus error messages and premature termination of the routine.

DESCRIPTION
lvdetilt computes the best-fit plane for an image, and then subtracts that plane from the image to produce the output. This is very handy for correcting illumination gradients in a poorly digitized image. The pflg also removes the mean from the image, giving it zero-mean statistics.

The mask image must be of the same data type as the input images, and is used to gate the operation. A non-zero mask pixel enables the output pixel to contain the adjusted value. A zero mask pixel just transfers the value of the corresponding pixel in the input image to the output pixel.

img1 is the input image and img2 is the operation gating image. mflg should be set to one if the gating image is to be used. img1 is used for both the input xvimage structure and the output result xvimage structure. This is done to save space, but you must be careful not to overwrite important data.

The mask image must be the same size as the input images. The output image data type is the same as the input image data type. lvdetilt returns a value of one upon success and a zero on failure.

SEE ALSO
vdetilt(1), intro(3), vipl(3), verror(3), vutils(3) vgettilt(1), lvgettilt(3), vtilt(1), lvtilt(3)

RESTRICTIONS
lvdetilt will not work on BIT, transform or COMPLEX data storage types.

AUTHOR
Scott Wilson

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