Go to the documentation of this file.00001 #ifndef rgrl_feature_based_registration_h_
00002 #define rgrl_feature_based_registration_h_
00003
00004
00005
00006
00007
00008
00009 #include "rgrl_object.h"
00010 #include "rgrl_data_manager_sptr.h"
00011 #include "rgrl_convergence_tester_sptr.h"
00012 #include "rgrl_estimator_sptr.h"
00013 #include "rgrl_transformation_sptr.h"
00014 #include "rgrl_set_of.h"
00015 #include "rgrl_scale_sptr.h"
00016 #include "rgrl_initializer_sptr.h"
00017 #include "rgrl_converge_status_sptr.h"
00018 #include "rgrl_match_set_sptr.h"
00019 #include "rgrl_weighter_sptr.h"
00020 #include "rgrl_mask.h"
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 class rgrl_feature_based_registration: public rgrl_object
00031 {
00032 public:
00033
00034 rgrl_feature_based_registration( rgrl_data_manager_sptr data,
00035 rgrl_convergence_tester_sptr conv_tester );
00036
00037
00038
00039 rgrl_feature_based_registration( rgrl_data_manager_sptr data );
00040
00041 ~rgrl_feature_based_registration();
00042
00043
00044 rgrl_type_macro( rgrl_feature_based_registration, rgrl_object );
00045
00046
00047 void clear_results();
00048
00049
00050
00051
00052 void run( rgrl_initializer_sptr initializer );
00053
00054
00055
00056
00057
00058
00059 void run( rgrl_mask_box from_image_region,
00060 rgrl_mask_box to_image_region,
00061 rgrl_estimator_sptr estimator,
00062 rgrl_transformation_sptr initial_xform,
00063 rgrl_scale_sptr prior_scale = 0,
00064 unsigned init_resolution = 0);
00065
00066
00067
00068
00069 rgrl_transformation_sptr final_transformation() const;
00070
00071
00072 rgrl_set_of<rgrl_scale_sptr> const& final_scales() const;
00073 rgrl_scale_sptr final_scale() const;
00074
00075
00076 rgrl_converge_status_sptr final_status() const;
00077
00078
00079 rgrl_set_of<rgrl_match_set_sptr> const& final_match_sets() const;
00080
00081
00082 rgrl_match_set_sptr final_match_set() const;
00083
00084
00085
00086
00087
00088 unsigned num_initial_xforms_tested() const;
00089
00090
00091 bool has_final_transformation() const;
00092
00093
00094
00095
00096 void set_max_icp_iter( unsigned iter );
00097
00098
00099
00100
00101
00102 void set_expected_max_geometric_scale( double scale);
00103
00104
00105
00106
00107
00108 void set_expected_min_geometric_scale( double scale);
00109
00110
00111
00112
00113
00114 void set_iterations_for_scale_est( int iter);
00115
00116
00117 void penalize_scaling( bool );
00118
00119
00120 rgrl_set_of<rgrl_match_set_sptr> const& current_match_sets() const;
00121
00122
00123 rgrl_transformation_sptr current_transformation() const;
00124
00125
00126 unsigned current_stage() const;
00127
00128
00129 unsigned iterations_at_current_stage() const;
00130
00131 private:
00132
00133 void register_single_feature( rgrl_mask_box from_image_region,
00134 rgrl_mask_box to_image_region,
00135 rgrl_estimator_sptr initial_xform_estimator,
00136 rgrl_transformation_sptr xform_estimate,
00137 rgrl_scale_sptr prior_scale,
00138 unsigned init_resolution);
00139
00140
00141 void register_multi_feature( rgrl_mask_box from_image_region,
00142 rgrl_mask_box to_image_region,
00143 rgrl_estimator_sptr initial_xform_estimator,
00144 rgrl_transformation_sptr xform_estimate,
00145 rgrl_scale_sptr prior_scale,
00146 unsigned init_resolution);
00147
00148
00149
00150 void initialize_for_next_resolution( rgrl_mask_box & from_image_region,
00151 rgrl_mask_box & to_image_region,
00152 rgrl_transformation_sptr & xform_estimate,
00153 unsigned & current_resol ) const;
00154
00155 private:
00156 rgrl_data_manager_sptr data_;
00157 rgrl_convergence_tester_sptr conv_tester_;
00158
00159 rgrl_converge_status_sptr best_status_;
00160 rgrl_transformation_sptr best_xform_estimate_;
00161 rgrl_set_of<rgrl_match_set_sptr> best_matches_;
00162 rgrl_set_of<rgrl_scale_sptr> best_scales_;
00163
00164 unsigned num_xforms_tested_;
00165 unsigned max_icp_iter_;
00166 double expected_max_geometric_scale_;
00167 double expected_min_geometric_scale_;
00168 int iterations_for_scale_est_;
00169 bool should_penalize_scaling_;
00170
00171
00172 unsigned current_stage_;
00173 unsigned iterations_at_stage_;
00174 rgrl_set_of<rgrl_match_set_sptr> current_match_sets_;
00175 rgrl_transformation_sptr current_xform_estimate_;
00176 };
00177
00178 #endif // rgrl_feature_based_registration_h_