diff --git a/components/rgbd-sources/src/sources/stereovideo/stereovideo.cpp b/components/rgbd-sources/src/sources/stereovideo/stereovideo.cpp index 01afccee4134a66a0e20f80cf41ec65c17dd8543..5b94356c6674df9f0c7936cfd475b221d2bc0b9c 100644 --- a/components/rgbd-sources/src/sources/stereovideo/stereovideo.cpp +++ b/components/rgbd-sources/src/sources/stereovideo/stereovideo.cpp @@ -151,25 +151,29 @@ void StereoVideoSource::init(const string &file) { } ftl::rgbd::Camera StereoVideoSource::parameters(Channel chan) { + cv::Mat q; + if (chan == Channel::Right) { - cv::Mat q = calib_->getCameraMatrixRight(depth_size_); - ftl::rgbd::Camera params = { - q.at<double>(0,0), // Fx - q.at<double>(1,1), // Fy - -q.at<double>(0,2), // Cx - -q.at<double>(1,2), // Cy - (unsigned int)lsrc_->width(), - (unsigned int)lsrc_->height(), - 0.0f, // 0m min - 15.0f, // 15m max - 1.0 / calib_->getQ().at<double>(3,2), // Baseline - 0.0f // doffs - }; - return params; - //params_.doffs = -calib_->getQ().at<double>(3,3) * params_.baseline; + q = calib_->getCameraMatrixRight(depth_size_); } else { - return params_; + q = calib_->getCameraMatrixLeft(depth_size_); } + + // TODO: remove hardcoded values (min/max) + ftl::rgbd::Camera params = { + q.at<double>(0,0), // Fx + q.at<double>(1,1), // Fy + -q.at<double>(0,2), // Cx + -q.at<double>(1,2), // Cy + (unsigned int)lsrc_->width(), + (unsigned int)lsrc_->height(), + 0.0f, // 0m min + 15.0f, // 15m max + 1.0 / calib_->getQ().at<double>(3,2), // Baseline + 0.0f // doffs + }; + + return params; } bool StereoVideoSource::capture(int64_t ts) {