2

I built OpenCV 3.0.0 with Qt support (Qt 5.5) in order to try some of the advanced HighGUI features:

cv::namedWindow("Main", CV_WINDOW_NORMAL | CV_WINDOW_KEEPRATIO | CV_GUI_EXPANDED);
cv::createButton("test", buttonCb);
while (1)
    cv::waitKey(1);

I expected to see a window called "Main" with a nice toolbar as well as a control panel containing a push button "test" (see here).

What I do get is a window called "Main" with a toolbar where the icons are missing (see screenshot) and the control panel does not appear at all.

screenshot

What's wrong here?

Robert Hegner
  • 9,014
  • 7
  • 62
  • 98

2 Answers2

0

Have you tried including GTK or VTK libraries in your CMake file?

find_package(VTK REQUIRED)
include(${VTK_USE_FILE})

or

find_package(GTK REQUIRED)
include(${GTK_USE_FILE})
garlix
  • 576
  • 9
  • 26
  • Thanks for your response! I cannot find any indication on the internet that OpenCV or Qt has VTK or GTK as a dependency. Is that documented somewhere? – Robert Hegner Jul 24 '15 at 05:34
  • Not really, the advice is based on personal experience. Give it a try and let me know – garlix Jul 24 '15 at 10:16
0

If you build opencv as STATIC lib , try to build it as DLLs, not only icons appears but also the style of the GUI is much prettier. If you are not absolutely obliged to use opencv as static lib, this may be a solution. The control panel is not shown by default, you can display it by right-clicking on your main window and choose the last entry of the menu, or just use the shortcut CTRL+P.