From affc1dfb6ad0acf3a94cf47e243f28127d33164c Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Wed, 27 Aug 2014 02:48:12 +0200 Subject: fix, immernoch komisch. alte version war irgendwie besser. --- stabilize.py | 4 +++- warp.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/stabilize.py b/stabilize.py index ab11b51..50d064b 100644 --- a/stabilize.py +++ b/stabilize.py @@ -39,13 +39,15 @@ def get_maps(xres,yres): # is 92 deg. -> angle over half a diagonal's length is 92/2 deg constant2= 1./(math.sqrt((1280/2)**2+(720/2)**2))*(92/2)/180*math.pi + foo = math.tan( 92/2/math.sqrt(16**2+9**2)*16. ) * constant / math.tan(1280/2 * constant2) + for y in xrange(0,yres): xtmp=[] ytmp=[] yy=(y-yres/2.)/xres # yes, xres. for x in xrange(0,xres): - xx=math.tan((x-xres/2.)/xres) + xx=math.tan((x-xres/2.)/xres*foo)/foo dist = math.sqrt(xx**2 + yy**2) diff --git a/warp.py b/warp.py index f6407e9..00be9eb 100644 --- a/warp.py +++ b/warp.py @@ -12,6 +12,8 @@ def get_maps(xres,yres): # is 92 deg. -> angle over half a diagonal's length is 92/2 deg constant2= 1./(math.sqrt((1280/2)**2+(720/2)**2))*(92/2)/180*math.pi + foo = math.tan( 92/2/math.sqrt(16**2+9**2)*16. ) * constant / math.tan(1280/2 * constant2) + for y in xrange(0,yres): xtmp=[] ytmp=[] @@ -19,7 +21,7 @@ def get_maps(xres,yres): yy=(y-yres/2.)/xres # yes, xres. for x in xrange(0,xres): xx_=(x-xres/2.)/xres - xx=math.tan(xx_) + xx=math.tan(xx_*foo)/foo dist = math.sqrt(xx**2 + yy**2) -- cgit v1.2.1