为什么会引发错误:TypeError:参数'labels'的预期Ptr <cv :: UMat>

问题描述

我是opencv的新手,我正在尝试使用特征脸识别技术来训练人脸识别。代码在行中抛出错误:clf.train(faces,ids)

我的程序是:

for image in path :
    img = Image.open(image).convert('L')
    nimg = np.array(img,'uint8')
    id = os.path.split(image.split(".")[1])
    faces.append(nimg)
    ids.append(id)
ids = np.array(ids)
clf = cv2.face.EigenFaceRecognizer_create()
clf.train(faces,ids)
clf.write("classifier.yml")

感谢您的帮助

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)