Feature-based registration. More...
#include <rgrl_feature_based_registration.h>
Public Member Functions | |
rgrl_feature_based_registration (rgrl_data_manager_sptr data, rgrl_convergence_tester_sptr conv_tester) | |
Initialize with the data storage and the convergence tester. | |
rgrl_feature_based_registration (rgrl_data_manager_sptr data) | |
Initialize with the data storage. | |
~rgrl_feature_based_registration () | |
rgrl_type_macro (rgrl_feature_based_registration, rgrl_object) | |
void | clear_results () |
Clear record of results from previous runs. | |
void | run (rgrl_initializer_sptr initializer) |
Running from multiple initial estimates, produced by the initializer during registration. | |
void | run (rgrl_mask_box from_image_region, rgrl_mask_box to_image_region, rgrl_estimator_sptr estimator, rgrl_transformation_sptr initial_xform, rgrl_scale_sptr prior_scale=0, unsigned init_resolution=0) |
Running from a given initial estimate. | |
rgrl_transformation_sptr | final_transformation () const |
Return the final, best estimate. | |
rgrl_set_of< rgrl_scale_sptr > const & | final_scales () const |
Return the scales of the best transformation estimate. | |
rgrl_scale_sptr | final_scale () const |
rgrl_converge_status_sptr | final_status () const |
Return the status of the best transformation estimate. | |
rgrl_set_of < rgrl_match_set_sptr > const & | final_match_sets () const |
The multiple match sets used for the best transformation estimate. | |
rgrl_match_set_sptr | final_match_set () const |
The single match set used for the best transformation estimate. | |
unsigned | num_initial_xforms_tested () const |
Return the number of initial transformations tested. | |
bool | has_final_transformation () const |
Return true if has a best xform_estimate. | |
void | set_max_icp_iter (unsigned iter) |
Set the max number of icp iteration per stage. | |
void | set_expected_max_geometric_scale (double scale) |
Set the expected maximum geometric scale. | |
void | set_expected_min_geometric_scale (double scale) |
Set the expected minimum geometric scale. | |
void | set_iterations_for_scale_est (int iter) |
Set the number of iterations during which the scale is to be estimated. | |
void | penalize_scaling (bool) |
penalize transformation that involves scaling of the registration area. | |
rgrl_set_of < rgrl_match_set_sptr > const & | current_match_sets () const |
Return the current match sets. | |
rgrl_transformation_sptr | current_transformation () const |
Return the current estimate. | |
unsigned | current_stage () const |
Return the current stage. | |
unsigned | iterations_at_current_stage () const |
Return the current iterations_at_stage_. | |
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 () |
Private Member Functions | |
void | register_single_feature (rgrl_mask_box from_image_region, rgrl_mask_box to_image_region, rgrl_estimator_sptr initial_xform_estimator, rgrl_transformation_sptr xform_estimate, rgrl_scale_sptr prior_scale, unsigned init_resolution) |
registration of single feature type at each stage/resolution. | |
void | register_multi_feature (rgrl_mask_box from_image_region, rgrl_mask_box to_image_region, rgrl_estimator_sptr initial_xform_estimator, rgrl_transformation_sptr xform_estimate, rgrl_scale_sptr prior_scale, unsigned init_resolution) |
registration of multiple feature types at each stage/resolution. | |
void | initialize_for_next_resolution (rgrl_mask_box &from_image_region, rgrl_mask_box &to_image_region, rgrl_transformation_sptr &xform_estimate, unsigned ¤t_resol) const |
Scale/shrink the registration region and the xform_est according to the dim_increase_for_next_stage at current_resol. | |
Private Attributes | |
rgrl_data_manager_sptr | data_ |
rgrl_convergence_tester_sptr | conv_tester_ |
rgrl_converge_status_sptr | best_status_ |
rgrl_transformation_sptr | best_xform_estimate_ |
rgrl_set_of< rgrl_match_set_sptr > | best_matches_ |
rgrl_set_of< rgrl_scale_sptr > | best_scales_ |
unsigned | num_xforms_tested_ |
unsigned | max_icp_iter_ |
double | expected_max_geometric_scale_ |
double | expected_min_geometric_scale_ |
int | iterations_for_scale_est_ |
bool | should_penalize_scaling_ |
unsigned | current_stage_ |
unsigned | iterations_at_stage_ |
rgrl_set_of< rgrl_match_set_sptr > | current_match_sets_ |
rgrl_transformation_sptr | current_xform_estimate_ |
Feature-based registration.
The registration engine takes a data storage of single- or multiple-stage/resolution. Each stage may contain multiple feature types. Different transformation estimators may be assigned to different stages. The limitations of feature-based registration are fixed registration region and estimator at each stage.
Definition at line 30 of file rgrl_feature_based_registration.h.
rgrl_feature_based_registration::rgrl_feature_based_registration | ( | rgrl_data_manager_sptr | data, |
rgrl_convergence_tester_sptr | conv_tester | ||
) |
Initialize with the data storage and the convergence tester.
Definition at line 22 of file rgrl_feature_based_registration.cxx.
rgrl_feature_based_registration::rgrl_feature_based_registration | ( | rgrl_data_manager_sptr | data | ) |
Initialize with the data storage.
The default convergence tester is set to median error
Definition at line 37 of file rgrl_feature_based_registration.cxx.
rgrl_feature_based_registration::~rgrl_feature_based_registration | ( | ) |
Definition at line 51 of file rgrl_feature_based_registration.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.
void rgrl_feature_based_registration::clear_results | ( | ) |
Clear record of results from previous runs.
Definition at line 57 of file rgrl_feature_based_registration.cxx.
rgrl_set_of< rgrl_match_set_sptr > const & rgrl_feature_based_registration::current_match_sets | ( | ) | const |
Return the current match sets.
Definition at line 242 of file rgrl_feature_based_registration.cxx.
unsigned rgrl_feature_based_registration::current_stage | ( | ) | const |
Return the current stage.
Definition at line 258 of file rgrl_feature_based_registration.cxx.
rgrl_transformation_sptr rgrl_feature_based_registration::current_transformation | ( | ) | const |
Return the current estimate.
Definition at line 250 of file rgrl_feature_based_registration.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_match_set_sptr rgrl_feature_based_registration::final_match_set | ( | ) | const |
The single match set used for the best transformation estimate.
Definition at line 176 of file rgrl_feature_based_registration.cxx.
rgrl_set_of< rgrl_match_set_sptr > const & rgrl_feature_based_registration::final_match_sets | ( | ) | const |
The multiple match sets used for the best transformation estimate.
The matches used for the best transformation estimate.
Definition at line 169 of file rgrl_feature_based_registration.cxx.
rgrl_scale_sptr rgrl_feature_based_registration::final_scale | ( | ) | const |
Definition at line 152 of file rgrl_feature_based_registration.cxx.
rgrl_set_of< rgrl_scale_sptr > const & rgrl_feature_based_registration::final_scales | ( | ) | const |
Return the scales of the best transformation estimate.
Definition at line 145 of file rgrl_feature_based_registration.cxx.
rgrl_converge_status_sptr rgrl_feature_based_registration::final_status | ( | ) | const |
Return the status of the best transformation estimate.
Definition at line 161 of file rgrl_feature_based_registration.cxx.
rgrl_transformation_sptr rgrl_feature_based_registration::final_transformation | ( | ) | const |
Return the final, best estimate.
Definition at line 137 of file rgrl_feature_based_registration.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_feature_based_registration::has_final_transformation | ( | ) | const |
Return true if has a best xform_estimate.
Return true is has a best xform_estimate.
Definition at line 193 of file rgrl_feature_based_registration.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_feature_based_registration::initialize_for_next_resolution | ( | rgrl_mask_box & | from_image_region, |
rgrl_mask_box & | to_image_region, | ||
rgrl_transformation_sptr & | xform_estimate, | ||
unsigned & | current_resol | ||
) | const [private] |
Scale/shrink the registration region and the xform_est according to the dim_increase_for_next_stage at current_resol.
Definition at line 835 of file rgrl_feature_based_registration.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_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.
unsigned rgrl_feature_based_registration::iterations_at_current_stage | ( | ) | const |
Return the current iterations_at_stage_.
Return the iteration at current stage.
Definition at line 266 of file rgrl_feature_based_registration.cxx.
unsigned rgrl_feature_based_registration::num_initial_xforms_tested | ( | ) | const |
Return the number of initial transformations tested.
The value might be greater than 1 if using initializer which provides a number of initial estimates.
Definition at line 185 of file rgrl_feature_based_registration.cxx.
void rgrl_feature_based_registration::penalize_scaling | ( | bool | penalize | ) |
penalize transformation that involves scaling of the registration area.
Definition at line 233 of file rgrl_feature_based_registration.cxx.
void rgrl_feature_based_registration::register_multi_feature | ( | rgrl_mask_box | from_image_region, |
rgrl_mask_box | to_image_region, | ||
rgrl_estimator_sptr | initial_xform_estimator, | ||
rgrl_transformation_sptr | xform_estimate, | ||
rgrl_scale_sptr | prior_scale, | ||
unsigned | init_resolution | ||
) | [private] |
registration of multiple feature types at each stage/resolution.
registration of multiple feature type at each stage/resolution.
Definition at line 545 of file rgrl_feature_based_registration.cxx.
void rgrl_feature_based_registration::register_single_feature | ( | rgrl_mask_box | from_image_region, |
rgrl_mask_box | to_image_region, | ||
rgrl_estimator_sptr | initial_xform_estimator, | ||
rgrl_transformation_sptr | xform_estimate, | ||
rgrl_scale_sptr | prior_scale, | ||
unsigned | init_resolution | ||
) | [private] |
registration of single feature type at each stage/resolution.
Definition at line 277 of file rgrl_feature_based_registration.cxx.
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.
rgrl_feature_based_registration::rgrl_type_macro | ( | rgrl_feature_based_registration | , |
rgrl_object | |||
) |
void rgrl_feature_based_registration::run | ( | rgrl_initializer_sptr | initializer | ) |
Running from multiple initial estimates, produced by the initializer during registration.
Loop through the set of initial estimates.
Loop through the set of initial estimates, and call the next run(.) in the loop.
Definition at line 70 of file rgrl_feature_based_registration.cxx.
void rgrl_feature_based_registration::run | ( | rgrl_mask_box | from_image_region, |
rgrl_mask_box | to_image_region, | ||
rgrl_estimator_sptr | init_xform_estimator, | ||
rgrl_transformation_sptr | initial_xform, | ||
rgrl_scale_sptr | prior_scale = 0 , |
||
unsigned | init_resolution = 0 |
||
) |
Running from a given initial estimate.
Based on if data_->is_multi_feature(), call run_single_feature(.) or run_multi_feature(.)
Definition at line 110 of file rgrl_feature_based_registration.cxx.
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_feature_based_registration::set_expected_max_geometric_scale | ( | double | scale | ) |
Set the expected maximum geometric scale.
Set the expected max scale.
If expected_max_geometric_scale_ is never set, the default has no effect on the registration.
Definition at line 209 of file rgrl_feature_based_registration.cxx.
void rgrl_feature_based_registration::set_expected_min_geometric_scale | ( | double | scale | ) |
Set the expected minimum geometric scale.
Set the expected min scale.
If expected_min_geometric_scale_ is never set, the default has no effect on the registration.
Definition at line 217 of file rgrl_feature_based_registration.cxx.
void rgrl_feature_based_registration::set_iterations_for_scale_est | ( | int | iter | ) |
Set the number of iterations during which the scale is to be estimated.
Set the number of iteration for scale estimation.
If iterations_for_scale_est_ is never set, the default has no effect on the registration.
Definition at line 225 of file rgrl_feature_based_registration.cxx.
void rgrl_feature_based_registration::set_max_icp_iter | ( | unsigned | iter | ) |
Set the max number of icp iteration per stage.
Set the max number of icp iteration per level.
The default is 25 at initialization
Definition at line 201 of file rgrl_feature_based_registration.cxx.
void rgrl_object::set_warning | ( | bool | flag | ) | const [inherited] |
Set the flag for warning messages.
Definition at line 33 of file rgrl_object.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.
Definition at line 161 of file rgrl_feature_based_registration.h.
Definition at line 162 of file rgrl_feature_based_registration.h.
Definition at line 159 of file rgrl_feature_based_registration.h.
Definition at line 160 of file rgrl_feature_based_registration.h.
Definition at line 157 of file rgrl_feature_based_registration.h.
Definition at line 174 of file rgrl_feature_based_registration.h.
unsigned rgrl_feature_based_registration::current_stage_ [private] |
Definition at line 172 of file rgrl_feature_based_registration.h.
Definition at line 175 of file rgrl_feature_based_registration.h.
Definition at line 156 of file rgrl_feature_based_registration.h.
double rgrl_feature_based_registration::expected_max_geometric_scale_ [private] |
Definition at line 166 of file rgrl_feature_based_registration.h.
double rgrl_feature_based_registration::expected_min_geometric_scale_ [private] |
Definition at line 167 of file rgrl_feature_based_registration.h.
unsigned rgrl_feature_based_registration::iterations_at_stage_ [private] |
Definition at line 173 of file rgrl_feature_based_registration.h.
Definition at line 168 of file rgrl_feature_based_registration.h.
unsigned rgrl_feature_based_registration::max_icp_iter_ [private] |
Definition at line 165 of file rgrl_feature_based_registration.h.
unsigned rgrl_feature_based_registration::num_xforms_tested_ [private] |
Definition at line 164 of file rgrl_feature_based_registration.h.
bool rgrl_feature_based_registration::should_penalize_scaling_ [private] |
Definition at line 169 of file rgrl_feature_based_registration.h.