Skip to content
Snippets Groups Projects
Commit f147be2c authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Correction to correction

parent 3210fc19
No related branches found
No related tags found
No related merge requests found
Pipeline #12008 passed
...@@ -86,6 +86,7 @@ MiddleburySource::MiddleburySource(ftl::rgbd::Source *host, const string &dir) ...@@ -86,6 +86,7 @@ MiddleburySource::MiddleburySource(ftl::rgbd::Source *host, const string &dir)
host_->getConfig()["centre_x"] = params_.cx; host_->getConfig()["centre_x"] = params_.cx;
host_->getConfig()["centre_y"] = params_.cy; host_->getConfig()["centre_y"] = params_.cy;
host_->getConfig()["baseline"] = params_.baseline; host_->getConfig()["baseline"] = params_.baseline;
host_->getConfig()["doffs"] = params_.doffs;
// Add event handlers to allow calibration changes... // Add event handlers to allow calibration changes...
host_->on("baseline", [this](const ftl::config::Event &e) { host_->on("baseline", [this](const ftl::config::Event &e) {
...@@ -97,6 +98,10 @@ MiddleburySource::MiddleburySource(ftl::rgbd::Source *host, const string &dir) ...@@ -97,6 +98,10 @@ MiddleburySource::MiddleburySource(ftl::rgbd::Source *host, const string &dir)
params_.fy = params_.fx; params_.fy = params_.fx;
}); });
host_->on("doffs", [this](const ftl::config::Event &e) {
params_.doffs = host_->value("doffs", params_.doffs);
});
host_->on("centre_x", [this](const ftl::config::Event &e) { host_->on("centre_x", [this](const ftl::config::Event &e) {
params_.cx = host_->value("centre_x", params_.cx); params_.cx = host_->value("centre_x", params_.cx);
}); });
...@@ -137,7 +142,6 @@ MiddleburySource::MiddleburySource(ftl::rgbd::Source *host, const string &dir) ...@@ -137,7 +142,6 @@ MiddleburySource::MiddleburySource(ftl::rgbd::Source *host, const string &dir)
} }
static void disparityToDepth(const cv::cuda::GpuMat &disparity, cv::cuda::GpuMat &depth, static void disparityToDepth(const cv::cuda::GpuMat &disparity, cv::cuda::GpuMat &depth,
const cv::cuda::GpuMat &mask,
const ftl::rgbd::Camera &c, cv::cuda::Stream &stream) { const ftl::rgbd::Camera &c, cv::cuda::Stream &stream) {
double val = c.baseline * c.fx; double val = c.baseline * c.fx;
cv::cuda::add(disparity, c.doffs, depth, cv::noArray(), -1, stream); cv::cuda::add(disparity, c.doffs, depth, cv::noArray(), -1, stream);
...@@ -190,7 +194,7 @@ void MiddleburySource::_performDisparity() { ...@@ -190,7 +194,7 @@ void MiddleburySource::_performDisparity() {
} }
bool MiddleburySource::grab(int n, int b) { bool MiddleburySource::grab(int n, int b) {
//_performDisparity(); _performDisparity();
return true; return true;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment