how to check opencv version

C++
$ python # "python3"- if you are using another version of python
>>>import cv2
>>>cv2.__version__# in terminal type python3 then the following,
import cv2
cv2.__version__$ python -c 'import cv2; print(cv2.__version__)' # 'python3' - if you are using another version of pythonChecking your OpenCV version using Python
$ python					#for python3 use python3
>>> import cv2
>>> cv2.__version__
'3.0.0'
Source

Also in C++: