Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes
rgrl_est_proj_func< Tdim, Fdim > Class Template Reference

a generic class to estimate a homogeneous projection matrix using L-M. More...

#include <rgrl_est_proj_func.h>

Inheritance diagram for rgrl_est_proj_func< Tdim, Fdim >:
Inheritance graph
[legend]

List of all members.

Public Types

enum  UseGradient

Public Member Functions

 rgrl_est_proj_func (rgrl_set_of< rgrl_match_set_sptr > const &matches, bool with_grad=true)
 ctor.
 rgrl_est_proj_func (bool with_grad=true)
 ctor without matches.
void set_centres (vnl_vector_fixed< double, Fdim > const &fc, vnl_vector_fixed< double, Tdim > const &tc)
void set_max_num_iter (int max)
 set max number of iterations.
int max_num_iter () const
 return max number of iterations.
void set_rel_thres (double thres)
 set relative threshold for parameters change.
double rel_thres () const
 relative threshold.
void set_zero_svd_thres (double thres)
 set zero singular value threshold for SVD.
double zero_svd_thres () const
 zero singular value threshold.
bool projective_estimate (vnl_matrix_fixed< double, Tdim+1, Fdim+1 > &proj, vnl_matrix< double > &full_covar, vnl_vector_fixed< double, Fdim > &from_centre, vnl_vector_fixed< double, Tdim > &to_centre)
 estimate the projective transformation and the associated covariance.
void f (vnl_vector< double > const &x, vnl_vector< double > &fx)
 obj func value.
void gradf (vnl_vector< double > const &x, vnl_matrix< double > &jacobian)
 Jacobian.
vnl_matrix_fixed< double, Tdim+1,
Fdim+1 > 
uncentre_proj (vnl_matrix_fixed< double, Tdim+1, Fdim+1 > const &proj) const
 uncentre projection matrix.
void map_loc (vnl_vector_fixed< double, Tdim > &mapped, vnl_matrix_fixed< double, Tdim+1, Fdim+1 > const &proj, vnl_vector_fixed< double, Fdim > const &from) const
 map a location.
void throw_failure ()
void clear_failure ()
void fdgradf (vnl_vector< double > const &x, vnl_matrix< double > &jacobian, double stepsize)
void ffdgradf (vnl_vector< double > const &x, vnl_matrix< double > &jacobian, double stepsize)
virtual void trace (int iteration, vnl_vector< double > const &x, vnl_vector< double > const &fx)
double rms (vnl_vector< double > const &x)
unsigned int get_number_of_unknowns () const
unsigned int get_number_of_residuals () const
bool has_gradient () const
bool vnl_discrete_diff_fwd (vnl_least_squares_function *lsf, double h, vnl_vector< double > const &x, vnl_matrix< double > &J)
bool vnl_discrete_diff_fwd (vnl_least_squares_function *lsf, vnl_vector< double > const &h, vnl_vector< double > const &x, vnl_matrix< double > &J)
bool vnl_discrete_diff_fwd (vnl_least_squares_function *lsf, vnl_vector< double > const &h, vnl_vector< double > const &x, vnl_vector< double > const &y, vnl_matrix< double > &J)
bool vnl_discrete_diff_sym (vnl_least_squares_function *lsf, double h, vnl_vector< double > const &x, vnl_matrix< double > &J)
bool vnl_discrete_diff_sym (vnl_least_squares_function *lsf, vnl_vector< double > const &h, vnl_vector< double > const &x, vnl_matrix< double > &J)

Public Attributes

 no_gradient
 use_gradient
bool failure

Protected Member Functions

void reduced_proj_jacobian (vnl_matrix_fixed< double, Tdim,(Fdim+1)*(Tdim+1)-1 > &base_jac, vnl_matrix_fixed< double, Tdim+1, Fdim+1 > const &proj, vnl_vector_fixed< double, Fdim > const &from) const
 compute jacobian.
