quadratic

[ XITE Reference Manual | XITE home ]

Name

quadratic - quadratic geometric transform

Syntax

 #include <xite/geometry.h>

 int quadratic( IBAND inband, IBAND outband,
    double* xa, double* ya, int ip, int bg );

Description

quadratic performs a quadratic transformation of the coordinate system (x, y) to another coordinate system (u,v)

All coordinates are adjusted acording to (xstart, ystart).
 outband(x,y) = inband(u,v)
 u = xa[0] + xa[1] * x + xa[2] * y
   + xa[3] * x * x + xa[4] * x * y + xa[5] * y * y
 v = ya[0] + ya[1] * x + ya[2] * y
   + ya[3] * x * x + ya[4] * x * y + ya[5] * y * y

The interpolation method ip is
  0 : Nearest neighbor
  1 : Bilinear   interpolation
      g(x) = bi(f(x), f(x+1), d)
      bi(x, y, d) = x(1-d) + yd
  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 bg parameter specifies the background pixel value.

Restrictions

inband and outband must have pixel type unsigned byte.

Return value

 0 : Ok
 1 : Bad input or output pixel type

Reference

Wayne Niblack. Digital Image Processing, p 131-150

See also

quadratic(1), affine(3), rotate(3), shift_band(3), transpose_band(3)

Author

Otto Milvang

Examples

Id

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