Last active
January 13, 2016 04:44
-
-
Save minhoolee/c23b284a34c228e802a7 to your computer and use it in GitHub Desktop.
Ubuntu OpenCV Installation Scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# Install script for OpenCV on Ubuntu 14.04 | |
# Written by Min Hoo Lee | |
# November 28, 2015 (11/28/15) | |
echo "\nOpenCV Install Script for Ubuntu\n" | |
# Activate all the apt-get repositories | |
echo "\nAdding all apt-get repositories\n" | |
sudo add-apt-repository main | |
sudo add-apt-repository universe | |
sudo add-apt-repository multiverse | |
sudo add-apt-repository restricted | |
sudo apt-get -y update | |
# Install OpenCV dependencies | |
echo "\nInstalling dependencies\n" | |
sudo apt-get install git vim curl cmake g++ libopencv-dev build-essential libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff5 libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip -y | |
# Install OpenCV 3.0.0 | |
echo "\nPreparing for OpenCV installation\n" | |
mkdir -p ~/Vision/src | |
mkdir ~/Vision/bin | |
git clone https://github.com/Itseez/opencv.git ~/Vision/bin/opencv | |
cd ~/Vision/bin/opencv | |
git checkout 3.0.0 | |
mkdir ~/Vision/bin/opencv/build | |
# Additional repository for SIFT and SURF patented operators | |
cd ~/Vision/bin/ | |
git clone https://github.com/Itseez/opencv_contrib.git ~/Vision/bin/opencv_contrib | |
cd ~/Vision/bin/opencv_contrib | |
git checkout 3.0.0 | |
cd ~/Vision/bin/opencv/build | |
echo "\nStarting OpenCV installation\n" | |
cmake -D CMAKE_BUILD_TYPE=RELEASE \ | |
-D CMAKE_INSTALL_PREFIX=/usr/local \ | |
-D OPENCV_EXTRA_MODULES_PATH=~/Vision/bin/opencv_contrib/modules \ | |
-D WITH_TBB=ON \ | |
-D WITH_CUDA=ON ~/Vision/bin/opencv | |
sudo make -j4 install | |
sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf' | |
sudo ldconfig | |
echo "\nDone installing OpenCV (may or may not have been successful)\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# Install script for OpenCV on Ubuntu 14.04 | |
# Written by Min Hoo Lee | |
# November 28, 2015 (11/28/15) | |
echo "\nOpenCV Samples Installation script" | |
cd ~/Vision/bin/opencv/samples | |
echo "\nStarting to install OpenCV samples\n" | |
sudo cmake . | |
sudo make -j 4 | |
echo "\nRunning OpenCV samples\n" | |
cd ~/Vision/bin/opencv/samples/data | |
~/Vision/bin/opencv/samples/cpp/cpp-example-facedetect ~/Vision/bin/opencv/samples/data/lena.jpg | |
~/Vision/bin/opencv/samples/cpp/cpp-example-houghlines ~/Vision/bin/opencv/samples/data/pic1.png | |
echo "\nFinished running samples\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment