Ask Your Question

Revision history [back]

error buiding cudaoptflow/samples/optical_flow.cpp on current master branch for opencv AND contrib

Hello all.

I am trying to get yolov4 to work with CUDA on ubuntu, so I cloned from the master branches of both opencv and opencv_contrib, as I see the support for mish activation function was already implemented.

However, I am getting the following build error:

/home/antonio/installers/opencv_contrib_2020_05_21/modules/cudaoptflow/samples/optical_flow.cpp:185:101: error: cannot bind non-const lvalue reference of type ‘cv::cuda::Stream&’ to an rvalue of type ‘cv::cuda::Stream’ NvidiaOpticalFlow_1_0::NVIDIA_OF_PERF_LEVEL::NV_OF_PERF_LEVEL_FAST, false, false, false, 0, Stream(), Stream()); ^~~~~~~~

In file included from /home/antonio/installers/opencv_contrib_2020_05_21/modules/cudaoptflow/samples/optical_flow.cpp:7:0: /home/antonio/installers/opencv_contrib_2020_05_21/modules/cudaoptflow/include/opencv2/cudaoptflow.hpp:447:47: note: initializing argument 8 of ‘static cv::Ptr<cv::cuda::nvidiaopticalflow_1_0> cv::cuda::NvidiaOpticalFlow_1_0::create(int, int, cv::cuda::NvidiaOpticalFlow_1_0::NVIDIA_OF_PERF_LEVEL, bool, bool, bool, int, cv::cuda::Stream&, cv::cuda::Stream&)’ CV_WRAP static Ptr<nvidiaopticalflow_1_0> create( ^~~~~~ modules/cudaoptflow/CMakeFiles/example_cudaoptflow_optical_flow.dir/build.make:65: recipe for target 'modules/cudaoptflow/CMakeFiles/example_cudaoptflow_optical_flow.dir/samples/optical_flow.cpp.o' failed

Can you please help me understand what's going on? Since it seems like a syntax error, I am thinking that I either have to clone opencv_contrib from a different place than master, or that this is an actual bug on the code.

Thanks a lot for your time and help!

Antonio