contrib/rpl/rgrl/rgrl_convergence_on_weighted_error.h
Go to the documentation of this file.
00001 #ifndef rgrl_convergence_on_weighted_error_h_
00002 #define rgrl_convergence_on_weighted_error_h_
00003 //:
00004 // \file
00005 #include "rgrl_convergence_tester.h"
00006 
00007 //: Determine convergence based on the weighted average of geometric errors.
00008 //
00009 class rgrl_convergence_on_weighted_error
00010   : public rgrl_convergence_tester
00011 {
00012  public:
00013   //: Create a tester with a tolerance \a tol.
00014   //
00015   // The tolerance value determines if the transformation is
00016   // considered acceptable. It is not used for the testing of
00017   // convergence.
00018   //
00019   rgrl_convergence_on_weighted_error( double tol );
00020 
00021   virtual ~rgrl_convergence_on_weighted_error();
00022   
00023   rgrl_converge_status_sptr
00024   compute_status( rgrl_converge_status_sptr               prev_status,
00025                   rgrl_view                        const& prev_view,
00026                   rgrl_view                        const& current_view,
00027                   rgrl_set_of<rgrl_match_set_sptr> const& current_match_sets,
00028                   rgrl_set_of<rgrl_scale_sptr>     const& current_scales,
00029                   bool                                    penalize_scaling = false ) const;
00030 
00031   //: verify the final alignment
00032   virtual
00033   rgrl_converge_status_sptr 
00034   verify( rgrl_transformation_sptr         const& xform_estimate,
00035           rgrl_set_of<rgrl_match_set_sptr> const& current_match_sets,
00036           rgrl_set_of<rgrl_scale_sptr>     const& current_scales )const;
00037 
00038   // Defines type-related functions
00039   rgrl_type_macro( rgrl_convergence_on_weighted_error, rgrl_convergence_tester );
00040 
00041  protected:
00042   double
00043   compute_alignment_error( rgrl_set_of<rgrl_match_set_sptr> const& current_match_sets ) const;
00044 
00045   double
00046   compute_alignment_error( rgrl_match_set_sptr const& current_match_set ) const;
00047 
00048  private:
00049   double tolerance_;
00050 };
00051 
00052 #endif // rgrl_convergence_on_weighted_error_h_