Installation Method: Run Yum install opencv-devel to complete the installation.
The key is to configure eclipse and let him find the library of opencv, that is, G ++ test. CPP-O test-I ......................... -l .............................,, one is the include directory and the other is the library directory.
The configuration method is as follows:
1. Create a new C ++ Project (provided that the CDT has been installed ).
2. Right-click the new project and choose C ++ build-> settings in the project properties. Here, you need to set the compiler parameters. Add/usr/include/opencv in the include paths of gcc C ++ compiler-> include;
3. Add CV, highgui, and cxcore to the gcc c ++ linker-> libraries respectively (note that only one can be added at a time. The default value is-L, you only need to fill in the CV, and the other two classes are the same), and add/usr/include/opencv in the following library search path.
In these three steps, you have completed the steps for configuring opencv in eclipse! The effect of step 3 is as follows. There are four databases in total! Be sure to add one by one
A test example:
# Include <iostream>
# Include "cv. H"
# Include "highgui. H"
Using namespace STD;
Int main (){
Iplimage * pimg = cvloadimage ("/home/Yan/download/zhuntifomu.jpg ");
Cvnamedwindow ("image", 1 );
Cvshowimage ("image", pimg );
Cvwaitkey (0 );
Cout <"!!! Hello world !!! "<Endl; // prints !!! Hello world !!!
Return 0;
}