% Kaitlin Dennison
% CS232 Digital Image Processing
% Final Project

%{
Properties of the shreds...
 - random order
 - roughly vertical w/in a few degrees
 - may be flipped vertically
 - 100 strips per page
%}

close all
clear
clc
scores = zeros(20,4); %[score,total,longest,time]
listing = dir('training');
figure(); hold on
for i = 1:20
    test = listing(i+2).name;
    disp(test)
    shred_directory = ['training\',test,'\'];
    matFile = ['ground_truth\',test,'.mat'];
    [order,orientation,time,recovered_page] = assemble_shreds(shred_directory);
    [score,total,longest] = eval_order_v3(order,orientation,matFile);
    disp(['Time: ',num2str(time)]);
    scores(i,:) = [score,total,longest,time];
    imshow(recovered_page)
    imwrite(recovered_page,['results\',test,'.png'],'png');
end
hold off