

Ia=imread('seta.bmp');

Ia=imresize(Ia,0.5,'nearest'); 

Ib=(double(Ia(:,:,1))>nivel).*(double(Ia(:,:,2))>nivel).*(double(Ia(:,:,3))>nivel);
   Ib=~Ib;
   Icentro_1 = bwmorph(Ib,'shrink',inf);
   Icentro_2 = bwmorph(Ib,'erode',5);
   Icentro_21 = bwmorph(Icentro_2,'shrink',inf);
   %I_final = double(Icentro_21)+double(Icentro_1);
   [ponto1_y,ponto1_x] = find(Icentro_21);
   [ponto2_y,ponto2_x] = find(Icentro_1);
   
