% Created by Yuandong Tian, Oct. 5, 2009
% Email: yuandong@andrew.cmu.edu
% generate paper figure 9

init;
load warp.mat;
load synthesis_computed_200-260.mat;

tsel = 200:260;
xi = 7;
yi = 2;
xsel = blockx1(xi) : (blockx1(xi) + b.w - 1);
ysel = blocky1(yi) : (blocky1(yi) + b.h - 1);

%% show these patches
row1 = zeros(b.h, b.w*15);
row2 = zeros(b.h, b.w*15);
for i = 1:15
    index1 = 2*(i-1)+1;
    index2 = 30 + index1;
    
    row1(:, (i-1)*b.w+1:i*b.w) = frames(ysel, xsel, tsel(index1));
    row2(:, (i-1)*b.w+1:i*b.w) = frames(ysel, xsel, tsel(index2));
end;
figure;
subplot(2, 1, 1);
imshow(row1);
subplot(2, 1, 2);
imshow(row2);

%% generate figures
[reconImg] = extractPsShow(img, frames, tsel, blockx1, blocky1, deltapsReals1, b, warp, 7, 2);
