samples: fix python samples compatibility with demo.py

This commit is contained in:
Alexander Alekhin
2019-03-19 21:03:58 +03:00
parent f4c2c4412b
commit 04fad57fc1
48 changed files with 678 additions and 403 deletions
+10 -4
View File
@@ -11,13 +11,12 @@ Usage:
# Python 2/3 compatibility
from __future__ import print_function
import cv2 as cv
import numpy as np
import cv2 as cv
import sys
if __name__ == '__main__':
print(__doc__)
def main():
try:
fn = sys.argv[1]
except IndexError:
@@ -40,3 +39,10 @@ if __name__ == '__main__':
cv.imshow("source", src)
cv.waitKey(0)
print('Done')
if __name__ == '__main__':
print(__doc__)
main()
cv.destroyAllWindows()