title: error in video input opencv 3.3.0
body: <p>I have installed OpenCV 3.3.0 it works fine for the images but when i try to take video input it shows folowing error</p>
  
  <pre><code>VideoCapture failed
  OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /io/opencv/modules/imgproc/src/color.cpp, line 10638
  Traceback (most recent call last):
  File “video.py”, line 18, in
  gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
  cv2.error: /io/opencv/modules/imgproc/src/color.cpp:10638: error: (-215) scn == 3 || scn == 4 in function cvtColor
  </code></pre>
  
  <p>Here is my code for same :</p>
  
  <pre><code>import numpy as np
  import cv2
  cap = cv2.VideoCapture(0)
  
  if cap.isOpened() == False:
      print (“VideoCapture failed”)
  
  while(True):
  
      ret, frame = cap.read()
  
      gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
  
      cv2.imshow(‘frameq’,frame)
      cv2.imshow(‘frame’,gray)
  
      if cv2.waitKey(1) &amp; 0xFF == ord(‘q’):
          break
  
  cap.release()
  cv2.destroyAllWindows()
  </code></pre>
  
  <p>Your comment is awaiting moderation.</p>