title: cv::VideoCapture::open VIDEOIO(DSHOW)
body: <p>I have been working on this error for a while but can't resolve it.
  This is my code</p>
  
  <pre><code>import cv2
  import numpy as np
  import time
  
  cam = cv2.VideoCapture(0)
  time.sleep(2)
  
  while True:
      ret,frame = cam.read()
      cv2.imshow('webcam', frame)
      if cv2.waitKey(1)&amp;0xFF == ord('q'):
          break
  
  cam.release()
  cv2.destroyAllWindows()
  </code></pre>
  
  <p>And this is the error it is giving me.</p>
  
  <pre><code>[ERROR:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap.cpp (193) cv::VideoCapture::open VIDEOIO(DSHOW): raised unknown C++ exception!
  </code></pre>
  
  <p>Traceback (most recent call last):
    File "C:\Users\VVA\Desktop\test.py", line 10, in 
      cv2.imshow('webcam', frame)
  cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:376: error: (-215:Assertion failed) size.width>0 &amp;&amp; size.height>0 in function 'cv::imshow'</p>