您的位置:首页 > 运维架构

Install OpenCV 2.4.2 on Ubuntu 12.04 LTS

2013-03-26 00:00 465 查看
The Installation Procedure

Current Installed Software Versions:
-v4l-utils-0.9.1.tar.bz2
-ffmpeg-1.0.tar.bz2
-vlc_2.0.1-4_amd64.deb
-OpenCV-2.4.2.tar.bz2
-x264-snapshot-20121004-2245-stable.tar.bz2

Download latest files from Repository
cd ~
mkdir OpenCV
cd OpenCV

To install and configure OpenCV 2.4.2, complete the following steps.

Remove any installed versions of ffmpeg and x264 by entering the following command:
sudo apt-get remove ffmpeg x264 libx264-dev

Get all the dependencies for x264 and ffmpeg by entering the following commands:
sudo apt-get update
sudo apt-get install build-essential checkinstall git cmake libfaac-dev libjack-jackd2-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libva-dev libvdpau-dev libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev texi2html yasm zlib1g-dev

Download and install gstreamer by entering the following command:
sudo apt-get install libgstreamer0.10-0 libgstreamer0.10-dev gstreamer0.10-tools gstreamer0.10-plugins-base libgstreamer-plugins-base0.10-dev gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad gstreamer0.10-ffmpeg

Download and install VLC
sudo apt-get install vlc vlc-dbg vlc-data libvlccore5 libvlc5 libvlccore-dev libvlc-dev tbb-examples libtbb-doc libtbb2 libtbb-dev libxine1-bin libxine1-ffmpeg libxine-dev
**sudo apt-get install x264 (Not needed since we installed x264 above)

Install MySQLC++Client
sudo apt-get install libmysqlcppconn-dev

Download and install install x264. Recent stable snapshot of x264 from ftp://ftp.videolan.org/pub/videolan/x264/snapshots/ cd ~/OpenCV
tar xjvf x264-snapshot-20121004-2245-stable.tar.bz2
cd x264-snapshot-20121004-2245-stable
./configure --enable-static --enable-pic --enable-shared
make
sudo make install

Download and install install ffmpeg. Latest from http://ffmpeg.org/download.html cd ~/OpenCV
tar xzvf ffmpeg-1.0.tar.gz
cd ffmpeg-1.0
./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-pic --enable-shared
make
sudo make install

Download and install gtk libjpeg by entering the following command:
sudo apt-get install libgtk2.0-0 libgtk2.0-dev libjpeg62 libjpeg62-dev

Download and install install v4l (video for linux). Download v4l-utils-#.#.#.tar.bz2 from http://www.linuxtv.org/downloads/v4l-utils/ cd ~/OpenCV
tar xjvf v4l-utils-0.9.1.tar.bz2
cd v4l-utils-0.9.1
./configure
make
sudo make install

Download and install install OpenCV. Download OpenCV from http://sourceforge.net/projects/opencvlibrary/files/ cd ~/OpenCV
tar xjvf OpenCV-2.4.2.tar.bz2
cd OpenCV-2.4.2
mkdir build
cd build
cmake -D WITH_TBB=ON -D WITH_XINE=ON ..

Check that the output of cmake includes the following text:
gstreamer-base-0.10
GTK+ 2.x: YES
FFMPEG: YES
GStreamer: YES
V4L/V4L2: Using libv4l
make
sudo make install

----------------------------------------------------------------------
Add this to ~/.bashrc

export LD_LIBRARY_PATH=/usr/local/lib:/home/LOCAL_USER_NAME/OpenCV/OpenCV-2.4.2/build/lib:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
export CLASSPATH=/usr/share/java/mysql.jar:/usr/include/mysql++:$CLASSPATH
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ubuntu opencv install