My blog has moved!

You will be automatically redirected to the new address. If that does not occur, visit
http://ashokbasnet.com.np
and update your bookmarks.

Friday, March 11, 2011

Qt : Installing OpenCV in Qt Platform

QTCreator is the open source cross-platform IDE from Nokia’s QT project, and with its ease of use, complete integration with the QT library, and included compiler, it has proven to be a complete solution. After downloading the latest version of Qt-Creator and openCV libray w the following instructions to configure the openCV library.

 

  • First install the Qt-Creator and extract OpenCV at any locaion. For convience I have extracted the OpenCV in C:\.
  • This creates the project. Now open the projectName.pro file. U will find something like this…
  • Restart the computer — This step is required for the PATH to be registered.  Run QTCreator
  • Start a New Project (File -> New File or Project…  Then pick a QT C++ project, could be QT GUI  application or Console application, then follow the instructions to create the new project)
  • Now that you have a new project, you should have a view like the figure below.qt_1
  • All you have left to do, is to add the INCLUDEPATH and LIBS lines to your pro file, like the ones shown in the figure below, but remember to use the actual directory where you installed OpenCV.  (Backward slashes “\” are used to add multiple lines)
        

    INCLUDEPATH += "C:\OpenCV2.0\include"

    LIBS += "C:\OpenCV2.0\lib\*.a"


  • I have used OpenCV2.0. And that’s all. You are ready to start with OpenCV in Qt. Smile.

2 comments :

  1. I am trying to use ml210 lib but it is not really working; however, cv, cvaux, etc, are working properly. Do you think I need to download the uncompiled version of OpenCV and manually compile it ?

    If yes, then can you please advice on how to do it ?

    ReplyDelete
  2. any idea on how to do it on linux?

    ReplyDelete