function [ cornersActual ] = simple12segmentCriterion( img, threshold )
% Hassan Nahas
%This function performs the highspeed rejection test on an image for a
%certain threshold.
%     numbefOfBrigher = zeros(size(image,1),size(image,2));
    allF = extractFeatureVector(img,threshold);
    
%     for x = [1,9,5,13]
%         
%         numbefOfBrigher = numbefOfBrigher + allF(:,:,x);
%     end
    numbefOfBrigher = sum(allF(:,:,[1,9,5,13]),3);
    corners = abs(numbefOfBrigher) >= 3;
    corners = reshape(corners,1,[]);
    corners = 1 - corners;
    allF = permute(allF,[3,1,2]);
    allFlong = reshape(allF,16,[]);
    key = 1:size(corners,2);
    allFlong(:,corners == 1) = [];
    key(corners == 1) = [];
    cornersActual = zeros(size(corners));
    cornersActual(key) = segmentCriterionFeatures(allFlong,12);
    cornersActual = reshape(cornersActual,size(img,1),size(img,2));
   
end

