Check opencv version

Hello,
I want to check the OpenCV version without using python, I mean directly from the terminal.
the expected results should be in the following format:

Name: opencv
Description: The opencv library
Version: 2.x.x
Cflags: -I${includedir}/opencv -I${includedir}/opencv2
Libs: -L${libdir} -lopencv_calib3d -lopencv_imgproc -lopencv_contrib -lopencv_legacy -lopencv_core -lopencv_ml -lopencv_features2d -lopencv_objdetect -lopencv_flann -lopencv_video -lopencv_highgui

Thank you.

If you have installed OpenCV with pkg_config enabled, just type:

cat /usr/local/lib/pkgconfig/opencv4.pc

(or /usr/lib/... if installed from the package manager and .../opencv.pc if using opencv 2.x/3.x).

If needed, type find /usr -name opencv4.pc (or opencv.pc)

Hello,
Thanks for replying,
Actually, I tried all that did you mentioned here, and none of them is working for me.
The output of this
import cv2
print(cv2.version)
is
Screenshot from 2021-03-01 14-50-37

My main issue was

Screenshot from 2021-03-01 16-23-17

OpenCv V4 was already installed, and I solved it by running the following

sudo apt-get install libopencv-dev

look for opencv_version. it’s an executable.

Thanks @crackwitz , already fixed.

Just note that your open cv version and your python package for opencv may not be the same version, as per my understanding opencv is a system installed library, and the python opencv package is just a python package using it. E.g. I have (per opencv_version) opencv 4.2.0, and my python opencv is 4.5.