Go to the documentation of this file.00001 #ifndef rgrl_view_h_
00002 #define rgrl_view_h_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include <rgrl/rgrl_transformation_sptr.h>
00016 #include <rgrl/rgrl_estimator_sptr.h>
00017 #include <rgrl/rgrl_mask.h>
00018 #include <rgrl/rgrl_mask_sptr.h>
00019
00020 #include <rgrl/rgrl_view_sptr.h>
00021 #include <rgrl/rgrl_feature_sptr.h>
00022 #include <rgrl/rgrl_fwd.h>
00023 #include <vcl_stlfwd.h>
00024
00025
00026
00027
00028
00029
00030 class rgrl_view
00031 : public rgrl_object
00032 {
00033 public:
00034
00035 typedef vcl_vector< rgrl_feature_sptr > feature_vector;
00036
00037
00038 rgrl_view();
00039
00040
00041 rgrl_view( rgrl_mask_sptr const& from_image_roi,
00042 rgrl_mask_sptr const& to_image_roi,
00043 rgrl_mask_box const& region,
00044 rgrl_mask_box const& global_region,
00045 rgrl_estimator_sptr xform_estimator,
00046 rgrl_transformation_sptr xform_estimate,
00047 unsigned resolution = 0,
00048 rgrl_transformation_sptr inverse_estimate = 0 );
00049
00050
00051
00052
00053 virtual
00054 rgrl_view_sptr
00055 self_copy() const;
00056
00057
00058 rgrl_mask_sptr const& from_image_roi() const
00059 { return from_image_roi_; }
00060
00061
00062 void set_from_image_roi(rgrl_mask_sptr const& roi)
00063 { from_image_roi_ = roi; }
00064
00065
00066 rgrl_mask_sptr const& to_image_roi() const
00067 { return to_image_roi_; }
00068
00069
00070 void set_to_image_roi(rgrl_mask_sptr const& roi)
00071 { to_image_roi_ = roi; }
00072
00073
00074 rgrl_mask_box const& region() const
00075 { return current_region_; }
00076
00077
00078 void set_region( rgrl_mask_box const& box )
00079 { current_region_ = box; }
00080
00081
00082 rgrl_mask_box const& global_region() const
00083 { return global_region_; }
00084
00085
00086 void set_global_region( rgrl_mask_box const& global_region )
00087 { global_region_ = global_region; }
00088
00089
00090 rgrl_estimator_sptr xform_estimator() const
00091 { return xform_estimator_; }
00092
00093
00094 void set_xform_estimator( rgrl_estimator_sptr const& est)
00095 { xform_estimator_ = est; }
00096
00097
00098 rgrl_transformation_sptr xform_estimate() const
00099 { return xform_estimate_; }
00100
00101
00102 void set_xform_estimate( rgrl_transformation_sptr const& xform )
00103 { xform_estimate_ = xform; }
00104
00105
00106 rgrl_transformation_sptr inverse_xform_estimate() const
00107 { return inverse_estimate_; }
00108
00109
00110 void set_inverse_xform_estimate(rgrl_transformation_sptr const& inverse)
00111 { inverse_estimate_ = inverse; }
00112
00113
00114 unsigned resolution() const
00115 { return current_resolution_; }
00116
00117
00118 void set_resolution( unsigned res )
00119 { current_resolution_ = res; }
00120
00121
00122 bool is_at_finest_resolution() const;
00123
00124
00125 int num_updates_global_region() const
00126 { return num_updates_global_region_; }
00127
00128
00129
00130 void set_num_updates_global_region(int num)
00131 { num_updates_global_region_ = num; }
00132
00133
00134
00135 virtual
00136 bool
00137 features_in_region( feature_vector& features, rgrl_feature_set const& fea_set ) const;
00138
00139
00140 virtual
00141 bool current_region_converged() const;
00142
00143
00144
00145 virtual
00146 bool regions_converged_to(const rgrl_view& other) const;
00147
00148
00149 virtual
00150 bool is_valid() const;
00151
00152
00153 virtual
00154 rgrl_view_sptr scale_by( unsigned new_resol, double scaling ) const;
00155
00156 virtual
00157 bool
00158 inside_current_region( vnl_vector<double> const& loc );
00159
00160 #if 0
00161
00162 bool operator==( const rgrl_view& other ) const;
00163
00164
00165 bool operator!=( const rgrl_view& other ) const;
00166 #endif
00167
00168
00169 rgrl_type_macro( rgrl_view, rgrl_object );
00170
00171 protected:
00172 rgrl_mask_sptr from_image_roi_;
00173 rgrl_mask_sptr to_image_roi_;
00174
00175 rgrl_mask_box current_region_;
00176 rgrl_mask_box global_region_;
00177
00178
00179
00180 rgrl_estimator_sptr xform_estimator_;
00181 rgrl_transformation_sptr xform_estimate_;
00182 rgrl_transformation_sptr inverse_estimate_;
00183
00184 unsigned current_resolution_;
00185 int num_updates_global_region_;
00186 };
00187
00188
00189 #endif // rgrl_view_h_