rotate

[ XITE Reference Manual | XITE home ]

Name

rotate - rotate an image

Syntax

 rotate [-ip n] [-bg <bg>] <inimage> <outimage> [-deg]
        <theta> <rx> <ry>

Description

rotate an image around global coordinates (rx, ry).

The input image is rotated around the point (rx, ry) in the global coordinate system. Thus, an image of size 25x25 with xstart=ystart=100 should have rx=ry=112 to be rotated around its center. If xstart=ystart=1, global coordinates equal local coordinates.

Restrictions

inimage must have bands with pixel type unsigned byte.

Options

-deg
theta is specified in degrees, default: radians.
 outimage (x,y) = inimage (u,v)
 u = cos(theta) *  x - sin(theta) *  y
   - cos(theta) * rx + sin(theta) * ry + rx
 v = sin(theta) *  x + cos(theta) *  y
   - sin(theta) * rx - cos(theta) * ry + ry

-ip n
The interpolation method, where n is one of

0
Nearest neighbor

1
Bilinear interpolation. This is the default.
     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)))

-bg bg
Specifies the background pixel value, default = 0.

Reference

Wayne Niblack. Digital Image Processing, p 131-150.

See also

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

Author

Otto Milvang

Examples

 rotate mona.img monarot.img -deg 30 256 256

Id

$Id: rotate.c,v 1.30 1997/06/03 13:49:51 svein Exp $