Now working on OpenCV with Qt support

This commit is contained in:
gineshidalgo99
2017-05-07 09:40:24 -04:00
parent 8a963bda3b
commit 2a07aa59fb
7 changed files with 89 additions and 67 deletions
@@ -164,16 +164,19 @@ int openPoseTutorialThread1()
op::log("Starting thread(s)", op::Priority::Max);
// Two different ways of running the program on multithread enviroment
// Option a) Using the main thread (this thread) for processing (it saves 1 thread, recommended)
// threadManager.exec(); // It blocks this thread until all threads have finished
threadManager.exec(); // It blocks this thread until all threads have finished
// Option b) Giving to the user the control of this thread
// Start threads
threadManager.start();
// Keep program alive while running threads. Here the user could perform any other desired function
while (threadManager.isRunning())
std::this_thread::sleep_for(std::chrono::milliseconds{33});
// Stop and join threads
op::log("Stopping thread(s)", op::Priority::Max);
threadManager.stop();
// // VERY IMPORTANT NOTE: if OpenCV is compiled with Qt support, this option will not work. Qt needs the main thread to
// // plot visual results, so the final GUI (which uses OpenCV) would return an exception similar to:
// // `QMetaMethod::invoke: Unable to invoke methods with return values in queued connections`
// // Start threads
// threadManager.start();
// // Keep program alive while running threads. Here the user could perform any other desired function
// while (threadManager.isRunning())
// std::this_thread::sleep_for(std::chrono::milliseconds{33});
// // Stop and join threads
// op::log("Stopping thread(s)", op::Priority::Max);
// threadManager.stop();
// ------------------------- CLOSING -------------------------
// Logging information message
@@ -206,16 +206,19 @@ int openPoseTutorialThread2()
op::log("Starting thread(s)", op::Priority::Max);
// Two different ways of running the program on multithread enviroment
// Option a) Using the main thread (this thread) for processing (it saves 1 thread, recommended)
// threadManager.exec(); // It blocks this thread until all threads have finished
threadManager.exec(); // It blocks this thread until all threads have finished
// Option b) Giving to the user the control of this thread
// Start threads
threadManager.start();
// Keep program alive while running threads. Here the user could perform any other desired function
while (threadManager.isRunning())
std::this_thread::sleep_for(std::chrono::milliseconds{33});
// Stop and join threads
op::log("Stopping thread(s)", op::Priority::Max);
threadManager.stop();
// // VERY IMPORTANT NOTE: if OpenCV is compiled with Qt support, this option will not work. Qt needs the main thread to
// // plot visual results, so the final GUI (which uses OpenCV) would return an exception similar to:
// // `QMetaMethod::invoke: Unable to invoke methods with return values in queued connections`
// // Start threads
// threadManager.start();
// // Keep program alive while running threads. Here the user could perform any other desired function
// while (threadManager.isRunning())
// std::this_thread::sleep_for(std::chrono::milliseconds{33});
// // Stop and join threads
// op::log("Stopping thread(s)", op::Priority::Max);
// threadManager.stop();
// ------------------------- CLOSING -------------------------
// Logging information message
@@ -197,16 +197,19 @@ int openPoseTutorialThread3()
op::log("Starting thread(s)", op::Priority::Max);
// Two different ways of running the program on multithread enviroment
// Option a) Using the main thread (this thread) for processing (it saves 1 thread, recommended)
// threadManager.exec(); // It blocks this thread until all threads have finished
threadManager.exec(); // It blocks this thread until all threads have finished
// Option b) Giving to the user the control of this thread
// Start threads
threadManager.start();
// Keep program alive while running threads. Here the user could perform any other desired function
while (threadManager.isRunning())
std::this_thread::sleep_for(std::chrono::milliseconds{33});
// Stop and join threads
op::log("Stopping thread(s)", op::Priority::Max);
threadManager.stop();
// // VERY IMPORTANT NOTE: if OpenCV is compiled with Qt support, this option will not work. Qt needs the main thread to
// // plot visual results, so the final GUI (which uses OpenCV) would return an exception similar to:
// // `QMetaMethod::invoke: Unable to invoke methods with return values in queued connections`
// // Start threads
// threadManager.start();
// // Keep program alive while running threads. Here the user could perform any other desired function
// while (threadManager.isRunning())
// std::this_thread::sleep_for(std::chrono::milliseconds{33});
// // Stop and join threads
// op::log("Stopping thread(s)", op::Priority::Max);
// threadManager.stop();
// ------------------------- CLOSING -------------------------
// Logging information message
@@ -209,16 +209,19 @@ int openPoseTutorialThread4()
op::log("Starting thread(s)", op::Priority::Max);
// Two different ways of running the program on multithread enviroment
// Option a) Using the main thread (this thread) for processing (it saves 1 thread, recommended)
// threadManager.exec(); // It blocks this thread until all threads have finished
threadManager.exec(); // It blocks this thread until all threads have finished
// Option b) Giving to the user the control of this thread
// Start threads
threadManager.start();
// Keep program alive while running threads. Here the user could perform any other desired function
while (threadManager.isRunning())
std::this_thread::sleep_for(std::chrono::milliseconds{33});
// Stop and join threads
op::log("Stopping thread(s)", op::Priority::Max);
threadManager.stop();
// // VERY IMPORTANT NOTE: if OpenCV is compiled with Qt support, this option will not work. Qt needs the main thread to
// // plot visual results, so the final GUI (which uses OpenCV) would return an exception similar to:
// // `QMetaMethod::invoke: Unable to invoke methods with return values in queued connections`
// // Start threads
// threadManager.start();
// // Keep program alive while running threads. Here the user could perform any other desired function
// while (threadManager.isRunning())
// std::this_thread::sleep_for(std::chrono::milliseconds{33});
// // Stop and join threads
// op::log("Stopping thread(s)", op::Priority::Max);
// threadManager.stop();
// ------------------------- CLOSING -------------------------
// Logging information message