33 #include <VisionX/interface/components/RGBDImageProvider.h>
36 #include <pcl/common/transforms.h>
37 #include <pcl/point_cloud.h>
38 #include <pcl/point_types.h>
40 #include <libfreenect2/libfreenect2.hpp>
41 #include <libfreenect2/frame_listener_impl.h>
42 #include <libfreenect2/registration.h>
43 #include <libfreenect2/packet_pipeline.h>
45 #include <Eigen/Geometry>
70 defineOptionalProperty<bool>(
"EnableRGB",
true,
"Enable color image.");
71 defineOptionalProperty<bool>(
"EnableDepth",
true,
"Enable depth image.");
72 defineOptionalProperty<KinectProcessorType>(
"Pipeline",
CPU,
73 "Kinect Pipeline for image processing. Can be one of CPU, GL, CL, CLKDE, CUDA, CUDAKDE")
80 defineOptionalProperty<std::string>(
"Serial",
"",
81 "Serial Number of the Camera to use. If empty the serial will be chosen automatically");
82 defineOptionalProperty<bool>(
"Mirror",
false,
83 "Mirrors the resulting images");
84 defineOptionalProperty<std::string>(
"ReferenceFrameName",
"DepthCamera",
"Optional reference frame name.");
96 virtual public RGBDPointCloudProviderInterface,
105 libfreenect2::Frame::
Color | libfreenect2::Frame::Ir | libfreenect2::Frame::Depth),
106 undistorted_(512, 424, 4), registered_(512, 424, 4) {};
110 return "KinectV2PointCloudProvider";
178 return getProperty<std::string>(
"ReferenceFrameName");
182 typedef pcl::PointXYZRGBA
PointT;
184 libfreenect2::Freenect2Device::IrCameraParams getCameraIrParameters();
186 libfreenect2::Freenect2Device::ColorCameraParams getCameraRGBParameters();
188 void initializeCameraCalibration();
190 libfreenect2::Freenect2 freenect2_;
191 libfreenect2::Freenect2Device* dev_;
192 libfreenect2::PacketPipeline* pipeline_;
193 libfreenect2::SyncMultiFrameListener listener_;
194 libfreenect2::FrameMap frames_;
196 libfreenect2::Frame undistorted_, registered_;
197 bool enable_rgb_, enable_depth_, mirror_;
205 ImageProviderInterfacePrx imageProviderPrx;
206 std::string providerName;
207 CByteImage** rgbImages_;
208 int rgb_width_, rgb_height_, d_width_, d_height_;
209 StereoCalibration calibration;