How to rotate an image about a corner point?

Asked by teamxaviers xie on 4 Aug 2012
Latest activity Answered by teamxaviers xie on 9 Aug 2012
           We have an image in rectangular shape which is tilted.We have found the corner points and now we want to rotate the rectangular image about one of its corner points.We want the image in horizontal position.Thank you in advance... 

0 Comments

teamxaviers xie

Products

No products are associated with this question.

2 Answers

Answer by venkat vasu on 4 Aug 2012

help imrotate B = imrotate(A,ANGLE) rotates image A by ANGLE degrees in a counterclockwise direction around its center point. To rotate the image clockwise, specify a negative value for ANGLE. imrotate makes the output image B large enough to contain the entire rotated image. imrotate uses nearest neighbor interpolation, setting the values of pixels in B that are outside the rotated image to 0 (zero).

 Example
    -------
         % This example brings image I into horizontal alignment by
         % rotating the image by -1 degree.
         I = fitsread('solarspectra.fts');
         I = mat2gray(I);
         J = imrotate(I,-1,'bilinear','crop');
         figure, imshow(I), figure, imshow(J)

0 Comments

venkat vasu
Answer by teamxaviers xie on 9 Aug 2012

Thanks for your code...,but the problem is that we have a rectangular tilted object in the image which is to be made horizontal. The imrotate rotates the image about the centre point,we want the object rotated about one of its corner point.We have the corner points of the object...

0 Comments

teamxaviers xie

Contact us