summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2014-08-25 18:46:11 +0200
committerFlorian Jung <flo@windfisch.org>2014-08-25 18:46:11 +0200
commit9c0ffdaef99084a877c16fa8af78cb849fd34e9c (patch)
tree6af1c4ae66c39cda6ddda89c7a2a826d3d939381
parent4254110d795febc9d2b3330e7810aece01b297ca (diff)
scalefactor
-rw-r--r--test.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/test.py b/test.py
index 325ffec..2f703e7 100644
--- a/test.py
+++ b/test.py
@@ -10,6 +10,8 @@ feature_params = dict( maxCorners = 100,
minDistance = 20,
blockSize = 7 )
+scale_factor=0.5
+
# Parameters for lucas kanade optical flow
lk_params = dict( winSize = (15,15),
maxLevel = 2,
@@ -67,9 +69,9 @@ while(cap.isOpened()):
print angle/3.141592654*180,'deg\t',stretch,"%\t", shift_x,'\t',shift_y
frame2=frame.copy()
- mat2=cv2.getRotationMatrix2D((width/2,height/2), total_angle/3.141593654*180, 1.)
- mat2[0,2] = mat2[0,2]+total_x
- mat2[1,2] = mat2[1,2]+total_y
+ mat2=cv2.getRotationMatrix2D((width/2,height/2), total_angle/3.141593654*180, scale_factor)
+ mat2[0,2] = mat2[0,2]+total_x*scale_factor
+ mat2[1,2] = mat2[1,2]+total_y*scale_factor
print mat2.__repr__()