diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2006-12-14 18:58:35 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2006-12-14 18:58:35 +0100 |
commit | fbb4796e81dcb2dc2bcf792917f2391f799653c8 (patch) | |
tree | 43a7e33cf76dab6eb517df167163000b7aa26b39 | |
parent | 9a34815b9821b5c49b849277a005cd27cbb6c959 (diff) |
works quite well now
-rw-r--r-- | src/ProjectionTangentialLSQ.cxx | 9 | ||||
-rw-r--r-- | src/lsq_funcs.mac | 10 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/ProjectionTangentialLSQ.cxx b/src/ProjectionTangentialLSQ.cxx index b2f7d38..8c48105 100644 --- a/src/ProjectionTangentialLSQ.cxx +++ b/src/ProjectionTangentialLSQ.cxx @@ -65,13 +65,13 @@ ProjectionTangentialLSQ::comp_params(const Hills *h, ViewParams *parms) { parms->a_center = a_center_tmp; parms->scale = scale_tmp; parms->a_nick = a_nick_tmp; - - lsq(h, parms); - if (angle_dist(parms->a_center, m1->alph) > pi_d/2.0) { parms->a_center = parms->a_center + pi_d; } + + lsq(h, parms); + return 0; } } @@ -205,6 +205,9 @@ ProjectionTangentialLSQ::lsq(const Hills *h, ViewParams *parms) { status = gsl_multifit_fdfsolver_iterate (s); fprintf(stderr, "gsl_multifit_fdfsolver_iterate: status %d\n", status); + if (status) { + break; + } } diff --git a/src/lsq_funcs.mac b/src/lsq_funcs.mac index 0056185..d57008e 100644 --- a/src/lsq_funcs.mac +++ b/src/lsq_funcs.mac @@ -2,14 +2,14 @@ * This is the basic pinhole projection model with distortion correction */ -x_undist_unrot : tan(m_view - c_view) * scale$ -y_undist_unrot : tan(c_nick - m_nick) * scale$ +x_undist_unrot : tan(m_view - c_view) $ +y_undist_unrot : tan(c_nick - m_nick) $ d : y_undist_unrot ^ 2 + x_undist_unrot ^ 2$ -dist_fact : d ^2 * k1 + d * k0$ +dist_fact : d ^ 2 * k1 + d * k0$ x_unrot : x_undist_unrot * (1 + dist_fact)$ y_unrot : y_undist_unrot * (1 + dist_fact)$ -x : y_unrot * sin(c_tilt) + x_unrot * cos(c_tilt)$ -y : y_unrot * cos(c_tilt) - x_unrot * sin(c_tilt)$ +x : scale * (y_unrot * sin(c_tilt) + x_unrot * cos(c_tilt))$ +y : scale * (y_unrot * cos(c_tilt) - x_unrot * sin(c_tilt))$ /* * Some mangling for C code generation |