import numpy as np
import cv2
import thread, winsound
face_cascade = cv2.CascadeClassifier(\'C:\\Users\\Saddaqat\\Desktop\\Softwares\\opencv\\build\\share\\OpenCV\\
Well, for me it looks like the VideoCapture is not working. You should check after reading the image, if it could have read something:
ret, cur = cam.read()
if not ret:
print "VideoCapture read no frame."
break
If that's the case, there has been some answers here in SO that might help you, for example: OpenCV 2.4 VideoCapture not working on Windows Basically, they say that you might have problems with the ffmpeg. Maybe you have to add it to Windows path, and/or rename it to have the OpenCV version on it.