1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Various Python samples updated for Python 2/3 compatibility.

This commit is contained in:
Adam Gibson
2015-09-14 00:00:22 +08:00
parent 190d00ea3e
commit b57be28920
34 changed files with 288 additions and 99 deletions
+8 -1
View File
@@ -11,6 +11,13 @@
Pressing any key (except ESC) will reset the tracking with a different speed.
Pressing ESC will stop the program.
"""
# Python 2/3 compatibility
import sys
PY3 = sys.version_info[0] == 3
if PY3:
long = int
import cv2
from math import cos, sin
import numpy as np
@@ -21,7 +28,7 @@ if __name__ == "__main__":
img_width = 500
kalman = cv2.KalmanFilter(2, 1, 0)
code = -1L
code = long(-1)
cv2.namedWindow("Kalman")