function[repeatabilityMetric,Nrepeatedd,Nusefuld]=evaluateDataset(cornerMap_dt,warp,n)
% Hassan Nahas
%Sarah Meshreqy
%This function evaluates the dataset for repeatability by comparing every
%two possible pairs, using their corresponding warp and calculating the
%final repeatability over the whole dataset.
Nrepeatedd=zeros(length(cornerMap_dt),length(cornerMap_dt));
Nusefuld=zeros(length(cornerMap_dt),length(cornerMap_dt));
for i=1:length(cornerMap_dt)
   
    
    for j=1:length(cornerMap_dt)
    
        if ( j==i)
            continue;
        else
            %for z=1:length(srcFileswarp)
            
            [ Nrepeatedd(i,j),Nusefuld(i,j) ]=repeatibility(cornerMap_dt{i},cornerMap_dt{j},warp{i,j},n);
            %end
        end
        %[ Nrepeated, Nuseful ] = repeatibility(corners_dt0,corners_dt1,warp0_1 ) 
    end
    
end

OverallNrepeated = sum(sum(Nrepeatedd));
OverallNuseful = sum(sum(Nusefuld));

repeatabilityMetric = OverallNrepeated/OverallNuseful;
end