How can I make all pictures to vertically align?

조회 수: 2 (최근 30일)
Zara Khan
Zara Khan 2018년 9월 20일
댓글: Zara Khan 2018년 9월 20일
I am attaching my data set and code also. I want to correct all images orientation and want to make them all vertically align. I have tried this. But my code not going to be the general one. For few images I am not able to correct their orientation. Actually I want the fingers parts to be the upside.
if true
clc;
close all;
clear;
workspace;
folder = pwd;
% folder = pwd;
filepattern = fullfile(folder, '*.png');
srcFiles = dir(filepattern);
numImages = length(srcFiles);
for k = 1 : numImages
fullFileName = fullfile(folder, srcFiles(k).name);
a = imread(fullFileName);
bwimg =bwareafilt(~a, 1);
s=regionprops(bwimg,'Orientation');
theta = s.Orientation;
if theta>=0 && theta<90
phi=90-theta;
Y=imrotate(bwimg,phi);
else
phi=90+theta;
Y=imrotate(bwimg,-phi);
end
end
  댓글 수: 2
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 9월 20일
Do you want to rotate the complete image?
Zara Khan
Zara Khan 2018년 9월 20일
Yes. Will you able to help me ??please then

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by