I am trying to transition from OpenCV 2.4.9 to 3.0 but I am having trouble getting xfeatures2d to compile as a lib. I am using VS2012 c++/cli on a Win8.1 64 bit machine using CMake 3.0.1.
I do not have any problem just making OpenCV 3.0 itself but need to add xfeatures2d so I can use SURF, etc.
I downloaded the xfeatures2d, etc. code from https://github.com/Itseez/opencv_contrib and installed it on my hard drive at the root, so the files are stored in opencv_contrib-master. I added c:/opencv_contrib-master/modules to the OPENCV_EXTRA_MODULES_PATH setting but changed nothing else. CMake config and master report no problems.
When I now select the ALL_BUILD project, I compile for quite a period of time. The first project I fail at says:
94>Time Elapsed 00:00:05.27
98>------ Build started: Project: (sample) simpleflow_demo, Configuration: Debug x64 ------
98>Build started 6/12/2015 10:42:43 PM.
98>InitializeBuildStatus:
98> Touching "example_optflow_simpleflow_demo.dir\Debug\(sample) simpleflow_demo.unsuccessfulbuild".
98>CustomBuild:
98> Building Custom Rule C:/opencv_contrib-master/modules/optflow/CMakeLists.txt
98> CMake does not need to re-run because C:\opencv\build\modules\optflow\CMakeFiles\generate.stamp is up-to-date.
97>C:\opencv_contrib-master\modules\optflow\samples\optical_flow_evaluation.cpp(43): error C2065: 'NAN' : undeclared identifier
97>C:\opencv_contrib-master\modules\optflow\samples\optical_flow_evaluation.cpp(64): error C2065: 'NAN' : undeclared identifier 98>ClCompile: 98> simpleflow_demo.cpp 97> 97>Build FAILED.
Next, I fail at:
118>Time Elapsed 00:00:16.65
125> disparity_bilateral_filter.cu
126>------ Build started: Project: opencv_line_descriptor, Configuration: Debug x64 ------
126>Build started 6/12/2015 10:43:48 PM.
126>InitializeBuildStatus:
126> Touching "opencv_line_descriptor.dir\Debug\opencv_line_descriptor.unsuccessfulbuild".
126>CustomBuild:
126> Building Custom Rule C:/opencv_contrib-master/modules/line_descriptor/CMakeLists.txt
126> CMake does not need to re-run because C:\opencv\build\modules\line_descriptor\CMakeFiles\generate.stamp is up-to-date.
126>ClCompile:
126> opencv_line_descriptor_pch.cpp
124> depth_cleaner.cpp
124> depth_to_3d.cpp
124> linemod.cpp
124> normal.cpp
124> odometry.cpp
124> plane.cpp
124> utils.cpp
77>C:\opencv\sources\modules\core\include\opencv2/core/base.hpp(342): warning : function declared with "noreturn" does return
77>
123>C:\opencv\sources\modules\core\include\opencv2/core/base.hpp(342): warning : function declared with "noreturn" does return
123>
126>c:\opencv_contrib-master\modules\line_descriptor\src\bitops.hpp(104): error C2059: syntax error : 'bad suffix on number'
126>c:\opencv_contrib-master\modules\line_descriptor\src\bitops.hpp(104): error C2146: syntax error : missing ',' before identifier 'U'
126>c:\opencv_contrib-master\modules\line_descriptor\src\bitops.hpp(104): error C2065: 'U' : undeclared identifier
126>
124>Link:
124> Creating library C:/opencv/build/lib/Debug/opencv_rgbd300d.lib and object C:/opencv/build/lib/Debug/opencv_rgbd300d.exp
126>Build FAILED.
Ultimately, VS reports: ========== Build: 181 succeeded, 186 failed, 0 up-to-date, 55 skipped ==========
I have tried only specifying the top level of the contrib download (i.e., c:/opencv_contrib-master) in CMake and while that reports fewer failures, it still does not build xfeatures2d.
Any help on getting this to work greatly appreciated.