contrib/rpl/rgrl/rgrl_feature_point.h
Go to the documentation of this file.
00001 #ifndef rgrl_feature_point_h_
00002 #define rgrl_feature_point_h_
00003 //:
00004 // \file
00005 // \author Amitha Perera
00006 // \date   Feb 2003
00007 // \verbatim
00008 // Modifications
00009 //      Nov 2008 J Becker: Added a clone function.
00010 // \endverbatim
00011 
00012 #include "rgrl_feature.h"
00013 #include <vcl_iosfwd.h>
00014 
00015 //: Represent a point in space.
00016 //
00017 // This type of feature can be used to represent simple point-to-point
00018 // correspondences.
00019 //
00020 class rgrl_feature_point
00021   : public rgrl_feature
00022 {
00023  public:
00024 
00025   //:ctor
00026   rgrl_feature_point( vnl_vector<double> const& loc );
00027 
00028   //:ctor
00029   rgrl_feature_point( vnl_vector<double> const& loc, double scale );
00030 
00031   //: read in feature
00032   virtual
00033   bool read( vcl_istream& is, bool skip_tag=false );
00034 
00035   //: write out feature
00036   virtual
00037   void write( vcl_ostream& os ) const;
00038 
00039   vnl_matrix<double> const&
00040   error_projector() const;
00041 
00042   vnl_matrix<double> const&
00043   error_projector_sqrt() const;
00044 
00045   //: Result is a rgrl_feature_point.
00046   virtual
00047   rgrl_feature_sptr
00048   transform( rgrl_transformation const& xform ) const;
00049 
00050   unsigned int
00051   num_constraints() const;
00052 
00053   //:  Compute the signature weight between two features.
00054   virtual double absolute_signature_weight( rgrl_feature_sptr other ) const;
00055 
00056   // Defines type-related functions
00057   rgrl_type_macro( rgrl_feature_point, rgrl_feature );
00058 
00059   //: make a clone copy
00060   virtual rgrl_feature_sptr clone() const;
00061 
00062  protected:
00063   friend class rgrl_feature_reader;
00064   //:
00065   // Create an uninitialized feature with enough space to store a dim
00066   // dimensional feature.
00067   //
00068   rgrl_feature_point( unsigned dim=0 );
00069 
00070   // to be able to use the protected constructor
00071   friend rgrl_feature_sptr
00072          rgrl_feature_reader( vcl_istream& is );
00073 
00074   //: Apply transformation to the scale property
00075   virtual double
00076   transform_scale( rgrl_transformation const& xform ) const;
00077 
00078  protected:
00079   mutable vnl_matrix<double> err_proj_, err_proj_sqrt_;
00080 };
00081 
00082 #endif // rgrl_feature_point_h_