function A = decompress_jpeg_to_greyscale_and_crop(l);

eval(sprintf('!djpeg -g v%03d.jpg > deleteme_deleteme.pgm',l))
A=loadpnm('deleteme_deleteme.pgm');
[M,N]=size(A);
A=A(1:2:M,:);
A=(A(:,1:2:N-1) + A(:,2:2:N))/2;
keyboard
whos
A=A(10+1:10+240,5+1:5+310);

