Lightweight GUI integration with keyboard callback and buttons

asked 2015-12-16 05:37:26 -0500

digtooni gravatar image


The GUI elements built into OpenCV are fairly limited, and don't have features like true keyboard callbacks (waitKey stalls the program) or buttons. I realise Qt is supported but that is a huge library and I don't need to make full use of all of its features. I also need something which will not slow down my programs as I will be running them on NVidia Tegras and Raspberry Pis.

So my question: has anyone found any lightweight C++ GUI libraries which they have managed to integrate into their OpenCV programs (notably reading in a cv::Mat and displaying it in the GUI)? I have looked at FLTK but the license is GPL and I am looking for something with a BSD license or similar where I do not have to open source my code.


edit retag flag offensive close merge delete



Wait ... lightweight piecies like tegras and pis, combined with a GUI? That is in my opinion a non compatible option...

StevenPuttemans gravatar imageStevenPuttemans ( 2015-12-16 05:51:18 -0500 )edit

The GUI would be used more for debugging than for running the programs in release mode.

I want to use a GUI for things like moving backwards and forwards in a video, pausing, toggling various features and views, recording, taking a screenshot etc. which is definitely realistic on these devices.

My main gripe with the HighGui module is the lack of buttons and the fact that cv::waitKey() is not a true callback function.

digtooni gravatar imagedigtooni ( 2015-12-16 05:54:33 -0500 )edit

I don't think Qt is too heavy. The Raspberry Pi runs Qt apps without problem, and the Tegra is much more powerful. The Raspberry Pi 2 can do some pretty amazing processing with a full Qt interface. More, Qt can do the display using hardware acceleration (opengl, egl), and even without an X server.

A very fast solution for embedded systems would be to use directly the OpenGL. You can display your image as a texture and use the mouse and keyboard callbacks from GLUT for interaction.

However if you need something for debugging that's fast easy to implement, you can use Highgui and write your own keyboard callback (some ideas here). Then use keystrokes instead of buttons.

kbarni gravatar imagekbarni ( 2015-12-16 09:50:57 -0500 )edit

You should consider wxWidgets GUI. I know it works on Raspberry too but I never tested

pklab gravatar imagepklab ( 2015-12-17 06:16:56 -0500 )edit

It works on raspberry but I haven't test with opencv

LBerger gravatar imageLBerger ( 2015-12-17 10:03:54 -0500 )edit