Search code examples
opencvcomputer-visionglut

get handle to current active window in OpenCV


Are there OpenCV equivalents of the GLUT glutGetWindow()/glutSetWindow() functions, which allows the current active window to be identified and switched from your own codes?

Basically, I'd like to able to identify the current active window from a within a mouse callback function registered with all windows, and have it call another processing function with different parameters for each window.

Any help would be appreciated.


Solution

  • There's no function to do that in OpenCV, however, the signature of cvSetMouseCallback() allows you to register one callback per window.

    You will have to register individual callbacks to achieve what you need to do.

    Here is the complete list of features supported by the HIGHGUI module.

    Another (hardcore) alternative is to dive into the native API of the OS you are working with and search for methods that accomplish this. The problem is that this solution is not cross-platform.