0. Declaration: The environment used is Windows XP + Visual Studio 2005 + opencv2.0
1. Download opencv2.0, http://www.opencv.org.cn/index.php/Download
, Installed in C :/.
2. After installation, the file under C:/opencv2.0/lib/is *. dll. A. It is not a library file and must be converted to a library file.
3.
Http://www.cmake.org/cmake/resources/software.html
Download cmake and select windows (Win32
Installer ). Install and add environment variables (C:/Program
Files/cmake 2.8/bin ).
4. Run cmake (cmake-Gui) and locate source codeto the cmakelists.txt location (generally C:/opencv2.0 ),
Binaries locates C:/opencv2.0/cmake_compile_result and click Configure-> generate.
Became opencv. sln.
5. Use Visual Studio 2005 to open opencv. sln. Debug to regenerate the opencv solution. Under dubug, regenerate
Install; Release to regenerate the opencv solution. Therefore, in C:/opencv2.0/cmake_compile_result/lib/
The following six library files of * D. Lib are generated. Add environment variables to the directory where the current library file is located (C:/opencv2.0
/Cmake_compile_result/bin ).
6. You can write the opencv application under Visual Studio 2005. Create a Win32 console project and set
Lib (Project-properties-configuration properties-connection-input-add additional items-Add the six lib file names generated above, separated by spaces ).
7. Run the opencv application. The source code will be later. The solution is successfully generated. Run D:/try0621 in DOS
/Opencvhello/debug> opencvhello.exe. The image is displayed.
8. More content reference http://hi.baidu.com/mailrabbit/blog/item/d1248dcbd9a5088cc91768d0.html
9. The first opencv Program
// My first opencv program // This solution contains the library file # include "stdafx. H "# include <cv. h> # include
Notes:
- After a great deal of effort, I finally got it done.
- A good sleep.
- Go to opencv.