1. Install OpenCV Library
1.1 Double-click Opencv-2.4.9.exe to install to the specified directory.
1.2 Install VC2010 Run library, Baidu search VC2010 Run library, download and install. If you complete all of the following configuration after running the program prompt also missing files such as DLLs, need to use repair, enter the manual service, search for the missing DLL files, click Repair.
1.3 Add the paths of the bin, Lib, staticlib three folders under the OPENCV\BUILD\X86\VC11 path to the environment variable.
2. Configuring Eclipse
2.1 Create a new project file--new C + + Project Empty Project
2.2 Add a main.cpp to the project that you just added, and add the following code to it.
2.3 Right-click on the project, properities >c/c++ Build > Settings
2.3.1 Set the Include file, click gcc C + + compileer >includes
Click the Green + button to add the path under the installed OpenCV directory
$\build\include
$\build\include\opencv
$\build\include\opencv2
(ps:$ is the path of the installed OpenCV)
2.3.2 Set the Lib path, click MinGW C + + Linker >libraries
Add libraries
$\build\x86\vc11\lib all the. lib files ending in D, as follows:
opencv_calib3d249d
opencv_contrib249d
opencv_core249d
opencv_features2d249d
opencv_flann249d
opencv_gpu249d
opencv_highgui249d
opencv_imgproc249d
opencv_legacy249d
opencv_ml249d
opencv_nonfree249d
opencv_objdetect249d
opencv_ocl249d
opencv_photo249d
opencv_stitching249d
opencv_superres249d
opencv_ts249d
opencv_video249d
opencv_videostab249d
Extension tip: How to extract the file name (without type) of all files in this directory
1. Go to cmd, enter the disk where the folder is located, for example, C:, and enter the path to the Cd+ folder.
2, input dir/b > Filename.txt.
3. Enter Filename.txt to view all file names.
Add Library Search Path
$\opencv\build\x86\vc11\bin
$\opencv\build\x86\vc11\lib
Complete the above steps to show the results
Click OK, at which time all configuration work is complete, and you can clean project and run, and if the result is as shown, the configuration is successful.
Future projects do not require reconfiguration, only the first configuration of the successful project directory under the. Cproject Overlay to the new project. Cproject and Clean project.
OpenCV Learning Note One OpenCV 2.49 + Eclipse Configuration Tutorial