function N=neigh(r1,r2)
% neigh	Create an neighborhood descriptor for a neighborhood with
%	radius r: 
%		N=neigh(r)
%	Alternatively, create a elliptic neighborhood, with vertical
%	radius r1 and horizontal radius r2:
%		N=neigh(r1,r2)
%	The description will not be symmetric.
%
%	Se also: symmetric_ext, unpack_param

if nargin<2,
  r2=r1;
end

N=[0;0];
for i=-r1:r1,
  for j=-r2:0,
    if ~((i>0 & j==0) | (i==0 & j==0) | ((sqrt(i^2/r1^2+j^2/r2^2) > 1))),
      N=[N [i;j]];
    end
  end
end
N=N(:,2:size(N,2));