ProbMultiReg.h

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------------
00002 //
00003 // $Id$
00004 //
00005 // Copyright 2008, 2009, 2010, 2011, 2012  Antonio Franchi and Paolo Stegagno    
00006 //
00007 // This file is part of MIP.
00008 //
00009 // MIP is free software: you can redistribute it and/or modify
00010 // it under the terms of the GNU General Public License as published by
00011 // the Free Software Foundation, either version 3 of the License, or
00012 // (at your option) any later version.
00013 //
00014 // MIP is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU General Public License for more details.
00018 //
00019 // You should have received a copy of the GNU General Public License
00020 // along with MIP. If not, see <http://www.gnu.org/licenses/>.
00021 //
00022 // Contact info: antonio.franchi@tuebingen.mpg.de stegagno@diag.uniroma1.it
00023 //
00024 // ----------------------------------------------------------------------------
00025 
00026 
00030 
00031 
00032 
00033 #ifndef __PROB_MULTI_REG_H
00034 #define __PROB_MULTI_REG_H
00035 
00036 
00037 #ifdef MIP_HOST_APPLE
00038 #include <applePatch.h>
00039 #endif
00040 
00041 #include <map>
00042 
00043 #include <Spaces.h>
00044 #include <BiReg.h>
00045 #include <BiRegRANSAC.h>
00046 #include "MultiRegSol.h"
00047 
00048 using namespace std;
00049 
00050 namespace MipAlgorithms{
00051  
00053  /* @{ */
00054  
00058  class ProbMultiRegPar {
00059   private:
00060    Decimal _linearTollerance;
00061    Decimal _angularTollerance;
00062    Decimal _maxVisuale;    // 8
00063    Decimal _discretization;// 5
00064    Decimal _discretizationStep;
00065   
00066   public:
00068    ProbMultiRegPar();
00069    
00071    ProbMultiRegPar(Decimal lt, Decimal at, Decimal mV, Decimal di, Decimal ds);
00072    
00074    ProbMultiRegPar(const ProbMultiRegPar &A);
00075    
00077    ProbMultiRegPar operator= (ProbMultiRegPar A);
00078    
00080    Decimal linearTollerance(){ return _linearTollerance; }
00081    
00083    Decimal angularTollerance(){ return _angularTollerance; }
00084    
00086    Decimal maxVisuale(){ return _maxVisuale; }
00087    
00089    Decimal discretization(){ return _discretization; }
00090    
00092    Decimal discretizationStep(){ return _discretizationStep; }
00093  };
00094  
00095  
00099  class ProbMultiRegStepInput {
00100   
00101   public:
00103    int num;
00105    Observation obsLoc;
00107    vector< Observation >* obse;
00109    BiRegSol form;
00111    MultiRegSol *solution;
00113    DDubIntList *dubshortlist;
00115    int firstNewDot;
00116    
00117    
00119    ProbMultiRegStepInput();
00120    
00122    ProbMultiRegStepInput(const ProbMultiRegStepInput &A);
00123    
00125    ProbMultiRegStepInput(int n, Observation oL, vector< Observation >* o, BiRegSol f, MultiRegSol *so, DDubIntList *dsl, int fND);
00126    
00128    ProbMultiRegStepInput  operator= (ProbMultiRegStepInput A);
00129  };
00130  
00131  
00135  class ProbMultiReg {
00136   
00137   public:
00139    ProbMultiRegPar par;
00141    BiReg *biReg;
00142    
00143    
00145    ProbMultiReg();
00146    
00148    ProbMultiReg(ProbMultiRegPar p);
00149    
00151    ProbMultiReg(ProbMultiRegPar p, BiRegPar pa);
00152    
00154    ProbMultiReg(ProbMultiRegPar p, BiRegPar pa, BiRegType bType);
00155    
00157    ~ProbMultiReg();
00158    
00163    void registration(vector <Observation> observ, MultiRegSol *mrsols, int localizator = 0);
00164    
00166    void verboseOn(){ verbose = true; }
00167    
00169    void verboseOff(){ verbose = false; }
00170    
00175    void setLikelihood(vector<int>& ids, map <int, vector<Pose> >* lik);
00176    
00177   private:
00178    
00179    map <int, vector<Pose> > *likelihood;
00180    vector <int> activeLikelihoods;
00181    
00182    bool verbose;
00183    
00184    // a step of the multiple registration algorithm
00185    void step(ProbMultiRegStepInput &in);
00186    
00187    //
00188   public:
00189    void leastMeanSquare(Observation obs0, Observation obs1, BiRegOut* sol);  // TODO DA MODIFICARE IL CALCOLO DELLA SVD
00190    
00191   private:
00192    //
00193    Decimal computeProbability(Pose measure, int id);
00194  };
00195  
00196  /* @} */
00197  
00198  
00199 };// end namespace MipAlgorithms
00200 
00201 
00202 
00203 #endif
00204 
00205 
00206 
00207 
00208 
00209 
00210 
00211 

Generated on Mon Feb 20 07:01:06 2017 for MIP by  doxygen 1.5.6