OpenThermal / libseek-thermal

SEEK thermal compact camera driver supporting the thermal Compact, thermal CompactXR and and thermal CompactPRO
MIT License
286 stars 99 forks source link

Unable to compile: cmake reports not find OpenCV even being installed #63

Closed afgranero closed 3 years ago

afgranero commented 3 years ago

I followed the instructions and installed the dependencies (for Linux Mint):

sudo apt-get install libusb-1.0-0-dev
sudo apt-get install libopencv-dev

But cmake reports (the relevant part):

-----------------------------------------------------------------------------
-- The following REQUIRED packages could NOT be located on your system.
-- You must install these packages before continuing.
-----------------------------------------------------------------------------
   * OpenCV  <https://opencv.org/>
     Required to handle image processing

-----------------------------------------------------------------------------

libopencv-dev is the correct version. I added those lines to CMakelists.txt:

find_package(OpenCV)

message(STATUS "OpenCV_INCLUDE_DIRS = ${OpenCV_INCLUDE_DIRS}")
message(STATUS "OpenCV_LIBS = ${OpenCV_LIBS}")

getting (the relevant part):

-- OpenCV_INCLUDE_DIRS = /usr/include/opencv;/usr/include
-- OpenCV_LIBS = opencv_videostab;opencv_video;opencv_ts;opencv_superres;opencv_stitching;opencv_photo;opencv_ocl;opencv_objdetect;opencv_ml;opencv_legacy;opencv_imgproc;opencv_highgui;opencv_gpu;opencv_flann;opencv_features2d;opencv_core;opencv_contrib;opencv_calib3d;opencv_videostab;opencv_video;opencv_ts;opencv_superres;opencv_stitching;opencv_photo;opencv_ocl;opencv_objdetect;opencv_ml;opencv_legacy;opencv_imgproc;opencv_highgui;opencv_gpu;opencv_flann;opencv_features2d;opencv_core;opencv_contrib;opencv_calib3d

If I give :

ldconfig -p | grep opencv-dev

I get:

    libopencv_videostab.so.2.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_videostab.so.2.4
    libopencv_videostab.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_videostab.so
    libopencv_video.so.2.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_video.so.2.4
    libopencv_video.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_video.so
    libopencv_ts.so.2.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_ts.so.2.4
    libopencv_ts.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_ts.so
    libopencv_superres.so.2.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_superres.so.2.4
    libopencv_superres.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_superres.so
    libopencv_stitching.so.2.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_stitching.so.2.4
    libopencv_stitching.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_stitching.so
    libopencv_photo.so.2.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_photo.so.2.4
    libopencv_photo.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_photo.so
    libopencv_ocl.so.2.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_ocl.so.2.4
    libopencv_ocl.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_ocl.so
    libopencv_objdetect.so.2.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_objdetect.so.2.4
    libopencv_objdetect.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_objdetect.so
    libopencv_ml.so.2.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_ml.so.2.4
    libopencv_ml.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_ml.so
    libopencv_legacy.so.2.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_legacy.so.2.4
    libopencv_legacy.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_legacy.so
    libopencv_imgproc.so.2.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so.2.4
    libopencv_imgproc.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so
    libopencv_highgui.so.2.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4
    libopencv_highgui.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_highgui.so
    libopencv_gpu.so.2.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_gpu.so.2.4
    libopencv_gpu.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_gpu.so
    libopencv_flann.so.2.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_flann.so.2.4
    libopencv_flann.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_flann.so
    libopencv_features2d.so.2.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_features2d.so.2.4
    libopencv_features2d.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_features2d.so
    libopencv_core.so.2.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_core.so.2.4
    libopencv_core.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_core.so
    libopencv_contrib.so.2.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_contrib.so.2.4
    libopencv_contrib.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_contrib.so
    libopencv_calib3d.so.2.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_calib3d.so.2.4
    libopencv_calib3d.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libopencv_calib3d.so
afgranero commented 3 years ago

I also tried to rewrite the lib in C without using OpenCV for a simpler lib to work around OpenCV (the program where I use it can do all OpenCV stuff). But my call to libusb_bulk_transfer gives me an LIBUSB_ERROR_IO after connecting to the Seek CompactPro.

afgranero commented 3 years ago

I tryed to compile OpenCV from source. I followed instructions here: http://techawarey.com/programming/install-opencv-c-c-in-ubuntu-18-04-lts-step-by-step-guide/. I was sucessfull in compiling and installing. I was able to compile a C++ test program using OpenCV using headers from /usr/include/opencv.

But I am still not able to compile this project, recieving the error of of libopencv-dev not installed.

Bostwickenator commented 3 years ago

This is interesting because as I'm sure you can see the library does not do anything out of the ordinary to direct CMAKE how to locate OpenCV we just call the find_package macro. On most platforms the package will be automatically located. I wonder if something is going wrong with the logging macro. Can you try removing the TRUE from macro_log_feature (OPENCV_FOUND "OpenCV" "Required to handle image processing" "https://opencv.org/" TRUE) and seeing if the build proceeds.

afgranero commented 3 years ago

After compiling OpenCV from source I attempted to use cmake again and it worked. I was able to cmpile the examples. But I still don't understandt why installling libopencv-dev didn't work

afgranero commented 3 years ago

This is interesting because as I'm sure you can see the library does not do anything out of the ordinary to direct CMAKE how to locate OpenCV we just call the find_package macro. On most platforms the package will be automatically located. I wonder if something is going wrong with the logging macro. Can you try removing the TRUE from macro_log_feature (OPENCV_FOUND "OpenCV" "Required to handle image processing" "https://opencv.org/" TRUE) and seeing if the build proceeds.

I will try.

duydangg commented 3 years ago

have anyone solved this problem in win10 i've downloaded opencv from https://opencv.org/releases/ then install i've copied OpenCVConfig.cmake to cmake folder
which step that i am missing or i'm wrong please correct me