function [R]=harrisn (I)

% clear all
% clc
%  I=imread('e.png');
%  I=uint8(I);
%  I=rgb2gray(I);

%%%%%%%%%%%%%%%%%%%%%%%%%%

I=uint8(conv2(I,fspecial('average',5)));


blizkost=400070;%370 -pro e    %%vzdalenost minimalni a maximalni lampdy
prah=5;%80 min pro e

R=zeros(size(I,1),size(I,2));
 for i=1:size(I,1)
     for j=1:size(I,2)
         if(size(I,1)<=i+1)continue;end
         if(size(I,2)<=j+1)continue;end
         Ix=I(i+1,j)-I(i,j);
         Iy=I(i,j+1)-I(i,j);
         f=Ix*Iy;
         Ixx=Ix^2;
         Iyy=Iy^2;
         f=[Ixx,f;f,Iyy];
         f=double(f);
         f=eig(f);
         f=abs(f);
         f=sort(f);
         if(f(1)>prah)
             if((f(1)+blizkost)>f(2))
               % R(i,j)=min(f(:));
                R(i,j)=255;
             end
         end
     end
 end
 
 
 
 
%%%% imshow(R,[])
 
 %%zobrazeni
%  f=zeros(size(I,1),size(I,2),3);
%  f(:,:,1)=R;
%  f(:,:,2)=R;
%  f(:,:,3)=I;
%  imshow(f);
 
