contrib/oxl/mvl/FMatrixComputeRANSAC.h
Go to the documentation of this file.
00001 #ifndef FMatrixComputeRANSAC_h_
00002 #define FMatrixComputeRANSAC_h_
00003 //:
00004 // \file
00005 // \brief Robust FMatrix computation
00006 //
00007 //    FMatrixComputeRANSAC implements
00008 //    Phil Torr's RANSAC (Robust Sampling Consensus) of the fundamental matrix.
00009 //
00010 //    The resulting F matrix is rank-2 truncated.  The
00011 //     conditioning and truncation are optional and may be
00012 //    omitted. The RANSAC class is also responsible for maintaining the inliers
00013 //    passed in the PairMatchSetCorner class.
00014 //
00015 // \author
00016 //     David N. McKinnon, UQ I.R.I.S., 17.05.2001
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 
00028 class FMatrixComputeRANSAC : public FMatrixComputeRobust
00029 {
00030  public:
00031   //: Initialize FMatrixComputeRobust object.
00032   // If rank2_truncate = false, the resulting solution is not forced to rank 2
00033   // using the vnl_svd<double>.
00034   FMatrixComputeRANSAC(bool rank2_truncate, double std);
00035   virtual ~FMatrixComputeRANSAC();
00036 
00037   virtual double calculate_term(vcl_vector<double>& residuals,
00038                                 vcl_vector<bool>& inlier_list,
00039                                 int& count);
00040   virtual double calculate_residual(HomgPoint2D& one,
00041                                     HomgPoint2D& two,
00042                                     FMatrix* F);
00043   virtual double calculate_residual(vgl_homg_point_2d<double>& one,
00044                                     vgl_homg_point_2d<double>& two,
00045                                     FMatrix* F);
00046 };
00047 
00048 #endif // FMatrixComputeRANSAC_h_