Installing OpenCV      2.4.x with Qt                       Luigi De Russis                  Politecnico di TorinoDipartime...
0. Getting started…    Official installation guides           Currently, only for Linux and Windows           http://do...
1. Qt SDK (I)    Download and install Qt SDK from http://qt-     project.org/downloads, using the offline installer     (...
1. Qt SDK (II) - Windows11/9/2012   Luigi De Russis - Computer Vision - OpenCV   4
1. Qt SDK (II) - Windows             At the end, check if the folder            C:QtSDKmingwbin (or similar)            is...
2. OpenCV 2.4.x    Download and unpack OpenCV 2.4.x from     http://opencv.org/11/9/2012          Luigi De Russis - Compu...
3. Cmake (I)    Download and install Cmake from     http://www.cmake.org/11/9/2012           Luigi De Russis - Computer V...
3. Cmake (II)    Create two new folders named “cmake-debug” and     “cmake-release” inside the opencv folder    Create a...
3. Cmake (II)    Create two new folders named “cmake-debug” and     “cmake-release” inside the opencv folder    Create a...
3. Cmake (IV)    Run Cmake11/9/2012        Luigi De Russis - Computer Vision - OpenCV   10
3. Cmake (V)    “Where is the source code” field requires the     location of the opencv folder    “Where to build the b...
3. Cmake (VI)    In the next window, select “MingGW Makefiles”     under Windows, “Unix Makefiles” otherwise    Then, pr...
3. Cmake (VII)    The Cmake window should appear in this way:11/9/2012           Luigi De Russis - Computer Vision - Open...
3. Cmake (VIII)    Open the CMAKE entry           assign the value Debug to the CMAKE_BUILD_TYPE            variable    ...
3. Cmake (IX)    Open the WITH entry:           check WITH_QT           uncheck useless values (CUDA, CUFFT, EIGEN, and...
3. Cmake (X)    Open the Ungrupped Entries (or QT) with a red     background and add the location of qmake to the     var...
3. Cmake (XI)    Click again on “Configure” (until the entries     background becomes totally white)11/9/2012            ...
3. Cmake (XII)    Press “Generate”    Repeat the steps reported on slides 11 - 18,     changing:           the build de...
4a. Final steps, on Linux/Mac(I)    Open the terminal, move to the “cmake-debug”     folder, type “make -jN”, where N is ...
4a. Final steps, on Linux/Mac(II)    Add the following folders:           /build_with_Qt/debug/bin           /build_wit...
4b. Final steps, on Windows (I)    Open the command prompt, move to the “cmake-debug”     folder, type “mingw32-make –j N...
4b. Final steps, on Windows(II)    Add to the PATH environment variable the following     folders:           /build_with...
4b. Final steps, on Windows(III)    Copy the file “opencv.hpp” from “/include/opencv2”     to “include” (in your “build_w...
Upcoming SlideShare
Loading in...5
×

Installing OpenCV 2.4.x with Qt

16,241

Published on

Published in: Education
3 Comments
1 Like
Statistics
Notes
  • Hi, when i get to generate there is still red fields in there, if i press configure again it show me an error and the red fields dissapear but it still show me the error, someone can help me with that?
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • I can't install Opencv 2.4.3 with Qt 4.8.1 with MinGW 4.4. (windows 7 32 bit).
    mingw32-make crashes on building perf_core (about 35% of building). What do you think about
    'which mingw compiler is used to create the pre-build libs in 2.4.3 release' post here http://blog.gmane.org/gmane.comp.lib.opencv.devel/month=20121101?
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Hi !
    Thanks for this tutorial witch is really well explained.
    However I have a problem.
    After finishing the tutorial, my 'Built_with_QT' folder is empty !
    Do you have an idea why ?

    Clement - Win 7 64bits - Opencv (2.3 and 2.4.3), QT 2009 and 2010
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
16,241
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
247
Comments
3
Likes
1
Embeds 0
No embeds

No notes for slide

Installing OpenCV 2.4.x with Qt

  1. 1. Installing OpenCV 2.4.x 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 guides  Currently, only for Linux and Windows  http://docs.opencv.org/doc/tutorials/introduction/table_of_c ontent_introduction/table_of_content_introduction.html Prerequisites:  [Mac OS X] Xcode with command line tools installed  [Linux] GCC 4.4 or later N.B. This tutorial has been tested with OpenCV 2.3.1, 2.4.2, and 2.4.3 under Windows 7 and Mac OS X 10.7+11/9/2012 Luigi De Russis - Computer Vision - OpenCV 2 Installation
  3. 3. 1. Qt SDK (I) Download and install Qt SDK from http://qt- project.org/downloads, using the offline installer (current SDK release 1.2.1) [Windows-only] Perform a custom installation, installing all the MinGW stuff. Components about Harmattan, Symbian, etc. are not necessary for our purpose (see next slide)11/9/2012 Luigi De Russis - Computer Vision - OpenCV 3
  4. 4. 1. Qt SDK (II) - Windows11/9/2012 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/9/2012 Luigi De Russis - Computer Vision - OpenCV 5
  6. 6. 2. OpenCV 2.4.x Download and unpack OpenCV 2.4.x from http://opencv.org/11/9/2012 Luigi De Russis - Computer Vision - OpenCV 6
  7. 7. 3. Cmake (I) Download and install Cmake from http://www.cmake.org/11/9/2012 Luigi De Russis - Computer Vision - OpenCV 7
  8. 8. 3. Cmake (II) Create two new folders named “cmake-debug” and “cmake-release” inside the opencv folder Create a folder named “build_with_Qt” (or similar) wherever you want  create two new folders named “debug” and “release” inside the “build_with_Qt” folder11/9/2012 Luigi De Russis - Computer Vision - OpenCV 8
  9. 9. 3. Cmake (II) Create two new folders named “cmake-debug” and “cmake-release” inside the opencv folder Create a folder named “build_with_Qt” (or similar) wherever you want It is not strongly mandatory… it  create two new folders named “debug” and “release” inside is only a “best practice”! the “build_with_Qt” folder11/9/2012 Luigi De Russis - Computer Vision - OpenCV 9
  10. 10. 3. Cmake (IV) Run Cmake11/9/2012 Luigi De Russis - Computer Vision - OpenCV 10
  11. 11. 3. Cmake (V) “Where is the source code” field requires the location of the opencv folder “Where to build the binaries” field requires the location of the “cmake-debug” folder, previously created Now press the button “Configure”…11/9/2012 Luigi De Russis - Computer Vision - OpenCV 11
  12. 12. 3. Cmake (VI) In the next window, select “MingGW Makefiles” under Windows, “Unix Makefiles” otherwise Then, press “Finish”11/9/2012 Luigi De Russis - Computer Vision - OpenCV 12
  13. 13. 3. Cmake (VII) The Cmake window should appear in this way:11/9/2012 Luigi De Russis - Computer Vision - OpenCV 13
  14. 14. 3. Cmake (VIII) Open the CMAKE entry  assign the value Debug to the CMAKE_BUILD_TYPE variable  change the CMAKE_INSTALL_PREFIX to match the “build_with_Qt/debug” folder11/9/2012 Luigi De Russis - Computer Vision - OpenCV 14
  15. 15. 3. Cmake (IX) Open the WITH entry:  check WITH_QT  uncheck useless values (CUDA, CUFFT, EIGEN, and PVAPI, typically)  Press “Configure”, again11/9/2012 Luigi De Russis - Computer Vision - OpenCV 15
  16. 16. 3. Cmake (X) Open the Ungrupped Entries (or QT) with a red background and add the location of qmake to the variable QT_QMAKE_EXECUTABLE  [Windows] qmake is in /Desktop/Qt/4.8.1/mingw/bin inside the folder where Qt SDK has been installed  [Linux/Mac] qmake is in /Desktop/Qt/4.8.1/gcc/bin inside the folder where Qt SDK has been installed11/9/2012 Luigi De Russis - Computer Vision - OpenCV 16
  17. 17. 3. Cmake (XI) Click again on “Configure” (until the entries background becomes totally white)11/9/2012 Luigi De Russis - Computer Vision - OpenCV 17
  18. 18. 3. Cmake (XII) Press “Generate” Repeat the steps reported on slides 11 - 18, changing:  the build destination folder from “cmake-debug” to “cmake- release”  the value of the CMAKE_BUILD_TYPE variable (in the CMAKE entry) to Release  the value of the CMAKE_INSTALL_PREFIX variable (in the CMAKE entry) to match the “build_with_Qt/release” folder11/9/2012 Luigi De Russis - Computer Vision - OpenCV 18
  19. 19. 4a. Final steps, on Linux/Mac(I) Open the terminal, move to the “cmake-debug” folder, type “make -jN”, where N is the number of threads to use, and press enter Wait… Type “make install” to complete the OpenCV installation Repeat the previous three steps for the “cmake- release” folder11/9/2012 Luigi De Russis - Computer Vision - OpenCV 19
  20. 20. 4a. Final steps, on Linux/Mac(II) Add the following folders:  /build_with_Qt/debug/bin  /build_with_Qt/release/bin to the DYLD_LIBRARY_PATH (Mac) or LD_LIBRARY_PATH (Linux) environment variable. You can perform this operation right inside QtCreator (“Build Environments” field inside the Projects” tab). 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/9/2012 Luigi De Russis - Computer Vision - OpenCV 20
  21. 21. 4b. Final steps, on Windows (I) Open the command prompt, move to the “cmake-debug” folder, type “mingw32-make –j N”, where N is the number of threads to use, and press enter Wait… Type “mingw32-make install” and press enter Repeat the previous three steps for the “cmake-release” folder11/9/2012 Luigi De Russis - Computer Vision - OpenCV 21
  22. 22. 4b. Final steps, on Windows(II) Add to the PATH environment variable the following folders:  /build_with_Qt/debug/bin  /build_with_Qt/release/bin  QtSDK/Desktop/Qt/4.8.1/mingw/bin How do I set the PATH variable? Read here. You can also perform this operation inside QtCreator (“Build Environments” field inside the Projects” tab).11/9/2012 Luigi De Russis - Computer Vision - OpenCV 22
  23. 23. 4b. Final steps, on Windows(III) Copy the file “opencv.hpp” from “/include/opencv2” to “include” (in your “build_with_Qt” folder) Done: you can start to use OpenCV with Qt!11/9/2012 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.

×