x,y coordinate transformation when image is rotated by 90 degrees

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

x,y coordinate transformation when image is rotated by 90 degrees

Post by manit »

i have 512x512 image whose SIFT descriptors I had found.
Now i rotated image by 90 degree using
convert src.jpg -rotate 90 dest.jpg
what will be new coordinates of point x,y of src.jpg ?
I require this so that I can see SIFT descriptor change between correspondences in src.jpg and dest.jpg .

Thanks.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: x,y coordinate transformation when image is rotated by 90 degrees

Post by snibgo »

If we rotate an image of height (h) 90 degrees clockwise, a pixel that was at (x,y) will be in new location (x',y') where:

x' = h - 1 - y
y' = x
snibgo's IM pages: im.snibgo.com
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Re: x,y coordinate transformation when image is rotated by 90 degrees

Post by manit »

okay.
Thanks.
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Re: x,y coordinate transformation when image is rotated by 90 degrees

Post by manit »

verified it.
it works.
Post Reply