visual-search/descriptor/extractGlobalColHist.m
2019-11-12 16:27:04 +00:00

13 lines
309 B
Matlab

function F=extractGlobalColHist(img)
divs = 8;
qimg = floor(img .* divs);
bin = qimg(:,:,1) * divs^2 + qimg(:,:,2) * divs^1 + qimg(:,:,3);
vals = reshape(bin, 1, size(bin, 1) * size(bin, 2));
hist_values = histogram(vals, divs^3, 'Normalization', 'probability').Values;
F=hist_values;
return;