How it is possible to change all images orientation to same i.e. to vertical

3 views (last 30 days)
My folder consisting of 1000 binary images with different orientation. I want to make all of them to vertically align. How it will be possible through a single code ? Later I want to save all the vertically aligned images to a new folder. Note:few images are already in vertical orientation . I want to keep them as it is .
  2 Comments

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 21 Jun 2018
regionprops() is not needed. Simply use size(). Rotate if the image is wider than tall:
[rows, columns, numberOfColorChannels] = size(yourImage);
if columns > rows
yourImage= imrotate(yourImage, 90);
end
  8 Comments

Sign in to comment.

More Answers (1)

Matt J
Matt J on 21 Jun 2018
Use imrotate() with the Orientation angle given by regionprops().
  4 Comments
Matt J
Matt J on 21 Jun 2018
You loop through them and apply regionprops and imrotate to each one separately.

Sign in to comment.

Categories

Find more on Image Processing and Computer Vision in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!