OpenCVでcv2.createLBPHFaceRecognizer()のAttributeError

Jetson Nanoには最初からOpenCV3が入っている。

顔識別のソフトを使おうとしたところ表題のエラー。

recoginizer = cv2.createLBPHFaceRecognizer()
AttributeError: ‘module’ object has no attribute ‘createLBPHFaceRecognizer’

if you have that error it means the face class is installed.
but the updated version of opencv-contrib doesnt have ‘createLBPHFaceRecognizer’ it changed the name. so to find out print(help(cv2.face))

https://github.com/opencv/opencv/issues/10516#issuecomment-369510955

どうやらアップデートによって名前が変わってしまったようだ。

OpenCV4にアップデートした所、AttributieErrorは出なくなり解決した。

参考

AttributeError: 'module' object has no attribute 'face' · Issue #10516 · opencv/opencv
I got an error when running opencv in Python on raspberry pi. I tried to find and apply it to fix the error, but it did ...

コメント

タイトルとURLをコピーしました