开发者

How to set up OpenCV 2.0 on Visual C++?

开发者 https://www.devze.com 2022-12-20 05:49 出处:网络
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

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++

  1. Click File->New->Project.
  2. Select Win32 under Visual C++ on the left side
  3. Select Win32 Console Applicationon the right side
  4. Enter a name and click OK.
  5. 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).

0

精彩评论

暂无评论...
验证码 换一张
取 消