title: Read a sequence of images with VideoCapture
body: <p>Here is a python code to read a sequence ( 0.jpg ...1052.jpg) of images with <code>VideoCapture</code> module of <code>openCV</code>.</p>
  
  <pre><code>import cv2
  import numpy
  cap = cv2.VideoCapture("/path to/RGB/I%04d.jpg",cv2.CAP_IMAGES).
  
  while(1):
     ret,frame = cap.read()
     cv2.imshow('image',frame)
     cv2.waitKey()
     print(frame.shape)
  </code></pre>
  
  <p>I get this error </p>
  
  <blockquote>
    <p><strong>OpenCV Error: Assertion failed (size.width>0 &amp;&amp; size.height>0) in imshow</strong>.</p>
  </blockquote>
  
  <p>It seems that the frame object is empty!</p>