![]() D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.1.0/modules \ With the paths resolved, we start configuring the build, If using Python 2, look for the appropriate directories in your Anaconda environment. Note: these paths are when you're using Python 3.5. ~/anaconda3/envs/keras-test/include/python3.5m ![]() ~/anaconda3/envs/keras-test/lib/python3.5Īnd the include directory would be at ~/anaconda3/envs//include/python3.5m e.g. The library path would be ~/anaconda3/envs//lib/python3.5 e.g. ~/anaconda3/envs/keras-test/bin/python for my keras-test environment The Python executable in Anaconda will be at ~/anaconda3/envs//bin/python e.g. Since the Anaconda installation is independent from the system installed Python, and CMake defaults to system paths, we need to tell CMake to where to find the correct library path and include path for headers. But first we must figure out some library paths. We first configure the build using CMake. Make sure you have activated the Anaconda environment you created, Now that our environment is ready, we can download the OpenCV sources, So, make sure you install the following conda packages at a minimum when creating the environment.Ĭonda create -name keras-test numpy scipy pillow h5py We won’t necessarily need to have Keras or Theano installed, but we do need numpy. I'll be using the same 'keras-test' environment I created in my earlier post. ![]() If you haven't installed Anaconda Python yet you can follow my earlier post to get it installed.įollow it to install Anaconda and then create a Python 3.5 environment. Sudo apt-get install python2.7-dev python3.5-dev However, I got few errors while compiling without installing the following packages, The Python binaries installed with the Anaconda installation contains the development headers. Sudo apt-get install libatlas-base-dev gfortran The following libraries optimize several functions of OpenCV (source: PyImageSearch) Install the GTK dev libraries to support GUI functions of OpenCV, Note: on Ubuntu 16.04, the package name for libpng was libpng12-dev. Sudo apt-get install libxvidcore-dev libx264-dev Sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev Sudo apt-get install libjpeg8-dev libtiff5-dev libjasper-dev libpng-dev Then, we install the following packages which allows OpenCV to interact with various image and video formats, Sudo apt-get install build-essential cmake git unzip pkg-config ![]() Then (if you have not done already) install the necessary build tools, But the steps and commands will be exactly the same for any flavor of Ubuntu 16.10.įirst, as a habit, get and install the latest updates for Ubuntu, I'll be installing OpenCV 3.1, and will be using the Lubuntu 16.10 virtual machine which I used in my earlier post. libpng-dev, libhdf5-serial-dev) and the build commands due to the changes from Ubuntu 16.04 to 16.10, and because I'm using Anaconda environments rather than virtualenv. I followed his steps as a base, but had to make numerous adjustments to some of the packages which gets installed (e.g. Since OpenCV does not have a pre-built package for Linux, it meant I had to compile OpenCV from source.Īdrian of PyImageSearch has recently done a post about how to compile OpenCV on Ubuntu 16.04 using virtualenv. Now, I wanted to install OpenCV on Ubuntu also. I recently switched to Linux for my Machine Learning experiments, and I did a post on How to install Keras and Anaconda Python on Ubuntu 16.10.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |