Rotating an output image
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Image Analyst
2013-5-22
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().
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!