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
00048 void clear_results();
00049
00050
00051
00052
00053 void run( rgrl_initializer_sptr initializer );
00054
00055
00056
00057
00058
00059
00060 void run( rgrl_mask_box from_image_region,
00061 rgrl_mask_box to_image_region,
00062 rgrl_estimator_sptr estimator,
00063 rgrl_transformation_sptr initial_xform,
00064 rgrl_scale_sptr prior_scale = 0,
00065 unsigned init_resolution = 0);
00066
00067
00068
00069
00070 rgrl_transformation_sptr final_transformation() const;
00071
00072
00073 rgrl_set_of<rgrl_scale_sptr> const& final_scales() const;
00074 rgrl_scale_sptr final_scale() const;
00075
00076
00077 rgrl_converge_status_sptr final_status() const;
00078
00079
00080 rgrl_set_of<rgrl_match_set_sptr> const& final_match_sets() const;
00081
00082
00083 rgrl_match_set_sptr final_match_set() const;
00084
00085
00086
00087
00088
00089 unsigned num_initial_xforms_tested() const;
00090
00091
00092 bool has_final_transformation() const;
00093
00094
00095
00096
00097 void set_max_icp_iter( unsigned iter );
00098
00099
00100
00101
00102
00103 void set_expected_max_geometric_scale( double scale);
00104
00105
00106
00107
00108
00109 void set_expected_min_geometric_scale( double scale);
00110
00111
00112
00113
00114
00115 void set_iterations_for_scale_est( int iter);
00116
00117
00118 void penalize_scaling( bool );
00119
00120
00121 rgrl_set_of<rgrl_match_set_sptr> const& current_match_sets() const;
00122
00123
00124 rgrl_transformation_sptr current_transformation() const;
00125
00126
00127 unsigned current_stage() const;
00128
00129
00130 unsigned iterations_at_current_stage() const;
00131
00132 private:
00133
00134 void register_single_feature( rgrl_mask_box from_image_region,
00135 rgrl_mask_box to_image_region,
00136 rgrl_estimator_sptr initial_xform_estimator,
00137 rgrl_transformation_sptr xform_estimate,
00138 rgrl_scale_sptr prior_scale,
00139 unsigned init_resolution);
00140
00141
00142 void register_multi_feature( rgrl_mask_box from_image_region,
00143 rgrl_mask_box to_image_region,
00144 rgrl_estimator_sptr initial_xform_estimator,
00145 rgrl_transformation_sptr xform_estimate,
00146 rgrl_scale_sptr prior_scale,
00147 unsigned init_resolution);
00148
00149
00150
00151 void initialize_for_next_resolution( rgrl_mask_box & from_image_region,
00152 rgrl_mask_box & to_image_region,
00153 rgrl_transformation_sptr & xform_estimate,
00154 unsigned & current_resol ) const;
00155
00156 private:
00157 rgrl_data_manager_sptr data_;
00158 rgrl_convergence_tester_sptr conv_tester_;
00159
00160 rgrl_converge_status_sptr best_status_;
00161 rgrl_transformation_sptr best_xform_estimate_;
00162 rgrl_set_of<rgrl_match_set_sptr> best_matches_;
00163 rgrl_set_of<rgrl_scale_sptr> best_scales_;
00164
00165 unsigned num_xforms_tested_;
00166 unsigned max_icp_iter_;
00167 double expected_max_geometric_scale_;
00168 double expected_min_geometric_scale_;
00169 int iterations_for_scale_est_;
00170 bool should_penalize_scaling_;
00171
00172
00173 unsigned current_stage_;
00174 unsigned iterations_at_stage_;
00175 rgrl_set_of<rgrl_match_set_sptr> current_match_sets_;
00176 rgrl_transformation_sptr current_xform_estimate_;
00177 };
00178
00179 #endif // rgrl_feature_based_registration_h_