%Ben Graf  &  Michael Victory
%created: 12/12/99
%updated: 
%filename: /mvictory/elec301/scan.m

function aye=scan(bigpic)

threshold=200;
rc=size(bigpic);

%%%This method didn't work to grand... %%%
%for r=1:rc(1)
%  for c=1:rc(2)
%    if (bigpic(r,c) > threshold)
%      startpoint=[r,c];
%      break;
%      break;
%    end;
%  end;
%end;

% finds the top corner
r=0;
Found=0;
while ( (r<=rc(1)-1) & (~Found) )
  r=r+1;
  c=0;
  while ((c<=rc(2)-1) & (~Found))
     c=c+1;
     if (bigpic(r,c) > threshold)
       startpoint=[r,c];
       Found=1;
     end;
  end;
end;

%startpoint

if (startpoint(1) < 5)
  top=0;
else 
  top=startpoint(1)-5;
end;

% now we slide down the topleft edge of the card
% to find the left corner
left=findleft(bigpic,startpoint);
if (left < 5)
  left=0;
else 
  left=left-5;
end;

aye=[top,left];
%returns the top row we need and the leftmost column that we need






