Hinzufügen von Modulen von opencv_contrib zu OpenCV

Ich versuche das @ hinzuzufügxfeatures2d Modul vonopencv_contrib zu einem vorhandenen OpenCV / Python-Projekt.

Ich habe die neueste Version des Moduls von @ heruntergelade the repo und baute OpenCV erneut mit den folgenden zusätzlichen Parametern:

OPENCV_EXTRA_MODULES_PATH=/path/to/opencv_contrib-master/modules
BUILD_opencv_xfeatures2d=ON

Auszug aus dem Build-Protokoll:

-- Installing: /usr/local/lib/python2.7/site-packages/cv2.so
-- Installing: /usr/local/lib/python3.4/site-packages/cv2.so
-- Installing: /usr/local/lib/libopencv_xfeatures2d.3.0.0.dylib

Anscheinend ist das neue Modul korrekt installiert. Ich kann @ importiercv2 in beiden Python-Versionen. Erkennen Sie jedoch auch nicht die neuen Funktionen, die das Modul hinzufügen soll.

>>> cv2.SURF()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'SURF'
>>> cv2.xfeatures2d.SURF()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'xfeatures2d'

Antworten auf die Frage(4)

Ihre Antwort auf die Frage