Next: frot Up: Reference Previous: fmaskrot   Contents   Index

#### fproj

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, y) = (ax + by + c, dx + ey + f ),

and the constants a, b, c, d, e, f are computed in order that
 F(x1, y1) = (0, 0) F(x2, y2) = (sx, 0) F(x3, y3) = (0, sy).

This means that the new image is extracted from the original one in a parallelogram domain.

In the projective case, one has

F(x, y) = ,,

and the constants a, b, c, d, e, f, g, h are computed in order that
 F(x1, y1) = (0, 0) F(x2, y2) = (sx, 0) F(x3, y3) = (0, sy) F(x4, y4) = (sx, sy)

This means that the new image is extracted from the original one in a quadrilateral domain.

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

fzrt.

Version 2.0

Last Modification date : Thu Nov 29 20:23:56 2001

Author

Lionel Moisan

Next: frot Up: Reference Previous: fmaskrot   Contents   Index
mw 2004-05-05