Superpixel Benchmark
Superpixel benchmark, tools and algorithms.
depth_tools.h
Go to the documentation of this file.
1 
32 #ifndef DEPTH_TOOLS_H
33 #define DEPTH_TOOLS_H
34 
35 #include <opencv2/opencv.hpp>
36 
40 class DepthTools {
41 public:
45  struct Camera {
46 
53  float projectZ(unsigned short depth, float factor = 1000.f) const;
54 
62  template <typename T>
63  float projectX(T x, unsigned short depth, float factor = 1000.f) const;
64 
72  template <typename T>
73  float projectY(T y, unsigned short depth, float factor = 1000.f) const;
74 
82  int backprojectX(float x, float depth, float factor = 1000.f) const;
83 
91  int backprojectY(float y, float depth, float factor = 1000.f) const;
92 
94  float cropping_x;
96  float cropping_y;
98  float principal_x;
100  float principal_y;
102  float focal_x;
104  float focal_y;
105  };
106 
113  static void computeCloudFromDepth(const cv::Mat &depth, const Camera &camera,
114  cv::Mat &cloud);
115 };
116 
117 #endif /* DEPTH_TOOLS_H */
118 
float cropping_y
If the images was cropped in y dimension by a specific number of pixels.
Definition: depth_tools.h:96
float projectX(T x, unsigned short depth, float factor=1000.f) const
Given the depth by depth/factor, project the x coordinate into 3D room.
Definition: depth_tools.cpp:48
int backprojectY(float y, float depth, float factor=1000.f) const
Given the depth by depth/factor, back project the y coordinate to image plain.
Definition: depth_tools.cpp:79
int backprojectX(float x, float depth, float factor=1000.f) const
Given the depth by depth/factor, back project the x coordinate to image plain.
Definition: depth_tools.cpp:71
float principal_y
Principal point y coordinate.
Definition: depth_tools.h:100
float projectZ(unsigned short depth, float factor=1000.f) const
Get the z coordinate of the projected point given the depth as depth/factor.
Definition: depth_tools.cpp:39
float cropping_x
If the image was cropped in x dimension by a specific number of pixels.
Definition: depth_tools.h:94
Tools for using depth information.
Definition: depth_tools.h:40
static void computeCloudFromDepth(const cv::Mat &depth, const Camera &camera, cv::Mat &cloud)
Compute a point cloud stored as three channel float image from the given depth map and the intrinsic ...
Definition: depth_tools.cpp:87
float projectY(T y, unsigned short depth, float factor=1000.f) const
Given the depth by depth/factor, project the y coordinate into 3D room.
Definition: depth_tools.cpp:60
Represents basic intrinsic parameters used to project pixels into a point cloud.
Definition: depth_tools.h:45
float focal_y
Focal length in y.
Definition: depth_tools.h:104
float focal_x
Focal length in x.
Definition: depth_tools.h:102
float principal_x
Principal point x coordinate.
Definition: depth_tools.h:98