Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine which version of OpenCV

Tags:

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.

like image 697
vijaym123 Avatar asked Apr 20 '12 15:04

vijaym123


People also ask

How do I know what version of OpenCV I have?

The OpenCV version is included in a special string variable named cv2. __version__ . All we need to do is check this variable and we'll be able to determine our OpenCV version.

What version of Python does OpenCV use?

It uses the Python 3 that comes with the system. If you want to use your own Python 3 installation, let's see how to install OpenCV for Python. Now you should have pip installed.

Is OpenCV Python and cv2 same?

cv2 is the module import name for opencv-python, "Unofficial pre-built CPU-only OpenCV packages for Python". The traditional OpenCV has many complicated steps involving building the module from scratch, which is unnecessary.


2 Answers

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

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

like image 162
fraxel Avatar answered Oct 24 '22 21:10

fraxel


One line way can be like below:-

enter image description here

like image 21
kratikagandhi Avatar answered Oct 24 '22 21:10

kratikagandhi