% Checks if a certain block has an adjacent CLASSIFIED neighbor
% Returns 1 if block has classified neighbor

function Result = checkAdjNeighbor(x,y,CI)
[a,b,c]=size(CI);


   Result=0;

if ((x+1)<=a)
   if (CI(x+1,y,2)~=4)
      Result=1;
   end
end

if ((y+1)<=b)
   if (CI(x,y+1,2)~=4)
      Result=1;
   end
end

if ((x-1)>=1)
   if (CI(x-1,y,2)~=4);
      Result=1;
   end
end

if ((y-1)>=1)
   if (CI(x,y-1,2)~=4)
      Result=1;
   end
end


