From 15ecb7ea95888e4d23abbe2be89646f75f0fd11b Mon Sep 17 00:00:00 2001 From: Sebastian Hahta <joseha@utu.fi> Date: Tue, 13 Aug 2019 09:47:29 +0300 Subject: [PATCH] move namedWindow to loop --- applications/groupview/src/main.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/applications/groupview/src/main.cpp b/applications/groupview/src/main.cpp index 66ff5d0d1..eadda40ce 100644 --- a/applications/groupview/src/main.cpp +++ b/applications/groupview/src/main.cpp @@ -110,7 +110,6 @@ void modeLeftRight(ftl::Configurable *root) { int key; Mat show; - cv::namedWindow("Cameras", cv::WINDOW_KEEPRATIO | cv::WINDOW_NORMAL); while (ftl::running) { while (!new_frames) { @@ -124,7 +123,7 @@ void modeLeftRight(ftl::Configurable *root) { mutex.unlock(); stack(rgb, show); - + cv::namedWindow("Cameras", cv::WINDOW_KEEPRATIO | cv::WINDOW_NORMAL); cv::imshow("Cameras", show); key = cv::waitKey(100); @@ -197,8 +196,6 @@ void modeFrame(ftl::Configurable *root, int frames=1) { vector<cv::Mat> rgb(sources.size()); vector<cv::Mat> depth(sources.size()); - cv::namedWindow("Cameras", cv::WINDOW_KEEPRATIO | cv::WINDOW_NORMAL); - while (ftl::running) { for (auto s : sources) s->grab(30); for (size_t i = 0; i < sources.size(); i++) { @@ -207,6 +204,7 @@ void modeFrame(ftl::Configurable *root, int frames=1) { } stack(rgb, show); + cv::namedWindow("Cameras", cv::WINDOW_KEEPRATIO | cv::WINDOW_NORMAL); cv::imshow("Cameras", show); auto key = cv::waitKey(20); @@ -231,8 +229,6 @@ void modeVideo(ftl::Configurable *root) { vector<cv::Mat> rgb(sources.size()); vector<cv::Mat> depth(sources.size()); - cv::namedWindow("Cameras", cv::WINDOW_KEEPRATIO | cv::WINDOW_NORMAL); - int count = 0; int remaining = 0; @@ -257,6 +253,7 @@ void modeVideo(ftl::Configurable *root) { } stack(rgb, show); + cv::namedWindow("Cameras", cv::WINDOW_KEEPRATIO | cv::WINDOW_NORMAL); cv::imshow("Cameras", show); auto key = cv::waitKey(20); -- GitLab