visual-search/descriptor/extractAvgRGB.m

16 lines
301 B
Mathematica
Raw Normal View History

2019-11-07 16:36:30 +00:00
function F=extractAvgRGB(img)
red = img(:,:,1);
red = reshape(red, 1, []);
avg_red = mean(red);
green = img(:,:,2);
green = reshape(green, 1, []);
avg_green = mean(green);
blue = img(:,:,3);
blue = reshape(blue, 1, []);
avg_blue = mean(blue);
F=[avg_red avg_green avg_blue];
return;