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.
The version string is located in:
https://github.com/opencv/opencv/blob/master/modules/core/include/opencv2/core/version.hpp
I would like to enhance one of the answers using version.hpp defines.
Please notice the potential problem with that solution:
v. 2.4.13.6 defines:
and v. 3.4.2 defines:
As a result, CV_VERSION_MAJOR are not comparable. Much safer solution is to parse CV_VERSION and use the first value before a dot.