简体   繁体   中英

How to Use OpenCV Submodule In Python?

How to use createLBPHFaceRecognizer() in opencv3.3, and Python 2.7.13?

I Used Windows 64 bit OS

because i find an error in syntax :

import os
import cv2
import numpy as np
from PIL import Image

recognizer = cv2.createLBPHFaceRecognizer()
path='dataSet'

Error : recognizer = cv2.createLBPHFaceRecognizer()

AttributeError: 'module' object has no attribute 'createLBPHFaceRecognizer'

You need compile OpenCV from source. Download both opencv and opencv_contrib .

In opencv_contrib source, there is a folder called modules , delete you don't use.

I don't how to compile it on Windows. There (OpenCV 3 Tutorials, Resources, and Guides) are some tutorials for install OpenCV(Linux, macOS, etc), but no Windows version. You can refer to relevant information for compile OpenCV from source on Windows.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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