Compiling and installing opencv in Linux (UBUNTU)
1. Install the relevant libraries first:
Sudo apt-Get install build-essential
Sudo apt-Get install libv4l-dev libv4l-0 libboost1.40-all-Dev Libusb-1.0-0-dev libgtk2.0-dev libgsl0-dev
2. decompress the opencv2.0 source code and enter the directory. Use the following statement to configure and install it:
./Configure
Make
Sudo make install
3. Set the relevant library path:
Use the root user to perform the following operations
Add the path/usr/local/lib to the file/etc/lD. So. conf.
4. Reload the library path:
Ldconfig
5,Test the installation package
To test whether the installation is successful, you can use the following command line to compileSource codePackageDrawing. cExample: (IN Version 1.0, It is located under the sample/C directory)
G ++'Pkg-config opencv -- Libs -- cflags opencv'Drawing. C-o drawing
After successful compilation, you should be able to execute./DrawingSeeHighguiThe result of the output window is displayed.
After installation, the path is:/Usr/local/lib/usr/local/include/opencv