Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integration between OpenCV and QT

I'm completely newbie to QT and OpenCV development - Acutally C++ in general. I would like to develop one application with OpenCV and create its interface with Qt. What I'm not getting is, how do I integrate both parts?

I mean, to develop java I use only eclipse which gives me JFrame and other Classes for both GUI and App development. To work with OpenCV I added the C++ IDE; But even that QT has its IDE, May I fully work with Eclipse importing Qt Libraries to develop the GUI of my application?

like image 644
Victor R. Oliveira Avatar asked Jul 28 '13 11:07

Victor R. Oliveira


People also ask

Can I use OpenCV in Visual Studio?

Summary. In this post, we learned how to configure a Visual Studio project to use OpenCV. First we set the Additional Include Directories, which is required for the #include commands- this tells the compiler how the OpenCV library looks.

Is Qtcreator an IDE?

Qt Creator is a cross-platform integrated development environment (IDE) built for the maximum developer experience. Qt Creator runs on Windows, Linux, and macOS desktop operating systems and allows developers to create software across desktop, mobile, and embedded platforms.


2 Answers

Qt and OpenCV are just C++ libraries, you can work in any C++ environment with a C++ compiler supported by them. Eclipse with a (supported) C++ compiler of your choice would be one alternative. Visual C++ if you're on Windows is another.

Qt has stand-alone tools that you can use to design the user interface in, such as Qt Designer and Qt Linguist. Qt also has an excellent C++ cross-platform development environment called Qt Creator that you may want to take a closer look at. An overview of the tools available can be found here. And just to be clear, Qt Creator is not for Qt only development, you can add any C++ library, like the OpenCV library.

like image 70
Daniel Hedberg Avatar answered Oct 12 '22 01:10

Daniel Hedberg


Beside Daniel excellent points, there are few things you will have to take care of, such as conversion from OpenCV Mat (or IplImage if you happen to work with old code) to Qt QImage.

There are simple examples of Qt+OpenCV integration around, such as Qt-OpenCV-multithreaded or even simpler isee (this one being my own little project).

Cheers

like image 27
CTZStef Avatar answered Oct 12 '22 00:10

CTZStef