function b = lmask(lanes,f)
% b = lmask(lanes,f)
%
% Creates a matrix of non-zero values for each lane
%
% On input:
%          lanes: lanes matrix of dimension # lanes by 8
%              f: image function (needed for dimension of mask)
%
% On output:
%              b: non-zero down lane extent
%
[m n] = size(f);
b = zeros(m,n);
[lm ln] = size(lanes);

for l1 = 1:lm
  cdif = lanes(l1,4)-lanes(l1,2);
  j1 = lanes(l1,2);
  for i1 = lanes(l1,1):lanes(l1,3)
    b(i1,j1) = 255;
    if abs(cdif)>0
	  j1 = j1+cdif/abs(cdif);
      cdif = cdif-cdif/abs(cdif);
    end
  end
end
