feichtenhofer / gpu_flow

GPU based optical flow extraction in OpenCV
430 stars 109 forks source link

build fails with fatal error #5

Open tkoham opened 7 years ago

tkoham commented 7 years ago

On centos 7 and all dependencies installed, make fails with:

 fatal error: opencv2/gpu/gpu.hpp: No such file or directory
 #include "opencv2/gpu/gpu.hpp"

using qt 5.6, opencv 2.4.8

kasparov92 commented 6 years ago

I am having this issue, how have you solved it?

tkoham commented 6 years ago

no, ended up using something else for that project.

audreyls commented 5 years ago

For anyone looking at this later, I fixed this by building OpenCV myself instead of using the pre-built binaries and specifying the OpenCV directory to CMake. The error above is because CMake isn't finding the correct OpenCV files. I'm using Windows, but hopefully this step-list is helpful for anyone else having this issue:

  1. Download OpenCV 2.4.13.6 Sources from https://opencv.org/releases.html
  2. Use CMake to make the files for MinGW Makefiles (if it fails to build in the next step, try adding the -DENABLE_PRECOMPILED_HEADERS=OFF flag)
  3. I then built OpenCV with MinGW64 in C:\opencv\build
  4. I specified the OpenCV directory to the system (In Windows CMD: setx -m OPENCV_DIR "C:\opencv\build") Or alternatively, just specify that to CMake when making gpu_flow.

Takeaway is that building OpenCV yourself from sources seems to fix this problem, or at least it did for me.