26 #ifndef MLN_REGISTRATION_GET_RTRANSF_HH
27 # define MLN_REGISTRATION_GET_RTRANSF_HH
29 # include <mln/core/site_set/p_array.hh>
30 # include <mln/fun/x2x/all.hh>
31 # include <mln/algebra/quat.hh>
32 # include <mln/algebra/vec.hh>
33 # include <mln/math/jacobi.hh>
34 # include <mln/registration/get_rot.hh>
39 namespace registration
42 using namespace fun::x2x;
44 template <
typename P,
typename M>
45 composed<rotation<P::dim, float>, translation<P::dim, float> >
46 get_rtransf(
const p_array<P>& C,
47 const algebra::vec<P::dim,float>& mu_C,
52 # ifndef MLN_INCLUDE_ONLY
54 template <
typename P,
typename M>
55 composed<rotation<P::dim, float>, translation<P::dim, float> >
56 get_rtransf(
const p_array<P>& c,
57 const algebra::vec<P::dim,float>& mu_c,
64 std::cout << c.nsites() << std::endl;
65 for (
unsigned i = 0; i < c.nsites(); ++i)
67 if (not map.has(ck[i]))
69 std::cout << ck[i] <<
" " << i << std::endl;
72 mu_xk += convert::to< algebra::vec<P::dim,float> >
73 (map(
convert::to< algebra::vec<P::dim,float> >(ck[i])));
79 rotation<P::dim, float> tqR = get_rot(c, mu_c, ck, map, mu_xk);
82 const algebra::vec<P::dim,float> qT = mu_xk - tqR(mu_c);
83 translation<P::dim, float> tqT(qT);
87 # endif // ! MLN_INCLUDE_ONLY
94 #endif // ! MLN_REGISTRATION_GET_RTRANSF_HH