Installing OpenCV 3.3.0 on Ubuntu 16.04 LTS
Get Ubuntu update.
First of starting this we need to make sure and update Ubuntu before doing any thing else, which is:
2. Install all the recommended packages.
Compilers
Required:
And recommended optional package:
3. Setup you enviroment
We are going to install pip and virtual environment manager packages in python:
We install virtualenv and virtualenwrapper :
Then wee need to add some line to .bashr file:
add the following lines to the bottom of the content of the file:
Then save the file, go back to terminal. Run this line:
This line is to activate/apply what we have done to the .bashrc
file, which finalizes the installation of virtualenv and virtualenvwrapper.
Next, we need to create a virtual enviroment for OpenCV, that we are going to call it cv:
If you restart or accidentally close the terminal, type the command below:
the last package to install is numpy.
4. Download OpenCV source
We need to clone the latest release of OpenCV.
5. Configuring and compiling
We need to build using cmake:
Then we need to compile OpenCV while you are in the build folder:
where jx where x are the number of process you want to dedicate to this operation.
Finally we need to install openCV:
6. Finishing OpenCV installation
There are some work remaining so everything is done. Lets look at the ouput of our work so far:
At the output you will see a file that start with the name of cv2.cpython. We need to move it back to site-packages and rename it to cv2.so:
To have OpenCV working in our virtual environment, we create a sym-link of the file to our site-package folder in the virtual environment.
Finally we need to download
Last updated
Was this helpful?