Determine which version of OpenCV

opencv, python

Solution

>>> from cv2 import __version__
>>> __version__
'$Rev: 4557 $'

If that doesn't work then, use `cv` instead of `cv2`.

Problem

I want to write to short code snippet in python, to determine which version of OpenCV has been installed in my System. How do i do it ? Thank you.

Original source