BiReg.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 
00037 
00038 
00039 #ifndef __BI_REG_H
00040 #define __BI_REG_H
00041 
00042 #include <Spaces.h>
00043 
00044 namespace MipAlgorithms{
00045  
00047  /* @{ */
00048  
00052  enum BiRegType {
00053   UNINIT_BIREG,
00054   RANSAC_BIREG,
00055   BIREG_NUM
00056  };
00057  
00061  static const char* BiRegNames[BIREG_NUM] = {
00062   "UninitializedRansac",
00063   "BiRegRansac"
00064  };
00065  
00066  
00071  class DDubInt {
00072   protected: 
00073    DubInt _m;
00074    Decimal _dist;
00075   
00076   public:
00078    Decimal dist();
00079    
00081    int m1();
00082    
00084    int m2();
00085   
00087    DubInt m();
00088    
00090    DDubInt();
00091    
00093    DDubInt(int a, int b, Decimal c);
00094    
00096    DDubInt(const DDubInt &db);
00097    
00099    DDubInt operator= (DDubInt db);
00100    
00102    string print();
00103  };
00104  
00105  
00109  class DDubIntListPar{
00110   public:
00112    Decimal discretization;
00114    Decimal maxDist;
00116    Decimal discToll;
00117    
00119    DDubIntListPar();
00120    
00125    DDubIntListPar(Decimal disc, Decimal mD, Decimal dToll);
00126    
00128    void operator= (DDubIntListPar A);
00129  };
00130  
00131  
00135  class DDubIntList : public vector < vector < DDubInt > >{
00136   
00137   public:
00138    
00140    DDubIntListPar par;
00141    
00143    DDubIntList();
00144    
00148    DDubIntList(Observation &obs, DDubIntListPar p);
00149    
00152    DDubIntList(DDubIntList &d);
00153    
00157    void update(Observation &obs, int firstNewDot);
00158    
00161    string print();
00162  };
00163  
00164  
00168  class BiRegOut{
00169    
00170   protected:
00172    Decimal _x; 
00174    Decimal _y;
00176    Angle _rot;
00178    int _id;
00179    
00181    vector<int> _inlier;
00183    int _numInliers;
00184    
00185   public:
00186    
00188    Decimal x(void);
00189    
00191    Decimal y(void);
00192    
00194    Angle rot(void);
00195    
00197    int id(void);
00198    
00200    int numInliers(void);
00201    
00203    int inlier(int i);
00204    
00206    int size();
00207    
00210    void setX(Decimal a);
00211    
00214    void setY(Decimal a);
00215    
00218    void setRot(Angle a);
00219    
00222    void setId(int a);
00223    
00226    void setNumInliers(int a);
00227    
00229    void clear();
00230    
00233    void resize(int i);
00234    
00238    void setInlier(int i, int a);
00239    
00240    
00242    BiRegOut();
00243    
00246    BiRegOut(const BiRegOut &A);
00247    
00249    ~BiRegOut();
00250    
00252    void operator= (BiRegOut A);
00253    
00255    bool operator!= (BiRegOut A);
00256    
00258    string print();
00259    
00261    void init();
00262  };
00263  
00264  
00268  class BiRegSol : public vector <BiRegOut>{
00269    
00270   public:
00272    BiRegSol();
00273    
00276    BiRegSol(int a);
00277    
00279    string print();
00280  };
00281  
00282  
00286  class BiRegIn{
00287   public:
00288    
00289    Observation obs0;
00290    Observation obs1;
00291    
00292    vector< vector <DDubInt> > *dubshortlist;
00293    
00295    BiRegIn();
00296    
00301    BiRegIn(Observation o0, Observation o1, vector< vector <DDubInt> > *dsh);
00302  };
00303  
00304  
00309  class BiRegPar {
00310   
00311   public:
00313    Decimal linThld;
00315    Angle angThld;
00317    int obs0Trials;
00319    int obs1Trials;
00321    int minInliersNum;
00323    Decimal discStep;
00325    Decimal prewrpToll;
00326    
00328    BiRegPar(){
00329     linThld  = 0.1;
00330     angThld  = 0.1;
00331     obs0Trials = 10;
00332     obs1Trials = 10;
00333     minInliersNum = 3;
00334     discStep = 5.0;
00335     prewrpToll = 0.05;
00336    }
00345    BiRegPar(Decimal lTh, Decimal aTh, int o0T, int o1T, int mInlNum, Decimal dSt, Decimal pw);
00346    
00348    BiRegPar(const BiRegPar &A);
00349    
00351    BiRegPar operator= (BiRegPar A);
00352  };
00353  
00354  
00358  class BiReg {
00359    
00360    BiRegType type;
00361    
00362   protected:
00363    
00365    BiRegPar par;
00366    
00368    bool verbose;
00369    
00371    void setType(BiRegType t);
00372    
00373   public:
00374    
00376    BiReg();
00377    
00380    BiReg(BiRegPar BRP);
00381    
00383    BiRegType getType();
00384    
00388    virtual void registration(BiRegIn &in, BiRegSol *solution) = 0;
00389    
00391    void verboseOn();
00392    
00394    void verboseOff();
00395  };
00396  
00397  /* @} */
00398  
00399 }; // end namespace MipAlgorithms
00400 
00401 #endif
00402 
00403 
00404 
00405 
00406 

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