简体   繁体   English

OpenCV和本征面识别器,Python

[英]opencv and eigenface recognizer, python

I'm playing with openCV in python. 我正在用python玩openCV。 I'd like to use the eigenface algorithm to guess who's in a picture. 我想使用特征脸算法来猜测谁在图片中。 I tried with 我尝试过

recognizer = cv2.createEigenFaceRecognizer()

and it complains that 它抱怨

'module' object has no attribute 'createEigenFaceRecognizer'

I read around in the internet and found that the submodule 'face' should be used starting form openCV 3, but as I run 我在互联网上四处浏览,发现应该从openCV 3开始使用子模块“ face”,但是在我运行时

recognizer = cv2.face.createEigenFaceRecognizer()

it complains with a 它抱怨着

'module' object has no attribute 'face'

I'm puzzled.. Thanks AC 我很困惑..谢谢AC

edit - how I installed it: 编辑-我如何安装它:

1. download openCV from http://sourceforge.net/projects/opencvlibrary
2. unpack to ~/opencv
3. download opencv_contrib from https://github.com/Itseez/opencv_contrib
4. unpack to ~/opencv/contrib
5. >cd ~/opencv
6. >mkdir tmp; cd tmp
7. >cmake -D -DOPENCV_EXTRA_MODULES_PATH=~/opencv/contrib/modules  CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ~/opencv
8. >make -j5
9. >sudo make install

您可能需要重新构建 opencv以及此处所述的其他模块-opencv_contrib ,如果尚未执行的话。

  1. cmake -D -DOPENCV_EXTRA_MODULES_PATH cmake -D -DOPENCV_EXTRA_MODULES_PATH

that "-D" is the cause of the error 该“ -D”是错误的原因

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM