function [F, S, C, h] = Dog(sigma, epsilon)

h = floor(sigma*2+.5);  % the half size
w = h+h-1; % size of filter
F = zeros(w); % the filter 
S = zeros(w); % symbol of filter
r = .9; s = 1.; % the sizes of center and sorround 

for i = 1:w
  for j = 1:w
    x = (i-h)/sigma;
    y = (j-h)/sigma;    % scale x and y
    F(i, j) = G(x, r)*G(y, r) - G(x, s)*G(y, s);
    a = sqrt(x*x+y*y); 
    if ((a<=.6)&&(a>=.4)) 
         S(i, j) = 1.;       % a circle 
    end
  end
end

F = F - mean(F(:)); 
t = F(:); 
F = F/sqrt(sum(t.*t));  % normalize to have norm 1
   
h = h-1; 
A = zeros(2*(h+h)+1);   
A((h+1):(h+2*h+1), (h+1):(h+2*h+1)) = F; 
T = filter2(F, A, 'same');
C = ((T.*T)<epsilon)*1.; 











