嗨,我正在尝试做一个人脸识别器。 我每个人都有一些目录,有图片。 我的代码有问题:
recognizer = cv2.face_LBPHFaceRecognizer
path = curFolder+"/usersPics/"
path1, dirs, files = next(os.walk(path))
for i in dirs:
path2, dirs2, files2 = next(os.walk(path+"/"+str(i)))
for j in files2:
print(j)
pil_image = Image.open(path+"/"+str(i)+"/"+str(j))
image_array = np.array((pil_image),"uint8")
recognizer.update(image_array,np.array(i))
当我运行它时,我会得到这个错误:
descriptor 'train' requires a 'cv2.face_FaceRecognizer' object but received a 'numpy.ndarray'