title: what values to use for classification using HMM
body: <p>Can i use the mean and standard deviation values obtained from an image in the HSV color space for the training of a system for recognition using HMM in MATLAB?</p>
  
  <pre><code>%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
  </code></pre>