Home > front end >  import cv2 import os cap = cv2.VideoCapture(0) recognizer = cv2.face.LBPHFaceRecognizer_create() cas
import cv2 import os cap = cv2.VideoCapture(0) recognizer = cv2.face.LBPHFaceRecognizer_create() cas

Time:07-01

I tried to run the program, but it displays the error result as above, Has anyone experienced this error before? here is my code :

import cv2
import os

cap = cv2.VideoCapture(0)
recognizer = cv2.face.LBPHFaceRecognizer_create()

cascadePath = "haarcascade_frontalface_default.xml"
font = cv2.FONT_HERSHEY_SIMPLEX

CodePudding user response:

I hope this one can help you looks like you forgot to add this command :

import cv2
import os

cap = cv2.VideoCapture(0)
recognizer = cv2.face.LBPHFaceRecognizer_create()

cascadePath = "haarcascade_frontalface_default.xml"
faceCascade = cv2.CascadeClassifier(cascadePath);
font = cv2.FONT_HERSHEY_SIMPLEX

path = 'trained/'
  • Related