contrib/rpl/rgrl/rgrl_invariant.h
Go to the documentation of this file.
00001 #ifndef rgrl_invariant_h_
00002 #define rgrl_invariant_h_
00003 //:
00004 // \file
00005 // \brief  Represent a feature associated with a set of invariant properties.
00006 // \author Charlene Tsai
00007 // \date   March 2004
00008 
00009 #include <vnl/vnl_vector.h>
00010 
00011 #include "rgrl_transformation_sptr.h"
00012 #include "rgrl_scale_sptr.h"
00013 #include "rgrl_mask.h"
00014 #include "rgrl_invariant_sptr.h"
00015 #include "rgrl_object.h"
00016 
00017 //: Represent a feature associated with a set of invariant properties.
00018 //
00019 class rgrl_invariant
00020   : public rgrl_object
00021 {
00022  public:
00023   rgrl_invariant() {}
00024 
00025   //:
00026   virtual ~rgrl_invariant() {}
00027 
00028   //: Estimate the xform mapping \a from to the current feature
00029   virtual bool estimate(rgrl_invariant_sptr         from,
00030                         rgrl_transformation_sptr&   xform,
00031                         rgrl_scale_sptr&            scale ) = 0;
00032 
00033   //: Returns the vector of invariants normalized by scale
00034   virtual const vnl_vector<double>& cartesian_invariants() const { return zero_vec; }
00035 
00036   //: Returns the vector of invariants normalized by scale
00037   virtual const vnl_vector<double>& angular_invariants() const { return zero_vec; }
00038 
00039 
00040   //: Return the ROI associated with the feature
00041   virtual rgrl_mask_box region() const;
00042 
00043   //: Return true if the feature has an initial ROI
00044   virtual bool has_region() const { return false; }
00045 
00046   // Defines type-related functions
00047   rgrl_type_macro( rgrl_invariant, rgrl_object );
00048 
00049  private:
00050   // disabled
00051   rgrl_invariant& operator=( rgrl_invariant const& );
00052 
00053  private:
00054   // a 0-length dummy vector
00055   static vnl_vector<double> zero_vec;
00056 };
00057 
00058 #endif // rgrl_invariant_h_