Filter löschen
Filter löschen

compute a pixel's location in original image given its location in the rotated image and the rotated angle--matlab

1 Ansicht (letzte 30 Tage)
There is an image called rI and a pixel p located at [px, py] in this image. The image rI is got by rI = imrotate(I, angle, 'bilinear', 'crop') where I is the original image and angle is the rotated angle. We also assume that the size of image I is [h, w] .
Now the problem is how can I get the location of pixel corresponding to p in image I ?

Antworten (1)

Image Analyst
Image Analyst am 23 Feb. 2014
It rotates about the center, right? So the new x and y = [cos(theta), sin(theta);-sin(theta), cos(theta)] * [oldx;oldy]. You have to figure out precisely where the center of rotation is. Not sure but it might be different (half a pixel, maybe) depending on whether the image has an odd number of rows and columns or an even number.
  1 Kommentar
zhang
zhang am 23 Feb. 2014
Thanks, according to the matlab document: "B = imrotate(A,angle) rotates image A by angle degrees in a counterclockwise direction around its center point.". Can you explain this equation a lit bit?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Geometric Transformation and Image Registration finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by