Category : face-recognition

I have been trying to get to understand how OpenCV and facial recognition works, but I keep getting an error message. I get the following error Message: OpenCV: terminate handler is called! The last OpenCV error is: OpenCV(4.5.3) Error: Assertion failed (!empty()) in cv::CascadeClassifier::detectMultiScale, file C:buildmaster_winpack-build-win64-vc15opencvmodulesobjdetectsrccascadedetect.cpp, line 1689 can someone please tell me what this ..

Read more

1>—— Build started: Project: try5, Configuration: Debug x64 —— 1>FLD.cpp 1>C:dlib-19.6sourcedlibconsole_progress_indicator.h(153,28): warning C4834: discarding return value of function with ‘nodiscard’ attribute 1>D:roboaticsopen_cv_facial recognitiontry5try5FLD.cpp(148,51): warning C4554: ‘|’: check operator precedence for possible error; use parentheses to clarify precedence 1>D:roboaticsopen_cv_facial recognitiontry5try5FLD.cpp(178,46): warning C4554: ‘|’: check operator precedence for possible error; use parentheses to clarify precedence 1>C:dlib-19.6sourcedlibserialize.h(527,17): warning ..

Read more

I am creating a file which Recognizes face from some given samples. But whenever I am trying to run the code , this error is coming: error: (-215:Assertion failed) !_src.empty() in function ‘cv::cvtColor’ I tried several fixes from StackOverflow, Internet and Github, But none worked. This is my code: import cv2 recognizer = cv2.face.LBPHFaceRecognizer_create() # ..

Read more

import numpy as np import face_recognition import cv2 import os path="C:/Users/HP/Desktop/face1/img/known/" images=list() classnames=[] my_list=os.listdir(path) for i in my_list: currentim=cv2.imread(f'{path}{i}’) images.append(currentim) classnames.append(os.path.splitext(i)[0]) def findenc(images): encs=[] for img in images : img=cv2.cvtColor(img,cv2.COLOR_BGR2RGB) encs.append(face_recognition.face_encodings(img)[0]) return encs encs=findenc(images) print("encoding has ended") cap=cv2.VideoCapture(0) while True: success,img=cap.read() imgsize=cv2.resize(img,(0,0),None,0.25,0.25) imgsize=cv2.cvtColor(imgsize,cv2.COLOR_BGR2RGB) faces=face_recognition.face_locations(imgsize)[0] encodescurf=face_recognition.face_encodings(imgsize)[0] for encode,faceloc in zip(encodescurf,faces): matches=face_recognition.compare_faces(encs,encode) facedis=face_recognition.face_distance(encs,encode) when ı run the ..

Read more

import numpy as np import face_recognition import cv2 import os path="C:/Users/HP/Desktop/face1/img/known/" images=list() classnames=[] my_list=os.listdir(path) for i in my_list: currentim=cv2.imread(f'{path}{i}’) images.append(currentim) classnames.append(os.path.splitext(i)[0]) def findenc(images): encs=[] for img in images : img=cv2.cvtColor(img,cv2.COLOR_BGR2RGB) encs.append(face_recognition.face_encodings(img)[0]) return encs encs=findenc(images) print("encoding has ended") cap=cv2.VideoCapture(0) while True: success,img=cap.read() imgsize=cv2.resize(img,(0,0),None,0.25,0.25) imgsize=cv2.cvtColor(imgsize,cv2.COLOR_BGR2RGB) faces=face_recognition.face_locations(imgsize)[0] encodescurf=face_recognition.face_encodings(imgsize)[0] for encode,faceloc in zip(encodescurf,faces): matches=face_recognition.compare_faces(encs,encode) facedis=face_recognition.face_distance(encs,encode) when ı run the ..

Read more