Reputation: 3588
I have used imrotate
function to rotate an image without using the 'crop'
argument and now after some processing I would like to imrotate back to have the original orientation and size. Is there a way to do that, maybe with other functions other than imrotate?
Upvotes: 1
Views: 990
Reputation: 1250
If the rotation angle is not a multiple of 90' - 0', 90', 180', ... , There is no way to rotate back and get the exact original image. The reason is that the rotation of an image is a non-linear transformation - see in mathworks-ref-imrotate. The rotation is performed using interpolation, where the default is "nearest". In your case theta=332' the transformation is non preserving.
So the answer is no.
Note: For theta = K*90' there is a linear transformation - 2X2 rotation matrix, and also you can use a combination of flip and transpose: easiest-way-to-transpose-an-image-rotate-by-90-degrees-using-opencv
Upvotes: 1