使用HMM进行分类的值

时间:2015-04-04 12:45:08

标签: matlab

我可以使用从HSV色彩空间中的图像获得的平均值和标准差值来训练使用MATM中的HMM进行识别的系统吗?

%function colorMoments = colorMoments(hsv)
% image to be first converted from R, G, B to the H, S, V color space 
% input: image to be analyzed and extract 2 first moments from each H,S,V
% output: 1x6 vector containing the 2 first color momenst from each H,S,V
% channel

% load image into work space and re-size
a = imread('filename.ext');
b = imresize(a,0.079);

% convert from R,G,B to the H,S,V color space
hsv = rgb2hsv(b);

% extract color channels
H = double(hsv(:, :, 1));
S = double(hsv(:, :, 2));
V = double(hsv(:, :, 3));

% compute 2 first color moments from each channel
meanH = mean( H(:) );
stdH  = std( H(:) );
meanS = mean( S(:) );
stdS  = std( S(:) );
meanV = mean( V(:) );
stdV  = std( V(:) );

% construct output vector
colorMoments = zeros(1, 6);
colorMoments(1, :) = [meanH stdH meanS stdS meanV stdV];
end

0 个答案:

没有答案