Friday, May 14, 2004

Setup OpenCV in VC++

Ref. this website.
"C/C++" and "Preprocessor" in the roll down menu. In the "Additional include directories" write a comma separated list of include directories. You can use either relative or absolute paths, write: "C:\Program Files\opencv\cv\include,C:\Program Files\opencv\otherlibs\highgui". Still with "All Configuration" in the "Settings for" roll down menu. Choose the "Link" Tab and "input" in the "Category" roll down menu.
Write, again a comma separated list of the relevant library paths: "C:\Program Files\opencv\lib" in the "Additional Library Path" edit box.

With "Win32 Debug" marked in the "Settings for" roll down menu.
Choose the "Link" Tab and "input" in the "Category" roll down menu.
Write a space separated list of libraries: "cvd.lib HighGUId.lib" in the "Object/library modules "edit box.
Change the "Settings for" roll down menu to "Win32 Release". Write "cv.lib HighGUI.lib" in the "Object/library modules" edit box and press OK.

The OpenCV workspace is inserted in the workspace by choosing the "Project" menu and then "Insert Project into Workspace". Browse to and select "C:\Program Files\opencv\cv\make\cv.dsp" and "C:\Program Filesl\opencv\otherlibs\highgui\highgui.dsp".
Specify the Dependencies by clicking on the menu point "Project" and then "Dependencies...". Select "MyApplication" in the roll down menu and set a mark in the "CV" and "HighGUI" box, then select "HighGUI" in the rolldown and set a mark in "CV" and click on close.

For simple cases, Project ->Setting->All Configurations->
C/C++: c:\Program Files\opencv\cv\include,C:\Program Files\opencv\otherlibs\highgui
Link: C:\Program Files\opencv\lib
->Win32 Debug: cv.lib highgui.lib

No comments:

Post a Comment