Skip to content

Instantly share code, notes, and snippets.

@mmitou
Created November 10, 2017 06:30
Show Gist options
  • Save mmitou/649aebd3fedb704299a08f9d9269160b to your computer and use it in GitHub Desktop.
Save mmitou/649aebd3fedb704299a08f9d9269160b to your computer and use it in GitHub Desktop.

How to install OpenCV 3.3.1 on Fedora 26

download these packages to ~/opencv/

  • opencv-3.3.1.zip
  • opencv_contrib-3.3.1.zip

and execute commands below.

# 1. set up python virtual einvironment.
python3 -m venv tutorial
cd tutorial
source bin/activate 
pip install numpy

# 2. install developer packages.
sudo dnf install cmake-gui ffmpeg-devel libpng-devel libjpeg-turbo-devel jasper-devel libtiff-devel tbb-devel eigen3-devel

# 3. build and install.
cd ~/opencv/
unzip opencv-3.3.1.zip opencv_contrib-3.3.1.zip
mkdir build-3.3.1
cd build-3.3.1
cmake -DCMAKE_BUILD_TYPE=RELEASE -DWITH_TBB=ON -DBUILD_opencv_python3=ON -DOPENCV_EXTRA_MODULES_PATH=~/opencv/opencv_contrib-3.3.1/modules -DCMAKE_INSTALL_PREFIX:PATH=$HOME/opencv/3.3.1 ~/opencv/opencv-3.3.1
make install
ln -s ~/opencv/3.3.1/lib/python3.6/site-packages/cv2.cpython-36m-x86_64-linux-gnu.so ${VIRTUAL_ENV}/lib64/python3.6/site-packages

try executing this command. if you succeeded in building and installing opencv, it prints '3.3.1'.

python -c 'import cv2; print(cv2.__version__)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment