summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2014-08-27 02:48:12 +0200
committerFlorian Jung <flo@windfisch.org>2014-08-27 02:48:12 +0200
commitaffc1dfb6ad0acf3a94cf47e243f28127d33164c (patch)
treecc5b49dfecc66d17efabfd7805386f47eb73a136
parentec85614111a3b8e4df01ad290eae7a1182d4885f (diff)
fix, immernoch komisch. alte version war irgendwie besser.
-rw-r--r--stabilize.py4
-rw-r--r--warp.py4
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)