Skip to content

About

TMF8829 People tracking / people counting application

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

 
 

Repository files navigation

3D Contour Tracking - People Counting and Tracking

This demo is tracking 3D contour throughout the scene - this can be used to track people and also provide motion vectors to the system. Individual contours (respectively persons) are assigned numbers, starting with '1', and are tracked in the scene. If a person leaves the scene and returns, it will get a new number.

This app operates with TMF8829_EVM_DB_DEMO or TMF8829_EVM_EB_SHIELD boards.

Example contour tracking output (note: older version without speed estimation):

Demo video

Use the mouse to rotate the view or zoom in/out.

Additionally it performs speed measurement and occlusion detection, see video below:

  • Object 1: Moving person with speed indication
  • Object 2-4: Partially and fully occluded object in the background.

Demo video

Setup

  • OS Compatibility: Windows, Linux, or any platform supporting scipy and sklearn (DBSCAN).
  • Hardware:
    • TMF8829 EVM connected to PC - TMF8829_EVM_DB_DEMO or TMF8829_EVM_EB_SHIELD
    • The TMF8829 should face the people directly.

Orientation of EVM:

Orientation

Installation

Virtual environment

Recommendation is to set-up a virtual environment. Open your favourite Windows PowerShell, VisualStudio Code etc. To install a virtual environment named env, and use it:

python -m venv env
# If PowerShell blocks the script, run: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
./env/Scripts/Activate.ps1

Install libraries

Python version 3.13 or higher is required.

To run the scripts in this folder you need to install the packages in the requirements.txt file with:

pip install -r requirements.txt

All required python packages are inside the subdirectory packages.

Usage

If you are using TMF8829_EVM_EB_SHIELD, start tmf8829_zeromq_server.py first; this can be done with the pre-compiled server file from TMF8829_Driver_ZMQ_Server_Client_EXE_[latest version].zip or inside a separate shell

python tmf8829/zeromq/tmf8829_zeromq_server.py

If you are using TMF8829_EVM_DB_DEMO, no additional server needs to be started.

Execute tool

Run gui.py

python gui.py

This will open a PyQt window, where the detection result is displayed:

Operation

Visualization of depth data in parallel

The EVM GUI can be used in parallel to this application, but needs to be started AFTERWARDS.

Configuration

The GUI enables several configuration parameters:

  • Maximum distance - limit the range of operation of the TMF8829
  • Height threshold - adds a limit for ignoring objects, which are below this height. This threshold is applied on the y-axis, see orientation drawing above.
  • Height of TMF8829 - the height of TMF8829 above the floor.
  • Minimal dimension - contours, whose bounding box is smaller than this dimension are ignored.
  • Maximum dimension - contours, whose bounding box is larger than this dimension are ignored.
  • Motion threshold - below this speed motion is considered as stationary.
  • Enable occlusion detection - checkbox to switch on/off occlusion detection.
  • Reset Parameters and Tracker - reset above parameters to their default value and re-start contour tracking.

Update file cfg_client.json for TMF8829 configuration:

  • Parameter period [in ms] to modify speed of detection - takes only effect if speed is not defined by iterations.
  • Parameter iterations [in k iterations] is used to change performance of detection

Info

This is a fork of tmf8829_driver_python modifying files to create an application, which can run together with TMF8829_EVM_DB_DEMO or TMF8829_EVM_EB_SHIELD.

About

TMF8829 People tracking / people counting application

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages