Install OpenCV2.4.6.1 in Ubuntu12.04
OpenCV2.4.6.1 Installation Process in Ubuntu 12.04:
Related reading:
Summary of installing OpenCV 2.4.5 in Ubuntu 12.04Http://www.linuxidc.com/Linux/2013-06/86704.htm
Install OpenCv2.1 nine-step http://www.linuxidc.com/Linux/2010-09/28678.htm in Ubuntu 10.04
1. Install the compilation environment and related libraries
Sudo apt-get install cmake build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libswscale-dev libjpeg62-dev libtiff4-dev libjasper-dev
2. Download The OpenCV source code and compile it.
Tar-xvf
Go to the extract directory,
Cmake. # generate the compilation configuration file
Make # compile. Compile in different linux systems. You may need to install more libraries for compiling dependencies. Follow the prompts to install whatever is missing.
Make install # install it. It is installed under/usr/local by default.
3. Update the dynamic link library and configuration file
Sudo gedit/etc/ld. so. conf. d/opencv. conf # Add the path of the opencv lib Library:/usr/local/lib, save
Sudo ldconfig # configure
Update the configuration file: sudo gedit/etc/bash. bashrc
Add at the end:
PKG_CONFIG_PATH = $ PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
Export PKG_CONFIG_PATH
Iv. test Sample
Go to the sample/c directory:
./Facedetect -- cascade = "/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml" -- scale =. 5./lena.jpg
Output the face detection result. OK.
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2