Building OpenCV_contrib for OpenCV 3, Windows GUI
I built successfully the main branch of OpenCV 3 from Github. Now, I want to build the OpenCV_contrib portion of it, especially the xfeature2d (actually, it is the only thing that matters for me). There are instructions on how to do so in the readme section of the Github page.
I am using CMake 3.0.2 GUI on Windows 7. So far, I haven't found a command line version so I am using the GUI.
The steps I am using (from the readme):
start cmake-gui
select the opencv source code folder and the folder where binaries will be built (the 2 upper forms of the interface)
press the configure button. you will see all the opencv build parameters in the central interface
browse the parameters and look for the form called OPENCV_EXTRA_MODULES_PATH (use the search form to focus rapidly on it)
complete this OPENCV_EXTRA_MODULES_PATH by the proper pathname to the <opencv_contrib>/modules value using its browse button.
press the configure button followed by the generate button (the first time, you will be asked which makefile style to use)
build the opencv core with the method you chose
Here is how the folder containing the sources and build looks like:
So the Master branch is in the "Sources" folder and the extra module are in the "Contrib" folder.
Following the instructions, the CMake part seems to work well. But, when I try to build it in Visual Studio, various errors about "No such files or directory" in "descriptors.hpp" and "types.hpp" and some problems with undeclared identifiers in the Saliency module.
There could be a lot of reasons for this. A knowledgeable person told me in a comment that I should launch CMake from the same build folder than for the main repo, but I don't see how with the GUI...
EDIT : Here is the output of CMake after I configured it, so just before I click on
"Generate":
Checking for Windows Platform SDK
Checking for Visual Studio 2012
found IPP (ICV version): 8.1.1 [8.1.1]
at: D:/OpenCV3/Sources/3rdparty/ippicv/unpack/ippicv_win
Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "2.7")
Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "2.6")
Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "3.4")
Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "3.2")
Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
Could NOT find Matlab (missing: MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN)
VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
Tesseract: NO
CMake Warning (dev) at cmake/OpenCVModule.cmake:896 (get_target_property):
Policy CMP0026 is not set: Disallow use of the LOCATION target property.
Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The LOCATION property should not be read from target "opencv_test_core".
Use ...
Somewhat related: http://answers.opencv.org/question/43614/building-opencv-3-with-extra-modules/
Start by providing us with your CMAKE config output after configuring is completed.
Hmm that seems correct. How about removing the saliency module since you don't need it. This can be done by adding
-DBUILD_opencv_saliency=OFF
to your CMAKE command.In the GUI, I have selected the xfeature2d module only. Now I just compiled the "Debug" version of ALL_BUILD without error. Will go through the Release version, then the INSTALL build and keep you updated. I should have thought of it before; compiling ALL the experimental modules isn't always a good idea ;)
@Doombot, was doing the check myself. Seems that on the current master branch the following modules are already broken: cvv cudastereo text ccalib ... and still not succeeding. It is a pitty that so much faulty code gets in ...
hmm it seems even more stuff is breaking down... not in the mood to fix it all...
Wow I understand. I understand a lot of modules no longer work now... (even though there is no Release candidate of OpenCV3 out yet).
Well I just finished to compile everything, I am preparing a sample program with some xfeature2d in it (like FREAK) but right now I tested with a BRISK demo program I made and everything works. Thanks a lot @StevenPuttemans !
You are welcome! Yep it seems that the buildbots dont succeed in capturing all problems. But then the developing community jumps in!
I was able to use the cmake gui to successfully (?) create a makefile. At least, I see a file
opencv/build/Makefile
. I told cmake to use MinGW as the generator (was having trouble with Visual Studio 11). In MinGW (actually, Git Bash), I navigate to the build dir and typemake -j4
(or even justmake
), and nothing seems to happen but the terminal printsMicrosoft Windows [Version 10.0.14393] (c) 2016 Microsoft Corporation. All rights reserved.
Any ideas?