void full_proj_jacobian (vnl_matrix_fixed< double, Tdim,(Fdim+1)*(Tdim+1)> &base_jac, vnl_matrix_fixed< double, Tdim+1, Fdim+1 > const &proj, vnl_vector_fixed< double, Fdim > const &from) const
 compute jacobian.
void proj_jac_wrt_loc (vnl_matrix_fixed< double, Tdim, Fdim > &jac_loc, vnl_matrix_fixed< double, Tdim+1, Fdim+1 > const &proj, vnl_vector_fixed< double, Fdim > const &from) const
 compute jacobian w.r.t. location.
void convert_parameters (vnl_vector< double > &params, vnl_matrix_fixed< double, Tdim+1, Fdim+1 > proj_matrix, vnl_vector_fixed< double, Fdim > const &fc, vnl_vector_fixed< double, Tdim > const &tc)
 convert parameters.
void restored_centered_proj (vnl_matrix_fixed< double, Tdim+1, Fdim+1 > &proj_matrix, vnl_vector< double > const &params) const
 convert parameters.
void init (unsigned int number_of_unknowns, unsigned int number_of_residuals)

Protected Attributes

rgrl_set_of
< rgrl_match_set_sptr > const * 
matches_ptr_
vnl_vector_fixed< double, Fdim > from_centre_
vnl_vector_fixed< double, Tdim > to_centre_
unsigned int index_row_
unsigned int index_col_
int max_num_iterations_
 specify the maximum number of iterations for this estimator.
double relative_threshold_
 The threshold for relative parameter change before termination.
double zero_svd_thres_
 zero singular value threshold.
unsigned int p_
unsigned int n_
bool use_gradient_

Static Protected Attributes

static const unsigned int proj_size_ = (Tdim+1)*(Fdim+1)

Detailed Description

template<unsigned int Tdim, unsigned int Fdim>
class rgrl_est_proj_func< Tdim, Fdim >

a generic class to estimate a homogeneous projection matrix using L-M.

Definition at line 58 of file rgrl_est_proj_func.h.


Constructor & Destructor Documentation

template<unsigned int Tdim, unsigned int Fdim>
rgrl_est_proj_func< Tdim, Fdim >::rgrl_est_proj_func ( rgrl_set_of< rgrl_match_set_sptr > const &  matches,
bool  with_grad = true 
)

ctor.

Definition at line 29 of file rgrl_est_proj_func.txx.

template<unsigned int Tdim, unsigned int Fdim>
rgrl_est_proj_func< Tdim, Fdim >::rgrl_est_proj_func ( bool  with_grad = true)

ctor without matches.

Definition at line 45 of file rgrl_est_proj_func.txx.


Member Function Documentation

template<unsigned int Tdim, unsigned int Fdim>
void rgrl_est_proj_func< Tdim, Fdim >::convert_parameters ( vnl_vector< double > &  params,
vnl_matrix_fixed< double, Tdim+1, Fdim+1 >  proj_matrix,
vnl_vector_fixed< double, Fdim > const &  fc,
vnl_vector_fixed< double, Tdim > const &  tc 
) [protected]

convert parameters.

Definition at line 62 of file rgrl_est_proj_func.txx.

template<unsigned int Tdim, unsigned int Fdim>
void rgrl_est_proj_func< Tdim, Fdim >::f ( vnl_vector< double > const &  x,
vnl_vector< double > &  fx 
) [virtual]

obj func value.

Implements vnl_least_squares_function.

Reimplemented in rgrl_est_proj_rad_func< Tdim, Fdim >, and rgrl_est_proj_rad_func< 2, 2 >.

Definition at line 260 of file rgrl_est_proj_func.txx.

