Newer
Older
#pragma once
#ifndef _FTL_RGBD_NET_HPP_
#define _FTL_RGBD_NET_HPP_
#include <ftl/net/universe.hpp>
#include <string>
namespace ftl {
namespace rgbd {
static const int kDefaultFrameCount = 30;
/**
* RGBD source from either a stereo video file with left + right images, or
* direct from two camera devices. A variety of algorithms are included for
* calculating disparity, before converting to depth. Calibration of the images
* is also performed.
*/
int chunks_dim_;
int chunk_width_;
int chunk_height_;
cv::Mat idepth_;
int default_quality_;
ftl::rgbd::channel_t prev_chan_;
// Double buffering
cv::Mat d_depth_;
cv::Mat d_rgb_;
bool _getCalibration(ftl::net::Universe &net, const ftl::UUID &peer, const std::string &src, ftl::rgbd::Camera &p);
void _recv(const std::vector<unsigned char> &jpg, const std::vector<unsigned char> &d);
void _recvChunk(int64_t frame, int chunk, bool delta, const std::vector<unsigned char> &jpg, const std::vector<unsigned char> &d);