Installation instructions¶
Introduction¶
The OpenPTV contains of:
- Core library written in C, called liboptv
- Python/Cython bindings, shipped together with the liboptv
The Python bindings allow the easy access to the C library. There are two Python GUI packages that are built around the Python bindings to allow the end-user to use it in a more intuitive way:
- Python 3 with PyQt4 GUIs and command line scripts from Yosef Meller called The Particle Bureau of Investigation or pbi
- Python 3 based GUI (using TraitsUI, Enthought Chaco, etc.) called PyPTV
The overview¶
- if you plan to use C/C++/Fortran/etc. - compile the liboptv from source using cmake and testing it using libcheck library (see below instructions for Linux and Mac OS X).
- if you plan to use it only from Python (either through pbi command line approach or using pyptv GUI) then you can save time on installing liboptv by pip (see below) or compiling through Python bindings and testing it from Python.
liboptv - a library of the OpenPTV algorithms¶
This is a library - you can build it and link to it in your own project, e.g. calling functions from your own GUI or command-line software. When the package is installed correctly, you can reference it in your code by including files from the optv
directory under the standard include path. For example:
#include <optv/tracking_frame_buf.h>
To build your program you also link it with liboptv
. On gcc
, one adds the flag
-loptv
to the command line. Other compilers and IDEs have their own
instructions for adding libraries; consult your IDE/compiler manual for the
details.
The library is using Check framework for the unit tests and Cmake project for the build. We recommend installing both software packages, however it is not obligatory, you may skip the relevant parts if you’re not going to develop or test the library.
Installation of PyPTV (the GUI, including liboptv) called PyPTV¶
Install Python 3 (Anaconda or anything else):
python -m pip install --upgrade pip
pip install numpy
pip install pyptv --index-url https://pypi.fury.io/pyptv --extra-index-url https://pypi.org/simple
- note that you need a C compiler, on Mac OS X and Linux it’s included as gcc or clang, but on Windows you might want to install one https://wiki.python.org/moin/WindowsCompilers
Use our test case folder to see PyPTV in action like in video tutorials¶
Download and run the test case:
git clone --depth 1 -b master --single-branch https://github.com/OpenPTV/test_cavity.git
pyptv test_cavity
If you want to try the software but not really to get a development version, then you can use one of the two options: Virtual Machine appliance for VirtualBox software or Docker:
Virtual Machine¶
Ubuntu 18.04 with pyptv, see here: https://github.com/alexlib/pyptv/wiki/Getting-started-using-VirtualBox-Linux-(Ubuntu-18.04)-image
Try Docker¶
This method requires to install first: Docker and X Server (for GUI); then, either pull the ready image or build locally the docker image. This installation works on Windows (tested on Win 10), Mac OS X (tested on Mojave 10.14.2) and Linux.
Please follow the detailed instructions on PyPTV Dockerfiles
Building development version and installation¶
If you want your own copy of the software, compiled and tested on your platform, then you first need to install Python 3. Note that we work on the Python 3 version but it is not ready yet.
Recommended Python distribuitons¶
Instead of using the Python 3 that comes with your system we recommend to install one of these distributions - later it will miminize the issues of cross-compiled packages.
- Anaconda Python distribution for Windows or Linux
- Canopy (Enthought Python Distribution) for Mac OS X.
Installation of liboptv and Python bindings¶
Install Python 3 (Anaconda or anything else):
pip install optv
Now you can proceed to Python shell and try:
import optv
If nothing works, where I can get help?¶
Send your build logs, description of the problem and details of the operating system, Python version, etc. to our Google group or forum: <https://groups.google.com/forum/#!forum/openptv>