0

I'm using OpenCV 3.1.0 on my PC which runs on Ubuntu 16.04 and I'd like to be able to create GUIs on my OpenCV projects and I've read that using QT is the best way to go about this. The question is, how do I get OpenCV to support QT? I originally built it without QT and considering how much of a nightmare setting up OpenCV has been, I don't really want to have to start from scratch but is there a way to recompile it, perhaps with cmake in order to support QT?

I've downloaded "libqt4-dev" on my repository (I think) using the following:

sudo -y apt-get install libqt4-dev

So I've downloaded it but it's just sitting there not being useful. How do I integrate QT with OpenCV 3.1?

Thanks in advance

HJGBAUM
  • 297
  • 5
  • 16
  • you dont have to make openCV an Qt "compatible"... just code you Qt gui and code your openCV stuff and instead of using "imshow" convert the Mat to QImage and display it in a QLabel (or draw with openGL if QLabel is too slow for you). The only "compatibility" thing you could use is the Qt version of the standard openCV window but this doesn't give you much benefit. – Micka Sep 19 '16 at 13:13
  • but yes, compiling openCV is easily done with CMake – Micka Sep 19 '16 at 13:15
  • You don't integrate anything, OpenCV doesn't need to "support Qt". Qt is gui and application development, OpenCV is computer vision, you simply use the two together. Just google "Qt getting started". I'd recommend you get the most recent Qt version from their website rather than only dev libs from apt, as Qt also has its own tools, not just the libs. – dtech Sep 19 '16 at 13:15
  • 2
    Possible duplicate of [How to link opencv in QtCreator and use Qt library](http://stackoverflow.com/questions/15881913/how-to-link-opencv-in-qtcreator-and-use-qt-library) – Miki Sep 19 '16 at 13:58
  • So does this mean I can simply #include QT header files into my OpenCV project and use it in my windows? – HJGBAUM Sep 19 '16 at 16:15
  • @HJGBAUM - as I already mentioned, Qt requires its own toolset, namely the moc compiler, you can't compile most Qt code without it. It won't work if you compile it as you normally compile C++. You also need a Qt project PRO file. – dtech Sep 19 '16 at 16:22

0 Answers0