libfovis
stereo_frame.hpp
1 #ifndef __fovis_stereo_frame_hpp__
2 #define __fovis_stereo_frame_hpp__
3 
4 #include <stdint.h>
5 #include <assert.h>
6 
7 #include <vector>
8 #include <Eigen/Geometry>
9 
10 #include "options.hpp"
11 #include "keypoint.hpp"
12 #include "pyramid_level.hpp"
13 #include "rectification.hpp"
14 
15 namespace fovis
16 {
17 
25 {
26  public:
27  StereoFrame(int width, int height,
28  const Rectification* rectify_map,
29  const VisualOdometryOptions& options);
30 
31  ~StereoFrame();
32 
33  void prepareFrame(const uint8_t* raw_gray, int fast_threshold);
34 
35  int getNumDetectedKeypoints() const {
36  int result = 0;
37  for(int i=0; i<_num_levels; i++)
38  result += _levels[i]->getNumDetectedKeypoints();
39  return result;
40  }
41 
42  PyramidLevel * getLevel(int level_num) { return _levels[level_num]; }
43 
44  void rectify(Eigen::Vector2d xy_in, Eigen::Vector2d * out) {
45  _rectify_map->rectifyBilinearLookup(xy_in, out);
46  }
47 
48  private:
49  void initialize(int bucket_width, int bucket_height, int max_keypoints_per_bucket);
50 
51  int _base_width;
52  int _base_height;
53  int _feature_window_size;
54 
55  int _num_levels;
56  std::vector<PyramidLevel *> _levels;
57 
58  Rectification* _rectify_map;
59 
60  bool _use_bucketing;
61  bool _use_image_normalization;
62 };
63 
64 }
65 
66 #endif
One level of a Gaussian image pyramid.
Definition: pyramid_level.hpp:21
Stores the right-hand image for a stereo pair.
Definition: stereo_frame.hpp:24
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.
void rectifyBilinearLookup(const Eigen::Vector2d &dist_uv, Eigen::Vector2d *rect_uv) const
Definition: rectification.hpp:128