1、Create a new Win32 Console Application

Learning OpenCV Lecture 1 (Using OpenCV in VS2010)
Learning OpenCV Lecture 1 (Using OpenCV in VS2010)
 
2、Open the Property Manager by View->Property Manage
rLearning OpenCV Lecture 1 (Using OpenCV in VS2010)
Learning OpenCV Lecture 1 (Using OpenCV in VS2010)
In Visual C++ 2010, a property sheet is an XML file that describes your project settings. We will now create a new one by right-clicking on the Debug | Win32 node of the project, and by selecting the Add New Project Property Sheet option (as seen in the following screenshot):
Learning OpenCV Lecture 1 (Using OpenCV in VS2010)
 
3、The new property sheet is then added once we click on Add. We now need to edit it. Simply double-click on the property sheet's name and select VC++ Directories, as seen here:
Learning OpenCV Lecture 1 (Using OpenCV in VS2010)
Edit the Include Directories textfield and add the path to the include files of your OpenCV library:
Learning OpenCV Lecture 1 (Using OpenCV in VS2010)
Do the same thing with the Library Directories. This time you add the path to your OpenCV library files:
Learning OpenCV Lecture 1 (Using OpenCV in VS2010)
 
4、Go to the Input item of the Linker node, as seen in the following screenshot: Edit
Learning OpenCV Lecture 1 (Using OpenCV in VS2010)
Edit the Additional Dependencies textfield and add the following list of library modules:
Learning OpenCV Lecture 1 (Using OpenCV in VS2010)
Note that we specified the libraries with names ending with the letter "d". These are the binaries for the Debug mode. You will need to create another (almost identical) property sheet for the Release mode. You follow the same procedure, but you add it under the Release | Win32 node. This time, the library names are specified without appending a "d" at the end.
 
5、Add a new .cpp file
Learning OpenCV Lecture 1 (Using OpenCV in VS2010)
Once you have recopied the code in the preceding figure (it will be explained later), you can compile it and run it using the Start green arrow in the Toolbar at the top of your screen. You will see your image displayed for five seconds. An example is seen here:
Learning OpenCV Lecture 1 (Using OpenCV in VS2010)
 Learning OpenCV Lecture 1 (Using OpenCV in VS2010)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

相关文章:

  • 2021-09-29
  • 2021-11-17
  • 2021-04-01
  • 2021-11-02
  • 2021-05-06
  • 2022-12-23
  • 2021-11-21
  • 2022-02-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案