Namespaces | Classes | Functions

mln::registration Namespace Reference

Namespace of "point-wise" expression tools. More...

Namespaces

namespace  impl
namespace  internal

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...

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 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 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 >
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 >
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 , 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 >
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)

Detailed Description

Namespace of "point-wise" expression tools.


Function Documentation

template<typename P , typename F >
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]
template<typename P , typename F >
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 
)
template<typename P , typename F >
float mln::registration::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 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 
)
template<typename P >
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 
)
template<typename P , typename F >
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]
template<typename P , typename M >
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 
)
template<typename P , typename M >
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 
)

Definition at line 56 of file get_rot.hh.

template<typename P , typename M >
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 
)

Referenced by get_rtransf(), and icp().

template<typename P , typename F >
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 
)

FIXME: work only for 3d images.

Spx: cross-covariance matrix.

Definition at line 527 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().

template<typename P , typename M >
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 
)
template<typename P , typename F >
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.

Parameters:
[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.
Returns:
the rigid transformation which may be use later to create a registered image.

WARNING: the function 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.

Precondition:
P_ and X must not be empty.

Reference article: "A Method for Registration of 3-D Shapes", Paul J. Besl and Neil D. McKay, IEEE, 2, February 1992.

Compute transformation

End of "compute transformation"

Compute transformation

End of "compute transformation"

Definition at line 612 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, p_array< P > >::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().

template<typename P , typename F >
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 
)

Register point in c using a function of closest points closest_point.

Parameters:
[in] P_ The cloud of points.
[in] X the reference surface.
[in] closest_point The function of closest points.
Returns:
the rigid transformation which may be use later to create a registered image.
template<typename P >
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(), and mln::registration::internal::registration_tests().

template<typename P >
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::trace::entering(), mln::trace::exiting(), and mln::registration::internal::registration_tests().

template<typename P >
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::trace::entering(), mln::trace::exiting(), and mln::registration::internal::registration_tests().

template<typename P , typename F >
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 
)
template<typename P , typename F >
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 
)