Summary
I have installed the requisite software on chimay for interfacing the FLIR A70 camera in Python. There are two packages required from FLIR:
- Spinnaker SDK, which provides the low-level camera drivers and a C/C++ API.
- PySpin, a wrapper of the Spinnaker library which provides the Python API.
These installations did not work out-of-the-box for Debian 11 (only Ubuntu is officially supported). I had to make several modifications which are documented below for future reference.
This setup has not yet been tested with the camera connected to chimay.
Documentation and Demo Codes
The PySpin package comes with a number of Python demo codes and a complete API reference. These can be found on chimay at the following locations.
- Example codes:
/opt/spinnaker/python/Examples/Python3/
- Python API reference manual:
/opt/spinnaker/python/docs/PySpinDoc.pdf
Installing Spinnaker SDK
Below were the steps required to install Spinnaker on chimay (Debian 11).
- Download the Spinnaker binaries (AMD64 architecture) and copy the tarball to, e.g.,
/home/controls on chimay.
- Unpack the tarball contents and enter the new directory:
$ tar -xf spinnaker-2.6.0.160-Ubuntu20.04-amd64-pkg.tar.gz $ cd spinnaker-2.6.0.160-amd64
Next, install the dependencies (on chimay, these were all already installed):
$ sudo apt-get install libavcodec58 libavformat58 \
libswscale5 libswresample3 libavutil56 libusb-1.0-0 \
libpcre2-16-0 libdouble-conversion3 libxcb-xinput0 \
libxcb-xinerama0
There is one additional dependency, qt5-default , which is obsolete in Debian and no longer available via the package manager (that is, its functionality was absorbed into other Qt packages). I was able to find a workaround based on these instructions.
- Install all the dependencies of
qt5-default :
$ sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
- Manually remove the
qt5-default dependency from the Spinnaker package.
Unpack the spinview-qt_2.6.0.160_amd64.deb package:
$ mkdir tmp $ cd tmp $ ar -x ../spinview-qt_2.6.0.160_amd64.deb $ tar xf control.tar.xz
Open the file control in a text editor and delete the qt5-default dependency from the Depends list.
Then repackage the contents:
$ tar cfJ control.tar.xz control
$ ar rcs ../spinview-qt_2.6.0.160_amd64.deb debian-binary control.tar.xz data.tar.xz
$ cd .. $ rm -rf tmp
This overwrites the original package with a version no longer containing the qt5-default dependency.
- Now proceed with running the install script:
$ sudo sh install_spinnaker.sh
This will install the Spinnaker library at /opt/spinnaker . Spinnaker also provides a standalone GUI application, SpinView, which can be executed from the terminal (from any directory) via the command spinview .
Installing PySpin
The main challenge with installing PySpin was that it is currently only supported for Python <=3.8. The system installation on Debian 11 is Python 3.9 and 3.8 is not available within the package manager. Following these instructions, I manually installed a second version of Python (3.8) on chimay, in a way that should not interfere with the system installation.
The Python 3.8 executable is in the system path and can be run only via the command python3.8 . It is not symlinked to python or to python3 . Those remain linked to the preexisting Python 3.9.
After installing Python 3.8, I proceeded with the installation as follows:
- Download the PySpin package (x86_64 architecture) and copy the tarball to, e.g.,
/home/controls on chimay.
- Unpack the tarball contents and into a new directory:
$ mkdir python
$ mv spinnaker_python-2.6.0.160-Ubuntu20.04-cp38-cp38-linux_x86_64.tar.gz python $ tar xf spinnaker_python-2.6.0.160-Ubuntu20.04-cp38-cp38-linux_x86_64.tar.gz
- Move the new directory into the Spinnaker installation directory:
$ sudo mv python /opt/spinnaker $ cd /opt/spinnaker/python
- Install the dependencies:
$ sudo python3.8 -m pip install --upgrade numpy matplotlib
- Finally, install PySpin itself:
$ sudo python3.8 -m pip install spinnaker_python-2.6.0.160-cp38-cp38-linux_x86_64.whl
If this succeeded, you should now be able to enter import the package PySpin as
$ python3.8 >>> import PySpin
without error.
|