You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
myFaceListC = []
myFaceListArea = []
for (x,y,w,h) in faces:
cv2.rectangle(img,(x,y),(x + w, y + h),(0,0,255),2)
cap = cv2.VideoCapture(0)
while True:
_, img = cap.read()
findFace(img)
cv2.imshow("Output",img)
cv2.waitKey(1)
Error:
File "C:/Users/zachd/PycharmProjects/droneproject2/venv/Face Tracking.py", line 20, in
findFace(img)
File "C:/Users/zachd/PycharmProjects/droneproject2/venv/Face Tracking.py", line 7, in findFace
faces = faceCascade.detectMultiScale(imgGray,1.1,8)
cv2.error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-oduouqig\opencv\modules\objdetect\src\cascadedetect.cpp:1689: error: (-215:Assertion failed) !empty() in function 'cv::CascadeClassifier::detectMultiScale'
[ WARN:1] global C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-oduouqig\opencv\modules\videoio\src\cap_msmf.cpp (434) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback
The text was updated successfully, but these errors were encountered:
Continue getting this error for drone face tracking course, I think it is due to the file. Any ideas?
My Code:
import cv2
import numpy as np
def findFace(img):
faceCascade = cv2.CascadeClassifier('Resources/haarcascade_frontalface_default.xml')
imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = faceCascade.detectMultiScale(imgGray,1.1,8)
cap = cv2.VideoCapture(0)
while True:
_, img = cap.read()
findFace(img)
cv2.imshow("Output",img)
cv2.waitKey(1)
Error:
File "C:/Users/zachd/PycharmProjects/droneproject2/venv/Face Tracking.py", line 20, in
findFace(img)
File "C:/Users/zachd/PycharmProjects/droneproject2/venv/Face Tracking.py", line 7, in findFace
faces = faceCascade.detectMultiScale(imgGray,1.1,8)
cv2.error: OpenCV(4.5.1) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-oduouqig\opencv\modules\objdetect\src\cascadedetect.cpp:1689: error: (-215:Assertion failed) !empty() in function 'cv::CascadeClassifier::detectMultiScale'
[ WARN:1] global C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-oduouqig\opencv\modules\videoio\src\cap_msmf.cpp (434) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback
The text was updated successfully, but these errors were encountered: