title: PIL.Image to cv2: Expected Ptr<cv::UMat> for argument 'src'
body: <p>I am using the pyautogui library to take a screenshot, which gets stored as PIL.Image.Image.
  When I try to use cv2's cvtColor() function to convert it, I get a TypeError:</p>
  
  <pre><code>TypeError: Expected Ptr&lt;cv::UMat&gt; for argument 'src'
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>img = pyautogui.screenshot(0, 0, 500, 500)
  print(type(img))    #&lt;class 'PIL.Image.Image'&gt;
  img_rgb = numpy.array(img)
  img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY)
  </code></pre>
  
  <p>What is my mistake here, and how could I convert the image as desired?</p>