lukasmach/insight3d

`opencv/cv.h` not found despite `opencv` is installed.

Opened this issue · 6 comments

When I run make (after fixing the SDL.h include path issue), I run into a problem I cannot fix:

In file included from ui_state.h:4,
                 from tool_core.h:7,
                 from actions.cpp:1:
gui.h:7:10: fatal error: cv.h: No such file or directory
    7 | #include "cv.h"
      |          ^~~~~~
compilation terminated.

I have installed opencv version 4.7.0. It does not provide an include file named cv.h, but many others:

pacman -Qql opencv | grep '\.h$':

/usr/include/opencv4/opencv2/calib3d/calib3d_c.h
/usr/include/opencv4/opencv2/core/core_c.h
/usr/include/opencv4/opencv2/core/cv_cpu_dispatch.h
/usr/include/opencv4/opencv2/core/cv_cpu_helper.h
/usr/include/opencv4/opencv2/core/cvdef.h
/usr/include/opencv4/opencv2/core/hal/interface.h
/usr/include/opencv4/opencv2/core/hal/msa_macros.h
/usr/include/opencv4/opencv2/core/types_c.h
/usr/include/opencv4/opencv2/cvconfig.h
/usr/include/opencv4/opencv2/features2d/hal/interface.h
/usr/include/opencv4/opencv2/flann/all_indices.h
/usr/include/opencv4/opencv2/flann/allocator.h
/usr/include/opencv4/opencv2/flann/any.h
/usr/include/opencv4/opencv2/flann/autotuned_index.h
/usr/include/opencv4/opencv2/flann/composite_index.h
/usr/include/opencv4/opencv2/flann/config.h
/usr/include/opencv4/opencv2/flann/defines.h
/usr/include/opencv4/opencv2/flann/dist.h
/usr/include/opencv4/opencv2/flann/dummy.h
/usr/include/opencv4/opencv2/flann/dynamic_bitset.h
/usr/include/opencv4/opencv2/flann/general.h
/usr/include/opencv4/opencv2/flann/ground_truth.h
/usr/include/opencv4/opencv2/flann/hdf5.h
/usr/include/opencv4/opencv2/flann/heap.h
/usr/include/opencv4/opencv2/flann/hierarchical_clustering_index.h
/usr/include/opencv4/opencv2/flann/index_testing.h
/usr/include/opencv4/opencv2/flann/kdtree_index.h
/usr/include/opencv4/opencv2/flann/kdtree_single_index.h
/usr/include/opencv4/opencv2/flann/kmeans_index.h
/usr/include/opencv4/opencv2/flann/linear_index.h
/usr/include/opencv4/opencv2/flann/logger.h
/usr/include/opencv4/opencv2/flann/lsh_index.h
/usr/include/opencv4/opencv2/flann/lsh_table.h
/usr/include/opencv4/opencv2/flann/matrix.h
/usr/include/opencv4/opencv2/flann/nn_index.h
/usr/include/opencv4/opencv2/flann/object_factory.h
/usr/include/opencv4/opencv2/flann/params.h
/usr/include/opencv4/opencv2/flann/random.h
/usr/include/opencv4/opencv2/flann/result_set.h
/usr/include/opencv4/opencv2/flann/sampling.h
/usr/include/opencv4/opencv2/flann/saving.h
/usr/include/opencv4/opencv2/flann/simplex_downhill.h
/usr/include/opencv4/opencv2/flann/timer.h
/usr/include/opencv4/opencv2/highgui/highgui_c.h
/usr/include/opencv4/opencv2/imgcodecs/imgcodecs_c.h
/usr/include/opencv4/opencv2/imgcodecs/ios.h
/usr/include/opencv4/opencv2/imgcodecs/legacy/constants_c.h
/usr/include/opencv4/opencv2/imgcodecs/macosx.h
/usr/include/opencv4/opencv2/imgproc/hal/interface.h
/usr/include/opencv4/opencv2/imgproc/imgproc_c.h
/usr/include/opencv4/opencv2/imgproc/types_c.h
/usr/include/opencv4/opencv2/photo/legacy/constants_c.h
/usr/include/opencv4/opencv2/video/legacy/constants_c.h
/usr/include/opencv4/opencv2/videoio/cap_ios.h
/usr/include/opencv4/opencv2/videoio/legacy/constants_c.h
/usr/include/opencv4/opencv2/videoio/videoio_c.h

Regards!

I believe it requires a much older version of OpenCV. Unfortunately, the best way to use this tool seems to be with Wine and the existing binaries.

I believe it requires a much older version of OpenCV. Unfortunately, the best way to use this tool seems to be with Wine and the existing binaries.

So, upstream/@lukasmach, can you please adapt it to work with up to date OpenCV?

cv.h is present in /opt/opencv3/include/opencv/cv.h by building the opencv3-opt package, how can it be passed to the makefile since there isn't an autogen.sh or configure.sh ?

I believe it requires a much older version of OpenCV. Unfortunately, the best way to use this tool seems to be with Wine and the existing binaries.

So, upstream/@lukasmach, can you please adapt it to work with up to date OpenCV?

I've looked into this a bit, I don't know how easy it would be. It looks like many of the interfaces changed or were removed. I'm working on trying to get it to compile with an older copy of OpenCV since upgrading it would require me to actually understand how this code works, and it's well outside of my wheelhouse at the moment.

Hi everyone! I should have some timeslots to look into upgrading it tomorrow

Hi everyone! I should have some timeslots to look into upgrading it tomorrow

That sounds great. I was messing with OpenCV 4.8.x the other day, getting some test code to build with the SFM modules on Linux with CMake. It took me a bit of fiddling. If you think it'd be helpful, I can share the directory layouts and the CMake I was using to get it working. Statically linking, and not using the system's version of OpenCV, as at least on Arch Linux, the default OpenCV package doesn't have the SFM modules. I'm not sure if you're using those.