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
@@ -65,8 +65,7 @@ def defocus_kernel(d, sz=65):
return kern
if __name__ == '__main__':
print(__doc__)
def main():
import sys, getopt
opts, args = getopt.getopt(sys.argv[1:], '', ['circle', 'angle=', 'd=', 'snr='])
opts = dict(opts)
@@ -128,3 +127,11 @@ if __name__ == '__main__':
if ch == ord(' '):
defocus = not defocus
update(None)
print('Done')
if __name__ == '__main__':
print(__doc__)
main()
cv.destroyAllWindows()