From Zero to Image
Learn how to get started with image processing on your Raspberry Pi 3!
Hardware license: Solderpad 0.51
From Zero to Image
This guide will get you all set up for Python-based image processing on your Raspberry Pi 3! You can also use this guide with other hardware if you apply some slight tweaks (e.g. pick another architecture when downloading software). You should also be familiar with basic usage of your system's terminal. Let's get started!
- This guide assumes that you're running Debian Jessie or a similar derivate (think Ubuntu) on your machine
- Ensure your system's software is up-to-date by running the following commands from your terminal:
sudo apt-get update
sudo apt-get dist-upgrade
Pylon contains all the software we need for interacting with Basler cameras. Builds are provided for multiple platforms.
- Download the latest pylon version from here, pick the hardfloat ARM version for Linux
- Unpack the file to a directory of your choice
- Follow the instructions in the
INSTALLfile. Do not attempt to run the pylon viewer as it is not bundled with ARM releases
- After successful installation plug in e.g. your Basler USB camera
- Now we will check if everything works. In your terminal move to pylon's
Samples/Grabdirectory and execute
make, then run
./Grab, you should see some text scrolling with information about pictures being grabbed
OpenCV and Python 3
In this step we'll set up Python 3 and the OpenCV image processing library. Just follow the instructions over here.
The only missing part is connecting Python to your camera now. PyPylon takes care of this task.
- First, ensure you're using the
cvvirtualenv you created while installing OpenCV
- Get your exact python version by running
python --versionfrom within your virtualenv
- Using this information, pick the corresponding PyPylon version from here (e.g. Python 3.4 →
- Install the
whlfile with pip via
pip3 install *path-to-whl*
- Open a Python REPL with
pythonand check that running
import pypylon.pylondoes not yield any errors
Done! You can either try out our example projects now or create some cool stuff of your own. Have fun!