libfovis
frame.hpp
1 #ifndef __fovis_frame_hpp__
2 #define __fovis_frame_hpp__
3 
4 #include <stdint.h>
5 #ifndef NDEBUG
6 #include <assert.h>
7 #endif
8 
9 #include <vector>
10 #include <Eigen/Geometry>
11 
12 #include "options.hpp"
13 #include "keypoint.hpp"
14 #include "grid_filter.hpp"
15 #include "pyramid_level.hpp"
16 
17 namespace fovis
18 {
19 
20 class CameraIntrinsics;
21 class Rectification;
22 class DepthSource;
23 
34 {
35  public:
36  OdometryFrame(const Rectification* rectification,
37  const VisualOdometryOptions& options);
38 
39  ~OdometryFrame();
40 
41  void prepareFrame(const uint8_t* raw_gray,
42  int fast_threshold,
43  DepthSource* depth_source);
44 
45  int getNumKeypoints() const {
46  int result = 0;
47  for(int i=0; i<_num_levels; i++)
48  result += _levels[i]->getNumKeypoints();
49  return result;
50  }
51 
52  int getNumDetectedKeypoints() const {
53  int result = 0;
54  for(int i=0; i<_num_levels; i++)
55  result += _levels[i]->getNumDetectedKeypoints();
56  return result;
57  }
58 
59  int getNumLevels() const {
60  return _num_levels;
61  }
62 
63  const PyramidLevel* getLevel(int i) const {
64  return _levels[i];
65  }
66 
67  PyramidLevel* getLevel(int i) {
68  return _levels[i];
69  }
70 
71  void sanityCheck() const;
72 
73  int getFeatureWindowSize() const { return _feature_window_size; }
74 
75  private:
76 
77  void purgeBadKeypoints();
78 
79  int _orig_width;
80  int _orig_height;
81 
82  int _num_levels;
83  int _feature_window_size;
84  bool _use_bucketing;
85  bool _use_image_normalization;
86 
87  // note: the rectification pointer is 'borrowed'
88  const Rectification* _rectification;
89 
90  std::vector<PyramidLevel*> _levels;
91 };
92 
93 }
94 
95 #endif
One level of a Gaussian image pyramid.
Definition: pyramid_level.hpp:21
Stores data specific to an input frame.
Definition: frame.hpp:33
Provides depth estimates for input image pixels.
Definition: depth_source.hpp:29
std::map< std::string, std::string > VisualOdometryOptions
Options.
Definition: options.hpp:106
Maps image coordinates from an input image to image coordinates on a rectified camera.
Definition: rectification.hpp:41
quick and dirty profiling tool.inspired by the matlab tic/toc command
Definition: camera_intrinsics.hpp:6
Options.