Forked from sedovolosiy/install-opencv-2.4.13-in-ubuntu.sh
Last active
January 9, 2020 16:06
-
-
Save AssiNET/5cc9879817b86ed2aea79a75bd812eb2 to your computer and use it in GitHub Desktop.
Install opencv-2.4.13 in Ubuntu 16.04
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
## Install java8 | |
sudo apt install -y openjdk-8-jre-headless -y | |
## Solve java error - Run following command from command prompt. | |
sudo sed -i 's/^assistive_technologies=/#&/' /etc/java-8-openjdk/accessibility.properties | |
# Or just comment out below line in /etc/java-8-openjdk/accessibility.properties | |
# assistive_technologies=org.GNOME.Accessibility.AtkWrapper | |
## Install other standart libs | |
sudo apt install wmctrl -y | |
sudo apt install xdotool -y | |
# QT4 openGL neeeded only for Lubuntu 18 (may not be needed for Ubuntu 18) | |
sudo apt install libqt4-opengl-dev -y | |
# install dependencies | |
sudo apt-get update | |
sudo apt-get install -y build-essential | |
sudo apt-get install -y cmake | |
sudo apt-get install -y libgtk2.0-dev | |
sudo apt-get install -y pkg-config | |
sudo apt-get install -y python-numpy python-dev | |
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev | |
sudo apt-get install -y libjpeg-dev libpng12-dev libtiff5-dev libjasper-dev | |
sudo apt-get -qq install libopencv-dev build-essential checkinstall cmake pkg-config yasm libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine2 libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils | |
# download opencv-2.4.13 | |
wget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.13/opencv-2.4.13.zip | |
unzip opencv-2.4.13.zip | |
cd opencv-2.4.13 | |
mkdir release | |
cd release | |
# compile and install | |
cmake -G "Unix Makefiles" -DCMAKE_CXX_COMPILER=/usr/bin/g++ CMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_TBB=ON -DBUILD_NEW_PYTHON_SUPPORT=ON -DWITH_V4L=ON -DINSTALL_C_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON -DBUILD_EXAMPLES=ON -DWITH_QT=ON -DWITH_OPENGL=ON -DBUILD_FAT_JAVA_LIB=ON -DINSTALL_TO_MANGLED_PATHS=ON -DINSTALL_CREATE_DISTRIB=ON -DINSTALL_TESTS=ON -DENABLE_FAST_MATH=ON -DWITH_IMAGEIO=ON -DBUILD_SHARED_LIBS=OFF -DWITH_GSTREAMER=ON .. | |
make all -j2 # 2 cores | |
sudo make install | |
#TODO | |
# Add commands to install tesseract 3.3.x | |
# ignore libdc1394 error http://stackoverflow.com/questions/12689304/ctypes-error-libdc1394-error-failed-to-initialize-libdc1394 | |
#python | |
#> import cv2 | |
#> cv2.SIFT | |
#<built-in function SIFT> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment