how to get opencv version code example
Example 1: how to check opencv version using python
$ python # "python3"- if you are using another version of python
>>>import cv2
>>>cv2.__version__
Example 2: how to check opencv version command line
# in terminal type python3 then the following,
import cv2
cv2.__version__
Example 3: how to check opencv version
$ python -c 'import cv2; print(cv2.__version__)' # 'python3' - if you are using another version of python