function [ corners ] = segmentCriterionFeatures( features,n )
% Hassan Nahas
%This function labels a feature vector according to the segment test
%criterion. 
    numOfConsequitiveBrightPixels = ones(1,size(features,2));
%     previousnumOfConsequitiveBrightPixels = zeros(size(img,1),size(img,2));
%     allF = extractFeatureVector(img,threshold);
%     onlyBrighter = allF > 0;
%     cleanSlate = zeros(size(img,1),size(img,2));
    for x = [1:16,1:16]
       
        previous = x -1;
        if (previous == 0)
           previous = 16; 
        end
        thisframe = features(x,:);
%         numOfConsequitiveBrightPixels = previousnumOfConsequitiveBrightPixels + thisframe;
%         numOfConsequitiveBrightPixels(numOfConsequitiveBrightPixels == previousnumOfConsequitiveBrightPixels) = 0;
        numOfConsequitiveBrightPixels(features(previous,:) == features(x,:)) = numOfConsequitiveBrightPixels(features(previous,:) == features(x,:)) + abs(thisframe(features(previous,:) == features(x,:)));
        numOfConsequitiveBrightPixels(features(previous,:) ~= features(x,:)) = 0;
%         previousnumOfConsequitiveBrightPixels = numOfConsequitiveBrightPixels;
    end
    
    corners = numOfConsequitiveBrightPixels > n;

end

