Relative Content

Tag Archive for pythonopencvcascadefacial-identification

why cant my program find the cascade file

cascPath = sys.argv[1] faceCascade = cv2.CascadeClassifier(“C:/Users/zack/OneDrive/Desktop/face_recognition/haarcascade_frontalface_default.xml”) #sets up the video source to default webcam video_capture = cv2.VideoCapture(0) while True: #frame by frame video and a return code ret, frame = video_capture.read() # Check if the frame is empty if not ret: print(“Error: Failed to capture frame”) break gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) faces = faceCascade.detectMultiScale( gray, […]