function lbp_m = lbp_16_3(vstup)
    [sx, sy] = size(vstup);
    lbp_m = zeros(sx-6,sy-6);
    
    for x = 1:sx-6
        for y = 1:sy-6
            b = vstup(x:x+6, y:y+6); % matica veľkosti 3x3
            c = zeros(7,7);
%             c(b < b(25))=0;
            c(b >= b(25))=1;
%             c(25) = 0; % centrálny pixel
            % matica binárnych váh
            bin_w = [0 0     1 2 4 0 0;
                     0 32768 0 0 0 8 0;
                     16384   0 0 0 0 0 16;
                     8192    0 0 0 0 0 32;
                     4096    0 0 0 0 0 64;
                     0 2048  0 0 0 128 0;
                     0 0     1024 512 256 0 0];
                     
            d = c.*bin_w; % vahovanie pozicii binarnymi vahami
            lbp_m(x,y) = sum(sum(d));% hodnota LBP
        end
    end
end