function [ cornerStrength ] = cornerStrengthSegment( img, n )
% Hassan Nahas
%This function varies the threshold of the segment test to calculate the
%score for every pixel.
    thresholds = 0:5:255;
    cornerStrength = zeros(size(img,1),size(img,2));
%     i = 1;
    pixelsToIgnore = zeros(size(img,1),size(img,2));
    previousThreshold = -1;
    for threshold = thresholds
        pixelsToIgnore(cornerStrength < previousThreshold) = 1;
        if max(max(cornerStrength)) < previousThreshold
            continue
        end
        cornerMap = classifyImageAccordingToSegment(img,threshold,n,pixelsToIgnore);
        cornerStrength(cornerMap == 1) = threshold;
        
        
        previousThreshold = threshold;
%         i = i + 1;
%         imagesc(cornerMap);
    end
%     allF = extractFeatureVector(img,threshold);
%     allF = flatten(allF);
    

end

