I am trying to setup OpenCV 2.0 for Visual C++ Express but I can not do it successfully. I have looked all over the internet and have tried the official guide. Can someone guide me to a tutorial that worked for them for OpenCV 2.0. Than开发者_Python百科ks in advance.
Since you're done compiling OpenCV, you need to create a new project in Visual C++
- Click
File->New->Project
. - Select
Win32
underVisual C++
on the left side - Select
Win32 Console Application
on the right side - Enter a name and click
OK
. - Then click
Finish
.
Now, follow the instructions detailed in this tutorial to set the directories etc. It also has a sample program.
http://opencv.willowgarage.com/wiki/VisualC%2B%2B
Let me know if you have any difficulties.
Update:
You need to put the folder containing the DLLs in the system path. You can find this folder in the same folder as the lib
folder which contains cv200d.lib
. Suppose cv200d.lib
was in C:\OpenCV2.0\opencv\lib\debug
then the Debug DLLs should be in C:\OpenCV2.0\opencv\bin\debug
and the Release DLLs should be in C:\OpenCV2.0\opencv\bin\release
. If you have any questions about adding folders to the path, let me know.
The above is mentioned in the tutorial you linked to:
4 Add the output directories to the system path, e.g.: C:\OpenCV2.0\vs2008\bin\Debug;C:\OpenCV2.0\vs2008\bin\Release:%PATH% It is safe to add both directories, since the Debug OpenCV DLLs have the "d" suffix, which the Release DLLs do not have.
Also, cv200d.lib
would correctly configure the Debug
mode of your project. You have to go to the Release
mode of the project and add cv200.lib
(i.e. without the d
).
精彩评论