Blame view

3rdparty/opencv-4.5.4/samples/python/opencv_version.py 744 Bytes
f4334277   Hu Chunming   提交3rdparty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
  #!/usr/bin/env python
  
  '''
  prints OpenCV version
  
  Usage:
      opencv_version.py [<params>]
      params:
          --build: print complete build info
          --help:  print this help
  '''
  
  # Python 2/3 compatibility
  from __future__ import print_function
  
  import numpy as np
  import cv2 as cv
  
  def main():
      import sys
  
      try:
          param = sys.argv[1]
      except IndexError:
          param = ""
  
      if "--build" == param:
          print(cv.getBuildInformation())
      elif "--help" == param:
          print("\t--build\n\t\tprint complete build info")
          print("\t--help\n\t\tprint this help")
      else:
          print("Welcome to OpenCV")
  
      print('Done')
  
  
  if __name__ == '__main__':
      print(__doc__)
      main()
      cv.destroyAllWindows()