Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 #ifndef VISO_MONO_H
00023 #define VISO_MONO_H
00024 
00025 #include "viso.h"
00026 
00027 class VisualOdometryMono : public VisualOdometry {
00028 
00029 public:
00030 
00031   
00032   struct parameters : public VisualOdometry::parameters {
00033     double                      height;           
00034     double                      pitch;            
00035     int32_t                     ransac_iters;     
00036     double                      inlier_threshold; 
00037     double                      motion_threshold; 
00038     parameters () {
00039       height           = 1.0;
00040       pitch            = 0.0;
00041       ransac_iters     = 2000;
00042       inlier_threshold = 0.00001;
00043       motion_threshold = 100.0;
00044     }
00045   };
00046 
00047   
00048   VisualOdometryMono (parameters param);
00049   
00050   
00051   ~VisualOdometryMono ();
00052   
00053   
00054   
00055   
00056   
00057   
00058   
00059   
00060   
00061   
00062   
00063   
00064   bool process (uint8_t *I,int32_t* dims,bool replace=false);
00065 
00066 private:
00067 
00068   template<class T> struct idx_cmp {
00069     idx_cmp(const T arr) : arr(arr) {}
00070     bool operator()(const size_t a, const size_t b) const { return arr[a] < arr[b]; }
00071     const T arr;
00072   };  
00073 
00074   std::vector<double>  estimateMotion (std::vector<Matcher::p_match> p_matched);  
00075   Matrix               smallerThanMedian (Matrix &X,double &median);
00076   bool                 normalizeFeaturePoints (std::vector<Matcher::p_match> &p_matched,Matrix &Tp,Matrix &Tc);
00077   void                 fundamentalMatrix (const std::vector<Matcher::p_match> &p_matched,const std::vector<int32_t> &active,Matrix &F);
00078   void                 EtoRt(Matrix &E,Matrix &K,std::vector<Matcher::p_match> &p_matched,Matrix &X,Matrix &R,Matrix &t);
00079   int32_t              triangulateChieral (std::vector<Matcher::p_match> &p_matched,Matrix &K,Matrix &R,Matrix &t,Matrix &X);
00080   std::vector<int32_t> getInlier (std::vector<Matcher::p_match> &p_matched,Matrix &F);
00081   
00082   
00083   parameters param;  
00084 };
00085 
00086 #endif // VISO_MONO_H
00087