function good = inrange(pix1, pix2, lower, upper);

% Assumes edge detection has already been done.
% Takes one component of the pix location (x or y) provided by edge
% detection and determines whether it is within the range for the object
% we're looking for.

diff=abs(pix1-pix2);

if (diff<=upper) & (diff>=lower)
   good=1;
else
   good=0;
end
