visual-search/descriptor/extractGlobalColHist.m

13 lines
309 B
Mathematica
Raw Normal View History

2019-11-07 16:36:30 +00:00
function F=extractGlobalColHist(img)
2019-11-12 16:27:04 +00:00
divs = 8;
2019-11-07 16:36:30 +00:00
2019-11-08 11:51:33 +00:00
qimg = floor(img .* divs);
bin = qimg(:,:,1) * divs^2 + qimg(:,:,2) * divs^1 + qimg(:,:,3);
2019-11-07 16:36:30 +00:00
2019-11-08 11:51:33 +00:00
vals = reshape(bin, 1, size(bin, 1) * size(bin, 2));
2019-11-07 16:36:30 +00:00
2019-11-08 11:51:33 +00:00
hist_values = histogram(vals, divs^3, 'Normalization', 'probability').Values;
2019-11-07 16:36:30 +00:00
F=hist_values;
return;