function lbp_m = kvantizacia_lbp(lbp_m, pq)
max_lbp = max(max(lbp_m));
min_lbp = min(min(lbp_m));

rozsah = max_lbp-min_lbp;
C_q = rozsah/(pq-1);
for ii = 1:pq-1
    lbp_m(lbp_m>min_lbp+C_q*(ii-1) & lbp_m<min_lbp+C_q*ii) = min_lbp+C_q*(ii-1);
end
u = unique(lbp_m)';
q = 0;
for i = u
    lbp_m(lbp_m == i) = q;
    q = q+1;
end