MATLAB Answers

0

how can I rotate an image about an arbitrary point in that image

Asked by Robert Gengelbach on 8 May 2018 at 15:57
Latest activity Answered by Srinath Tankasala on 18 May 2018 at 16:05

how can I rotate an image about an arbitrary point in that image

  1 Comment

Sign in to comment.

1 Answer

Answer by Srinath Tankasala on 18 May 2018 at 16:05
 Accepted Answer

The ability to rotate an image around a point is not available directly in MATLAB.

However, to work around this issue, rotating an image around a point is possible by first zero-padding the image (calculating how many rows and columns to pad to create a "virtual center"), rotating around its center (using "imrotate"), and then cropping to remove the initial padding ("un-pad" the image).

There is a File exchange submission that performs this rotation using the above methodology.

Download this file and add it to MATLAB's path before use. The provided example in the function's help documentation works fine:

imshow(rotateAround(imread('eight.tif'), 1, 1, 10));

  0 Comments

Sign in to comment.


Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today