1IM_LITECOR(3)              Library Functions Manual              IM_LITECOR(3)
2
3
4

NAME

6       im_litecor - perform light correction
7

SYNOPSIS

9       #include <vips/vips.h>
10
11       int im_litecor(in, white, out, clip, factor)
12       IMAGE *in, *out;
13       int clip;
14       double factor;
15

DESCRIPTION

17       im_litecor(3)  performs light correction on the image held by the IMAGE
18       descriptor in, with respect to a reference  white  image  held  by  the
19       IMAGE  descriptor white.  The result is written onto the IMAGE descrip‐
20       tor out.  The function works on byte one channel images only.
21
22       The flag clip can take two values 0 and 1.  If clip is 1 then the input
23       is  corrected  with  reference  to the maximum value of white (maxw) as
24       follows.
25
26        pel_out = factor * pel_in * maxw / pel_white.
27
28       If clip is 0 then the output is scaled with the maximum possible output
29       set  to  255.   In this case factor is not used but it must be set to a
30       dummy value.
31
32       The basic reason for lighting correction is that the input  frame  does
33       not  have  a  uniform  distribution  of  white light due to the optical
34       response of the lens.  The function accepts a white image  which  is  a
35       simple  multiple of the input image in size; for example it is possible
36       that the white is a subsampled version of in; however the sizes  of  in
37       must  be an exact multiple of the white.  If clip is set to 0, lighting
38       correction is carried out and the result is scaled between 0  and  255.
39       This can be used to correct individual frames.
40
41       If multiband images are grabbed, then flag should be set to 1, since no
42       scaling must be done.  In this case the factor can reduce the number of
43       clipped pels if overshooting occurs in the brightest band.  The program
44       prints the number of clipped pels with im_warning(3).
45

RETURN VALUE

47       The function returns 0 on success and -1 on error.
48

BUGS

50       clip==0 case not working too well.
51

SEE ALSO

53       im_add(3), im_lintra(3), im_multiply(3).
54
56       N. Dessipris
57

AUTHOR

59       N. Dessipris - 05/12/1991
60
61
62
63                                5 December 1991                  IM_LITECOR(3)
Impressum