function [cornerMap_dt,cornerStrength_dt,dt_time,cornerMap_dt_nms] = classifyDataSetAccordingToSegment(dataset, threshold, strengthMaps)
% Hassan Nahas
%This functions applies the segment detector to every image in a dataset. A
%strengthmap is generated and a threshold is used to control the number of
%corners detected.

%initialize containers
cornerMap_dt = cell(1, length(dataset));
cornerMap_dt_nms = cell(1, length(dataset));
cornerStrength_dt = cell(1, length(dataset));
if length(threshold) > 1
    thresholds = threshold;
else
    thresholds = ones(length(dataset),1)*threshold;
end
% thresholds
tic;
for i = 1 : length(dataset)

    
    if (isempty(strengthMaps))
        [ cornerStrength_dt{i} ] = cornerStrengthSegment( dataset{i}, 9 );
    else
        cornerStrength_dt{i} = strengthMaps{i};
    end
    
    
    cornerMap_dt{i} = classifyImageAccordingToSegment(dataset{i},thresholds(i),9,[]);
    
    [ cornerMap_dt_nms{i} ] = nonmaximalsuppression( cornerStrength_dt{i}.* cornerMap_dt{i});
    
end
dt_time = toc;
end

