diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-05-28 19:22:39 +0200 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2008-05-28 19:22:39 +0200 |
commit | 83699b53de7288b1ffb5a4c901730bee32524f4d (patch) | |
tree | d6e929015630324b9e85d674af335c704d0cb1f2 /src/lsq_rectilinear.mac | |
parent | 47dbcc5c434c293da10039eb56a8393926b3137a (diff) | |
parent | 2dfdc09969b8c32887cb45b6f7ff286227ddfd27 (diff) |
merge projection fixes
Diffstat (limited to 'src/lsq_rectilinear.mac')
-rw-r--r-- | src/lsq_rectilinear.mac | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/lsq_rectilinear.mac b/src/lsq_rectilinear.mac index 5bd7ac9..377c24a 100644 --- a/src/lsq_rectilinear.mac +++ b/src/lsq_rectilinear.mac @@ -2,10 +2,25 @@ * rectilinear (pinhole) projection model with distortion correction */ -x : tan(m_view - c_view)$ -y : tan(c_nick - m_nick)$ -x_rot : y * sin(c_tilt) + x * cos(c_tilt)+x0$ +/* switch to cartesian coordinates */ +c_x : cos(m_nick) * cos(m_view - c_view)$ +c_y : cos(m_nick) * sin(m_view - c_view)$ +c_z : sin(m_nick)$ + +/* nick rotation */ +c_x_rot : cos(c_nick) * c_x + sin(c_nick) * c_z$ +c_y_rot : c_y$ +c_z_rot : -sin(c_nick) * c_x + cos(c_nick) * c_z$ + +/* pinhole projection */ +x : c_y_rot / c_x_rot$ +y : -c_z_rot / c_x_rot$ + +/* rotation around view axis */ +x_rot : y * sin(c_tilt) + x * cos(c_tilt) + x0$ y_rot : y * cos(c_tilt) - x * sin(c_tilt)$ + +/* distortion correction */ d : x_rot ^ 2 + y_rot ^ 2$ dist_fact : d ^ 2 * k1 + d * k0$ x_dist : x_rot * (1 + dist_fact) * scale$ |