Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/samples/python/opencv_version.py
16337 views
1
#!/usr/bin/env python
2
3
'''
4
prints OpenCV version
5
6
Usage:
7
opencv_version.py [<params>]
8
params:
9
--build: print complete build info
10
--help: print this help
11
'''
12
13
# Python 2/3 compatibility
14
from __future__ import print_function
15
16
import cv2 as cv
17
18
if __name__ == '__main__':
19
import sys
20
print(__doc__)
21
22
try:
23
param = sys.argv[1]
24
except IndexError:
25
param = ""
26
27
if "--build" == param:
28
print(cv.getBuildInformation())
29
elif "--help" == param:
30
print("\t--build\n\t\tprint complete build info")
31
print("\t--help\n\t\tprint this help")
32
else:
33
print("Welcome to OpenCV")
34
35