title: OpenCV image conversion from RGB to Grayscale using imread giving poor results
body: <p>I'm loading a 24 Bit RGB image from a PNG file into my OpenCV application.</p>
  
  <p>However loading the image as grayscale directly using <code>imread</code> gives a very poor result.</p>
  
  <pre><code>Mat src1 = imread(inputImageFilename1.c_str(), 0);
  </code></pre>
  
  <p>Loading the RGB image as RGB and converting it to Grayscale gives a much better looking result.</p>
  
  <pre><code>Mat src1 = imread(inputImageFilename1.c_str(), 1);
  cvtColor(src1, src1Gray, CV_RGB2GRAY);
  </code></pre>
  
  <p>I'm wondering if I'm using <code>imread</code> for my image type correctly. Has anyone experienced similar behavior?</p>
  
  <p>The image converted to grayscale using <code>imread</code> is shown here:
  <img src="https://i.stack.imgur.com/BGQwz.png" alt="Bad result"></p>
  
  <p>The image converted to grayscale using <code>cvtColor</code> is shown here:
  <img src="https://i.stack.imgur.com/04hIV.png" alt="Good result"></p>