contrib/oxl/mvl/FMatrixComputeMLESAC.h
Go to the documentation of this file.
00001 #ifndef FMatrixComputeMLESAC_h_
00002 #define FMatrixComputeMLESAC_h_
00003 //:
00004 // \file
00005 // \brief Robust FMatrix computation
00006 //
00007 //  FMatrixComputeMLESAC implements
00008 //  Phil Torr's MLESAC (Maximum Likelihood Estimation) of the fundamental matrix.
00009 //
00010 //  Points are preconditioned as described in [Hartley, ``In defense of
00011 //  the 8-point algorithm'', ICCV95], and the resulting F matrix is rank-2
00012 //  truncated.  The conditioning and truncation are optional and may be
00013 //  omitted.
00014 //
00015 // \author
00016 //     David N. McKinnon, UQ I.R.I.S., 02.12.2000
00017 //
00018 // \verbatim
00019 //  Modifications
00020 //   22 Oct 2002 - Peter Vanroose - added vgl_homg_point_2d interface
00021 // \endverbatim
00022 //
00023 //-----------------------------------------------------------------------------
00024 
00025 #include <vgl/vgl_fwd.h>
00026 #include <mvl/FMatrixComputeRobust.h>
00027 #include <mvl/FManifoldProject.h>
00028 #include <vcl_vector.h>
00029 
00030 class FMatrixComputeMLESAC : public FMatrixComputeRobust
00031 {
00032  public:
00033   //: Initialize FMatrixComputeRobust object.
00034   // If rank2_truncate = false, the resulting solution is not forced to rank 2
00035   // using the vnl_svd<double>.
00036   FMatrixComputeMLESAC(bool rank2_truncate, double std);
00037   virtual ~FMatrixComputeMLESAC();
00038 
00039   virtual double calculate_term(vcl_vector<double>& residuals, vcl_vector<bool>& inlier_list, int& count);
00040   virtual double calculate_residual(HomgPoint2D& one, HomgPoint2D& two, FMatrix* F);
00041   virtual double calculate_residual(vgl_homg_point_2d<double>& one,
00042                                     vgl_homg_point_2d<double>& two,
00043                                     FMatrix* F);
00044 };
00045 
00046 #endif // FMatrixComputeMLESAC_h_