Hyunjun
Hyunjun

Reputation: 37

Want to build some necessary Libraries for feature detection. Got some error

Want to build some necessary Libraries for feature detection. Got some error. At first, I tried

$ cmake -DOPENCV_EXTRA_MODULES_PATH=~/Desktop/opencv_contrib-master/

and I got error message

FATAL: In-source builds are not allowed. You should create a separate directory for build files.

So, I've followed "In-source builds are not allowed" in cmake

cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/Desktop/opencv_contrib-master

but still got error message

CMake Error: The source directory "/home/ryucaps/opencv" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI.

Can't figure out what's going on. I only wanted to import some libraries that i don't have yet on my code.

Upvotes: 1

Views: 82

Answers (1)

pptaszni
pptaszni

Reputation: 8345

So, you want to compile and install OpenCV with additional module opencv_contrib-master, right?

Follow these steps for a relatively clean solution:

  • Download both Opencv and additional module to the same directory (for example /home/MyUser/Libs; note that I gave you the links to the particular OpenCV versions (in this case 3.4.1), not just to master branch
  • Go to /home/MyUser/Libs and unzip the archives (e.g. unzip 3.4.1.zip)
  • Go to /home/MyUser/Libs/opencv-3.4.1 and create the build dir mkdir build
  • Go to build dir cd build and execute cmake -DOPENCV_EXTRA_MODULES_PATH=/home/MyUser/Libs/opencv_contrib-3.4.1/modules .. ; Note the .. in the end of the command
  • Execute make
  • Execute sudo make install

Upvotes: 1

Related Questions