title: Count unique colors of RGB Image using OpenCV/EmguCV
body: <p>How can i count unique colors of image ROI.
  I try to use Histogram but i don't know how to handle Bin values. Here is my code so far using EMguCV:</p>
  
  <pre><code>image.ROI= new Rectangle(10,10,300,500);
  Image&lt;Gray, Byte&gt;[] gray = image.Split(); 
  DenseHistogram hist = new DenseHistogram(256, new RangeF(0f, 256f));
  hist.Calculate(new Image&lt;Gray, byte&gt;[] { gray[0] }, false, null);
  float[] r = hist.GetBinValues();
  hist.Calculate(new Image&lt;Gray, byte&gt;[] { gray[1] }, false, null);
  float[] g = hist.GetBinValues();
  hist.Calculate(new Image&lt;Gray, byte&gt;[] { gray[2] }, false, null);
  float[] b = hist.GetBinValues();
  </code></pre>
  
  <p>How can calculate r,g,b values to get the number of used colors? </p>