简体   繁体   中英

import cv2 import os cap = cv2.VideoCapture(0) recognizer = cv2.face.LBPHFaceRecognizer_create() cascadePath = "haarcascade_frontal

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

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/'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM