function [out]=convolution(In,maska)

out=zeros(size(In,1),size(In,2));

maska_x=floor(size(maska,1)/2);

maska_y=floor(size(maska,2)/2);

for i=maska_x+1:size(In,1)-maska_x
     for j=maska_y+1:size(In,2)-maska_y
         
           sum=0;
           k=1;
           for a= -1*maska_x:maska_x
               l=1;
               for b=-1*maska_y:maska_y
                   po=maska(k,l);
                   pom=double(In(i+a,j+b));
                   cit=pom*po;
                   sum=sum+(cit);
                   l=l+1;
               end
               k=k+1;
           end
           out(i,j)=sum;
     end
end

 