function out = threshold(a,t)
%  out = threshold(a,t)
%       Return thresholded image (set 255 if greater t)
%       a: input image
%       t: threshold
[m,n] = size(a);
out = zeros(m,n);
for ii = 1:m
  for jj = 1:n
    if a(ii,jj) > t
      out(ii,jj) = 255;
    end
  end
end
