[英]Face-Recognition OpenCV Python
伙計們,我在 python 中遇到 FaceRec 問題,請幫忙
main.py = https://pastebin.com/ST7DzBn4
simpleFaceRec = https://pastebin.com/a6aUVUbD
錯誤:
Traceback (most recent call last):
File "E:\Documents\Python\FaceRecognitionOS\main.py", line 16, in <module>
face_locations, face_names = sfr.detect_known_faces(frame)
File "E:\Documents\Python\FaceRecognitionOS\simple_facerec.py", line 47, in detect_known_faces
small_frame = cv2.resize(frame, (0, 0), fx=self.frame_resizing, fy=self.frame_resizing)
cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4052: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'
在第 9 行更改此內容:
cap = cv2.VideoCapture(2)
到:
cap = cv2.VideoCapture(0)
還有第 12 行:
while True:
到:
while cap.isOpened()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.