From 1e674aa02db67aa2e8b4a16e81e63907b7406b89 Mon Sep 17 00:00:00 2001 From: Sebastian Hahta <joseha@utu.fi> Date: Mon, 19 Aug 2019 17:10:54 +0300 Subject: [PATCH] fix group sync --- applications/calibration-multi/src/main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/applications/calibration-multi/src/main.cpp b/applications/calibration-multi/src/main.cpp index 485653282..0901be79c 100644 --- a/applications/calibration-multi/src/main.cpp +++ b/applications/calibration-multi/src/main.cpp @@ -402,7 +402,9 @@ void runCameraCalibration( ftl::Configurable* root, std::atomic<bool> new_frames = false; vector<Mat> rgb(n_cameras), rgb_new(n_cameras); - group.sync([&mutex, &new_frames, &rgb_new](const ftl::rgbd::FrameSet &frames) { + ftl::timer::start(false); + + group.sync([&mutex, &new_frames, &rgb_new](ftl::rgbd::FrameSet &frames) { mutex.lock(); bool good = true; for (size_t i = 0; i < frames.channel1.size(); i ++) { @@ -411,9 +413,8 @@ void runCameraCalibration( ftl::Configurable* root, if (frames.channel1[i].channels() != 3) good = false; // ASSERT if (frames.channel2[i].channels() != 3) good = false; if (!good) break; - - frames.channel1[i].copyTo(rgb_new[2 * i]); - frames.channel2[i].copyTo(rgb_new[2 * i + 1]); + cv::swap(frames.channel1[i], rgb_new[2 * i]); + cv::swap(frames.channel2[i], rgb_new[2 * i + 1]); } new_frames = good; -- GitLab