Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find OpenCV Version Installed on Ubuntu [duplicate]

Tags:

c++

opencv

I would like to find out what version of OpenCV is installed on my computer (i am running Ubuntu 10.04). Is there a simple way to check it if ? If not then can i find out the directories where files (samples, etc) are installed ?

I am trying to run some code that i have already tested on another computer with OpenCV 2.3 installed and i get many errors.

like image 563
Saad Avatar asked Jan 10 '12 13:01

Saad


People also ask

How do I tell what version of OpenCV is installed?

After installation, it is recommended that you can check the version of OpenCV that Python is using: import cv2 print cv2. __version__ # Should print 3.0. 0-rc1 or newer.

Where is OpenCV installed Ubuntu?

OpenCV libraries are installed as in . a(static library) or . so(dynamic library) format. You can find OpenCV2 (i.e. C++ version) libraries (e.g. libopencv_core.so,libopencv_highgui.so etc) at /usr/local/lib .


2 Answers

The other methods here didn't work for me, so here's what does work in Ubuntu 12.04 'precise'.

On Ubuntu and other Debian-derived platforms, dpkg is the typical way to get software package versions. For more recent versions than the one that @Tio refers to, use

 dpkg -l | grep libopencv

If you have the development packages installed, like libopencv-core-dev, you'll probably have .pc files and can use pkg-config:

 pkg-config --modversion opencv
like image 73
nealmcb Avatar answered Oct 10 '22 17:10

nealmcb


You can look at the headers or libs installed. pkg-config can tell you where they are:

pkg-config --cflags opencv
pkg-config --libs opencv

Alternatively you can write a simple program and print the following defs:

CV_MAJOR_VERSION
CV_MINOR_VERSION

A similar question has been also asked here:

like image 64
crenate Avatar answered Oct 10 '22 16:10

crenate