Click to See Complete Forum and Search --> : image processing


ananthi
December 13th, 2005, 03:01 AM
hi
Help me in this....i am now trying a code in c..for rotating an image.......i m getting the output different for different angles..i.e. if the angle is 90 degree it is rotating at some other angle....i m using themathematical:
x1 = (x0-center_x) * cos(angle) + (y0-center_y) * sin(angle) + center_x
y1 = -(x0-center_x)* sin(angle) + (y0-center_y) * cos(angle) + center_y

Yves M
December 13th, 2005, 04:59 AM
[ moved thread to more appropriate forum ]

Yves M
December 13th, 2005, 05:02 AM
The angles should probably be in radian units. Then 90 degrees is Pi/2, 180 degrees is Pi (3.1415...) etc.

RoboTact
January 2nd, 2006, 07:02 PM
And if it's image, you can't just move pixels to arbitrary positions, you need to consider algorithm to concurrently apply pixels to surrounding pixels.