%  A = not_an_edge(DoG,row,col,R)
%  computes the hessian to determine whether or not row,col is along 
%  an edge. 
%  row >= 2 
%  col >= 2
%  row <= size(DoG,1)
function A = not_an_edge(DoG, row, col, R)

  patch = DoG([row-1:row+1],[col-1:col+1]);

  dXdX = mean(diff(patch,2,2));
  dYdY = mean(diff(patch,2,1));
  dXdY = mean(mean(diff(diff(patch,1,1),1,2)));
  H = [dXdX dXdY; dXdY dYdY];
  


  A = 0;
  [v d] = eig(H);
  eigval=diag(d);
  if eigval(1) ~= 0 && eigval(2) ~= 0 && det(H) > 0 ...
	&&  eigval(1)/eigval(2) < R,
      A = 1;
  end;

%    if (det(H) < 0)
%      A = 0;
%    else
%      A = ((trace(H).^2/det(H)) < ((R + 1)^2)/R);
%    end
