title: error: (-215) size.width>0 && size.height>0 in function imshow
body: <p>The program needs to read a video, do the counting of frames and then show in a window. The error occurs after the video ends.
  How can i solve this?</p>
  
  <p>Here is the source:</p>
  
  <pre><code>import tkMessageBox
  import cv2
  
  banner = cv2.imread('../data/banner.png')
  video = cv2.VideoCapture('../data/pintado_real_crop.avi')
  contadorDeFrames = True
  contador = 0
  
  
  cv2.imshow('Projeto Pacu', banner)
  
  cv2.moveWindow('Projeto Pacu', 100,50)
  
  while(contadorDeFrames == True):
  
      contadorDeFrames, frame = video.read()
      contador = contador + 1
  
      cv2.imshow("Video", frame)
      cv2.moveWindow('Video', 100, 178)
  
      print"Frame: %d" %contador
  
      k = cv2.waitKey(30) &amp; 0xff
      if k == 27:
          break
  
  tkMessageBox.showinfo("Frames contador: %d" %contador)
  video.release()
  cv2.destroyAllWindows()
  </code></pre>
  
  <p><strong>Complete Error:</strong> </p>
  
  <pre><code>OpenCV Error: Assertion failed (size.width&gt;0 &amp;&amp; size.height&gt;0) in imshow, file /build/buildd/opencv-2.4.8+dfsg1/modules/highgui/src/window.cpp, line 269
  Traceback (most recent call last):
    File "/home/vagner/PycharmProjects/TesteVideo/src/TestaVideo.py", line 20, in &lt;module&gt;
      cv2.imshow("Video", frame)
  cv2.error: /build/buildd/opencv-2.4.8+dfsg1/modules/highgui/src/window.cpp:269: error: (-215) size.width&gt;0 &amp;&amp; size.height&gt;0 in function imshow
  </code></pre>