Ask Your Question
0

Problem using cmake to compile opencv-contrib

asked 2019-06-25 18:41:36 -0600

updated 2019-06-26 02:49:40 -0600

berak gravatar image

Hi, I have a problem when I try use the fuction cv2.Tracker_create in pycharm, I got the following error:

**tracker = cv2.Tracker_create(tipo_track[0])

AttributeError: module 'cv2' has no attribute 'Tracker_create'**

I undestend that I need to compile opencv adding the opencv-contrib module. I configure in cmake the following path:

OPENCV_EXTRA_MODULE_PATH = /home/kevinvig7/opencv_contrib/modules And when I click "Configure" I obtain the following waring: Unexpected include: /home/kevinvig7/opencv/build/downloads/xfeatures2d (module=opencv_xfeatures2d) Call Stack (most recent call first): /home/kevinvig7/opencv/cmake/OpenCVModule.cmake:711 (ocv_target_include_modules) /home/kevinvig7/opencv_contrib/modules/xfeatures2d/CMakeLists.txt:14 (ocv_module_include_directories)

Then when I run "cmake." and "sudo make -j8" I obtain the following error: /home/kevinvig7/opencv_contrib/modules/xfeatures2d/src/vgg.cpp:490:20: fatal error: vgg_generated_120.i: No existe el archivo o el directorio #include "vgg_generated_120.i" ^~~~~~~~~~~~~~~~~~~~~ compilation terminated.

The versions are: Python 3.6 OpenCV 3.2 CMake 3.10.2 Pycharm 2018.2.1

Can anyone help me? Thanks!

edit retag flag offensive close merge delete

Comments

it's not a cmake problem at all. your python code is outdated, that's all there is.

berak gravatar imageberak ( 2019-06-26 02:50:15 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-06-26 00:34:48 -0600

berak gravatar image

you must be looking at outdated docs, the api has changed, there is no more Tracker_create(name) method.

please have a look at the current samples ,

-- you have to create an explict instance of a certain tracker class now, like:

tracker = cv.TrackerMOSSE_create()
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-06-25 18:41:36 -0600

Seen: 663 times

Last updated: Jun 26 '19