title: Trouble converting RGB image to grayscale
body: <p>Sorry if duplicate - I can't convert an RGB (or BGR) image to grayscale using OpenCV in Google Colab  </p>
  
  <p>I've recently switched from using OpenCV in C++ to Python and have been using Google Colab (OpenCV version 3.4.3) for some basic image manipulation, I want to input an image and convert it to grayscale to perform some thresholding. I've learned that you can't use cv2.imshow on Colab and instead have been using pyplot.imshow which requires changing the format of the image from BGR to RGB.</p>
  
  <p>I was following <a href="https://colab.research.google.com/drive/1RWGmqoEQdeyh5TssoGtsXsFk8hbLGtWp#scrollTo=5z1pSaJNxf1c" rel="nofollow noreferrer">this tutorial notebook</a> which is very helpful but using the same code on the same image produces a different output - my 'grayscale' image is green/yellow/blue compared to the actual grayscale output achieved in the tutorial.</p>
  
  <pre><code># read input image in BGR format
  orig = cv2.imread('./20.png')
  
  # convert from BGR to RGB
  rgb = cv2.cvtColor(orig, cv2.COLOR_BGR2RGB)
  
  # convert from RGB to gray using cv2.COLOR_RGB2GRAY
  gray1 = cv2.cvtColor(rgb, cv2.COLOR_RGB2GRAY)
  
  print("Input image")
  plt.imshow(orig)
  plt.show()
  
  print("\nRGB image")
  plt.imshow(rgb)
  plt.show()
  
  print("\nGrayscale image: RGB2GRAY conversion")
  plt.imshow(gray1)
  plt.show()
  
  
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/yCbxt.png" rel="nofollow noreferrer">Output</a></p>
  
  <p><a href="https://i.stack.imgur.com/jDmq1.png" rel="nofollow noreferrer">Output2</a></p>
  
  <p>Outputs 1 and 2 (input image and RGB image) are as expected but the grayscale image is green/yellow/blue instead of black and white</p>