libfovis
depth_image.hpp
1 #ifndef __fovis_depth_image_hpp__
2 #define __fovis_depth_image_hpp__
3 
4 #include <inttypes.h>
5 #include "camera_intrinsics.hpp"
6 #include "depth_source.hpp"
7 
8 namespace fovis
9 {
10 
11 class KeypointData;
12 
19 class DepthImage : public DepthSource
20 {
21  public:
22  DepthImage(const CameraIntrinsicsParameters& rgb_camera_params,
23  int depth_width, int depth_height);
24  ~DepthImage();
25 
31  void setDepthImage(const float* depth_data);
32 
33  virtual bool haveXyz(int u, int v) ;
34  virtual void getXyz(OdometryFrame * frame);
35  virtual void refineXyz(FeatureMatch * matches,
36  int num_matches,
37  OdometryFrame * frame);
38 
39  virtual double getBaseline() const { return 0; }
40 
41  private:
42  int rgbToDepthIndex(double u, double v) const {
43  return (int)(v * _y_scale) * _depth_width + (int)(u * _x_scale);
44  }
45  bool getXyzInterp(KeypointData* kpdata);
46 
47  int _rgb_width;
48  int _rgb_height;
49 
50  int _depth_width;
51  int _depth_height;
52  float _x_scale;
53  float _y_scale;
54 
55  Eigen::Matrix<double, 3, Eigen::Dynamic>* _rays;
56  float* _depth_data;
57 
58  double _fx_inv;
59  double _fy_inv;
60  double _neg_cx_div_fx;
61  double _neg_cy_div_fy;
62 };
63 
64 }
65 #endif
Depth source where a fully dense, metric depth image is available.
Definition: depth_image.hpp:19
Stores data specific to an input frame.
Definition: frame.hpp:33
Provides depth estimates for input image pixels.
Definition: depth_source.hpp:29
virtual void refineXyz(FeatureMatch *matches, int num_matches, OdometryFrame *frame)
Represents a single image feature matched between two camera images taken at different times...
Definition: feature_match.hpp:41
virtual double getBaseline() const
Definition: depth_image.hpp:39
quick and dirty profiling tool.inspired by the matlab tic/toc command
Definition: camera_intrinsics.hpp:6
Intrinsic parameters for a pinhole camera with plumb-bob distortion model.
Definition: camera_intrinsics.hpp:14
void setDepthImage(const float *depth_data)
virtual bool haveXyz(int u, int v)
virtual void getXyz(OdometryFrame *frame)