Sie sind auf Seite 1von 6

Roy Allela

Intel Student Partner,UoN

Installing OpenCV and NumPy on the Intel Edison.


In this tutorial, I will walk you through installing OpenCV and NumPy on the Intel Edison.
OpenCV is a powerful computer vision library originally developed by Intel and aimed at real-time image
processing.
NumPy is a Python package for performing high-level mathematical functions on multi-dimensional
arrays and matrices.
These two packages are important if you are aiming at developing an IoT application that carries out
image-processing unit and number-crunching.
Lets get started.
First of all, power the Edison by plugging in the USB cable into Edisons USB OTG port . This is the microUSB port that is closer to the power plug and the larger USB port. Then connect the other USB to the
micro-USB port closer to the edge of the board. This is a serial connection that will allow you to establish
a 115200 baud serial connection with the Edison.
This tutorial assumes that you have already installed the Yocto Image on the Edison. If you havent
kindly follow the steps in this tutorial before proceeding
The next step is to establish a serial connection to the Edison using puTTY or any other SSH client of your
choice. Launch puTTY and set it to connect to the serial COM port of the Edison and set the baud rate to
115200. Click Open.
Once the puTTY terminal is launched, you should hit Enter twice to access the login prompt. When
prompted for login type root if you never changed youre the default login. Otherwise login with the
credentials you had set.
Once logged in,We now need to set up a WiFI connection that will enable us to download and install
these packages.
Type configure_edison wifi then press Enter. Edison will scan for WIFI networks and list them as shown
below

Select a network by typing the number adjacent to the networks name then provide the password for
the network and you should be connected now and should see the message below.

With internet connection established, we should now Install the IoT DevKit Libraries
Type the command below in the terminal to add the DevKit Libraries
echo "src intel-iotdk http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/intel-iotdk.conf
We now need to update the package repository.Do this by typing
opkg update
Your terminal should appear as below after the above step

Then upgrade the package repository by typing


opkg upgrade

This should take a few minutes, once its done, your terminal should appear as below

Next, we need to add the unofficial package repository. Access to every package is not available without
adding repository locations to the opkg/base-feeds.conf file. By doing this, youll add an enormous
number of compiled applications, saving you the hassle of compiling from source. Unofficial repositories
are quite common across Linux, that is one of the beauties of Linux.
To edit the opkg/base-feeds.conf file to add the unofficial repository type the command below
echo "src/gz all http://repo.opkg.net/edison/repo/all
src/gz edison http://repo.opkg.net/edison/repo/edison
src/gz core2-32 http://repo.opkg.net/edison/repo/core2-32" >> /etc/opkg/base-feeds.conf

Since we just added a new package location,we need to update the repository index again.Do this by
typing
opkg update

Next, well install NumPy, OpenCV, and OpenCV-Python.


opkg install python-numpy opencv python-opencv nano
This should take some time and If everything goes well , your terminal should appear as below.

To test whether the NumPy and OpenCV packages were installed correctly, launch the python shell by
typing python.
Once the shell is launched, we are going to check if everything is shipshape by printing the NumPy and
OpenCV versions
To get the Numpy version type:
>> import numpy
>> print numpy.__version__

To get the OpenCV version type:


>> import cv2
>> print cv2.__version__
At the time of writing this tutorial, the versions were as displayed below

Now, we are done,hack away and happy coding!!!

NB: Do not do a doing a blanket opkg upgrade with these unofficial repos. You'll max out the Edison's
memory in the process if you do, making your board very unstable and disabling the the virtual and USB
COM ports. If you do make that mistake, you will have to wirelessly flash a new image to the Edison and
lose all your config settings and packages (if you haven't backed them up already). DO NOT RUN opkg
upgrade WITH THE ABOVE REPO LINKED TO BASE-FEEDS.CONF