Skip to content

opencv_world: Unable to compile opencv 3.1 with nonfree xfeatures2d module #7438

@Trojahn

Description

@Trojahn

I'm unable to compile Opencv with xFeatures2D contrib module without CUDA support.

Running the following cmake comand:

cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -DWITH_EIGEN=ON -DWITH_FFMPEG=ON -DWITH_JASPER=ON -DWITH_JPEG=ON -DWITH_PNG=ON -DWITH_V4L=ON -DWITH_LIBV4L=ON -DWITH_XINE=ON -DBUILD_PACKAGE=ON -DBUILD_OPENCV_PYTHON3=ON -DPYTHON2_NUMPY_INCLUDE_DIRS=/usr/lib/python2.7/dist-packages/numpy/core/include -DPYTHON3_NUMPY_INCLUDE_DIRS=/usr/lib/python3/dist-packages/numpy/core/include -DINSTALL_CREATE_DISTRIB=ON -DWITH_CUDA=OFF ..

Gives that:

--   OpenCV modules:
--     To be built:                 core flann imgproc ml photo video imgcodecs shape videoio highgui objdetect superres features2d calib3d stitching videostab world xfeatures2d ximgproc xobjdetect xphoto aruco bgsegm bioinspired ccalib dnn dpm face fuzzy line_descriptor optflow plot reg rgbd saliency stereo structured_light surface_matching text ts datasets tracking
--     Disabled:                    contrib_world
--     Disabled by dependency:      -
--     Unavailable:                 cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 viz cvv hdf matlab sfm

When compiling the result are this:

In file included from /home/user/deps/opencv/modules/stitching/include/opencv2/stitching.hpp:49:0,
                 from /home/user/deps/opencv/modules/stitching/src/precomp.hpp:59,
                 from /home/user/deps/opencv/modules/stitching/src/matchers.cpp:43:
/home/user/deps/opencv/modules/stitching/include/opencv2/stitching/detail/matchers.hpp:52:42: fatal error: opencv2/xfeatures2d/cuda.hpp: No such file or directory

Ok, after removing the stitching module (do i really need to???)...

cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -DWITH_EIGEN=ON -DWITH_FFMPEG=ON -DWITH_JASPER=ON -DWITH_JPEG=ON -DWITH_PNG=ON -DWITH_V4L=ON -DWITH_LIBV4L=ON -DWITH_XINE=ON -DBUILD_PACKAGE=ON -DBUILD_OPENCV_PYTHON3=ON -DPYTHON2_NUMPY_INCLUDE_DIRS=/usr/lib/python2.7/dist-packages/numpy/core/include -DPYTHON3_NUMPY_INCLUDE_DIRS=/usr/lib/python3/dist-packages/numpy/core/include -DINSTALL_CREATE_DISTRIB=ON -DWITH_CUDA=OFF -DBUILD_opencv_stitching=OFF ..

Gives me this error:

/home/user/deps/opencv/modules/world/src/precomp.hpp:57:43: fatal error: opencv2/xfeatures2d/nonfree.hpp: No such file or directory

Which IS present as seems below:

user@pc:~/deps/opencv/release$ ls ../../opencv_contrib/modules/xfeatures2d/include/opencv2/
xfeatures2d  xfeatures2d.hpp

So, what should i do next? And why do stitching modules crashes even with CUDA explicity disabled? :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions