I am trying to build scene_reconstruction.cpp sample from OpenCV, but I have the following error:
In file included from /usr/local/include/opencv2/sfm.hpp:42:0,
from scene_reconstruction.cpp:1:
/usr/local/include/opencv2/sfm/numeric.hpp:41:22: fatal error: Eigen/Core: No such file or directory
compilation terminated.
But I did install eigen. I tried building opencv with BUILD_EXAMPLE=ON flag, the building using make, will just terminates at 9% Built target opencv_python3
Can anyone please explain to me?
Related
I am trying to run Lightgbm with gpu on Spyder. For installing the library I tried many commands but most have failed.
I tried "pip install lightgbm --install-option=--gpu" in anaconda prompt and got the
error.
The I followed the https://github.com/Microsoft/LightGBM/blob/master/docs/Installation-Guide.rst#build-gpu-version
I installed git, vs 2022, cmake and opencl(Cuda Toolkit)
For boost binaries I copied the boost_1_78_0 file in "C:\Boost".
But the file doesn't contain any "lib64-msvc-14.0"(or similar folder). This is the first problem but it contain libs folder so I gave that path(Hope that's right).
But then I get this error:
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
"CMake Error: The source directory "C:/Users/User Name/LightGBM/build" does not appear to contain CMakeLists.txt"
Any help is appreciated. Thanks
I want to add opencv2/cudaimgproc.hpp module from contrib. I followed the instructions in https://github.com/opencv/opencv_contrib to build opencv contrib. I also cloned opencv master because the instructions said so even though I have opencv 4 installed in Google colab. I still get the same error-
fatal error: opencv2/cudaimgproc.hpp: No such file or directory #include
when I run the cpp code with #include . Please help.
When I am building OpenCV, and running the make command, I get the following error:-
even though i have zlib installed in the path :-
zlib: /usr/include/zlib.h /usr/share/man/man3/zlib.3.gz
Has anyone encountered this error before?
I have installed opencv2 in a conda environment for using with yolo. But i am getting the following error.
Error:
No package 'opencv' found ./src/image_opencv.cpp:5:10: fatal error:
opencv2/opencv.hpp: No such file or directory #include
"opencv2/opencv.hpp"
^~~~~~~~~~~~~~~~~~~~ compilation terminated. Makefile:86: recipe for target 'obj/image_opencv.o' failed make: ***
[obj/image_opencv.o] Error 1
But i was able to access opencv in a jupyter notebook.
Q.2) Can we use opencv3 with yolo?
You can use OpenCV 3 with YOLO. But, in order to run opencv in Darknet framework and train your yolo model, you need OpenCV that is built with C++ support, not python.
All of darknet source code is written in C, that's why you need opencv that works with C++ program. Probably you installed opencv in conda environment that works for Python. To check whether you have opencv installed for C++, input this command :
pkg-config --modversion opencv
If nothing is shown or error, then you need to re-install opencv. Follow this guide to install opencv that works with both Python and C++ : https://www.learnopencv.com/install-opencv-3-4-4-on-ubuntu-16-04/
I am trying to build this code:
https://docs.opencv.org/3.2.0/d5/d6f/tutorial_feature_flann_matcher.html
I am using Ubuntu 16.04 with CLion 2017.3 and have OpenCV 3.4 installed.
xfeatures2d.hpp can't be found on the system.
I have looked at many different problems on the internet, but couldn't find a solution.
Any help?
You have to include cmake comiplation flag to opencv OPENCV_EXTRA_MODULES_PATH and set it to the opencv_contrib/modules.
cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules
Here's what I had to do to compile OpenCV with xfeatures2d:
Download opencv_contrib (I took a release from the releases page). This step is what gives us xfeatures2d.
Unpack the tarball somewhere, e.g., ~/src/opencv_contrib-4.5.5
When configuring OpenCV (the main OpenCV source like opencv-4.5.2) with CMake, add the following option to cmake command line (adjusting the value to be your actual path to the modules subdirectory of the opencv_contrib tarball):
-DOPENCV_EXTRA_MODULES_PATH=$HOME/src/opencv_contrib-4.5.5/modules/
Now just build as you normally would and install.
The above actions gave me the expected file (among others): /usr/include/opencv4/opencv2/xfeatures2d.hpp.