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.
if you are working under Windows and you need to configure Codeblocks or any other IDE (thus,you can not issue any command yet nor compile a program ) you can simply go to the folder of installation of OpenCV and look after the final leters of the libraries in the sub-folder "/lib" .All libraries there are named in a pattern that reflects the major,minor and the revision of the build of OpenCV.For instance if you stumble upon a file named opencv_ts300.lib or opencv_world300.lib then the major is 3,minor is 0 and revision is 0.
(Note: it's likely that this method fails I mean when these informations do not comply with the real version but this will be maybe with the revision but unlikely with the major)
You can check the following macro variables:
If you install from svn repository, you can see the exact revision version like that:
If you also want to get build information, you can use this code:
pkg-config --modversion opencv
You can check the
CV_VERSION
macro.