Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Trouble with imrotate (not rotating)

Subject: Trouble with imrotate (not rotating)

From: Michael

Date: 11 Mar, 2013 20:43:05

Message: 1 of 2

Imrotate seems to be translating my image instead of rotating it. Here is the relavent portion of my code:

for r = 1:Full_Size
      
    theta = r; %theta in degrees

    imR = imrotate(imcand, theta); %Uses degrees {'nearest'}
    
    imC = imcrop(imR, rect);

    if (r == 1 || r == center || r == Full_Size)
        figure('Name', strcat('imcandTransformed r:', num2str(theta))); imshow(imC);
    end
end

I am trying to incrementally rotate the image to compare to the original, but the figures that are being displayed have been translated and not rotated. Note: I am using a selected rectangular portion of my original image. I have tried using "Rotate an image about a point"
by Jan Motl but have the same problem.
Anyone with insight here?

Subject: Trouble with imrotate (not rotating)

From: Image Analyst

Date: 12 Mar, 2013 01:48:05

Message: 2 of 2

If your cropping rectangle is not exactly in the center of the image, then of course it will look like the image was also translated.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us