#include <rgrl_data_manager.h>
Public Member Functions | |
rgrl_data_manager (bool multi_stage=false) | |
Constructor. | |
~rgrl_data_manager () | |
void | add_data (unsigned stage, rgrl_feature_set_sptr from_set, rgrl_feature_set_sptr to_set, rgrl_matcher_sptr matcher=0, rgrl_weighter_sptr weighter=0, rgrl_scale_estimator_unwgted_sptr unwgted_scale_est=0, rgrl_scale_estimator_wgted_sptr wgted_scale_est=0, const vcl_string &label=vcl_string()) |
Add a data item to a multi-stage data storage. | |
void | add_data (rgrl_feature_set_sptr from_set, rgrl_feature_set_sptr to_set, rgrl_matcher_sptr matcher=0, rgrl_weighter_sptr weighter=0, rgrl_scale_estimator_unwgted_sptr unwgted_scale_est=0, rgrl_scale_estimator_wgted_sptr wgted_scale_est=0, const vcl_string &label=vcl_string()) |
Add a data item to a single-stage data storage. | |
void | add_estimator (unsigned stage, rgrl_estimator_sptr estimator) |
Add an estimator to a multi-stage data storage. | |
void | add_estimator (rgrl_estimator_sptr estimator) |
Add an estimator to a single-stage data storage. | |
void | set_dimension_increase_for_next_stage (unsigned stage, double rate) |
Set the dimension increase to go from the current stage to the next. | |
double | dimension_increase_for_next_stage (unsigned stage) const |
Return dimension_increase_for_next_stage_ at stage stage. | |
bool | is_multi_feature () const |
Return true if there exists at least one stage containing multiple data_items. | |
void | get_data_at_stage (unsigned stage, vcl_vector< rgrl_feature_set_sptr > &from_sets, vcl_vector< rgrl_feature_set_sptr > &to_sets, vcl_vector< rgrl_matcher_sptr > &matchers, vcl_vector< rgrl_weighter_sptr > &weighters, vcl_vector< rgrl_scale_estimator_unwgted_sptr > &unwgted_scale_ests, vcl_vector< rgrl_scale_estimator_wgted_sptr > &wgted_scale_ests, vcl_vector< rgrl_estimator_sptr > &estimators) const |
Return the set of data_items and estimators from a multi-stage data storage. | |
void | get_data_at_stage (unsigned stage, rgrl_feature_set_sptr &from_sets, rgrl_feature_set_sptr &to_sets, rgrl_matcher_sptr &matchers, rgrl_weighter_sptr &weighters, rgrl_scale_estimator_unwgted_sptr &unwgted_scale_ests, rgrl_scale_estimator_wgted_sptr &wgted_scale_ests, vcl_vector< rgrl_estimator_sptr > &estimators) const |
Return the a single data_item and the set of estimators from a multi-stage data storage. | |
void | get_data (vcl_vector< rgrl_feature_set_sptr > &from_sets, vcl_vector< rgrl_feature_set_sptr > &to_sets, vcl_vector< rgrl_matcher_sptr > &matchers, vcl_vector< rgrl_weighter_sptr > &weighters, vcl_vector< rgrl_scale_estimator_unwgted_sptr > &unwgted_scale_ests, vcl_vector< rgrl_scale_estimator_wgted_sptr > &wgted_scale_ests, vcl_vector< rgrl_estimator_sptr > &estimators) const |
Return the set of data_items and estimators from a single-stage data storage. | |
void | get_data (rgrl_feature_set_sptr &from_sets, rgrl_feature_set_sptr &to_sets, rgrl_matcher_sptr &matchers, rgrl_weighter_sptr &weighters, rgrl_scale_estimator_unwgted_sptr &unwgted_scale_ests, rgrl_scale_estimator_wgted_sptr &wgted_scale_ests, vcl_vector< rgrl_estimator_sptr > &estimators) const |
Return the a single data_item and the set of estimators from a single-stage data storage. | |
void | get_label (unsigned stage, vcl_vector< vcl_string > &labels) const |
Return labels. | |
void | get_label (vcl_vector< vcl_string > &labels) const |
Return labels. | |
bool | has_stage (unsigned i) const |
Return true if certain stage exists with data. | |
rgrl_type_macro (rgrl_data_manager, 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 () |
Private Member Functions | |
void | generate_defaults (rgrl_matcher_sptr &matcher, rgrl_weighter_sptr &weighter, rgrl_scale_estimator_unwgted_sptr &unwgted_scale_est) |
Private Attributes | |
rgrl_data_manager_data_storage | data_ |
bool | multi_stage_ |
bool | multi_feature_ |
Definition at line 133 of file rgrl_data_manager.h.
rgrl_data_manager::rgrl_data_manager | ( | bool | multi_stage = false | ) |
Constructor.
If multi_stage set to true, the data manager allows data stored in multiple stages. The registration engine processes data from the highest stage to the 0th stage. In the framework of multi-resolution, the stage index i corresponds to an effective sigma value of 2^i.
Definition at line 24 of file rgrl_data_manager.cxx.
rgrl_data_manager::~rgrl_data_manager | ( | ) |
Definition at line 32 of file rgrl_data_manager.cxx.
void rgrl_data_manager::add_data | ( | unsigned | stage, |
rgrl_feature_set_sptr | from_set, | ||
rgrl_feature_set_sptr | to_set, | ||
rgrl_matcher_sptr | matcher = 0 , |
||
rgrl_weighter_sptr | weighter = 0 , |
||
rgrl_scale_estimator_unwgted_sptr | unwgted_scale_est = 0 , |
||
rgrl_scale_estimator_wgted_sptr | wgted_scale_est = 0 , |
||
const vcl_string & | label = vcl_string() |
||
) |
Add a data item to a multi-stage data storage.
For multi-stage.
The data item for registration takes at least two feature sets. Other components are set to the techniques commonly used in the literature, if not given. In such case, best performance is not guaranteed. To optimize the registration results, all components should be specified.
The matcher is ICP, the weighter is m_estimator (Beaton-Tukey), and the unwgted_scale_estimator is MAD (Median Absolute Deviation). wgted_scale_est keeps the original value, since it is not an essential component.
Definition at line 39 of file rgrl_data_manager.cxx.
void rgrl_data_manager::add_data | ( | rgrl_feature_set_sptr | from_set, |
rgrl_feature_set_sptr | to_set, | ||
rgrl_matcher_sptr | matcher = 0 , |
||
rgrl_weighter_sptr | weighter = 0 , |
||
rgrl_scale_estimator_unwgted_sptr | unwgted_scale_est = 0 , |
||
rgrl_scale_estimator_wgted_sptr | wgted_scale_est = 0 , |
||
const vcl_string & | label = vcl_string() |
||
) |
Add a data item to a single-stage data storage.
For single-stage.
The stage is assumed to be 0.
Definition at line 68 of file rgrl_data_manager.cxx.
void rgrl_data_manager::add_estimator | ( | unsigned | stage, |
rgrl_estimator_sptr | estimator | ||
) |
Add an estimator to a multi-stage data storage.
Definition at line 86 of file rgrl_data_manager.cxx.
void rgrl_data_manager::add_estimator | ( | rgrl_estimator_sptr | estimator | ) |
Add an estimator to a single-stage data storage.
For single-stage.
The stage is assumed to be 0
Definition at line 95 of file rgrl_data_manager.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.
double rgrl_data_manager::dimension_increase_for_next_stage | ( | unsigned | stage | ) | const |
Return dimension_increase_for_next_stage_ at stage stage.
Definition at line 113 of file rgrl_data_manager.cxx.
void rgrl_data_manager::generate_defaults | ( | rgrl_matcher_sptr & | matcher, |
rgrl_weighter_sptr & | weighter, | ||
rgrl_scale_estimator_unwgted_sptr & | unwgted_scale_est | ||
) | [private] |
Definition at line 248 of file rgrl_data_manager.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.
void rgrl_data_manager::get_data | ( | vcl_vector< rgrl_feature_set_sptr > & | from_sets, |
vcl_vector< rgrl_feature_set_sptr > & | to_sets, | ||
vcl_vector< rgrl_matcher_sptr > & | matchers, | ||
vcl_vector< rgrl_weighter_sptr > & | weighters, | ||
vcl_vector< rgrl_scale_estimator_unwgted_sptr > & | unwgted_scale_ests, | ||
vcl_vector< rgrl_scale_estimator_wgted_sptr > & | wgted_scale_ests, | ||
vcl_vector< rgrl_estimator_sptr > & | estimators | ||
) | const |
Return the set of data_items and estimators from a single-stage data storage.
For single-stage, multi-type.
The stage is assumed to be 0.
Definition at line 205 of file rgrl_data_manager.cxx.
void rgrl_data_manager::get_data | ( | rgrl_feature_set_sptr & | from_sets, |
rgrl_feature_set_sptr & | to_sets, | ||
rgrl_matcher_sptr & | matchers, | ||
rgrl_weighter_sptr & | weighters, | ||
rgrl_scale_estimator_unwgted_sptr & | unwgted_scale_ests, | ||
rgrl_scale_estimator_wgted_sptr & | wgted_scale_ests, | ||
vcl_vector< rgrl_estimator_sptr > & | estimators | ||
) | const |
Return the a single data_item and the set of estimators from a single-stage data storage.
For single-stage, single-type.
The stage is assumed to be 0.
Definition at line 223 of file rgrl_data_manager.cxx.
void rgrl_data_manager::get_data_at_stage | ( | unsigned | stage, |
vcl_vector< rgrl_feature_set_sptr > & | from_sets, | ||
vcl_vector< rgrl_feature_set_sptr > & | to_sets, | ||
vcl_vector< rgrl_matcher_sptr > & | matchers, | ||
vcl_vector< rgrl_weighter_sptr > & | weighters, | ||
vcl_vector< rgrl_scale_estimator_unwgted_sptr > & | unwgted_scale_ests, | ||
vcl_vector< rgrl_scale_estimator_wgted_sptr > & | wgted_scale_ests, | ||
vcl_vector< rgrl_estimator_sptr > & | estimators | ||
) | const |
Return the set of data_items and estimators from a multi-stage data storage.
For multi-stage, multi-type.
Definition at line 129 of file rgrl_data_manager.cxx.
void rgrl_data_manager::get_data_at_stage | ( | unsigned | stage, |
rgrl_feature_set_sptr & | from_sets, | ||
rgrl_feature_set_sptr & | to_sets, | ||
rgrl_matcher_sptr & | matchers, | ||
rgrl_weighter_sptr & | weighters, | ||
rgrl_scale_estimator_unwgted_sptr & | unwgted_scale_ests, | ||
rgrl_scale_estimator_wgted_sptr & | wgted_scale_ests, | ||
vcl_vector< rgrl_estimator_sptr > & | estimators | ||
) | const |
Return the a single data_item and the set of estimators from a multi-stage data storage.
For multi-stage, single-type.
Definition at line 167 of file rgrl_data_manager.cxx.
void rgrl_data_manager::get_label | ( | unsigned | stage, |
vcl_vector< vcl_string > & | labels | ||
) | const |
void rgrl_data_manager::get_label | ( | vcl_vector< vcl_string > & | labels | ) | const |
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.
bool rgrl_data_manager::has_stage | ( | unsigned | i | ) | const |
Return true if certain stage exists with data.
Check if certain stage exists with data.
Definition at line 241 of file rgrl_data_manager.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.
bool rgrl_data_manager::is_multi_feature | ( | ) | const |
Return true if there exists at least one stage containing multiple data_items.
Check if any stage contains multi-type.
Definition at line 121 of file rgrl_data_manager.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.
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_data_manager::rgrl_type_macro | ( | rgrl_data_manager | , |
rgrl_object | |||
) |
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_data_manager::set_dimension_increase_for_next_stage | ( | unsigned | stage, |
double | rate | ||
) |
Set the dimension increase to go from the current stage to the next.
Operations for dim_increase_for_next_stage for multi-stage.
If the function is never called for stage stage, the dimension increase for stage is 1.
Definition at line 106 of file rgrl_data_manager.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 270 of file rgrl_data_manager.h.
bool rgrl_data_manager::multi_feature_ [private] |
Definition at line 272 of file rgrl_data_manager.h.
bool rgrl_data_manager::multi_stage_ [private] |
Definition at line 271 of file rgrl_data_manager.h.