Skip to content

Instantly share code, notes, and snippets.

@ecmelkytz
Created January 8, 2014 20:13
Show Gist options
  • Save ecmelkytz/8323761 to your computer and use it in GitHub Desktop.
Save ecmelkytz/8323761 to your computer and use it in GitHub Desktop.
clear all;
clc;
im=imread('left_near.png');
t=graythresh(im);
im=im2bw(im,t);
[x,y]=size(im);
sol=im(1:x,1:y/2);
sag=im(1:x,y/2+1:y);
alan=regionprops(im,'area');
if(sum(sol(:))< sum(sag(:))) && alan(1).Area<20000
komut='uzakta saga git';
end
if(sum(sol(:))< sum(sag(:))) && alan(1).Area>20000
komut='yakında saga git';
end
if(sum(sol(:))> sum(sag(:))) && alan(1).Area<20000
komut='uzakta sola git';
end
if(sum(sol(:))> sum(sag(:))) && alan(1).Area>20000
komut='yakında sola git';
end
if(sum(sol(:))== sum(sag(:))) && alan(1).Area>20000
komut='yakında duz git';
end
imshow(im)
title(komut);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment