Raport Tehnic Tanase Marian
Raport Tehnic Tanase Marian
Raport Tehnic Tanase Marian
ABSTRACT
Image rotation is a common image processing routine with applications in matching,
alignment, and other image-based algorithms. The input to an image rotation routine is an image,
the rotation angle θ, and a point about which rotation is done. It is most commonly used to improve
the visual appearance of an image. An image can be the subject of a perspective irregularity wherein
the position of the camera with respect to the scene alters the apparent dimensions of the scene
geometry.
The algorithm was implementend in C#, with Microsot Visual Studio. The developing of the
app was done using EMGU.CV. The basic algorithm that we used is simple and efficient. We
assume that the rotation angle is a part of our input. Furthermore, for simplicity of argument we
assume that the document is rotated in a counter-clockwise way. Rotation in the opposite direction
can be dealt within a symmetric manner. Based on some equations, we calculate the sine and cosine
value of the specific number, then also we compute the corresponting values for the rotated image.
Afterwards there it should take place the rotation transformation of the image and in the end we will
display the original and the transformed resulting image.
As a major advantage, we can say that the algorithm works safely in any conditions because
we started to compute our coordinates using the center of our input images. Therefore, our results
would not be damaged in any way by the working process.
INTRODUCTION
Rotation can be useful as a preprocessor in applications where directional operators are
involved. Applying this transformation to a uniformly distorted image can correct for a range of
perspective distortions by transforming the measurements from the ideal coordinates to those
actually used. For example, this is useful in satellite imaging where geometrically correct ground
maps are desired.
We implemented image rotation algorithm using a set of final equations which were obtained
from a specific rotation matrix. The result will be a rotation of a certain image by a given angle
established by the user.
MATHEMATICAL APPROACH
The rotation algorithm performs a geometric transform which maps the position (𝑥1 , 𝑦1 ) of
a picture element in an input image onto a position (𝑥2 , 𝑦2 ) in an output image by rotating it through
a user-specified angle 𝜃 about an origin 0. In most implementations, output locations (𝑥2 , 𝑦2 ) which
are outside the boundary of the image are ignored.
The transformation has the form:
𝑥𝑗 1 −𝑡𝑎𝑛(𝜃/2) 1 0 1 −𝑡𝑎𝑛(𝜃/2) 𝑢𝑝
[𝑦 ]=[ ][ ][ ] [𝑣 ]
𝑘 0 1 sin(𝜃) 1 0 1 𝑞
Where:
(𝑥0 , 𝑦0 ) are the coordinates of the center of rotation in the input image.
x1 and y1 are the original coordinates
x2 and y2 are the new coordinates
𝜃 is the angle of rotation with clockwise rotations having positive angles.
We are working in image coordinates, so the y axis goes downward, but similar rotation
formula can be defined for when the y axis goes upward.