% load a frame from the entrance77massave warped (un barrelldistort) sequence

function A=loadthis(l)

M=480;
N=640;

% separate data files
%A = eval(sprintf('loadraw(''entrance77massave_warped/data%d'',%d,%d)',...
%           l,M,N));

% single data file
myfidinteger = fopen('entrance77massave_warped/data');
fseek(myfidinteger,l*M*N,-1); % position l frames from beginning of file
[A, count]=fread(myfidinteger,M*N,'uchar');
A=reshape(A,N,M).';  % down columns transposes across rows

disp(sprintf('loadframe: about to load, downsample, and crop frame %d to 220 by 320',l));

A=A(1:2:M,1:2:N);  % blurry already so just downsample
A=A(6:235,1:320);  % crop off the NaNs (black at right got cropped by warp)

