00001 #ifndef __fovis_frame_hpp__ 00002 #define __fovis_frame_hpp__ 00003 00004 #include <stdint.h> 00005 #ifndef NDEBUG 00006 #include <assert.h> 00007 #endif 00008 00009 #include <vector> 00010 #include <Eigen/Geometry> 00011 00012 #include "options.hpp" 00013 #include "keypoint.hpp" 00014 #include "grid_filter.hpp" 00015 #include "pyramid_level.hpp" 00016 00017 namespace fovis 00018 { 00019 00020 class CameraIntrinsics; 00021 class Rectification; 00022 class DepthSource; 00023 00033 class OdometryFrame 00034 { 00035 public: 00036 OdometryFrame(const Rectification* rectification, 00037 const VisualOdometryOptions& options); 00038 00039 ~OdometryFrame(); 00040 00041 void prepareFrame(const uint8_t* raw_gray, 00042 int fast_threshold, 00043 DepthSource* depth_source); 00044 00045 int getNumKeypoints() const { 00046 int result = 0; 00047 for(int i=0; i<_num_levels; i++) 00048 result += _levels[i]->getNumKeypoints(); 00049 return result; 00050 } 00051 00052 int getNumDetectedKeypoints() const { 00053 int result = 0; 00054 for(int i=0; i<_num_levels; i++) 00055 result += _levels[i]->getNumDetectedKeypoints(); 00056 return result; 00057 } 00058 00059 int getNumLevels() const { 00060 return _num_levels; 00061 } 00062 00063 const PyramidLevel* getLevel(int i) const { 00064 return _levels[i]; 00065 } 00066 00067 PyramidLevel* getLevel(int i) { 00068 return _levels[i]; 00069 } 00070 00071 void sanityCheck() const; 00072 00073 int getFeatureWindowSize() const { return _feature_window_size; } 00074 00075 private: 00076 00077 void purgeBadKeypoints(); 00078 00079 int _orig_width; 00080 int _orig_height; 00081 00082 int _num_levels; 00083 int _feature_window_size; 00084 bool _use_bucketing; 00085 bool _use_image_normalization; 00086 00087 // note: the rectification pointer is 'borrowed' 00088 const Rectification* _rectification; 00089 00090 std::vector<PyramidLevel*> _levels; 00091 }; 00092 00093 } 00094 00095 #endif