%  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)

  dxdx_kernel = [1 -2 1; 1 -2 1; 1 -2 1];
  dxdy_kernel = [1 0 -1; 0 0 0; -1 0 1];
  dydy_kernel = [1 1 1; -2 -2 -2; 1 1 1];
  
  patch = DoG([row-1:row+1],[col-1:col+1]);
  dXdX = mean(sum(patch.*dxdx_kernel,2));
  hxy = patch.*dxdy_kernel;
  dXdY = mean(hxy(:));
  dYdY = mean(sum(patch.*dydy_kernel,1));
  h = [dXdX dXdY; dXdY dYdY];

  H = h;
  A = ((trace(H).^2/det(H)) < ((R + 1)^2)/R);
