Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You should check if the video you're trying to read is opened before trying to read a frame and convert it to grayscale.

  cap = cv2.VideoCapture("/home/user/.VIRTUALENVS/cv/lib/python2.7/site-packages/ped1.avi")
  while(cap.isOpened()):
    ret, frame1 = cap.read()
    if ret:
      prvs = cv2.cvtColor(frame1,cv2.COLOR_BGR2GRAY)