You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello all,
I am using cvui to display a window that will be used as UI and will be present in the user's screen while my application is running, to diplay button, info etc. Hence, i want to spawn a thread that updates the cvui window constantly, while my application is ran by other threads. So, i have created a class utilizing the UI, with function updateShowUI which updates and shows the UI through a thread. So what i do is:
UIComponent *uic = new UIComponent();
thread uiT(&UIComponent::updateShowUI, uic);
With the constructor of UIComponent class containing the cvui::init function etc:
I don't think cvui can actually work in a multi-thread environment since OpenCV's cv::imshow() itself is not thread-enabled. I have tried to do what you are trying to do in the past, but nothing I have tried actually worked.
I am afraid this is a limitation beyond what cvui can overcome. However, if you find a way to make your demo work, it would be a pleasure to know more about your approach, so I can create a demo to help other developers.
In fact, if you initialize with cvui::init(MAIN_WINDOW_NAME,-1,false); instead, it will work. But be advised that it is static, so you cannot actually interfere with anything like buttons and trackbars, you can only show static content like images and video...
If i find a way to introduce user interference i will let you know...Thank you!
Hello all,
I am using cvui to display a window that will be used as UI and will be present in the user's screen while my application is running, to diplay button, info etc. Hence, i want to spawn a thread that updates the cvui window constantly, while my application is ran by other threads. So, i have created a class utilizing the UI, with function updateShowUI which updates and shows the UI through a thread. So what i do is:
With the constructor of UIComponent class containing the cvui::init function etc:
updateShowUI function is:
When spawning a thread to run the above function, i find that it freezes when it tries to execute the "imshow" function. What can be the problem?
The text was updated successfully, but these errors were encountered: