Name
fproj affine or projective mapping using interpolation
Command Synopsis
fproj [-x sx] [-y sy] [-b bg] [-o o] [-p p] [-i] in out X1 Y1 X2 Y2 X3 Y3 [x4 y4 ]
-x sx : x-size of output image, default 512
-y sy : y-size of output image, default 512
-b bg : background grey value, default: 0.0
-o o : order: 0,1=linear,-3=cubic,3,5..11=spline, default 3
-p p : Keys' parameter (when o=-3), in [-1,0], default -0.5
-i : compute inverse transform
in : input Fimage
out : output Fimage
X1 : upleft corner
Y1 : upleft corner
X2 : upright corner
Y2 : upright corner
X3 : downleft corner
Y3 : downleft corner
x4 : downright corner (for projective transform)
y4 : downright corner (for projective transform)
Function Summary
void fproj (in , out , sx , sy , bg , o , p , i , X1 , Y1 , X2 , Y2 , X3 , Y3 , x4 , y4 )
Fimage in , out ;
int *sx , *sy , *o ;
char *i ;
float *bg , *p , X1 , Y1 , X2 , Y2 , X3 , Y3 , *x4 , *y4 ;
Description
This module applies an affine or a projective transformation to an image. The original (interpolated) image (x, y) u(x, y) is transformed into the image (x, y) v(x, y) = u(F(x, y)) where F is defined by its values on three (affine case) or four (projective case) points of the original image.
In the affine case, one has
F(x_{1}, y_{1}) | = | (0, 0) | |
F(x_{2}, y_{2}) | = | (sx, 0) | |
F(x_{3}, y_{3}) | = | (0, sy). |
In the projective case, one has
F(x_{1}, y_{1}) | = | (0, 0) | |
F(x_{2}, y_{2}) | = | (sx, 0) | |
F(x_{3}, y_{3}) | = | (0, sy) | |
F(x_{4}, y_{4}) | = | (sx, sy) |
The interpolation method is the same as the fcrop
module.
However, for generic transforms the separability of the interpolation
functions cannot be used, which results in a much slower algorithm.
Hence, whenever it is possible (extraction of a rectangular region with
vertical and horizontal sides) it is better to use the fcrop
module (up to 10 times faster) instead.
The -i
option performs the (approximate) inverse transform.
NB : calling this module with out=in is not possible
See Also
fzrt.
Version 2.0
Last Modification date : Thu Nov 29 20:23:56 2001
Author
Lionel Moisan