-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
pollKey, non-blocking variant of waitKey #19410
Description
this is a feature proposal for the highgui module.
I'd like to introduce a variant of waitKey, let's call it pollKey, that performs the same tasks, i.e. processing the GUI message loop until empty or actionable event, but does not wait for messages.
pollKey is the equivalent of what waitKey(0) might have been, if infinite wait had been defined as -1.
goal: get some speed out of OpenCV's GUI functions. currently there is a mandatory Sleep() in the windows module (and others too), which causes the process to lose at least one scheduler time slice, which can be 10-15 milliseconds per invocation. when processing and displaying video, that adds up and eats a good fraction of the whole run time.
I've come up with code for win32. pull request incoming. I can guess at the code needed for QT, cocoa, and gtk. winrt seems to contain a stub function for waitKey and appears to fall back on the function found in window_w32.cpp.
how should this be done? do I implement what I can and leave the rest, or do I stub them, or do I fill in my best guess for correct code without the ability to test, or do I see about a development environment for those platforms?
I know about OE-24 #11019, which puts into question extra effort here that is bound to be superseded anyway.