template<unsigned int Tdim, unsigned int Fdim>
void rgrl_est_proj_func< Tdim, Fdim >::full_proj_jacobian ( vnl_matrix_fixed< double, Tdim,(Fdim+1)*(Tdim+1)> &  base_jac,
vnl_matrix_fixed< double, Tdim+1, Fdim+1 > const &  proj,
vnl_vector_fixed< double, Fdim > const &  from 
) const [protected]

compute jacobian.

Definition at line 151 of file rgrl_est_proj_func.txx.

template<unsigned int Tdim, unsigned int Fdim>
void rgrl_est_proj_func< Tdim, Fdim >::gradf ( vnl_vector< double > const &  x,
vnl_matrix< double > &  jacobian 
) [virtual]

Jacobian.

Reimplemented from vnl_least_squares_function.

Reimplemented in rgrl_est_proj_rad_func< Tdim, Fdim >, and rgrl_est_proj_rad_func< 2, 2 >.

Definition at line 303 of file rgrl_est_proj_func.txx.

template<unsigned int Tdim, unsigned int Fdim>
void rgrl_est_proj_func< Tdim, Fdim >::map_loc ( vnl_vector_fixed< double, Tdim > &  mapped,
vnl_matrix_fixed< double, Tdim+1, Fdim+1 > const &  proj,
vnl_vector_fixed< double, Fdim > const &  from 
) const [inline]

map a location.

Definition at line 120 of file rgrl_est_proj_func.h.

template<unsigned int Tdim, unsigned int Fdim>
int rgrl_est_proj_func< Tdim, Fdim >::max_num_iter ( ) const [inline]

return max number of iterations.

Definition at line 81 of file rgrl_est_proj_func.h.

template<unsigned int Tdim, unsigned int Fdim>
void rgrl_est_proj_func< Tdim, Fdim >::proj_jac_wrt_loc ( vnl_matrix_fixed< double, Tdim, Fdim > &  jac_loc,
vnl_matrix_fixed< double, Tdim+1, Fdim+1 > const &  proj,
vnl_vector_fixed< double, Fdim > const &  from 
) const [protected]

compute jacobian w.r.t. location.

Definition at line 211 of file rgrl_est_proj_func.txx.

template<unsigned int Tdim, unsigned int Fdim>
bool rgrl_est_proj_func< Tdim, Fdim >::projective_estimate ( vnl_matrix_fixed< double, Tdim+1, Fdim+1 > &  proj,
vnl_matrix< double > &  full_covar,
vnl_vector_fixed< double, Fdim > &  from_centre,
vnl_vector_fixed< double, Tdim > &  to_centre 
)

estimate the projective transformation and the associated covariance.

Definition at line 351 of file rgrl_est_proj_func.txx.

template<unsigned int Tdim, unsigned int Fdim>
void rgrl_est_proj_func< Tdim, Fdim >::reduced_proj_jacobian ( vnl_matrix_fixed< double, Tdim,(Fdim+1)*(Tdim+1)-1 > &  base_jac,
vnl_matrix_fixed< double, Tdim+1, Fdim+1 > const &  proj,
vnl_vector_fixed< double, Fdim > const &  from 
) const [protected]

compute jacobian.

Definition at line 191 of file rgrl_est_proj_func.txx.

template<unsigned int Tdim, unsigned int Fdim>
double rgrl_est_proj_func< Tdim, Fdim >::rel_thres ( ) const [inline]

relative threshold.

Definition at line 89 of file rgrl_est_proj_func.h.

template<unsigned int Tdim, unsigned int Fdim>
void rgrl_est_proj_func< Tdim, Fdim >::restored_centered_proj ( vnl_matrix_fixed< double, Tdim+1, Fdim+1 > &  proj_matrix,
vnl_vector< double > const &  params 
) const [protected]

convert parameters.

Definition at line 242 of file rgrl_est_proj_func.txx.

template<unsigned int Tdim, unsigned int Fdim>
void rgrl_est_proj_func< Tdim, Fdim >::set_centres ( vnl_vector_fixed< double, Fdim > const &  fc,
vnl_vector_fixed< double, Tdim > const &  tc 
) [inline]

Definition at line 69 of file rgrl_est_proj_func.h.

template<unsigned int Tdim, unsigned int Fdim>
void rgrl_est_proj_func< Tdim, Fdim >::set_max_num_iter ( int  max) [inline]

set max number of iterations.

Definition at line 77 of file rgrl_est_proj_func.h.

template<unsigned int Tdim, unsigned int Fdim>
void rgrl_est_proj_func< Tdim, Fdim >::set_rel_thres ( double  thres) [inline]

set relative threshold for parameters change.

Definition at line 85 of file rgrl_est_proj_func.h.

template<unsigned int Tdim, unsigned int Fdim>
void rgrl_est_proj_func< Tdim, Fdim >::set_zero_svd_thres ( double  thres) [inline]

set zero singular value threshold for SVD.

Definition at line 93 of file rgrl_est_proj_func.h.

template<unsigned int Tdim, unsigned int Fdim>
vnl_matrix_fixed< double, Tdim+1, Fdim+1 > rgrl_est_proj_func< Tdim, Fdim >::uncentre_proj ( vnl_matrix_fixed< double, Tdim+1, Fdim+1 > const &  proj) const

uncentre projection matrix.

uncenter projection matrix.

Definition at line 123 of file rgrl_est_proj_func.txx.

template<unsigned int Tdim, unsigned int Fdim>
double rgrl_est_proj_func< Tdim, Fdim >::zero_svd_thres ( ) const [inline]

zero singular value threshold.

Definition at line 97 of file rgrl_est_proj_func.h.


Member Data Documentation

template<unsigned int Tdim, unsigned int Fdim>
vnl_vector_fixed<double, Fdim> rgrl_est_proj_func< Tdim, Fdim >::from_centre_ [protected]

Definition at line 160 of file rgrl_est_proj_func.h.

template<unsigned int Tdim, unsigned int Fdim>
unsigned int rgrl_est_proj_func< Tdim, Fdim >::index_col_ [protected]

Definition at line 164 of file rgrl_est_proj_func.h.

template<unsigned int Tdim, unsigned int Fdim>
unsigned int rgrl_est_proj_func< Tdim, Fdim >::index_row_ [protected]

Definition at line 163 of file rgrl_est_proj_func.h.

template<unsigned int Tdim, unsigned int Fdim>
rgrl_set_of<rgrl_match_set_sptr> const* rgrl_est_proj_func< Tdim, Fdim >::matches_ptr_ [protected]

Definition at line 159 of file rgrl_est_proj_func.h.

template<unsigned int Tdim, unsigned int Fdim>
int rgrl_est_proj_func< Tdim, Fdim >::max_num_iterations_ [protected]

specify the maximum number of iterations for this estimator.

Definition at line 166 of file rgrl_est_proj_func.h.

template<unsigned int Tdim, unsigned int Fdim>
const unsigned int rgrl_est_proj_func< Tdim, Fdim >::proj_size_ = (Tdim+1)*(Fdim+1) [static, protected]

Definition at line 157 of file rgrl_est_proj_func.h.

template<unsigned int Tdim, unsigned int Fdim>
double rgrl_est_proj_func< Tdim, Fdim >::relative_threshold_ [protected]

The threshold for relative parameter change before termination.

Definition at line 169 of file rgrl_est_proj_func.h.

template<unsigned int Tdim, unsigned int Fdim>
vnl_vector_fixed<double, Tdim> rgrl_est_proj_func< Tdim, Fdim >::to_centre_ [protected]

Definition at line 161 of file rgrl_est_proj_func.h.

template<unsigned int Tdim, unsigned int Fdim>
double rgrl_est_proj_func< Tdim, Fdim >::zero_svd_thres_ [protected]

zero singular value threshold.

Definition at line 172 of file rgrl_est_proj_func.h.


The documentation for this class was generated from the following files: