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
+9 -2
View File
@@ -11,8 +11,9 @@ USAGE:
# Python 2/3 compatibility
from __future__ import print_function
import cv2 as cv
import numpy as np
import cv2 as cv
import sys
@@ -62,8 +63,8 @@ def shift_dft(src, dst=None):
return dst
if __name__ == "__main__":
def main():
if len(sys.argv) > 1:
fname = sys.argv[1]
else:
@@ -110,4 +111,10 @@ if __name__ == "__main__":
cv.imshow("magnitude", log_spectrum)
cv.waitKey(0)
print('Done')
if __name__ == '__main__':
print(__doc__)
main()
cv.destroyAllWindows()