Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install OpenCV
#!/bin/bash
mkdir OpenCVInstall
cd OpenCVInstall
rm -rf last_stable_x264.tar.bz2
rm -rf x264-snapshot-20140930-2245-stable
rm -rf ffmpeg-2.4.1.tar.bz2
rm -rf ffmpeg-2.4.1
rm -rf v4l-utils-1.4.0.tar.bz2
rm -rf v4l-utils-1.4.0
rm -rf opencv-2.4.9.zip
rm -rf opencv-2.4.9
sudo apt-get install build-essential checkinstall cmake
sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get install qt5-default
sudo apt-get install pkg-config 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 libxine-dev git 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 libjpeg8 libjpeg8-dev libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev libtbb-dev libeigen3-dev sphinx-common texlive-latex-extra libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev
#nvidia
sudo apt-get install libopencv-dev
sudo apt-get remove ocl-icd-libopencl1
#caso não seja nvidia
#sudo apt-get install ocl-icd-libopencl1
#sudo apt-get remove libopencv-dev
sudo apt-get remove ffmpeg x264 libx264-dev libv4l-dev
sudo apt-get update
wget ftp://ftp.videolan.org/pub/videolan/x264/snapshots/last_stable_x264.tar.bz2
tar -xvf last_stable_x264.tar.bz2
cd x264-snapshot-20140930-2245-stable
./configure --enable-shared --enable-pic
make
sudo make install
cd ..
wget http://ffmpeg.org/releases/ffmpeg-2.4.1.tar.bz2
tar -xvf ffmpeg-2.4.1.tar.bz2
cd ffmpeg-2.4.1
./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-shared
make
sudo make install
cd ..
wget http://www.linuxtv.org/downloads/v4l-utils/v4l-utils-1.4.0.tar.bz2
tar -xvf v4l-utils-1.4.0.tar.bz2
cd v4l-utils-1.4.0
./configure
make
sudo make install
cd ..
sudo apt-get install cmake-curses-gui
wget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.9/opencv-2.4.9.zip
unzip opencv-2.4.9.zip
cd opencv-2.4.9
mkdir build
cd build
#ccmake ..
#Ubuntu install
#http://docs.opencv.org/3.0-beta/doc/tutorials/introduction/linux_install/linux_install.html
#http://rodrigoberriel.com/2014/10/installing-opencv-3-0-0-on-ubuntu-14-04/
cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_TBB=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_VTK=ON -D WITH_XINE=ON -D WITH_GSTREAMER=ON -D WITH_JPEG=ON -D WITH_PNG=ON -D WITH_FFMPEG=ON ..
make -j8
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment