title: OpenCV - RGB to HSV and back to RGB?
body: <p>I have an image that i want to convert from RGB to HSV, and then back to RGB.</p>
  
  <p>This is how i do it:</p>
  
  <pre><code>Mat frame1, frame2, frame3;
  cvtColor(frame1, frame2, CV_RGB2HSV);
  cvtColor(frame2, frame3, CV_HSV2BGR);
  namedWindow("origin", CV_WINDOW_AUTOSIZE);
  namedWindow("rgb2hsv", CV_WINDOW_AUTOSIZE);
  namedWindow("hsv2rgb", CV_WINDOW_AUTOSIZE);
  imshow("origin", frame1);
  imshow("rgb2hsv", frame2);
  imshow("hsv2rgb", frame3);
  </code></pre>
  
  <p>I believe i get the correct result when i convert from RGB to HSV.
  However, when i convert that converted image back to RGB, it gives me an incorrect result.</p>
  
  <p>Any idea why? 
  Thanks!</p>