%Sarah Meshreqy
%tests the functionality of the non maximal supression
n = 12;
% TODO: Provide Images
root = 'box/';
frame_0 = readpng(strcat(root,'frames/frame_0.png'));
frame_1 = readpng(strcat(root,'frames/frame_1.png'));
frame_2 = readpng(strcat(root,'frames/frame_2.png'));
warp0_1 = imread(strcat(root,'pngwarps/warp_0_1.png'));
%I1=readpng('frame_0.png');

%     %Test Pixel-by-Pixel Decision Tree
%     tic;
%     [ cornerStrength_dt ] = cornerStrengthTree( frame_1, Tree );
%     [ cornerMap_dt ] = nonmaximalsuppression( cornerStrength_dt );
%     dt_time = toc;
% 
%     %Test Pixel-by-Pixel Segment Criterion Test
%     tic;
%     [ cornerStrength_st ] = cornerStrengthSegment( frame_1, n );
%     [ cornerMap_st ] = nonmaximalsuppression( cornerStrength_st );
%     %corners_st{i} = classifyImageAccordingToSegment(dataset{i},threshold,n );
%     fullsegmentTime = toc;
srcFiles = dir('/Users/sarahhenry/Desktop/Project/Datasets/box/frames/*.png');  % the folder in which ur images exists
dataset = cell(1, length(srcFiles));
cornerStrength_dt = cell(1, length(srcFiles));
cornerMap_dt = cell(1, length(srcFiles));

cornerStrength_st = cell(1, length(srcFiles));
cornerMap_st = cell(1, length(srcFiles));

%Loop for loading images and getting corners st and dt
for i = 1 : length(srcFiles)
    filename = strcat('/Users/sarahhenry/Desktop/Project/Datasets/box/frames/',srcFiles(i).name);  
    dataset{i} = readpng(strcat(filename));
    
    %Test Pixel-by-Pixel Decision Tree
    tic;
    [ cornerStrength_dt{i} ] = cornerStrengthTree( dataset{i}, Tree );
    [ cornerMap_dt{i} ] = nonmaximalsuppression( cornerStrength_dt{i} );
    %corners_dt{i} = classifyImageAccordingToTree( Tree,dataset{i},threshold );
    dt_time = toc;

    %Test Pixel-by-Pixel Segment Criterion Test
    tic;
    [ cornerStrength_st{i} ] = cornerStrengthSegment( dataset{i}, n );
    [ cornerMap_st{i} ] = nonmaximalsuppression( cornerStrength_st{i} );
    %corners_st{i} = classifyImageAccordingToSegment(dataset{i},threshold,n );
    fullsegmentTime = toc;
end


