1
votes

I'm trying to install OpenCV with extra modules on a computer running Ubuntu 14.04.2 (I need this specific version of Ubuntu as I'm using some other hardware that requires it). I was able to do it on a Raspberry Pi 3 just last week (running Ubuntu Mate 16.04.3), but now I just can't seem to get it right.

I know that the opencv_contrib-version needs to be the same as the opencv-version, and I've tried building many different versions without luck (3.4.0, 3.3.0, 3.2.0, 3.1.0).

After downloading matching versions of opencv and opencv_contrib, I'm doing the following commands from the terminal:

$ cd opencv

$ mkdir build

$ cd build

$ cmake -D OPENCV_EXTRA_MODULES_PATH = ../../opencv_contrib/modules ..

where both opencv and opencv_contrib folders are located on the Desktop, so the "../../opencv_contrib/modules"-path should be correct.

But the extra modules aren't built. Here is parts of the cmake output:

-- OpenCV modules:

-- To be built: core flann imgproc ml objdetect photo video dnn imgcodecs shape videoio highgui superres ts features2d calib3d stitching videostab

-- Disabled: world

-- Disabled by dependency: -

-- Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 python3 viz

And as you can see, it's only the standard modules that are included. I've seen many people having the same issue, but the solution has always been about having the matching opencv/opencv_contrib versions. Now that I know that the versions are correct, I have no clue as to what I'm doing wrong.

1

1 Answers

1
votes

You have extra spaces around the = in your cmake call, so the path does not get set correctly. Remove the two spaces and you should be fine:

cmake -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules ..