#include <rgrl_est_spline.h>
Public Member Functions | |
rgrl_est_spline (unsigned dof, rgrl_mask_box const &roi, vnl_vector< double > const &delta, vnl_vector< unsigned > const &m, bool use_thin_plate=false, double lambda=0.001) | |
Constructor. | |
rgrl_est_spline (unsigned dof, rgrl_transformation_sptr global_xform, rgrl_mask_box const &roi, vnl_vector< double > const &delta, vnl_vector< unsigned > const &m, bool use_thin_plate=false, double lambda=0.001) | |
Constructor. | |
rgrl_transformation_sptr | estimate (rgrl_set_of< rgrl_match_set_sptr > const &matches, rgrl_transformation const &cur_transform) const |
Estimate the transform. | |
rgrl_transformation_sptr | estimate (rgrl_match_set_sptr matches, rgrl_transformation const &cur_transform) const |
Estimate the transform. | |
const vcl_type_info & | transformation_type () const |
Type of transformation estimated by this estimator. | |
void | set_optimize_method (int optimize_method) |
rgrl_type_macro (rgrl_est_spline, rgrl_nonlinear_estimator) | |
virtual bool | is_iterative_method () const |
Linear estimator is non-iterative. | |
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. | |
unsigned int | param_dof () const |
The degrees of freedom in the parameter set. | |
void | set_param_dof (unsigned int dof) |
Set the degrees of freedom. | |
virtual unsigned int | residual_dof () const |
The degrees of freedom in the residual. | |
virtual const vcl_string | transformation_name () const |
Name of transformation estimated by this estimator. | |
rgrl_type_macro (rgrl_estimator, rgrl_object) | |
virtual bool | is_type (const vcl_type_info &type) const |
void | set_debug_flag (unsigned int debugFlag) const |
Set the value of the debug flag. A non-zero value turns debugging on. | |
unsigned int | debug_flag () const |
Get the value of the debug flag. | |
void | set_warning (bool) const |
Set the flag for warning messages. | |
bool | warning () const |
Get the warning flag. | |
unsigned int | add_observer (rgrl_event_sptr event, rgrl_command_sptr) |
Allow people to add/remove/invoke observers (callbacks) to any rgrl object. | |
rgrl_command_sptr | get_command (unsigned int tag) |
Get the command associated with the given tag. | |
void | invoke_event (const rgrl_event &) |
Call execute(.) on all the rgrl_commands observing this event id. | |
void | invoke_event (const rgrl_event &) const |
Call execute(.) on all the rgrl_commands observing this event id. | |
void | remove_observer (unsigned int tag) |
Remove the observer with this tag value. | |
bool | has_observer (const rgrl_event &event) const |
Return true if an observer is registered for this event. | |
void | ref () |
void | unref () |
int | get_references () const |
bool | is_referenced () const |
Static Public Member Functions | |
static const vcl_type_info & | type_id () |
Protected Attributes | |
int | max_num_iterations_ |
specify the maximum number of iterations for this estimator. | |
double | relative_threshold_ |
The threshold for relative parameter change before termination. | |
Private Member Functions | |
void | point_in_knots (vnl_vector< double > const &point, vnl_vector< double > &spline_pt) const |
Private Attributes | |
rgrl_mask_box | roi_ |
vnl_vector< double > | delta_ |
vnl_vector< unsigned > | m_ |
bool | use_thin_plate_ |
double | lambda_ |
int | optimize_method_ |
rgrl_transformation_sptr | global_xform_ |
A global transformation. |
Definition at line 22 of file rgrl_est_spline.h.
rgrl_est_spline::rgrl_est_spline | ( | unsigned | dof, |
rgrl_mask_box const & | roi, | ||
vnl_vector< double > const & | delta, | ||
vnl_vector< unsigned > const & | m, | ||
bool | use_thin_plate = false , |
||
double | lambda = 0.001 |
||
) |
Constructor.
Only B-spline estimation is performed. Neither is the global estimation performed and nor is the global xformation used.
Definition at line 135 of file rgrl_est_spline.cxx.
rgrl_est_spline::rgrl_est_spline | ( | unsigned | dof, |
rgrl_transformation_sptr | global_xform, | ||
rgrl_mask_box const & | roi, | ||
vnl_vector< double > const & | delta, | ||
vnl_vector< unsigned > const & | m, | ||
bool | use_thin_plate = false , |
||
double | lambda = 0.001 |
||
) |
Constructor.
global_xform is used as the global xformation. No global estimation will be performed.
Definition at line 155 of file rgrl_est_spline.cxx.
unsigned int rgrl_object::add_observer | ( | rgrl_event_sptr | event, |
rgrl_command_sptr | cmd | ||
) | [inherited] |
Allow people to add/remove/invoke observers (callbacks) to any rgrl object.
This is an implementation of the subject/observer design pattern. An observer is added by specifying an event to respond to and an rgrl_command to execute. It returns an unsigned long tag which can be used later to remove the event or retrieve the command.
Definition at line 47 of file rgrl_object.cxx.
unsigned int rgrl_object::debug_flag | ( | ) | const [inherited] |
Get the value of the debug flag.
Definition at line 26 of file rgrl_object.cxx.
rgrl_transformation_sptr rgrl_est_spline::estimate | ( | rgrl_set_of< rgrl_match_set_sptr > const & | matches, |
rgrl_transformation const & | cur_transform | ||
) | const [virtual] |
Estimate the transform.
Given a collection of match sets in matches and the current transform estimate (from the previous iteration, for example), this function will estimate the transformation parameters and return a transform object that captures the estimated transform.
Implements rgrl_estimator.
Definition at line 188 of file rgrl_est_spline.cxx.
rgrl_transformation_sptr rgrl_est_spline::estimate | ( | rgrl_match_set_sptr | matches, |
rgrl_transformation const & | cur_transform | ||
) | const [virtual] |
Estimate the transform.
Given a set of matches in matches and the current transform estimate (from the previous iteration, for example), this function will estimate the transformation parameters and return a transform object that captures the estimated transform.
The default implementation in the abstract base class will simply construct a size one collection of match sets and call the other estimate function.
Reimplemented from rgrl_estimator.
Definition at line 465 of file rgrl_est_spline.cxx.
rgrl_command_sptr rgrl_object::get_command | ( | unsigned int | tag | ) | [inherited] |
Get the command associated with the given tag.
Definition at line 57 of file rgrl_object.cxx.
bool rgrl_object::has_observer | ( | const rgrl_event & | event | ) | const [inherited] |
Return true if an observer is registered for this event.
Definition at line 107 of file rgrl_object.cxx.
void rgrl_object::invoke_event | ( | const rgrl_event & | event | ) | [inherited] |
Call execute(.) on all the rgrl_commands observing this event id.
Definition at line 69 of file rgrl_object.cxx.
void rgrl_object::invoke_event | ( | const rgrl_event & | event | ) | const [inherited] |
Call execute(.) on all the rgrl_commands observing this event id.
The actions triggered by this call doesn't modify this object.
Definition at line 83 of file rgrl_object.cxx.
virtual bool rgrl_nonlinear_estimator::is_iterative_method | ( | ) | const [inline, virtual, inherited] |
Linear estimator is non-iterative.
Implements rgrl_estimator.
Definition at line 193 of file rgrl_estimator.h.
virtual bool rgrl_object::is_type | ( | const vcl_type_info & | type | ) | const [inline, virtual, inherited] |
Reimplemented in rgrl_scale_estimator.
Definition at line 66 of file rgrl_object.h.
int rgrl_nonlinear_estimator::max_num_iter | ( | ) | const [inline, inherited] |
return max number of iterations.
Definition at line 201 of file rgrl_estimator.h.
unsigned int rgrl_estimator::param_dof | ( | ) | const [inline, inherited] |
The degrees of freedom in the parameter set.
Definition at line 81 of file rgrl_estimator.h.
void rgrl_est_spline::point_in_knots | ( | vnl_vector< double > const & | point, |
vnl_vector< double > & | spline_pt | ||
) | const [private] |
Definition at line 178 of file rgrl_est_spline.cxx.
double rgrl_nonlinear_estimator::rel_thres | ( | ) | const [inline, inherited] |
relative threshold.
Definition at line 209 of file rgrl_estimator.h.
void rgrl_object::remove_observer | ( | unsigned int | tag | ) | [inherited] |
Remove the observer with this tag value.
Definition at line 97 of file rgrl_object.cxx.
virtual unsigned int rgrl_estimator::residual_dof | ( | ) | const [inline, virtual, inherited] |
The degrees of freedom in the residual.
Most of the time, this would be 1 since the residual comes from a single random variable. In some problems, however, the error is the combination of more than one random variable. (For example, if the residual is a 2d Euclidean distance with possible error in both coordinates, the degrees of freedom in the error will be 2.)
Definition at line 94 of file rgrl_estimator.h.
rgrl_est_spline::rgrl_type_macro | ( | rgrl_est_spline | , |
rgrl_nonlinear_estimator | |||
) |
rgrl_estimator::rgrl_type_macro | ( | rgrl_estimator | , |
rgrl_object | |||
) | [inherited] |
void rgrl_object::set_debug_flag | ( | unsigned int | debugFlag | ) | const [inherited] |
Set the value of the debug flag. A non-zero value turns debugging on.
Definition at line 19 of file rgrl_object.cxx.
void rgrl_nonlinear_estimator::set_max_num_iter | ( | int | max | ) | [inline, inherited] |
set max number of iterations.
Definition at line 197 of file rgrl_estimator.h.
void rgrl_est_spline::set_optimize_method | ( | int | optimize_method | ) | [inline] |
Definition at line 54 of file rgrl_est_spline.h.
void rgrl_estimator::set_param_dof | ( | unsigned int | dof | ) | [inline, inherited] |
Set the degrees of freedom.
Definition at line 84 of file rgrl_estimator.h.
void rgrl_nonlinear_estimator::set_rel_thres | ( | double | thres | ) | [inline, inherited] |
set relative threshold for parameters change.
Definition at line 205 of file rgrl_estimator.h.
void rgrl_object::set_warning | ( | bool | flag | ) | const [inherited] |
Set the flag for warning messages.
Definition at line 33 of file rgrl_object.cxx.
virtual const vcl_string rgrl_estimator::transformation_name | ( | ) | const [inline, virtual, inherited] |
Name of transformation estimated by this estimator.
It is more useful when a transformation/estimator pair is capable of storing/estimating several models, usually differing in dof
Reimplemented in rgrl_est_homo2d_proj_rad.
Definition at line 105 of file rgrl_estimator.h.
const vcl_type_info & rgrl_est_spline::transformation_type | ( | ) | const [virtual] |
Type of transformation estimated by this estimator.
Implements rgrl_estimator.
Definition at line 474 of file rgrl_est_spline.cxx.
static const vcl_type_info& rgrl_object::type_id | ( | ) | [inline, static, inherited] |
Reimplemented in rgrl_scale_estimator.
Definition at line 63 of file rgrl_object.h.
bool rgrl_object::warning | ( | ) | const [inherited] |
Get the warning flag.
Definition at line 40 of file rgrl_object.cxx.
vnl_vector<double> rgrl_est_spline::delta_ [private] |
Definition at line 64 of file rgrl_est_spline.h.
A global transformation.
If it's null, then the spline is used without other prior transformation.
Definition at line 74 of file rgrl_est_spline.h.
double rgrl_est_spline::lambda_ [private] |
Definition at line 68 of file rgrl_est_spline.h.
vnl_vector<unsigned> rgrl_est_spline::m_ [private] |
Definition at line 65 of file rgrl_est_spline.h.
int rgrl_nonlinear_estimator::max_num_iterations_ [protected, inherited] |
specify the maximum number of iterations for this estimator.
Definition at line 214 of file rgrl_estimator.h.
int rgrl_est_spline::optimize_method_ [private] |
Definition at line 70 of file rgrl_est_spline.h.
double rgrl_nonlinear_estimator::relative_threshold_ [protected, inherited] |
The threshold for relative parameter change before termination.
Definition at line 217 of file rgrl_estimator.h.
rgrl_mask_box rgrl_est_spline::roi_ [private] |
Definition at line 63 of file rgrl_est_spline.h.
bool rgrl_est_spline::use_thin_plate_ [private] |
Definition at line 66 of file rgrl_est_spline.h.