Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Problem Building xfeatures2d in OpenCV 3.0

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. My system has a NVidia card with CUDA 7.0 installed.

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.

Following earlier advice, I have turned off:

BUILD_EXAMPLES 
BUILD_contrib_world,
BUILD_opencv_face, 
BUILD_latentsvm, 
BUILD_line_descriptor, 
BUILD_saliency 
BUILD_world

but changed nothing else. CMake config and master report no problems.

When I now select the ALL_BUILD project, I am still failing. The first project I fail at says:

121>Time Elapsed 00:00:00.30
122>  surf.cu
125>------ Build started: Project: opencv_cudaimgproc, Configuration: Debug x64 ------
126>------ Build started: Project: opencv_cudafeatures2d, Configuration: Debug x64 ------
127>------ Build started: Project: opencv_test_cudafilters, Configuration: Debug x64 ------
128>------ Build started: Project: opencv_perf_cudafilters, Configuration: Debug x64 ------
127>Build started 6/14/2015 11:32:44 AM.
128>Build started 6/14/2015 11:32:44 AM.
126>Build started 6/14/2015 11:32:44 AM.
125>Build started 6/14/2015 11:32:44 AM.
125>InitializeBuildStatus:
125>  Creating "opencv_cudaimgproc.dir\Debug\opencv_cudaimgproc.unsuccessfulbuild" because "AlwaysCreate" was specified.
... [A LONG SERIES OF WARNINGS, ETC. THAT I AM OMITTING AS THEY DO NOT SEEM RELEVANT]
124>Link:
124>  opencv_perf_cudaarithm.vcxproj -> C:\opencv\build\bin\Debug\opencv_perf_cudaarithmd.exe
122>  surf.cu
122>  
122>ClCompile:
122>  opencv_xfeatures2d_pch.cpp
123>Link:
123>  opencv_test_cudaarithm.vcxproj -> C:\opencv\build\bin\Debug\opencv_test_cudaarithmd.exe
122>  brief.cpp
122>  daisy.cpp
122>  freak.cpp
122>  latch.cpp
122>  lucid.cpp
122>  sift.cpp
122>  stardetector.cpp
122>  surf.cpp
122>C:\opencv_contrib-master\modules\xfeatures2d\src\daisy.cpp(1270): error C3861: 'round': identifier not found
122>  surf.cuda.cpp
122>  surf.ocl.cpp
122>  xfeatures2d_init.cpp
122>  opencl_kernels_xfeatures2d.cpp
122>
122>Build FAILED.
122>

The next project says:

122>Time Elapsed 00:00:32.71
129>------ Build started: Project: opencv_perf_xfeatures2d, Configuration: Debug x64 ------
130>------ Build started: Project: opencv_test_xfeatures2d, Configuration: Debug x64 ------

125>C:\opencv\sources\modules\core\include\opencv2/core/cuda.hpp(530): warning : field of class type without a DLL interface used in a class with a DLL interface
125>  
130>  test_detectors.cpp
130>  test_features2d.cpp
130>  test_keypoints.cpp
130>  test_main.cpp
130>  test_rotation_and_scale_invariance.cpp
130>  test_surf.cuda.cpp
130>  test_surf.ocl.cpp
130>LINK : fatal error LNK1104: cannot open file '..\..\lib\Debug\opencv_xfeatures2d300d.lib'
130>
130>Build FAILED.

In total, it reports 105 projects built, and 6 failed.

Any help in getting xfeatures2d to compile so I can use SURF appreciated.