Classes | |
class | closest_point_basic |
Closest point functor based on map distance. More... | |
class | closest_point_with_map |
Closest point functor based on map distance. More... | |
Namespaces | |
namespace | impl |
namespace | internal |
Functions | |
template<typename P, typename F> | |
float | compute_d_k (const p_array< P > &P_, const F &closest_point, const algebra::quat &qR, const algebra::quat &qR_old, const vec3d_f &qT, const vec3d_f &qT_old) |
template<typename P, typename F> | |
void | compute_distance_criteria (const p_array< P > &P_, const F &closest_point, const std::pair< algebra::quat, mln_vec(P)> &pair, unsigned r, int &d_min, int &d_max) |
template<typename P, typename F> | |
float | compute_standard_deviation (const p_array< P > &P_, const std::pair< algebra::quat, mln_vec(P)> &pair, const F &closest_point) |
template<typename P> | |
void | display_sites_used_in_icp (image3d< value::rgb8 > &out, const p_array< P > &P_sub, const p_array< P > &P_, const p_array< P > &X, unsigned r, const std::string &prefix, const std::pair< algebra::quat, mln_vec(P)> &pair, const std::string &period, const value::rgb8 &c) |
template<typename P> | |
void | draw_last_run (const box3d &box, const p_array< P > &kept, const p_array< P > &removed, const p_array< P > &X, const algebra::quat &qR, const vec3d_f qT) |
template<typename P, typename F> | |
vec3d_f | get_mu_yk (const p_array< P > &P_, const F &closest_point, const algebra::quat &qR, const vec3d_f &qT, float &e_k) |
template<typename P, typename F> | |
algebra::quat | get_rot (const p_array< P > &P_, const vec3d_f &mu_P, const vec3d_f &mu_Yk, const F &closest_point, const algebra::quat &qR, const vec3d_f &qT) |
FIXME: work only for 3d images. | |
template<typename P, typename M> | |
fun::x2x::rotation< 3u, float > | get_rot (const p_array< P > &c, const algebra::vec< 3u, float > &mu_c, const p_array< P > &ck, const M &map, const algebra::vec< 3u, float > &mu_xk) |
template<typename P, typename M> | |
fun::x2x::rotation< 2u, float > | get_rot (const p_array< P > &c, const algebra::vec< 2u, float > &mu_c, const p_array< P > &ck, const M &map, const algebra::vec< 2u, float > &mu_xk) |
template<typename P, typename M> | |
fun::x2x::rotation< P::dim, float > | get_rot (const p_array< P > &c, const algebra::vec< P::dim, float > &mu_c, const p_array< P > &ck, const M &map, const algebra::vec< P::dim, float > &mu_xk) |
template<typename P, typename M> | |
composed< rotation< P::dim, float >, translation< P::dim, float > > | get_rtransf (const p_array< P > &C, const algebra::vec< P::dim, float > &mu_C, const p_array< P > &ck, const M &map) |
template<typename P, typename F> | |
composed< translation< P::dim, float >, rotation< P::dim, float > > | icp (const p_array< P > &P_, const p_array< P > &X, const F &closest_point) |
template<typename P, typename F> | |
std::pair< algebra::quat, mln_vec(P)> | icp (const p_array< P > &P_, const p_array< P > &X, const F &closest_point, const algebra::quat &initial_rot, const mln_vec(P)&initial_translation) |
Base version of the ICP algorithm. It is called in other variants. | |
template<typename P> | |
composed< translation< P::dim, float >, rotation< P::dim, float > > | registration1 (const box< P > &domain, const p_array< P > &P_, const p_array< P > &X) |
Call ICP once and return the resulting transformation. | |
template<typename P> | |
composed< translation< P::dim, float >, rotation< P::dim, float > > | registration2 (const box< P > &domain, const p_array< P > &P_, const p_array< P > &X) |
Call ICP 10 times. | |
template<typename P> | |
composed< translation< P::dim, float >, rotation< P::dim, float > > | registration3 (const box< P > &domain, const p_array< P > &P_, const p_array< P > &X) |
Call ICP 10 times. | |
template<typename P, typename F> | |
p_array< P > | remove_too_far_sites (image3d< value::rgb8 > &out, const p_array< P > &P_, const F &closest_point, const std::pair< algebra::quat, mln_vec(P)> &pair, const p_array< P > &X, p_array< P > &removed_set, unsigned r, int d_min, int d_max, const std::string &method) |
template<typename P, typename F> | |
void | remove_too_far_sites_debug (image3d< value::rgb8 > &out, const p_array< P > &P_, const F &closest_point, const std::pair< algebra::quat, mln_vec(P)> &pair, const p_array< P > &X, unsigned r, int d_min, int d_max, unsigned prefix) |
float mln::registration::compute_d_k | ( | const p_array< P > & | P_, | |
const F & | closest_point, | |||
const algebra::quat & | qR, | |||
const algebra::quat & | qR_old, | |||
const vec3d_f & | qT, | |||
const vec3d_f & | qT_old | |||
) | [inline] |
Definition at line 502 of file icp.hh.
References mln::algebra::quat::rotate(), mln::accu::rms< T, V >::take(), and mln::accu::rms< T, V >::to_result().
Referenced by icp().
void mln::registration::compute_distance_criteria | ( | const p_array< P > & | P_, | |
const F & | closest_point, | |||
const std::pair< algebra::quat, mln_vec(P)> & | pair, | |||
unsigned | r, | |||
int & | d_min, | |||
int & | d_max | |||
) | [inline] |
Definition at line 371 of file icp.hh.
References mln::p_array< P >::nsites(), mln::accu::math::sum< T, S >::take(), mln::accu::histo< V >::take(), and mln::point< G, C >::to_vec().
Referenced by mln::registration::impl::registration2(), and mln::registration::impl::registration3().
float mln::registration::compute_standard_deviation | ( | const p_array< P > & | P_, | |
const std::pair< algebra::quat, mln_vec(P)> & | pair, | |||
const F & | closest_point | |||
) | [inline] |
Definition at line 303 of file icp.hh.
References mln::accu::rms< T, V >::hook_value_(), mln::p_array< P >::nsites(), mln::accu::rms< T, V >::take(), and mln::accu::rms< T, V >::to_result().
void mln::registration::display_sites_used_in_icp | ( | image3d< value::rgb8 > & | out, | |
const p_array< P > & | P_sub, | |||
const p_array< P > & | P_, | |||
const p_array< P > & | X, | |||
unsigned | r, | |||
const std::string & | prefix, | |||
const std::pair< algebra::quat, mln_vec(P)> & | pair, | |||
const std::string & | period, | |||
const value::rgb8 & | c | |||
) | [inline] |
Definition at line 469 of file icp.hh.
References mln::literal::black, mln::data::fill(), mln::literal::red, mln::io::ppm::save(), mln::slice(), and mln::literal::white.
Referenced by mln::registration::impl::registration2(), and mln::registration::impl::registration3().
void mln::registration::draw_last_run | ( | const box3d & | box, | |
const p_array< P > & | kept, | |||
const p_array< P > & | removed, | |||
const p_array< P > & | X, | |||
const algebra::quat & | qR, | |||
const vec3d_f | qT | |||
) | [inline] |
Definition at line 277 of file icp.hh.
References mln::literal::black, mln::pw::cst(), mln::data::fill(), mln::literal::green, mln::literal::red, mln::algebra::quat::rotate(), mln::io::ppm::save(), mln::slice(), mln::point< G, C >::to_vec(), and mln::literal::white.
Referenced by mln::registration::impl::registration2(), and mln::registration::impl::registration3().
vec3d_f mln::registration::get_mu_yk | ( | const p_array< P > & | P_, | |
const F & | closest_point, | |||
const algebra::quat & | qR, | |||
const vec3d_f & | qT, | |||
float & | e_k | |||
) | [inline] |
Definition at line 582 of file icp.hh.
References mln::algebra::quat::rotate(), mln::accu::rms< T, V >::take(), mln::accu::center< P, V >::take(), mln::accu::center< P, V >::to_result(), mln::accu::rms< T, V >::to_result(), and mln::point< G, C >::to_vec().
Referenced by icp().
algebra::quat mln::registration::get_rot | ( | const p_array< P > & | P_, | |
const vec3d_f & | mu_P, | |||
const vec3d_f & | mu_Yk, | |||
const F & | closest_point, | |||
const algebra::quat & | qR, | |||
const vec3d_f & | qT | |||
) | [inline] |
FIXME: work only for 3d images.
Spx: cross-covariance matrix.
Definition at line 526 of file icp.hh.
References mln::math::jacobi(), mln::p_array< P >::nsites(), mln::algebra::quat::rotate(), and mln::algebra::mat< n, m, T >::t().
fun::x2x::rotation<3u, float> mln::registration::get_rot | ( | const p_array< P > & | c, | |
const algebra::vec< 3u, float > & | mu_c, | |||
const p_array< P > & | ck, | |||
const M & | map, | |||
const algebra::vec< 3u, float > & | mu_xk | |||
) | [inline] |
Definition at line 83 of file get_rot.hh.
References mln::math::jacobi(), mln::p_array< P >::nsites(), mln::algebra::mat< n, m, T >::t(), and mln::literal::zero.
fun::x2x::rotation<2u, float> mln::registration::get_rot | ( | const p_array< P > & | c, | |
const algebra::vec< 2u, float > & | mu_c, | |||
const p_array< P > & | ck, | |||
const M & | map, | |||
const algebra::vec< 2u, float > & | mu_xk | |||
) | [inline] |
Definition at line 56 of file get_rot.hh.
fun::x2x::rotation<P::dim, float> mln::registration::get_rot | ( | const p_array< P > & | c, | |
const algebra::vec< P::dim, float > & | mu_c, | |||
const p_array< P > & | ck, | |||
const M & | map, | |||
const algebra::vec< P::dim, float > & | mu_xk | |||
) | [inline] |
Referenced by get_rtransf(), and icp().
composed< rotation< P::dim, float >, translation< P::dim, float > > mln::registration::get_rtransf | ( | const p_array< P > & | C, | |
const algebra::vec< P::dim, float > & | mu_C, | |||
const p_array< P > & | ck, | |||
const M & | map | |||
) | [inline] |
Definition at line 56 of file get_rtransf.hh.
References mln::compose(), get_rot(), mln::p_array< P >::nsites(), mln::convert::to(), and mln::literal::zero.
composed< translation<P::dim,float>,rotation<P::dim,float> > mln::registration::icp | ( | const p_array< P > & | P_, | |
const p_array< P > & | X, | |||
const F & | closest_point | |||
) | [inline] |
Register point in c
using a function of closest points closest_point
.
[in] | P_ | The cloud of points. |
[in] | X | the reference surface. |
[in] | closest_point | The function of closest points. |
std::pair< algebra::quat, mln_vec(P)> mln::registration::icp | ( | const p_array< P > & | P_, | |
const p_array< P > & | X, | |||
const F & | closest_point, | |||
const algebra::quat & | initial_rot, | |||
const mln_vec(P)& | initial_translation | |||
) | [inline] |
Base version of the ICP algorithm. It is called in other variants.
Register point in c
using a function of closest points closest_point
. This overload allows to specify initial transformations.
[in] | P_ | The cloud of points. |
[in] | X | the reference surface. |
[in] | closest_point | The function of closest points. |
[in] | initial_rot | An initial rotation. |
[in] | initial_translation | An initial translation. |
closest_point
*MUST* take float/double vector as arguments. Otherwise the resulting transformation may be wrong due to the truncation of the vector coordinate values.
P_
and X
must not be empty.Compute transformation
End of "compute transformation"
Definition at line 611 of file icp.hh.
References mln::geom::bbox(), mln::literal::black, mln::set::compute(), compute_d_k(), mln::duplicate(), mln::box< P >::enlarge(), mln::trace::entering(), mln::trace::exiting(), mln::data::fill(), get_mu_yk(), get_rot(), mln::literal::green, mln::internal::site_set_base_< P, E >::is_empty(), mln::algebra::quat::is_null(), mln::norm::l2(), mln::algebra::quat::rotate(), mln::io::ppm::save(), mln::slice(), mln::algebra::quat::v(), and mln::literal::white.
Referenced by mln::registration::impl::registration1(), mln::registration::impl::registration2(), and mln::registration::impl::registration3().
composed< translation< P::dim, float >, rotation< P::dim, float > > mln::registration::registration1 | ( | const box< P > & | domain, | |
const p_array< P > & | P_, | |||
const p_array< P > & | X | |||
) | [inline] |
Call ICP once and return the resulting transformation.
Definition at line 325 of file registration.hh.
References mln::trace::entering(), mln::trace::exiting(), icp(), mln::registration::impl::registration1(), mln::registration::internal::registration_tests(), mln::util::timer::start(), and mln::literal::zero.
Referenced by registration1().
composed< translation< P::dim, float >, rotation< P::dim, float > > mln::registration::registration2 | ( | const box< P > & | domain, | |
const p_array< P > & | P_, | |||
const p_array< P > & | X | |||
) | [inline] |
Call ICP 10 times.
Do the first call to ICP with all sites then work on a subset of which size is decreasing. For each call, a distance criterion is computed on a subset. Sites part of the subset which are too far or too close are removed. Removed sites are *NOT* reused later in the subset.
Definition at line 345 of file registration.hh.
References mln::literal::blue, compute_distance_criteria(), display_sites_used_in_icp(), draw_last_run(), mln::trace::entering(), mln::trace::exiting(), mln::literal::green, icp(), mln::registration::impl::registration2(), mln::registration::internal::registration_tests(), remove_too_far_sites(), mln::util::timer::start(), and mln::literal::zero.
Referenced by registration2().
composed< translation< P::dim, float >, rotation< P::dim, float > > mln::registration::registration3 | ( | const box< P > & | domain, | |
const p_array< P > & | P_, | |||
const p_array< P > & | X | |||
) | [inline] |
Call ICP 10 times.
Do the first call to ICP with all sites then work on a subset. For each call, a distance criterion is computed on a subset. A new subset is computed from the whole set of points according to this distance. It will be used in the next call. Removed Sites *MAY* be reintegrated.
Definition at line 365 of file registration.hh.
References mln::literal::blue, compute_distance_criteria(), display_sites_used_in_icp(), draw_last_run(), mln::trace::entering(), mln::trace::exiting(), mln::literal::green, icp(), mln::registration::impl::registration3(), mln::registration::internal::registration_tests(), remove_too_far_sites(), mln::util::timer::start(), and mln::literal::zero.
Referenced by registration3().
p_array<P> mln::registration::remove_too_far_sites | ( | image3d< value::rgb8 > & | out, | |
const p_array< P > & | P_, | |||
const F & | closest_point, | |||
const std::pair< algebra::quat, mln_vec(P)> & | pair, | |||
const p_array< P > & | X, | |||
p_array< P > & | removed_set, | |||
unsigned | r, | |||
int | d_min, | |||
int | d_max, | |||
const std::string & | method | |||
) | [inline] |
Definition at line 405 of file icp.hh.
References mln::p_array< P >::append(), mln::literal::black, mln::data::fill(), mln::literal::green, mln::literal::red, mln::io::ppm::save(), mln::io::cloud::save(), mln::slice(), mln::point< G, C >::to_vec(), and mln::literal::white.
Referenced by mln::registration::impl::registration2(), and mln::registration::impl::registration3().
void mln::registration::remove_too_far_sites_debug | ( | image3d< value::rgb8 > & | out, | |
const p_array< P > & | P_, | |||
const F & | closest_point, | |||
const std::pair< algebra::quat, mln_vec(P)> & | pair, | |||
const p_array< P > & | X, | |||
unsigned | r, | |||
int | d_min, | |||
int | d_max, | |||
unsigned | prefix | |||
) | [inline] |
Definition at line 328 of file icp.hh.
References mln::literal::black, mln::data::fill(), mln::literal::green, mln::literal::red, mln::io::ppm::save(), mln::slice(), and mln::literal::white.