
function cMinSupport = BuildMinimumSupportTest(options);
%the support of the minimum are those pixels wich are within .5 of the appropriate line (L1)
for i = 1:options.NOrientations
   cMinSupport{i} = zeros(options.CellSupportSize);
   o(i) = (pi * (i-1)) / options.NOrientations - 1 * pi/2;
   u = [sin(-o(i)),cos(-o(i))];
   u = u / norm(u);
   o(i) = mod(o(i),pi);
   if not((o(i) < (pi/4)) || (o(i) > (3*pi/4)))  % for all x find one best y
     for x = 1:options.CellSupportSize 
        x2 = x - options.CellSupportSize / 2 - .5;  
        for y = 1:options.CellSupportSize 
           y2 = y - options.CellSupportSize / 2 - .5;  
   	   r = [y2, x2];
           d(y) = abs(r * u');
	end
	[m_dy,mi_dy] = min(d);
        cMinSupport{i}(mi_dy,x) = 1;
     end   
   else % for all y, find one best x
     for y = 1:options.CellSupportSize 
        y2 = y - options.CellSupportSize / 2 - .5;  
        for x = 1:options.CellSupportSize 
           x2 = x - options.CellSupportSize / 2 - .5;  
   	   r = [y2, x2];
           d(x) = abs(r * u');
	end
	[m_dx,mi_dx] = min(d);
        cMinSupport{i}(y,mi_dx) = 1;
     end   
   end
%   for x = 1:options.CellSupportSize 
%      for y = 1:options.CellSupportSize
%        x2 = x - options.CellSupportSize / 2 - .5;  
%        y2 = y - options.CellSupportSize / 2 - .5;  
%        r = [y2, x2];
% 	d = abs(r * u');
% 	if(d < .4)
% 	  cMinSupport{i}(x,y) = 1;
% 	end
%      end
%   end
end 
     
   