M BUZZ CRAZE NEWS
// news

Where is OpenCV installed?

By Joseph Russell

I have followed this guide to install OpenCV 2.4.8

OpenCV documentation says that I should find OpencV usr/local/include/opencv/ yet I find nothing.

Can someone tell me where to find the installed OpenCV files?


EDIT I'm not sure why the script installed OpenCV 2.4.8 instead of 2.4.9.

But I just found the files here here /usr/include/opencv and /usr/include/opencv2 I am not sure how that works but it does.

1

3 Answers

OpenCV is installed via checkinstall, have a look at the installer script.

Therefore you can check the installed files via

dpkg -L opencv-<version>

Eg:

dpkg -L opencv-2.4.8

If you have installed OpenCV via another script as you commented, open the script, find the line

make install

and replace with

sudo checkinstall

After that install checkinstall via

sudo apt-get install checkinstall

Now start the installer script again and check the installed files with

dpkg -L opencv

The installer script does exactly the same as before, but now it creates and installs a deb package.

1

Currently OpenCV 2.4 is provided via

sudo apt-get install libopencv

(if packages were not resolved try: libopencv* or opencv*)

Using package distribution from the Ubuntu repository may require you to update your indexes and packages (to be able to find actual OpenCV version available):

sudo apt-get update
sudo apt-get upgrade

After apt-get installing OpenCV, the latest available version (2.4.x) will be installed into your default system path:

/usr/local/lib - shared libraries (e.g. /usr/local/lib/libopencv-core2.4.x)
/usr/local/include - header files (e.g. /usr/local/include/opencv2)

See this guide (this is not my guide, so I am not aware if it is good or bad)

3

Generally I follow this pattern:

cmake ..
make
sudo make install

Add /usr/local/lib to /etc/ld.so.conf.d/opencv.conf

sudo ldconfig

Then you can use

pkg-config --libs --cflags opencv 

to get all include and libs on Ubuntu

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy