title: Convert HSV to grayscale in OpenCV
body: <p>I'm a newbie in OpenCV. I'm learning the Segmentation by Watershed algorithm and I have a problem.</p>
  <p>I have to convert the image color to grayscale for using Watershed.
  When I use the BGR color space, no problem but with HSV, I'm not sure that the code below is correct.</p>
  <pre class="lang-cpp prettyprint-override"><code>Mat im = imread(&quot;./Image/118035.jpg&quot;, CV_LOAD_IMAGE_COLOR);
  
  Mat imHSV;
  cvtColor(im, imHSV, CV_BGR2HSV);
  imshow(&quot;HSV&quot;, imHSV);
  
  cvtColor(imHSV, imHSV, CV_BGR2GRAY);
  imshow(&quot;HSV to gray&quot;, imHSV);
  
  
  imshow(&quot;BGR&quot;, im);
  cvtColor(im, im, CV_BGR2GRAY);
  imshow(&quot;BGR to gray&quot;, im);
  </code></pre>
  <p>I think, after converting from BGR to HSV, Hue = Blue, Saturation = Green, Value = Red and I can use the operator BGR2GRAY for convert from HSV to grayscale.</p>
  <p>The 2 output images are different. Can I convert HSV to grayscale like that?</p>
  <p>//Is it similaire with color space LAB?</p>