Skip to content

Instantly share code, notes, and snippets.

@ecmelkytz
Created January 8, 2014 20:15
Show Gist options
  • Save ecmelkytz/8323788 to your computer and use it in GitHub Desktop.
Save ecmelkytz/8323788 to your computer and use it in GitHub Desktop.
clc;
im=imread('zar.png');
resim=im;
t=graythresh(im);
im=imcomplement(im2bw(im,t));
say1=1;
say2=1;
l=bwlabel(im);
x=regionprops(l,'area');
bul=x(1).Area
for i=2:length(x)
if x(i).Area==bul
say1=say1+1;
elseif x(i).Area<bul
say2=say2+1;
end
end
imshow(resim)
title(['üste gelen zar:',num2str(say1)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment