即使安装了Make,make也无法检测到opencv_contrib

时间:2020-05-14 14:22:24

标签: opencv opencv-contrib

我正在尝试运行https://github.com/Katou2/Optical_Flow_GPU_Opencv3,但是遇到make无法检测到我的opencv_contrib模块的问题。这是直到cmake为止我已经完成的步骤。

conda create -n opticalflow python=3.6 anaconda
conda activate opticalflow
git clone https://github.com/Katou2/Optical_Flow_GPU_Opencv3
cd Optical_Flow_GPU_Opencv3
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUDA=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -D BUILD_TIFF=ON ..

这是我得到的没有错误的输出。

--     version: 4.2.0
-- OPENCV include:   /home/haziq/anaconda3/pkgs/libopencv-4.2.0-py36_3/include/opencv4
-- OPENCV libs dir:
-- OPENCV libs:   opencv_calib3dopencv_coreopencv_dnnopencv_features2dopencv_flannopencv_gapiopencv_highguiopencv_imgcodecsopencv_imgprocopencv_mlopencv_objdetectopencv_photoopencv_stitchingopencv_videoopencv_videoioopencv_arucoopencv_bgsegmopencv_bioinspiredopencv_ccalibopencv_cvvopencv_datasetsopencv_dnn_objdetectopencv_dnn_superresopencv_dpmopencv_faceopencv_freetypeopencv_fuzzyopencv_hdfopencv_hfsopencv_img_hashopencv_line_descriptoropencv_optflowopencv_phase_unwrappingopencv_plotopencv_qualityopencv_regopencv_rgbdopencv_saliencyopencv_shapeopencv_stereoopencv_structured_lightopencv_superresopencv_surface_matchingopencv_textopencv_trackingopencv_videostabopencv_xfeatures2dopencv_ximgprocopencv_xobjdetectopencv_xphoto
-- Configuring done
-- Generating done
-- Build files have been written to: /home/haziq/Optical_Flow_GPU_Opencv3/build

问题在我运行make时出现。

Scanning dependencies of target compute_flow_autogen
[ 25%] Automatic MOC for target compute_flow
[ 25%] Built target compute_flow_autogen
Scanning dependencies of target compute_flow
[ 50%] Building CXX object CMakeFiles/compute_flow.dir/compute_flow.o
/home/haziq/Optical_Flow_GPU_Opencv3/compute_flow.cpp:38:10: fatal error: opencv2/cudaoptflow.hpp: No such file or directory
 #include "opencv2/cudaoptflow.hpp"
          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/compute_flow.dir/build.make:62: recipe for target 'CMakeFiles/compute_flow.dir/compute_flow.o' failed
make[2]: *** [CMakeFiles/compute_flow.dir/compute_flow.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/compute_flow.dir/all' failed
make[1]: *** [CMakeFiles/compute_flow.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

因此该错误提到未找到文件opencv2/cudaoptflow.hpp,而我通读https://github.com/open-mmlab/mmaction/issues/39时说该错误是由于尚未安装opencv_contrib模块。但是,我确定已经安装了opencv_contrib,因为执行了此命令。

pip install opencv-contrib-python

,并已验证它,因为我能够调用需要运行cv2.xfeatures2d的{​​{1}}方法。

opencv_contrib

0 个答案:

没有答案