opencv_version.py 744 B

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