**Name**

**fcrop** image croping (with zoom) using interpolation

**Command Synopsis**

**fcrop** [-x *sx*] [-y *sy*] [-z *z*] [-b *bg*] [-o *o*] [-p *p*] *in* *out* *X1* *Y1* *X2* *Y2*

-xsx: force x-size of output image

-ysy: force y-size of output image

-zz: zoom factor (default 1.0)

-bbg: background grey value, default: 0.0

-oo: order: 0,1=linear,-3=cubic,3,5..11=spline, default 3

-pp: Keys' parameter (when o=-3), in [-1,0], default -0.5

in: input Fimage

out: output Fimage

X1: upleft corner

Y1: upleft corner

X2: downright corner

Y2: downright corner

**Function Summary**

Fimage fcrop (in , out , sx , sy , z , bg , o , p , X1 , Y1 , X2 , Y2 )

Fimage in , out ;

float *sx , *sy , *z , *p , *bg , X1 , Y1 , X2 , Y2 ;

int *o ;

**Description**

This module allows to extract a part of an image and to resize it to
the desired dimensions. This operation is realized using an
interpolation [TBU99][UAE91]
that can be chosen with the `-o`

option. The image is assumed
to be equal to a constant value *bg* (set with the `-b`

option)
outside its boundaries. Moreover, it is assumed that the image
has been sampled at the center of each pixel; that is, the value
*in*(*i*, *j*) corresponds to the exact value of the continuous image
at point
(*i* + 1/2, *j* + 1/2). The subpart of the original image that has
to be extracted is defined by the rectangle
(*X*1, *Y*1) - (*X*2, *Y*2). The user
can choose a magnification factor *z* (using `-z`

option),
which will set the output image dimensions by rounding to the nearest
integer the magnified input dimensions. Another possibility is to choose
the output dimensions *sx* and *sy* (using the `-x`

and `-y`

options); in that case, the magnification factor will be computed
accordingly. If only one output dimension is specified, then the other
one will be set in order to preserve the aspect ratio of the original
region.

`-o`

option (interpolation order) :

All interpolation schemes described below are separable, so they can
be applied separately on each coordinate. Direct interpolation of
a discrete set of value *u*_{k} is defined by

0: nearest-neighbor interpolation, which corresponds to direct interpolation with a B-spline of order 0,

(*x*) =

1: bilinear interpolation, which corresponds to direct interpolation with a B-spline of order 1,

(*x*) =

-3: direct interpolation with cubic Keys' function, defined by

(*x*) =

This function is `-p`

option. Its default value, -1/2,
ensures an approximation order equal to 3 (instead of 2 for other
values).

n=3,5,7,9,11: indirect interpolation
with the B-spline of order *n*

(*x*) : = *(*x*) = + *x* - *k*,

where
(`finvspline`

module.
Note that is of class

NB : calling this module with out=in is possible

**See Also**

`cccrop`, `fkview`, `fzoom`, `llview`.

**Version 1.0**

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

**Author**

Lionel Moisan