OpenCV learning notes: 2.49 + Eclipse configuration tutorial, opencv2.49
1. Install the opencv Library
1.1 double-click opencv-2.4.9.exe and install it in the specified directory.
1.2 install the VC2010 Runtime Library. Baidu searches for the VC2010 Runtime Library and downloads and installs it. If the system prompts that files such as dll are still missing when you run the program after completing all the following configurations, you need to use 360 to fix the issue, enter the manual service, search for the dll file that is missing, and click repair.
1.3 Add the bin, lib, and staticlib folders under the opencv \ build \ x86 \ vc11 path to the environment variable.
2. Configure Eclipse
2.1 create a project file> new> c ++ project empty project
2.2 Add a main. cpp file in the project, and add the following code.
2.3 right-click the project and choose properities> c/c ++ Build> Settings.
2.3.1 set the include file and click gcc c ++ Compileer> nodes des
Click the + button in green 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 and click MinGW C ++ Linker> Libraries
Add Libraries
All. lib files ending with d under $ \ build \ x86 \ vc11 \ lib are 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 tips: how to extract the file names of all files in this directory (excluding the file type)
1. Enter cmd, enter the disk where the folder is located, for example, C:, and enter the path of the cd + folder.
2. Enter dir/B> filename.txt.
3. Input filename.txt to view all file names.
Add Library search path
$ \ Opencv \ build \ x86 \ vc11 \ bin
$ \ Opencv \ build \ x86 \ vc11 \ lib
The result is displayed after completing the preceding steps.
Click OK. All configurations are completed. You can Clean the Project and run it. If the running result is shown in, the configuration is successful.
You do not need to reconfigure the Project in the future. You only need to overwrite. cproject under the Project directory that is successfully configured for the first time to the. cproject of the new Project and Clean the Project.