Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCV and creating GUIs

Can I use OpenCV to create GUIs that contain buttons, list boxes, ...etc for example?

Thanks.

like image 648
Simplicity Avatar asked Jul 25 '11 23:07

Simplicity


2 Answers

OpenCV has highgui built-in for making GUIs.

You can find online tutorials to get you started.

Note that this is not an extensive GUI library. You can only do basic stuff like opening windows, drawing points, anti-aliased lines, rectangles and text. There is a slider widget that can be used as a on-off button. If you need more than that, you can either

  • build stuff yourself (for instance drawing a rectangle with text to make your own button), or
  • use another library like Qt which provide plenty of widgets (buttons, menus, lists, dialogs…)

Good luck if you go for the first one!

like image 154
Simon Avatar answered Oct 03 '22 01:10

Simon


In the Learning OpenCV, the following title is mentioned in page 101: No Buttons.

And, this is some what is mentioned under this title:

Unfortunately, HighGUI does not provide any explicit support for buttons. It is thus common practice, among the particularly lazy, to instead use sliders with only two positions. Another option that occurs oft en in the OpenCV samples in …/opencv/ samples/c/ is to use keyboard shortcuts instead of buttons (see, e.g., the fl oodfi ll demo in the OpenCV source-code bundle).*

like image 39
Simplicity Avatar answered Oct 03 '22 00:10

Simplicity