Monday, June 11, 2012

Install OpenCV 2.4 with Visual Studio 2010

Download OpenCV 2.4
http://sourceforge.net/projects/opencvlibrary/files/opencv-win/

Extract the files into a folder ‘D:\Software\opencv’

Copy the following things to a folder in C:\OpenCV2.4
  D:\Software\opencv\build\x86\vc10
  D:\Software\opencv\build\include


Add the follwoing into system variable.
C:\OpenCV2.4\bin;C:\OpenCV2.4\bin\Debug;C:\OpenCV2.4\bin\Release


Create a new project and add this to your project properties:
1. Go to VC++ Directories;
2. Add 3 new Include Directories (it's the path where you installed OpenCV, include folder):
      C:\OpenCV2.4\include\
      C:\OpenCV2.4\include\opencv
      C:\OpenCV2.4\include\opencv2
3. Add 1 new Library Directory (it's the path where you installed OpenCV, lib folder):
      C:\OpenCV2.4\lib
4. Go to Linker in the left menu and select Input option
5. Add these entries on Additional Dependencies option(debug)

      C:\OpenCV2.4\lib\opencv_core240d.lib
      C:\OpenCV2.4\lib\opencv_highgui240d.lib
      C:\OpenCV2.4\lib\opencv_video240d.lib
      C:\OpenCV2.4\lib\opencv_ml240d.lib
      C:\OpenCV2.4\lib\opencv_legacy240d.lib
      C:\OpenCV2.4\lib\opencv_imgproc240d.lib

6. Add these entries on Additional Dependencies option(release)
      C:\OpenCV2.4\lib\opencv_core240.lib
      C:\OpenCV2.4\lib\opencv_highgui240.lib
      C:\OpenCV2.4\lib\opencv_video240.lib
      C:\OpenCV2.4\lib\opencv_ml240.lib
      C:\OpenCV2.4\lib\opencv_legacy240.lib
      C:\OpenCV2.4\lib\opencv_imgproc240.lib


No comments:

Post a Comment