From 9c0ffdaef99084a877c16fa8af78cb849fd34e9c Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Mon, 25 Aug 2014 18:46:11 +0200 Subject: scalefactor --- test.py | 8 +++++--- 1 file 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__() -- cgit v1.2.3