Rotating an output image
1 view (last 30 days)
Show older comments
I have got a result for an image, and, when I compared the result to a ground truth, I noticed that the output is like a mirror to the groundtruth, such that, what is black in the ground truth in white in the output image, and vice versa.
Is there a way to `rotate` the output image or another solution? When I used `imrotate` it seems it just rotates them on a 2D scale, such that, when you insert `90 degrees` for example, it just rotates to right or left for example. but in my case, it seems I want the rotation to be performed in a circular manner. For example, if the face direction was to the front, I want it to be to the back, not to go right, left, up, or down,
Is there some function that can perform that in `matlab`?
Thanks.
0 Comments
Answers (1)
Image Analyst
on 22 May 2013
I don't know if you have an intensity inversion (gray scales are inverted so that black = white and vice versa), or if you have a rotated image, or a flipped image. So I'll show you how to invert the image
invertedImage = 255-originalImage; % for uint8 images.
and if you want to rotate or flip an image:
rotatedImage = imrotate(originalImage, 180);
flippedIMage = fliplr(originalImage); % Or can use flipud().
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!