contrib/rpl/rgrl/rgrl_scale_est_all_weights.h
Go to the documentation of this file.
00001 #ifndef rgrl_scale_est_all_weights_h_
00002 #define rgrl_scale_est_all_weights_h_
00003 //:
00004 // \file
00005 // \brief
00006 // \author Chuck Stewart
00007 // \date   6 Dec 2002
00008 
00009 #include "rgrl_scale_estimator.h"
00010 
00011 #include <vnl/vnl_matrix.h>
00012 class rgrl_match_set;
00013 
00014 //:
00015 // Weighted scale estimator that computes the scale as the sum of the
00016 // weighted residuals divided by the sum of weights. The weights can
00017 // come from either the geometric error, or signature error, or both.
00018 //
00019 // The scale estimator is able to estimate both the geometric scale
00020 // and the signature error in the form of the covariance matrix. The
00021 // latter is optional (\a do_signature_scale ). In practice, if other
00022 // components for the registration engine require the use of
00023 // signature_error_vector, the \a do_signature_scale should be set to
00024 // true for the constructor.
00025 //
00026 class rgrl_scale_est_all_weights
00027   : public rgrl_scale_estimator_wgted
00028 {
00029  public:
00030   rgrl_scale_est_all_weights(  bool do_signature_scale = false );
00031 
00032   rgrl_scale_sptr
00033   estimate_weighted( rgrl_match_set const& match_set,
00034                      rgrl_scale_sptr const& current_scales,
00035                      bool use_signature_only =  false,
00036                      bool penalize_scaling = false) const;
00037 
00038   // Defines type-related functions
00039   rgrl_type_macro( rgrl_scale_est_all_weights, rgrl_scale_estimator_wgted );
00040 
00041  private:
00042   bool
00043   compute_geometric_scale( double& return_scale,
00044                            rgrl_match_set const& match_set,
00045                            bool use_signature_only, 
00046                            bool penalize_scaling ) const;
00047 
00048   bool
00049   compute_signature_inv_covar( vnl_matrix<double>& inv_covar, rgrl_match_set const& match_set ) const;
00050 
00051  private:
00052   bool do_signature_scale_;
00053 };
00054 
00055 #endif // rgrl_scale_est_all_weights_h_