quadratic

[ XITE Reference Manual | XITE home ]

Name

quadratic - quadratic geometric transform

Syntax

 quadratic [-ip <n>] [-bg <bg>] <inimage> <outimage> \\
     x0 .. x5 y0 .. y5
 quadratic [-ip <n>] [-bg <bg>] -f <datafile> \\
     <inimage> <outimage>

Description

quadratic performs a quadratic transform of the coordinate system (x, y) to another coordinate system (u,v) All coordinates are adjusted acording to (xstart, ystart).
 outimage (x,y) = inimage (u,v)
 u = x0 + x1 * x + x2 * y
   + x3 * x * x + x4 * x * y + x5 * y * y
 v = y0 + y1 * x + y2 * y
   + y3 * x * x + y4 * x * y + y5 * y * y

The interpolation method -ip is
 -ip 0 : Nearest neighbor
 -ip 1 : Bilinear   interpolation
         g(x) = bi(f(x), f(x+1), d)
         bi(x, y, d) = x(1-d) + yd
 -ip 3 ; Cubic      interpolation
         g(x) = cc(f(x-1), f(x), f(x+1), f(x+2), d)
         cc(x, y, z, v, d) = y + d((-x+z) +
                             d((2x-2y+z-v) + d(-x+y-z+v)))

The values x0 .. x5 and y0 .. y5 may be specified on the command line or in a datafile. The format on the datafile is
 # Lines with # or ; in pos 1 are treated as comments
 x0 x1 x2 x3 x4 x5
 y0 y1 y2 y3 y4 y5
All matrix of size n x 2 (n >= 6) will be accepted. If n > 6 only element 0..5 will be used.

Default is bilinear interpolation (-ip 1)

If the output image should have another size or startpoint than the input image this may be specified by the -xstart, -xstop, -xsize, -ystart, -ystop and -ysize switch. If start, stop as well as size switches are given, and inconsistently, the stop switch is ignored. The given sizes are clipped against the result of the transform.
 -bg is used to specify the background pixel value,
     default = 0.

Restrictions

inimage must have bands with pixel type unsigned byte.

Reference

Wayne Niblack. Digital Image Processing, p 131-150

See also

quadratic(3), affine(1), rotate(1), reorganize(1), shift_img(1), transpose_img(1), warp(1)

Author

Otto Milvang

Examples

 quadratic mona.img monarot.img  30 .5 .714 -40 -.0714 .5

Id

$Id: quadratic.c,v 1.30 1997/05/29 16:33:19 svein Exp $