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