Opencv 3.0 - module object has no attribute 'xfeatures2d'
Asked Answered
C

1

29

I have shifted from OpenCV 2.4.9 to 3.0 to make use of drawMatches and drawMatchesKnn function. I came to know that it does not come along with non-free algorithms like SIFT , SURF. So I installed opencv_contrib from https://github.com/Itseez/opencv_contrib by following steps

cmake -DOPENCV_EXTRA_MODULES_PATH=/home/zealous/Downloads/opencv_contrib-master/modules /usr/local ..

make -j5

make install

I also cross checked in modules of opencv, xfeatures2d was there. Then when I tried to do

>>> import cv2
>>> help(cv2.xfeatures2d)

It gives me following error

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

What am I doing wrong here. Just FYI that I am using OpenCV 3.0 beta version . has OpenCV deactivated python wrappers for xfeatures2d or I have not installed it correct way?

Cashandcarry answered 18/4, 2015 at 5:28 Comment(2)
try a cv2.__version__ to see, if it's really using your new cv2.pydOwlet
Thanks for comment , the opencv package I was trying for was downloaded from opencv official website.. I just downloaded latest code from github for opencv and installed it. It is working fine now with opencv-contrib..Cashandcarry
C
5

I am writing down an answer to my own question, as it might help somebody fixing the same issue.

The opencv package I was trying for was downloaded from opencv official website. I just downloaded latest code from github for opencv and installed it. It is working fine now with opencv-contrib.

Cashandcarry answered 9/9, 2015 at 8:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.