function [ cornerStrength ] = cornerStrengthTree( img, tree )
% Hassan Nahas
%This function calculates the maximum threshold for corner detection 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 = classifyImageAccordingToTree( tree,img,threshold,pixelsToIgnore );
        cornerStrength(cornerMap == 1) = threshold;
        
        previousThreshold = threshold;
%         i = i + 1;
%         imagesc(cornerMap);
    end
%     allF = extractFe
end

