%  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,eigen_vectorz] = not_an_edge(DoG, row, col, R, w)

  if (~exist('w')),
    w = 3;
  end;

  halfw = floor(w/2);

  patch = DoG([row-halfw:row+halfw],[col-halfw:col+halfw]);
  a = diff(patch,2,2);
  dXdX = mean(sum(a,2)/w);
  a = diff(patch,2,1);
  dYdY = mean(sum(a,1)/w);
  a = diff(diff(patch,1,1),1,2);
  dXdY = mean(a(:));
  H = [dXdX dXdY; dXdY dYdY];


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