function bo = pass3(seg,lrr,lcr)
% bo = pass3(seg,lrr,lcr)
%    Puts box of height column radius and width row radius around each non-zero
%    element
[m n] = size(seg);
for ii = 1:m
  for jj = 1:n
    bo(ii,jj) = 0.0;
  end
end
count = 1;
for ii = 1:m
  for jj = 1:n
    if seg(ii,jj) > 0
      rradius = lrr(ii,jj);
      cradius = lcr(ii,jj);
      imin = max(round(ii-cradius),1);
      imax = min(round(ii+cradius),m);
      jmin = max(round(jj-rradius),1);
      jmax = min(round(jj+rradius),n);
      for j2 = jmin:jmax
        bo(imin,j2) = count;
        bo(imax,j2) = count;
      end
      for i2 = imin:imax
        bo(i2,jmin) = count;
        bo(i2,jmax) = count;
      end
      count = count+1;
    end
  end
end
