Tutorial: BUILDING OPENCV 2.4.9

Instructions for building Opencv 2.4.9 + CUDA5 on Visual Studio 2012

Prerequisites:

Note:
We Assume you have both version of visual studio. Note, if you're an ACM member or have a dreamspark subscription you can download the professional versions for free.

1. Run Cmake

  • Select where you downloaded the opencv source files from 
  • For build directory make a new folder. (we use buildx32 to note the build environment)


RUN CMAKE 
 2 Press Configure

  • If the build folder has not been created select yes for making a new directory
  • Select Visual Studio 10 as the default compiler

Select Default Compiler
3. If not selected click on Grouped box in the upper right corner for grouping items together

  • Select where the SPHINX_BUILD exe file is and if you have eigen select the respective folder
  • Scroll down and click on WITH to expand it
    • Select WITH_TBB
      • Press configure
      • You will have to specify where the include folder for TBB is installed in and press configure

Select TBB_INCLUDE_DIRS folder



      • We use
         D:/gitsource/opencv/opencv_dep/tbb41_20130314oss/include
      • Note: it is good to make a separate folder for 3rd party libraries used 
    • Keep pressing configure until the red highlighted groups disappear.

4. Generate the CMAKE project solution
5. Open the Solution File & BUILD
    (Open up the directory where you created the build files to)

  • Run OpenCV.sln
  • When VS2012 runs select: Don't Update

Select Don't Update


  • All of the projects should be noted with "Visual Studio 2010"
  • Right click at the very bottom: ALL_BUILD and select build.
    • Note: #1 This will take awhile as this build is with CUDA
    • Note: #2 During the build and after the build is complete VS2012 will ask if you want to reload your solution... just press Ignore All
6. Your done: Build the Solution for Debug and Release mode
7. Also run the INSTALL project in the CMakeTarget section to move all libraries to one directory
8. Now you're ready to use OPENCV with CUDA.









1 comment:

  1. To update on this tutorial. Opencv + CUDA 5.5 can now be successfully built using vs110.

    Cheers!

    ReplyDelete