Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux cvui cpu consumption #100

Open
ahmetmanyasli opened this issue Oct 5, 2020 · 3 comments
Open

linux cvui cpu consumption #100

ahmetmanyasli opened this issue Oct 5, 2020 · 3 comments
Labels
platform:linux Issues related to the Linux platform question

Comments

@ahmetmanyasli
Copy link

When I run your canny example on MS windows10 opencv 4.3 it works smoothly cpu consumtion almost %0 but When I run same canny example code on ubuntu 20.04 opencv 4.3 cpu consumtion %30-%40. I guess the problem waitkey

@ahmetmanyasli ahmetmanyasli changed the title linuc cpu consumption linux cvui cpu consumption Oct 5, 2020
@Dovyski Dovyski added bug question platform:linux Issues related to the Linux platform labels Oct 5, 2020
@Dovyski
Copy link
Owner

Dovyski commented Oct 5, 2020

Thank you for your report. It is not the first time someone complains about this problem. I think you found the problem right away (the waitkey is the source of high CPU). I don't know what happens under Linux that the CPU gets so high.

I think all demos need to be checked regarding that.

@ahmetmanyasli
Copy link
Author

I was thinking to transport my app from windows to linux. and cvui was my gui candidate but with this performance issue I can not use :(

@Dovyski
Copy link
Owner

Dovyski commented Oct 6, 2020

I can help with that 😉 The function cvui::init() has a second param that is the value to be used in all internal waitKey calls. You can do something like this:

cvui::init(WINDOW_NAME, 40);

It will ensure the CPU load remains low both on Windows and on Linux. You can test a few values to ensure your app has the best performance possible, e.g. cvui::init(WINDOW_NAME, 60); , cvui::init(WINDOW_NAME, 100);. This second param of cvui::init() works both on C++ and Python.

Check this demo to see it in action.

@Dovyski Dovyski removed the bug label Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:linux Issues related to the Linux platform question
Projects
None yet
Development

No branches or pull requests

2 participants