1

I have a project which uses openCV. I am trying to set up openCV library to use in my Qt application.

For my Qt installation I installed Visual Studio and am using its compiler and CDS debugger. After doing all this when I am going through the documentation I am seeing that MinGW is used to configure openCV and Qt (https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows)

But in most cases we will be using VS, so how can someone configure openCV with Qt if using Visual Studio compilers.

arqam
  • 3,582
  • 5
  • 34
  • 69

1 Answers1

0

First you need to install the Visual Studio plugin - http://doc.qt.io/qtvstools/index.html

You then need to make sure you have built both OpenCV & Qt for whatever compiler you are using. VS2017 for example, I don't think the default binaries come with the Qt option. There is an installation guide here - https://wiki.qt.io/OpenCV_with_Qt

GPPK
  • 6,546
  • 4
  • 32
  • 57
  • So the best way is if I install using the pre-built libraries and then setting the environment path right? – arqam Sep 12 '17 at 07:54
  • I have followed the following guidance to install QT with VS debuggers and compilers : https://forum.qt.io/topic/60713/setting-visual-studio-2015-debugger/6. Do I need the visual studio plugin even then? – arqam Sep 12 '17 at 07:57
  • You need the VS plugin for Qt as it manages all the project files for you. Otherwise you would need to run qmake (or moc I can't remember which) every time you do a build. – GPPK Sep 12 '17 at 08:05
  • This is because of using openCV in the project or for just QT project also will it be required? – arqam Sep 12 '17 at 08:06
  • Qt projects, OpenCV can just be included as include directories and libs – GPPK Sep 12 '17 at 08:06
  • But I tried the default Qt widget program and it was building and running without any tool. Any reason why it didn't need? – arqam Sep 12 '17 at 08:07
  • I think as you get more complicated projects/multiple UI files etc. I'm not sure though. - Worth reading this https://stackoverflow.com/questions/32894097/how-do-i-use-qt-in-my-visual-studio-2015-projects – GPPK Sep 12 '17 at 08:11
  • This link has said how to use : http://blog.sensoviz.com/startopencv Will it work? – arqam Sep 12 '17 at 08:12
  • This will https://stackoverflow.com/questions/35537226/setting-up-opencv-3-1-in-visual-studio-2015 – GPPK Sep 12 '17 at 08:13
  • I am using Qt Creator and not Visual Studio to run the program – arqam Sep 12 '17 at 10:18