Skip to content

Installation and System Setup

Tim Poulsen edited this page Feb 24, 2019 · 1 revision

This guide here cannot possibly cover all aspects of setting up a vision processing environment. But here are the basics of how to get going.

System requirements

  • Python 3.5+
  • Numpy
  • OpenCV
  • Robovision, of course

Python 3.5+

Most modern python development is done in a 3.x environment. Robovision does not support 2.x.

On a Mac or Windows computer, I strongly recommend that you install the Anaconda version of python. It offers a one-click installer and a consistent, well-configured environment. It also includes many of the common libraries that you'll need, such as numpy.

On a Linux system (Raspberry Pi, Jetson, etc.) you should use the python environment provided by your system's package manager (e.g. apt-get). Make sure to update to the latest version.

For all systems, I recommend that you set up and use a virtual environment specific for your computer vision tasks. This is also a very easy way to enforce the use of python 3.x.

Note: Throughout this wiki, I assume you've set up python3 as your default interpreter. If not, substitute python3 and pip3 wherever I've left off the number.

Numpy

Numpy is a numerical processing library and is required for many vision tasks. This library offers highly optimized (fast) functions for matrix and other advanced mathematics operations. Installing it is as simple as:

sudo pip install numpy

OpenCV

Robovision was developed for the 3.x versions of OpenCV. It will likely work with 4.x. But, I haven't tested that yet. So, proceed at your own risk. :-)

Except on the Raspberry Pi, I strongly encourage you to compile OpenCV yourself. You'll get a version that includes the features you want, tailored to your specific system. Some articles to help you through the process are the one on my blog and those on the PyImageSearch blog.

Compiling from source on a Raspberry Pi is certainly doable (and preferrable). PyImageSearch has a few articles on how to do so, in particular Optimizing OpenCV on the Raspberry Pi article. Just know ahead of time that the process will take hours to work through. If you don't have the time, you can install using sudo pip install opencv-contrib-python You won't get any non-free algorithms, such as SIFT and SURF, with this installation method.

Robovision

If you haven't already, install robovision with:

pip install robovision

If you want the latest and greatest version, you can also clone the repo and install locally:

git clone https://github.com/skypanther/robovision.git
cd robovision
pip install -e .
Clone this wiki locally