So i am running ubuntu 13.04 on the sd card of my new beaglebone black. I am attempting to install opencv-2.4.2. I've got everything installed without errors but when i try to build and run a program
g++ 'pkg-config opencv --cflags' FILE.cpp -o FILE 'pkg-config opencv --libs'
I get the error:
pkg-config opencv --cflags: no such file or directory
pkg-config opencv --libs: no such file or directory
When I run pkg-config --libs opencv it gives me the correct directory (/usr/lib/ .so) with all my libraries and I have confirmed they are all actually there. pkg-config opencv --cflags gives -I/usr/include/opencv. Which also exists.
I have edited my bash.bashrc, opencv.pc, and opencv.conf files reflect these paths. They were /usr/local/lib but no libraries installed there.
I'm running out of ideas guys, any help or suggestions would be great.
Thanks.
you should be using backticks (`) instead of ' to substitute the output of pkg-config into the command line.
opencv-2.4.2 is provided in the angstrom distribution that comes with the BeagleBone Black. One problem I found was that python-opencv is at 2.3 with angstrom, so if you want to do your development work in python you have to downgrade opencv to 2.3.
Related
I have CUDA 10.1. I'm trying to build opencv4 using CUDA and CUDNN support.When i run make command i get the following error
/usr/bin/ld: cannot find -llib64 while trying to link with libopencv_cudev.so.
My cmake command is as follows:
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DINSTALL_PYTHON_EXAMPLES=ON -DINSTALL_C_EXAMPLES=ON -DOPENCV_ENABLE_NONFREE=ON -DWITH_CUDA=ON -DWITH_CUDNN=ON -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.1 -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -DPYTHON_EXECUTABLE=/usr/bin/python3 -DBUILD_EXAMPLES=ON ..
My nvidia cuda toolkit version is: release 7.5, V7.5.17.
What might be the error? Please guide.
EDIT
I installed CUDA using this link. But that did not install nvcc. So i installed nvcc using terminal command line sudo apt install nvidia-cuda-toolkit. Is it not the correct way.
I'm trying to build docker image, but I have this
app/utils
app/vendor/fifo/fifobuffer_v2
parkingDetection/pkgs/utils
app/pkgs/utils
app/vendor/github.com/stratoberry/go-gpsd
parkingDetection/gpsdata
gocv.io/x/gocv app/gpsdata
pkg-config --cflags opencv
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
Package 'opencv', required by 'virtual:world', not found
pkg-config:
exit status 1
apt-file search opencv.pc
gives me
libopencv-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/opencv.pc
echo $PKG_CONFIG_PATH
gives me
/usr/lib/x86_64-linux-gnu/pkgconfig/opencv.pc
How can I solve this problem?
I had a similar problem when I was trying to install a deep learning framework and this is how I fixed it:
Add the following to your .bashrc file:
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/x86_64-linux-gnu/pkgconfig
export PKG_CONFIG_PATH
then run the .bashrc file by either
source ~/.bashrc
or
. ~/.bashrc
I hope it works for you.
So, I guess, I just can't build docker image, which uses ppencv without opencv on my pc
I have installed CUDA 8.0 on ubuntu and set the environment variable in .bashrc as below:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
export CUDA_HOME=/usr/local/cuda
export PATH=$PATH:/usr/local/cuda/bin
Also, when I run
nvcc --version
I can find the correct version of CUDA.
However, it always shows "use cuda: NO" when I try to run "cmake .." inside opencv 3.3 directory.
Can anyone solve this problem? Thanks.
ps:
1. When I compile caffe, cmake can find CUDA correctly. It gets more confusing.
2. When I check OpenCVDetectCUDA.cmake, I found the following phrase sentence:
if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
message(STATUS "CUDA compilation is disabled (due to Clang unsupported on your platform).")
return()
endif()
Then I comment this paragraph, cmake can find CUDA. I am not sure what effect it will cause in later compilation and use.
If building from source is giving you as issue try installing via pip:
$ pip install opencv-python
I suspect the reason why you are having issues with building your opencv is because of the source of your files.
When I go with this command:
pkg-config --cflags opencv
I get the following message:
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
I'm on Cent OS 6, have found the solution for Linux Ubuntu over the internet and here on stack but not for Cent OS
I tried under OpenCV specifications with
PKG_CONFIG_PATH=/usr/share/opencv/lib/pkgconfig:${PKG_CONFIG_PATH}
export PKG_CONFIG_PATH
Still it doesn't work. How can I be sure OpenCV is also installed in that directory, I used whereis opencv and it triggered me /usr/share/
I know it is really late to answer to a question 4 years later but I will leave it here in hope that it will help someone.
I came also across a similar error after installing OpenCV 3.3.0 on Fedora 26. First, make sure you have the right path to your opencv.pc file. Mine is in this directory '/usr/local/lib/pkgconfig/'.
Run this command in your terminal. It will modify your .bashrc:
echo "#ADD OpenCV in PKG_CONFIG" >> ~/.bashrc
echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH}" >> ~/.bashrc
echo "export PKG_CONFIG_PATH" >> ~/.bashrc
Then execute:
source ~/.bashrc
Hi first of all i would like you to use 'Synaptic Package Manager'. You just need to goto the ubuntu software center and search for synaptic package manager.. The beauty of this is that all the packages you need are easily available here. Second it will automatically configures all your paths. Now install this then search for opencv packages over there if you found the package with the green box then its installed but else the package is not in the right place so you need to reinstall it but from package manager this time. If installed then you can do this only, you just need to fill the OpenCV_DIR variable with the path of opencv (containing the OpenCVConfig.cmake file)
export OpenCV_DIR=<path_of_opencv>
I already have OpenCV2.4.2 installed as part of ROS(Fuerte) in my computer(installed from Ubuntu Software Center, something due to ROS). How should I install OpenCV as a standalone?
I went through this guide and downloaded the opencv package from here. I am not quite clear as how to proceed. Can anyone give short list of steps to install? I want to use an IDE for my projects, so which IDE is proper for C++ and how to install the proper IDE and configure it correctly?
Also how to check if certain tools are installed?
This link which you also mentioned describes the necessary steps to compile OpenCV on your machine.
The version of OpenCV you install this way will be newer than the one installed with the ROS package, they usually have some delay. (Maybe not with Fuerte.)
Using multiple versions of the same library on a machine might cause problems with linking and it will create a bit of headache for you so I would avoid it.
Try running pkg-config opencv --libs to see if the ROS version pulled by Fuerte is available and you can use this with your projects later on.
For a starter IDE I would recommend Qt Creator.
The easy way to set OpenCV up with your project in Qt Creator is the following:
Create a project
Open the .pro file of the project
Run pkg-config opencv --cflags
Add this to the .pro file: INCLUDEPATH += __result__of__above
pkg-config opencv --libs
Add this to the .pro file: LIBS += __result__of__above
In the end what you add should look something like this:
INCLUDEPATH += -I/opt/ros/fuerte/include
LIBS += -L/opt/ros/fuerte/lib -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_ts -lopencv_video -lopencv_videostab
To install OpenCV using the terminal on Ubuntu:
$ su -
# apt-get update
# apt-get install build-essential
# apt-get install libavformat-dev
# apt-get install x264 v4l-utils ffmpeg
# apt-get install libcv2.3 libcvaux2.3 libhighgui2.3 python-opencv opencv-doc libcv-dev libcvaux-dev libhighgui-dev
OpenCV should be installed in /usr/local/ Installation Directory
You may also want to compile and view examples
$ cp -r /usr/share/doc/opencv-doc/examples .
$ cd examples
$ cd c
$ sh build_all.sh
You can read the complete article about How to install OpenCV on Ubuntu from Nam Huy Linux Blog at http://namhuy.net/1205/how-to-install-opencv-on-ubuntu.html
This github user has compiled all the installation steps using a shell script. You can install any OpenCV version you want by running the appropriate shell script inside.
$ git clone https://github.com/jayrambhia/Install-OpenCV.git
$ cd Ubuntu
$ chmod +x *
$ ./opencv_latest.sh
There is an installer for Ubuntu 16.04, and it may work well on Ubuntu 12.04, you could have a try. I have used it to install on Ubuntu 16.04 and it succeed!
An interactive installing script for install openCV on Ubuntu 16.04 LTS