1 #ifndef __fovis_primesense_depth_hpp__
2 #define __fovis_primesense_depth_hpp__
6 #include "feature_match.hpp"
7 #include "camera_intrinsics.hpp"
8 #include "rectification.hpp"
9 #include "depth_source.hpp"
111 double a = -0.125 * fx_inv * pdb_inv;
112 double b = 0.125 * params.
shift_offset * fx_inv * pdb_inv;
115 Eigen::Matrix4d result;
117 fx_inv, 0, 0, -cx * fx_inv,
118 0, fx_inv, 0, -cy * fx_inv,
129 Eigen::Isometry3d result = Eigen::Isometry3d::Identity();
132 result.rotate(Eigen::Quaterniond(q[0], q[1], q[2], q[3]));
177 return rgb_rectification;
198 void setDisparityData(
const uint16_t* disparity);
200 bool getXyz(
int u,
int v, Eigen::Vector3d & xyz);
218 inline uint16_t
getDisparity(
int rgb_u,
int rgb_v)
const;
227 inline bool haveXyz(
int u,
int v);
230 bool haveXyz(
float u_f,
float v_f);
240 uint16_t* _disparity;
244 uint32_t* _rgb_to_disparity_map;
246 uint32_t _disparity_map_max_index;
248 Eigen::Matrix4d* _uvd1_d_to_xyz_c;
254 int rgb_index = v * _ir_width + u;
255 uint32_t disparity_index = _rgb_to_disparity_map[rgb_index];
256 if(disparity_index < _disparity_map_max_index) {
257 return _disparity[disparity_index];
266 assert(ir_u >= 0 && ir_v >= 0 && ir_u < _ir_width && ir_v < _ir_height);
267 return _disparity[ir_v * _ir_width + ir_u];
279 int rgb_index = v * _ir_width + u;
280 uint32_t disparity_index = _rgb_to_disparity_map[rgb_index];
281 return disparity_index < _disparity_map_max_index;
Calibration data structure for Kinect / PrimeSense sensors.
Definition: primesense_depth.hpp:49
bool haveXyz(int u, int v)
Definition: primesense_depth.hpp:277
Eigen::Matrix4d getDepthUvdToRgbXyz() const
Definition: primesense_depth.hpp:162
double projector_depth_baseline
Definition: primesense_depth.hpp:67
double depth_to_rgb_quaternion[4]
Definition: primesense_depth.hpp:76
Stores data specific to an input frame.
Definition: frame.hpp:33
Provides depth estimates for input image pixels.
Definition: depth_source.hpp:29
Eigen::Isometry3d getDepthXyzToRgbXyz() const
Definition: primesense_depth.hpp:128
int width
Definition: primesense_depth.hpp:54
Represents a single image feature matched between two camera images taken at different times...
Definition: feature_match.hpp:41
Image feature used for motion estimation.
Definition: keypoint.hpp:49
int height
Definition: primesense_depth.hpp:58
uint16_t getDisparityAtIRPixel(int ir_u, int ir_v) const
Definition: primesense_depth.hpp:264
Eigen::Matrix< double, 3, 4 > getDepthUvdToRgbUvw() const
Definition: primesense_depth.hpp:153
const CameraIntrinsicsParameters & getInputCameraParameters() const
Definition: rectification.hpp:66
Eigen::Matrix< double, 3, 4 > getRgbXyzToRgbUvw() const
Definition: primesense_depth.hpp:140
Computes useful information from a PrimeSenseCalibrationParameters object.
Definition: primesense_depth.hpp:93
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
double cx
Definition: camera_intrinsics.hpp:64
double cy
Definition: camera_intrinsics.hpp:69
Eigen::Matrix< double, 3, 4 > toProjectionMatrix() const
Definition: camera_intrinsics.hpp:31
const Rectification * getRgbRectification() const
Definition: primesense_depth.hpp:176
Intrinsic parameters for a pinhole camera with plumb-bob distortion model.
Definition: camera_intrinsics.hpp:14
uint16_t getDisparity(int rgb_u, int rgb_v) const
Definition: primesense_depth.hpp:252
double getBaseline() const
Definition: primesense_depth.hpp:271
CameraIntrinsicsParameters rgb_params
Definition: primesense_depth.hpp:85
void refineXyz(FeatureMatch *matches, int num_matches, OdometryFrame *frame)
double depth_to_rgb_translation[3]
Definition: primesense_depth.hpp:72
Eigen::Matrix4d getDepthUvdToDepthXyz() const
Definition: primesense_depth.hpp:108
double fx
Definition: camera_intrinsics.hpp:54
PrimeSenseCalibration(const PrimeSenseCalibrationParameters ¶ms)
const PrimeSenseCalibrationParameters & getParameters() const
Definition: primesense_depth.hpp:169
double shift_offset
Definition: primesense_depth.hpp:63
Stores depth data for a Kinect / PrimeSense camera.
Definition: primesense_depth.hpp:192
CameraIntrinsicsParameters depth_params
Definition: primesense_depth.hpp:81