Pymrt Documentation Release 1.0.0

Pymrt Documentation Release 1.0.0

pymrt Documentation Release 1.0.0 Tinghui Wang May 14, 2018 Contents: 1 Python Environment Setup 1 1.1 Python 3.6 Environment.........................................1 1.2 Setup Tensorflow.............................................2 1.3 Setup Mayavi...............................................2 1.4 Known Issues...............................................3 2 Multi-Target Tracking 5 2.1 Dynamic Models for Multi-target Tracking...............................5 2.2 Gaussian Component........................................... 10 2.3 Gaussian-Mixture Probability Hypothesis Density Filter........................ 12 2.4 API.................................................... 16 3 Reference 21 3.1 Multi-Target Tracking.......................................... 21 4 Indices and tables 23 Bibliography 25 i ii CHAPTER 1 Python Environment Setup As the packages has a few package dependencies and get them set up properly for your python environment may be tricky sometimes. The following provides a general suggestion on how to set up each packages for better performance on various operating systems. 1.1 Python 3.6 Environment On MacOS and Windows 10, I personally recommend MiniConda package installer for python environment. Mini- Conda provides most numerical calculation packages such as numpy and scipy, pre-compiled for all operating systems with Intel Math kernel Library - probably the best performance you can get as pre-compiled binaries. It also includes virtual environment management so that you can have multiple Python environments co-existing on your ma- chine. MiniConda is installed with minimal packages and you can add additional packages that you need incrementally to keep a minimal footprint on your hard drive. 1.1.1 Windows Setup Setup MiniConda on windows, simply follow the link and download the installer for you Windows OS. Run the installer to install MiniConda to your machine. 1.1.2 Ubuntu 18.04 Setup Setup MiniConda on Linux, simple follow the link and download the bash installer for Linux operationg system. In terminal, make the downloaded bash script executable, and run it with sudo command as follows. $ sudo ./Miniconda3-latest-Linux-x86_64.sh In my case, I installed it under /opt/miniconda3 so that it is accessible for all users. Add the path of Miniconda to ~/.bashrc: 1 pymrt Documentation, Release 1.0.0 export PATH="/opt/miniconda3/bin:$PATH" 1.1.3 MacOS Setup In MacOS, I would recommend using homebrew as package manager to install MiniConda. Install homebrew in terminal: $ /usr/bin/ruby -e" $(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/ ,!master/install)" The command above fetches homebrew from GitHub and installs Xcode command line tools as well. Add homebrew to path $ echo export PATH='/usr/local/bin:$PATH' >> ~/.profile Install basic MiniConda environment using homebrew $ brew install wget $ wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh $ bash Miniconda3-latest-MacOSX-x86_64.sh $ rm ~/Miniconda3-latest-MacOSX-x86_64.sh $ echo export PATH='~/miniconda3/bin:$PATH' >> ~/.profile $ source ~/.profile $ conda install anaconda $ conda update --all 1.2 Setup Tensorflow For install tensorflow for your operating system, you can find instruction on tensorflow document page here. Note that on Windows with Conda environment, there is a chance that an out-dated html5lib package dependency may break the Conda setup. As a walk around, you can run $pip install html5lib==1.0b10 to correct it. The fix has been merged into tensorflow source tree, but has not released yet. 1.3 Setup Mayavi Mayavi library is used for 3D plot and visualization. However, set it up properly takes quite some work. 1.3.1 Windows Setup First, make sure that you have Visual Studio installed. In my case, I use VS2017 Community for compilation. More- over, in VS2017, you need to enable *Python Support* and have *Python Native Development Tools* installed. Start *x64 Native Tools Command Prompt for VS2017* in start menu and import Conda Python environment scripts (usually named as activate.bat). The default one for base environment is at Scripts\activate.bat under conda installation directory. (Replace C:\Anaconda3 in the following command with your installation path of conda). 2 Chapter 1. Python Environment Setup pymrt Documentation, Release 1.0.0 > C:\Anaconda3\Scripts\activate.bat C:\Anaconda3 Install pyside 1.2.4 > conda install -c conda-forge pyside=1.2.4 However, if you have pyqt package installed on your system, you may see it fails with error complaining about version conflicts. Remove pyqt first. > conda uninstall pyqt Install VTK from clinicalgraphics > conda install -c clinicalgraphics vtk Due to various bugs and compatibility issue, install mayavi, traits and pyface from source (Github). > pip install git+https://github.com/enthought/envisage.git > pip install git+https://github.com/enthought/traitsui.git > pip install git+https://github.com/enthought/pyface.git > pip install git+https://github.com/enthought/mayavi.git 1.3.2 Ubuntu 18.04 Setup You can install the mayavi in the same way as in Windows. In addition to the previous steps, you als need to install libcanberra-gtk-module and libcanberra-gtk3-module using system package manager. $ sudo apt install libcanberra-gtk-module libcanberra-gtk3-module 1.3.3 MacOS Setup First, install VTK using homebrew. $ brew install vtk --with-python3 --without-python --with-qt Install pyside 1.2.4 conda install pyside Due to various bugs and compatibility issue, install mayavi, traits and pyface from source (Github). It takes a while to install and compile all of them from the source. $ pip install git+https://github.com/enthought/envisage.git $ pip install git+https://github.com/enthought/traitsui.git $ pip install git+https://github.com/enthought/pyface.git $ pip install git+https://github.com/enthought/mayavi.git 1.4 Known Issues 1.4.1 mlab.axes() causes exception in Mayavi 4.5.0 When use mlab.axes, the following exception message is observed in terminal: 1.4. Known Issues 3 pymrt Documentation, Release 1.0.0 TypeError: SetInputData argument1:method requires a vtkDataSet, a vtkPolyDataNormals was provided.( in _wrap_call) AttributeError:'PolyDataNormals' object has no attribute'bounds' You can find fix on mayavi github page at #474. 1.4.2 UnicodeDecodeError while trying to close mayavi When you close mayavi window, you may saw the following error and the window is not closed unless you kills it using processor manager. The message may read: UnicodeDecodeError:'utf-8' codec can't decode byte 0xff in position 3: invalid start ,!byte The issued is tracked on mayavi Github page at #576. The fix for the issue is merged to master branch on Feb 14, 2018. 4 Chapter 1. Python Environment Setup CHAPTER 2 Multi-Target Tracking 2.1 Dynamic Models for Multi-target Tracking Namespace pymrt.tracking.models includes multiple classes for commonly used dynamic models. They serve as the basis of state transition modelling for multi-target tracking algorithm. 2.1.1 GM-based Constant Velocity Model pymrt.tracking.models.CVModel provides a base class for constant velocity maneuvering object in n- dimensional space. The model is composed of the following parts of information: State Space The state of an object maneuvering in a n-dimensional space with constant velocity can be expressed as an array composed of its location in the space and velocity at a given time. T x = [sd1 ; sd2 ; :::; sdn ; vd1 ; vd2 ; :::; vdn ] The state space where x is drawn from is usually R2n. State Update If the object is moving according to a constant velocity in the n-dimensional space, then the new state (after time t) can be expressed as T xt+1 = [sd1 + vd1 t; sd2 + vd2 t; :::; sdn + vdn t; vd1 ; vd2 ; :::; vdn ] In matrix format, we can rewrite it as xt+1 = F · xt 5 pymrt Documentation, Release 1.0.0 where [︂I I t]︂ F = n n 0 In In here is identity matrix of n-dimension. State Error Estimation Well, there is always error associated with a model, and to simulate the error, the following error term (only first order is considered) is added. T Given disturbance w = [wd0 ; wd1 ; :::; wdn ] , the state updated with error estimation can be written in matrix form as follows: xt+1 = F · xt + G · w where [︂I I t]︂ F = n n 0 In and [︂ 1 t2I ]︂ G = 2 n tIn Measurement Measurement, sometimes also referred to as observation, of a target at state x can be derived with the following equation zt = H · xt H is called measurement multiplier, and zt is the observation of the target at time t. Usually, only the space location of target can be measured, so the measurement multipler H is [︂I ]︂ H = n 0n Measurement Error Estimation Measurement will have error. The error is modeled by a uncertainty measure around the exact measurement. In Gaussian Mixture model, it is represented by a multi-variant Gaussian covariance matrix D. If each dimension are independent of each other, 2 D = 휎 In 2.1.2 GM-based Constant Velocity Model with Track ID pymrt.tracking.models.CVIDModel provides a base class for constant velocity maneuvering object in n- dimensional space with track ID embedded in state vector. 6 Chapter 2. Multi-Target Tracking pymrt Documentation, Release 1.0.0 State Space In order to accomplish data-track association during target tracking, the track ID needs to be append to state vector. At a given time, the state vector is described as follows T x = [sd0 ; sd1 ; :::; sdn ; vd0 ; vd1 ; :::; vdn ; tid] The state space is usually R2n × N. State Update The state update, without considering spawning (one object separated into two), can be expressed as follows: xt+1 = F · xt where 2 3 In Int 0 F = 4 0 In 05 0 0 1 State Error Estimation T Given disturbance w = [wd0 ; wd1 ; :::; wdn ] , the state updated with error estimation can be written in matrix form as follows: xt+1 = F · xt + G · w where 2 3 In Int 0 F = 4 0 In 05 0 0 1 and 2 1 2 3 2 t In G = 4 tIn 5 0 Measurement Measurement equation of the model can be expressed as: zt = H · xt where 2 3 In H = 40n5 0 2.1.3 Other Model Parameters for MTT In additional to the model parameters mentioned above, there are additional parameters defined for the tracking algo- rithm to use.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    31 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us