3

I know it's all described here, but it's not clear to me what and where exactly should I build this opencv_contrib source.

Let's assume I've installed OpenCV 3.2 from official download site and after extracting it looks like this:

enter image description here

Now, step two:

select the opencv source code folder and the folder where binaries will be built

which one is the source folder? Should I have it in my OpenCV installation folder or do I need to get it from somewhere else? And where should I build it? Is it, in my case, /Documents/OpenCV/opencv/build?

3 Answers 3

4

What I usually do is to build OpenCV from source directly but it should be more or less the same with the pre-built archive.

With CMake-gui tool:

  • where is the source code: the directory that contains the OpenCV source code and that contains the CMakeLists.txt file (in your case, the sources folder in the screenshot).
  • where to build the binaries: the directory of your choice (in your case the build directory or another directory if you want)
  • in CMake, the flag OPENCV_EXTRA_MODULES_PATH should point to the modules directory of the contrib source.
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks, that's exactly how it should be described there
But, although build was finished succesfully, I can't find FaceRecognizer class which should be in opencv_contrib project. Do you know anything about it?
You can find cv::face::FaceRecognizer in the documentation.
Well explained answer!
0

my build:

cd ~/opencv
mkdir build
cd build

cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules  .. 
make -j7
make install

../../opencv_contrib/modules is directory of contributed modules directory .. is opencv source root directory

Comments

-1

The OpenCV official download doesn't come with the extra module. You need to download the zip file or clone it using git to your source directory from OpenCV repository, e.g. /Documents/OpenCV/opencv/opencv_contrib in your case. Then, in CMake, set OPENCV_EXTRA_MODULES_PATH points to /Documents/OpenCV/opencv/opencv_contrib/modules.

The FaceRecognizer is under the face module of the OpenCV Contribute.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.