We first note that rotating the input image
by an angle
is equivalent to rotating the output image
by an
angle
. For each pixel position
of the output
we find the corresponding position in the input
:
 |
(25) |
This rotation is with respect to the origin of the image, the
top left corner of the image. If we want the rotation to be
around the center
of an image of size
, then
![$\displaystyle \left\{ \begin{array}{l}
p=[\;\;\;\cos\,\phi\; (k-x_0)+\sin\,\phi...
...+x_0 \\
q=[-\sin\,\phi\; (k-x_0)+\cos\,\phi\; (l-y_0)]+y_0
\end{array} \right.$](img63.svg) |
(26) |
Next we find the interpolation value
for each
pixel
of the output image using the same bilinear
interpolation method as in the arbitrary scaling discussed
above. Note that some pixels in the image after the rotation
may be outside the original image before the rotation, they
can be arbitrarily assigned with any color, such as black.