Created
November 30, 2018 03:07
-
-
Save pjspillai/64da7a0fe491b927dce1b63f0ec1950e to your computer and use it in GitHub Desktop.
OpenCV 4.0 , Ubuntu 18.04 Installation
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
git clone --recursive https://github.com/opencv/opencv_contrib.git | |
git clone --recursive https://github.com/opencv/opencv.git | |
Make sure the CmakeCache params are loaded (refer the one in gist), in cmake-gui | |
make -j8 install | |
sudo ldconfig | |
Note: This might not setup python opencv version correctly. It initially showed me 3.2 when I did | |
cv2.__version__ | |
cd opencv/opencv/build/python_loader | |
sudo python3 setup.py build | |
sudo python3 setup.py build install --prefix=/usr/local | |
sudo link the .so file in /usr/local/python/cv2/python-3.6 | |
sudo ln -s cv2.cpython-36m-x86_64-linux-gnu.so cv2.so | |
Add following line in bashrc which contains the cv2.so (opencv 4 lib) | |
export PYTHONPATH=$PYTHONPATH:/usr/local/python/cv2/python-3.6 | |
source ~/.bashrh | |
now open a fresh terminal to check | |
import cv2 | |
cv2.__version__ | |
This should print out the following | |
'4.0.0-dev' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment