0
Installing OpenCV      2.3.1 with Qt                       Luigi De Russis                  Politecnico di TorinoDipartime...
0. Getting started…    Official installation guide:     http://opencv.willowgarage.com/wiki/InstallGuide    Prerequisite...
1. Qt SDK (I)    Download and install Qt SDK from     http://qt.nokia.com/downloads, using the offline     installer (cur...
1. Qt SDK (II) - Windows11/11/2011   Luigi De Russis - Computer Vision - OpenCV   4
1. Qt SDK (II) - Windows              At the end, check if the folder             C:QtSDKmingwbin (or similar)            ...
2. OpenCV 2.3.1    Download and unpack OpenCV 2.3.1 from     http://opencv.willowgarage.com/wiki11/11/2011         Luigi ...
3. Cmake (I)    Download and install Cmake from     http://www.cmake.org/11/11/2011          Luigi De Russis - Computer V...
3. Cmake (II)    Create a folder named “builds_with_Qt” (or similar)     wherever you want (suggested location: inside th...
3. Cmake (II)    Create a folder named “builds_with_Qt” (or similar)     wherever you want (suggested location: inside th...
3. Cmake (III)    Run Cmake11/11/2011       Luigi De Russis - Computer Vision - OpenCV   10
3. Cmake (III)    “Where is the source code” field requires the     location of the opencv folder    “Where to build the...
3. Cmake (IV)    In the next window, select “MingGW Makefiles”     under Windows, “Unix Makefiles” otherwise    Then, pr...
3. Cmake (V)    The Cmake window should appear in this way:11/11/2011          Luigi De Russis - Computer Vision - OpenCV...
3. Cmake (VI)    Open the CMAKE entry and assign the value     DEBUG to the CMAKE_BUILD_TYPE variable11/11/2011         L...
3. Cmake (VII)    Open the WITH entry:            uncheck WITH_CUDA and WITH_EIGEN            check WITH_QT           ...
3. Cmake (VIII)    Open the QT entry with a red background and add     the location of qmake to the variable     QT_QMAKE...
3. Cmake (IX)    Click again on “Configure” (until the entries     background becomes totally white)11/11/2011           ...
3. Cmake (X)    Press “Generate”    Repeat the steps reported on slides 11 - 18,     changing:            the build des...
4a. Final steps, on Linux/Mac(I)    Open the terminal, move to the “debug” folder, type     “make -jN”, where N is the nu...
4a. Final steps, on Linux/Mac(II)    Copy the file “opencv.hpp” from “/include/opencv2”     to “include” (in your “builds...
4b. Final steps, on Windows (I)    Open the command prompt, move to the “debug” folder,     type “mingw32-make” and press...
4b. Final steps, on Windows(II)    Add to the PATH environment variable the location     of the following folders:      ...
4b. Final steps, on Windows(III)    Copy the “include” folder (the one inside the “build”     folder in the opencv folder...
Upcoming SlideShare
Loading in...5
×

Installing OpenCV 2.3.1 with Qt

13,322

Published on

Tutorial for installing OpenCV 2.3.1 with Qt. Slides made for the Computer Vision course at Politecnico di Torino (academic year 2011/2012).

Published in: Education, Technology
2 Comments
2 Likes
Statistics
Notes
No Downloads
Views
Total Views
13,322
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
173
Comments
2
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "Installing OpenCV 2.3.1 with Qt"

  1. 1. Installing OpenCV 2.3.1 with Qt Luigi De Russis Politecnico di TorinoDipartimento di Automatica e Informatica (DAUIN) Torino - Italy luigi.derussis@polito.itThis work is licensed under the Creative Commons (CC BY-SA) License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/
  2. 2. 0. Getting started… Official installation guide: http://opencv.willowgarage.com/wiki/InstallGuide Prerequisites:  [Mac OS X] Xcode 3.2 or later  [Linux] GCC 4.3 or later11/11/2011 Luigi De Russis - Computer Vision - OpenCV 2
  3. 3. 1. Qt SDK (I) Download and install Qt SDK from http://qt.nokia.com/downloads, using the offline installer (current release 4.7.4) [Windows-only] Perform a custom installation, installing all the mingw32 stuff. Components about Meego, Symbian, etc. are not necessary for our purpose (see next slide)11/11/2011 Luigi De Russis - Computer Vision - OpenCV 3
  4. 4. 1. Qt SDK (II) - Windows11/11/2011 Luigi De Russis - Computer Vision - OpenCV 4
  5. 5. 1. Qt SDK (II) - Windows At the end, check if the folder C:QtSDKmingwbin (or similar) is included in the PATH variable11/11/2011 Luigi De Russis - Computer Vision - OpenCV 5
  6. 6. 2. OpenCV 2.3.1 Download and unpack OpenCV 2.3.1 from http://opencv.willowgarage.com/wiki11/11/2011 Luigi De Russis - Computer Vision - OpenCV 6
  7. 7. 3. Cmake (I) Download and install Cmake from http://www.cmake.org/11/11/2011 Luigi De Russis - Computer Vision - OpenCV 7
  8. 8. 3. Cmake (II) Create a folder named “builds_with_Qt” (or similar) wherever you want (suggested location: inside the opencv folder) Create two new folders named “debug” and “release” inside the “builds_with_Qt” folder [Mac-only] Warning: choose carefully where you put the “builds_with_Qt” folder. To move the folder, thus maintaining the compiled opencv library working, may require a little bit effort (by using “install_name_tool”).11/11/2011 Luigi De Russis - Computer Vision - OpenCV 8
  9. 9. 3. Cmake (II) Create a folder named “builds_with_Qt” (or similar) wherever you want (suggested location: inside the opencv folder) Create two new folders named “debug” and It is not strongly mandatory… “release” inside the “builds_with_Qt” folder only a “best practice”! [Mac-only] Warning: choose carefully where you put the “builds_with_Qt” folder. To move the folder, thus maintaining the compiled opencv library working, may require a little bit effort (by using “install_name_tool”).11/11/2011 Luigi De Russis - Computer Vision - OpenCV 9
  10. 10. 3. Cmake (III) Run Cmake11/11/2011 Luigi De Russis - Computer Vision - OpenCV 10
  11. 11. 3. Cmake (III) “Where is the source code” field requires the location of the opencv folder “Where to build the binaries” field requires the location of the “debug” folder, previously created Now press the button “Configure”…11/11/2011 Luigi De Russis - Computer Vision - OpenCV 11
  12. 12. 3. Cmake (IV) In the next window, select “MingGW Makefiles” under Windows, “Unix Makefiles” otherwise Then, press “Finish”11/11/2011 Luigi De Russis - Computer Vision - OpenCV 12
  13. 13. 3. Cmake (V) The Cmake window should appear in this way:11/11/2011 Luigi De Russis - Computer Vision - OpenCV 13
  14. 14. 3. Cmake (VI) Open the CMAKE entry and assign the value DEBUG to the CMAKE_BUILD_TYPE variable11/11/2011 Luigi De Russis - Computer Vision - OpenCV 14
  15. 15. 3. Cmake (VII) Open the WITH entry:  uncheck WITH_CUDA and WITH_EIGEN  check WITH_QT  Press “Configure”, again11/11/2011 Luigi De Russis - Computer Vision - OpenCV 15
  16. 16. 3. Cmake (VIII) Open the QT entry with a red background and add the location of qmake to the variable QT_QMAKE_EXECUTABLE (qmake is in /Desktop/Qt/4.7.4/mingw/bin inside the folder where Qt SDK has been installed)11/11/2011 Luigi De Russis - Computer Vision - OpenCV 16
  17. 17. 3. Cmake (IX) Click again on “Configure” (until the entries background becomes totally white)11/11/2011 Luigi De Russis - Computer Vision - OpenCV 17
  18. 18. 3. Cmake (X) Press “Generate” Repeat the steps reported on slides 11 - 18, changing:  the build destination folder from “debug” to “release”  the value of the CMAKE_BUILD_TYPE variable (in the CMAKE entry) to RELEASE11/09/2011 Luigi De Russis - Computer Vision - OpenCV 18
  19. 19. 4a. Final steps, on Linux/Mac(I) Open the terminal, move to the “debug” folder, type “make -jN”, where N is the number of threads to use (typically, dual core processor can efficiently handle 4 threads), and press enter Wait… Repeat the previous two steps for the “release” folder Copy the “include” folder (the one inside the “build” folder) from the WINDOWS version of opencv in your “builds_with_Qt” folder11/09/2011 Luigi De Russis - Computer Vision - OpenCV 19
  20. 20. 4a. Final steps, on Linux/Mac(II) Copy the file “opencv.hpp” from “/include/opencv2” to “include” (in your “builds_with_Qt” folder) Done: you can start to use OpenCV with Qt!11/09/2011 Luigi De Russis - Computer Vision - OpenCV 20
  21. 21. 4b. Final steps, on Windows (I) Open the command prompt, move to the “debug” folder, type “mingw32-make” and press enter Wait… Repeat the previous two steps for the “release” folder11/09/2011 Luigi De Russis - Computer Vision - OpenCV 21
  22. 22. 4b. Final steps, on Windows(II) Add to the PATH environment variable the location of the following folders:  bin folder inside “debug”  bin folder inside “release”  QtSDK/Desktop/Qt/4.7.4/mingw/bin How do I set the PATH variable? Read here.11/11/2011 Luigi De Russis - Computer Vision - OpenCV 22
  23. 23. 4b. Final steps, on Windows(III) Copy the “include” folder (the one inside the “build” folder in the opencv folder) in your “builds_with_Qt” folder Copy the file “opencv.hpp” from “/include/opencv2” to “include” (in your “builds_with_Qt” folder) Done: you can start to use OpenCV with Qt!11/11/2011 Luigi De Russis - Computer Vision - OpenCV 23
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×