Tuesday, November 27, 2012

Install OpenCV 2.3 on Visual C++ .NET 2008

The following articles assumes you are using Windows7 with x86 .NET. If you are developing x64 application replace x86 with x64
  • Ready .NET 2008 Installed on your computer.
  • Download OpenCV-2.3.0-win-superpack.exe
  • Let it extracted in default location (Unless there must be no spaces in the path)
 
  • Start --> Right click computer --> Properties --> Advanced System Settings --> Environment Variables
  • Select Path in System Variables --> Edit
    Add the following to the end of text
;C:\OpenCV2.3\build\x86\vc9\bin

  • Restart Windows

  • Create new C++ project in .NET
  • Tools --> Options
  • Projects and Solutions --> VC++ Directories
  • Select Win32 under Platform for developing x86 application or select 64 for developing x64 application
  • Select Include files in Show directories for
  • Add the following path 
C:\OpenCV2.3\opencv\include\opencv
C:\OpenCV2.3\build\include 

  • Select Library files in Show directories for

C:\OpenCV2.3\build\x86\vc9\lib

  • Project->Properties 
  • Configuration Properties -> Linker -> Input 
  • Debug in 'Configuration'
  • Add the following to the Additional Dependencies

opencv_features2d230d.lib
opencv_highgui230d.lib
opencv_core230d.lib
opencv_imgproc230d.lib
opencv_ml230d.lib
opencv_objdetect230d.lib
opencv_video230d.lib
opencv_contrib230d.lib
opencv_calib3d230d.lib  

  • Select Release in Configuration
  • Add the following to the Additional Dependencies

opencv_features2d230.lib
opencv_highgui230.lib
opencv_core230.lib
opencv_imgproc230.lib
opencv_ml230.lib
opencv_objdetect230.lib
opencv_video230.lib
opencv_contrib230.lib
opencv_calib3d230.lib

  • Now you are ready to use OpenCV