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 -3
View File
@@ -18,8 +18,8 @@ Abid Rahman 3/14/12 debug Gary Bradski
# Python 2/3 compatibility
from __future__ import print_function
import cv2 as cv
import numpy as np
import cv2 as cv
bins = np.arange(256).reshape(256,1)
@@ -53,8 +53,7 @@ def hist_lines(im):
return y
if __name__ == '__main__':
def main():
import sys
if len(sys.argv)>1:
@@ -116,4 +115,11 @@ if __name__ == '__main__':
print('ESC')
cv.destroyAllWindows()
break
print('Done')
if __name__ == '__main__':
print(__doc__)
main()
cv.destroyAllWindows()