Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine OpenCV version

How to determine which version of OpenCV I have installed?

I am most interested in knowing a way of doing it programatically (and cross-platform), but I can't even find a way to determine the installed version from outside the code.

I'm working with C++03, on Fedora.

like image 454
penelope Avatar asked Jun 14 '12 09:06

penelope


People also ask

How do I know what version of OpenCV I have?

Use __version__ on cv2 to get its version.

What is OpenCV version?

The OpenCV – 4.5. 1 version is released in 2020 with advanced features of the library. The OpenCV 4. x is based on C++ 11 library and the OpenCV – 1.

Which OpenCV version should I use?

If you're working with Image Processing,hands down OpenCV 3 is way better(The latest stable version 3.4 was released around Feb 2018). Significant differences that you will find between 3 and 2 are: T-API or Transparent API has been introduced in OpenCV 3. Only thing that you'll need to use is UMat instead of Mat.


2 Answers

You can check the CV_VERSION macro.

like image 111
juanchopanza Avatar answered Sep 23 '22 01:09

juanchopanza


You can check the following macro variables:

CV_MAJOR_VERSION CV_MINOR_VERSION 
like image 41
CharlesB Avatar answered Sep 21 '22 01:09

CharlesB