function IsNOKholes = NOKholes(imds)


    dataFilenames = imds.Files;
    nFiles = numel(dataFilenames);
    Centerx = zeros(6,nFiles);
    Centery = zeros(6,nFiles);
    threshhrana = [263 350 350 263.3 109 109];
    threshkulat = [260 350 350 263.3 105 105];
    holes = zeros(1,nFiles);

%detekce
for k = 1:nFiles    
    I = readimage(imds,k);
    
    %rozdeleni sninmku na dve casti
    Ic = imcrop(I,[0 0 500 600]);
    Icr = imcrop(I,[450 0 800 600]);
   
    %hledani kruhu
    [centersleft,radiileft] = imfindcircles(Ic,[31 32],'ObjectPolarity','dark',...
        'Sensitivity',0.988);
    [centersright,radiiright] = imfindcircles(Icr,[39 42],'ObjectPolarity','dark',...
        'Sensitivity',0.97);
    
    %serazeni souradnic stredu
    sortedleft = sortrows(centersleft,2,'descend');
    sortedright = sortrows(centersright,2,'descend');
    
    %uprava pri spatne nalezenych kruzich
     if size(radiileft,1) < 4;
        sortedleft(4,:) = [0 0];
     elseif size(radiileft,1) == 5;
        sortedleft(3,:) = [];
    elseif size(radiileft,1) == 6;
        sortedleft(3,:) = [];
        sortedleft(4,:) = [];
     elseif size(radiiright,1) == 3;
         sortedright(2,:) = [];
     end

    %vlozeni souradic stredu do testovacich vektoru
    Centerx(1:4,k) = sortedleft(:,1);
    Centerx(5:6,k) = sortedright(:,1);
    Centery(1:4,k) = sortedleft(:,2);
    Centery(5:6,k) = sortedright(:,2);

%Overeni poloh vuci hranici   
for z = [1 5]
    if Centerx(z,k)<threshkulat(z)
        holes(k) = 1;
    end

end
end
 IsNOKholes = holes;
end