function [maskImg] = findNeighbours(N,neighbors, stdev, maskImg,labl)

black=0;
white=0;
    for n2 = 1:N;
    mask = labl==n2;
    cellLength = length(neighbors{n2});
      

     %For Count black and white neighbours
        for n3 = 1: cellLength;
                 if(stdev{neighbors{n2}(n3,1)}== 1)
                      white = white +1;
                 else
                      black = black+1;
                 end
         end
         if(maskImg(mask)==0)                % comparison of white pixels and black
                 if(white>black)
                    maskImg(mask)=1;                      
                 end 
        else
               if(black> white)
                  maskImg(mask)= 0;               
               end
         end 
       black = 0;
       white = 0;
       celllength=0;
    end
end

    