MATLAB: Rotate a selected object in an image around a predefined point on Image

imageimage acquisitionimage analysisimage processingImage Processing Toolboximage segmentationrotation

I have defined my object with the below function.
imshow(I);
h = impoly;
M = ~h.createMask();
I(M) = 0;
As an example I have attached an image with rotated object inside. I would be grateful if you could help me with that. The rotation angle, center point and distance from the center point is defined previously.

Best Answer

You have to crop the image, use imcrop(). Then rotate using imrotate(). After that it's just geometry and pasting. See attached copy and paste demo.
Related Question