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

3 Ansichten (letzte 30 Tage)
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.

Akzeptierte Antwort

Image Analyst
Image Analyst am 16 Jun. 2018
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.
  1 Kommentar
Ashkan sed
Ashkan sed am 19 Jun. 2018
Many thanks for your answer. Actually when I want to use imrotate() in 'loose' method, image would not be displayed. I can't use 'crop' method due to the reason that I want to rotate selected part of image without any cropping. I would be grateful if you could help me with that.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

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