Ask Your Question
1

xfeatures2d in Opencv 3.2-dev

asked 2017-03-01 04:16:56 -0600

Patst gravatar image

I just did a fresh install on my ubuntu machine. 3 folders. One for build, one for opencv and open for opencv_contrib. I took opencv and contrib from git repositories.

I executed on my build folder:

sudo cmake -DOPENCV_EXTRA_MODULES_PATH=/home/user/opencv/opencv_contrib/modules /home/user/opencv/opencv

After that, :

sudo make -j5

After a while it seems to be ok.

Then:

$ python
>>> import cv2
>>> surf = cv2.xfeatures2d.SURF_create(400)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'xfeatures2d'

If I exec cv2.__version__ I get: 3.2.0-dev

What should I do now? How can I include opencv_contrib?

edit retag flag offensive close merge delete

Comments

1

I don't know your platform. I think you have to add to -DOPENCV_ENABLE_NONFREE=ON :

sudo cmake -DOPENCV_EXTRA_MODULES_PATH=/home/user/opencv/opencv_contrib/modules /home/user/opencv/opencv -DOPENCV_ENABLE_NONFREE=ON

SIFT surf ... are non free algorithm you cannot use it in commercial application without royalties

LBerger gravatar imageLBerger ( 2017-03-01 04:26:46 -0600 )edit

I have a similar question. Asked it with more details in here

Matheusft gravatar imageMatheusft ( 2017-03-15 12:55:42 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-05-29 05:14:39 -0600

choosp gravatar image

I had the same issue until I tied this tutorial step by step link text

Make sure to enter all of the -D commands with cmake step and change opencv and contrib versions to 3.2.0. And after make -j4 command look in build/modules folder for xfeatures2d to be there.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-03-01 04:16:56 -0600

Seen: 5,982 times

Last updated: Mar 01 '17