1
votes

I have searched here on StackOverflow and other sites to figure out how to install OpenCV 3.0 the Contrib Modules. I have downloaded the extra modules and extracted the zip file to the /opt/local/include/opencv2/opencv_contrib/ folder. I've navigated to the /opt/local/include/opencv2 folder and typed the following command in the terminal:

cmake -DOPENCV_EXTRA_MODULES_PATH=/opt/local/include/opencv2/opencv_contrib/modules/ /opt/local/include/opencv2

I get:

-bash: $: command not found

If I just type in cmake -D, I get:

CMake Error: -D must be followed with VAR=VALUE.
CMake Error: Problem processing arguments. Aborting.

So I know it recognizes the cmake command with the -D tag.

Any ideas?

1

1 Answers

4
votes

Nobody said that installing OpenCV and their modules was easy.

Just like you, I already had Opencv 3.0.0 installed and running and wanted to add the contrib modules.

Steps:

1st- Delete and download again the OpenCV3.0.0 folder (is not necessary, but after twitching around, I prefer to download a new one) download the openccv_contrib and place them in the same folder.

2nd- Go to the OpenCV3.0.0 and create the build folder.

3rd- Open Cmake gui and follow the steps form https://github.com/itseez/opencv_contrib.

3.1- Fill “Where is the source code” with the rotute of where is openCV3.0.0. (my case /Users/Rafearl/Program/ComputerVision/opencv-3.0.0)
3.2- Fill “Where to build binaries” with the build route(/Users/Rafearl/Program/ComputerVision/opencv-3.0.0/build)
3.3- Press configure
3.4- In the search bar search for “OPENCV_EXTRA_MODULES_PATH” and fill with the Opencv_contrib modules(/Users/Rafearl/Program/ComputerVision/opencv_contrib-master/modules)
3.5- Click configure again and then click generate. By default current generator: Unix makefiles

4th- In terminal go to your build folder

5th- make -j4 (4 is the number of cores of the processor)

6th- sudo make install

Now you can check the lib in the build folder that the contrib libraries are added If you don´t want to download the OpenCV3.0.0 again just follow the same steps without downloading or deleting anything.

If you already have Opencv in Xcode, everything should work but just as a piece of advise; many of the OpenCV2.4 examples does´t work in the 3.0 version.