RefTrack - Basketball Referee Gesture Recognition, Using AI and Raspberry Pi

by Michal Heles in Circuits > Raspberry Pi

31 Views, 1 Favorites, 0 Comments

RefTrack - Basketball Referee Gesture Recognition, Using AI and Raspberry Pi

WhatsApp Image 2026-06-16 at 15.27.53.jpeg
WhatsApp Image 2026-06-14 at 15.23.54 (3).jpeg
WhatsApp Image 2026-06-16 at 15.11.39.jpeg
WhatsApp Image 2026-06-14 at 15.23.54 (8).jpeg

RefTrack is a system specifically designed to help the operators behind the scorer desk keep the flow and stability of a basketball game in real time. In high paced games this is a crucial helper as it is very easy to miss or misread referee's signals. RefTrack tracks all these signals with a custom-trained yolo model and showing them in a dashboard which is easy to read for the operators with minimal interaction. It serves as an assistant for the operators, not a replacement.


The camera tracks referees and their signals. When a signal is tracked it registers to a database from which it is pulled directly into the dashboard. The database contains 6 distinct referee calls so far so if the yolo model is retrained on much more data, the signal classes can be added

Supplies

WhatsApp Image 2026-06-16 at 15.29.23.jpeg

The project is running on a raspberry pi 5 with additional sensors and actuators.

  1. Raspberry Pi + power supply (not included)
  2. Optional: Raspberry Pi cooler
  3. LED
  4. Push button
  5. USB camera + tripod (included)
  6. 7-inch LCD + HDMI - micro HDMI (included) + power supply (Included)
  7. RFID reader
  8. Plywood of 8mm thickness (preferably 45x60 cm)
  9. 470 Ohm resistor
  10. Super strong wood glue
  11. Friction hinges
  12. Jumper wires (10 Female to Female + 2 Female to Male)


  1. Preferable access to lasercutter
  2. basic tools


Estimated total cost for this project is around 200eur.

Get Your Components

To start the project you need to have the components needed for it. Think of how you can save money, borrow old scanners from a friend or neighbour, check second hand shops with already used components or equipment.

Regarding the enclosure, it can be laser cut (what I did), it can be 3D printed or it can be made by hand depending on personal preferences.

Start Assembly

WhatsApp Image 2026-06-16 at 15.13.30.jpeg
WhatsApp Image 2026-06-16 at 15.14.43.jpeg
WhatsApp Image 2026-06-16 at 16.00.29.jpeg

First, you can start with assembling the enclosure itself. My project is built from plywood which was laser cut according to a file attached below. Then I used sandpaper to soften it and clean the smudges from the laser cutter and glued all parts together using super strong wood glue. Don't forget to hold it very tight for at least 10 minutes for it to hold properly and then let it dry for quite some time. In the meantime, you can connect your Raspberry Pi with all the components to try if they work. When the enclosure is completely dry and firm, you can glue the Raspberry Pi, RFID reader, push button and LED to the enclosure walls and floor to keep the project stable and solid. Connect all the necessary cables. You cut the frame for the LCD screen but you have to attach the hinges as well with wood glue.

Code Access

To get this whole application working you have to download and clone this Github repository in VS Code.

https://github.com/howest-mct/2025-26-projectone-ctai-HelesMichal.git

Install Requirements

.venv should be automatically activated. If not, activate it yourself with this command:

source .venv/bin/activate


If .venv is not even created run this command and then the first command again:

python3 -m venv .venv


Now install requirements.txt from the root folder

pip install -r RPi/requirements.txt

Setup

Then do this command in your root folder:

cd RPi/api && docker compose up -d --build

Then navigate do Docs/3_Production.md and follow the instructions there

Electronics

reftrack_wiring_v5.png

This is how the components should be all connected

How It Works

f9570718-04b9-45b7-9290-8dafa6a21c37.png
Screenshot 2026-06-16 141516.png
Screenshot 2026-06-16 141711.png
  1. Once started, the application asks for an access token which can be either entered manually with a little pop-up keyboard or through a badge / id card reading. When the user scans their card, the system is unlocked.
  2. First page a user sees is the Configuration Menu. Here, the user has to set up some values like which two teams are playing, which colour of jersey they have, where and when they play. All this data is saved and pulled from the database which tracks all those teams with their colours and locations etc. Once the game configuration is done, the user can Start Game.
  3. Now the user can find themselves in the main dashboard. First the user has to choose the quarter which one they are tracking at the moment and start the camera, set it up on the court, and the fun begins. Now every time a new referee signal is tracked with the camera, it will appear on the dashboard as a new record. Some of these signals also act as a trigger for something else and not only as a visual representation. For example, signal 'Jump Ball' is a trigger for the jump ball arrow so every time a jump ball is tracked, the jump ball arrow changes sides. The same thing happens with the 'Ball Left' and 'Ball Right' signals. When a misread happens and the camera tracks a signal that did not occur, the user can delete it with a single button. Also the user can add a record manually if needed or clear the whole table when they need to change quarters or just want a clear overview.
  4. At the end the user can press statistics and see the count of each record in each quarter played. When the game is finished the user can press one button and leave the page returning back to the token page.

You Are Ready to Use RefTrack

Good job! Enjoy!