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 -3
View File
@@ -18,12 +18,13 @@ PY3 = sys.version_info[0] == 3
if PY3:
long = int
import numpy as np
import cv2 as cv
from math import cos, sin, sqrt
import numpy as np
if __name__ == "__main__":
def main():
img_height = 500
img_width = 500
kalman = cv.KalmanFilter(2, 1, 0)
@@ -93,4 +94,10 @@ if __name__ == "__main__":
if code in [27, ord('q'), ord('Q')]:
break
cv.destroyWindow("Kalman")
print('Done')
if __name__ == '__main__':
print(__doc__)
main()
cv.destroyAllWindows()