Technik & Qualität
Für alle, die wissen möchten, wie TT-Motion arbeitet und wie wir Qualität sichern.
So erkennt TT-Motion einen Ballwechsel
- Tisch finden: Drei Bilder aus dem Video; Farbe, Form und stabile Lage der Tischplatte bestimmen den Bereich, in dem der Ball fliegt.
- Ballkandidaten: 30 Bilder pro Sekunde werden nach kleinen hellen oder orangen Punkten durchsucht, die sich bewegen und von der Umgebung abheben.
- Flugbahnen: Kandidaten werden zu schnellen, gerichteten Flügen verbunden; ein Rückschlag beendet einen Flug.
- Ballwechsel bestätigen: Mehrere Flüge mit Richtungswechseln und kurzen Pausen ergeben einen Ballwechsel. Reine Bewegung reicht nie.
- Schneiden: Aufschlag suchen, Ende vervollständigen, Clip mit Vor- und Nachlauf aus dem Original exportieren (H.264, Originalton).
Für Aufnahmen von hinter dem Tisch (Im Test) gibt es eine eigene Kandidatensuche: Ein zeitlicher Hintergrund trennt den Ball von Tisch und Banden, große bewegte Flächen (Spieler) werden ausgeblendet, und die Flugbahnen werden entlang der Bildhöhe ausgewertet.
Wie wir die Erkennung messen
Gemessen wird an kompletten, ungeschnittenen Spielen. Die Referenz liefert die Spielstand-Einblendung des Streams: Ein Werkzeug liest Satz- und Punktestand Bild für Bild und erkennt jeden Punktwechsel – auch Satzgewinne und Schiedsrichter-Korrekturen. Ein erkannter Ballwechsel gilt als Treffer, wenn er kurz vor einem Punktwechsel endet oder höchstens 3 s danach – bei zügig aufeinanderfolgenden Punkten prellt der nächste Aufschläger dann oft schon den Ball, bevor die Einblendung umspringt. Streng gewertet (höchstens 1 s danach) nennen wir die Zahlen ebenfalls.
- Trefferquote – Anteil der tatsächlichen Ballwechsel, die gefunden werden.
- Fehlclips – Anteil der Clips ohne gültigen Ballwechsel.
- Testbedingungen: Turnier-Stream, 1080p, 30 fps, eine Halle, Kamera erhöht hinter dem Tisch. Andere Hallen, Licht und Kameras können abweichen.
Softwarequalität
- Über 400 automatisierte Tests prüfen Erkennung, Export, Weboberfläche, Desktop-Oberfläche und Fehlerfälle.
- Testabdeckung des Programmcodes: 99,5 % (Ziel war 90 % Zeilen / 85 % Verzweigungen). Das ist ein Maß für die Prüfung des Codes, nicht für die Erkennungsgenauigkeit.
- Jede Änderung durchläuft automatisch Codeprüfung (ruff) und alle Tests (GitHub Actions).
Technischer Aufbau
- Sprache
- Python 3.12 (im Paket enthalten)
- Verteilung
- Paket für Windows und Linux (PyInstaller) mit FFmpeg 8.1, automatisch gebaut
- Bildanalyse
- NumPy 2, Pillow – kein trainiertes KI-Modell nötig
- Video
- FFmpeg · NVDEC/NVENC (optional) · libx264
- Oberflächen
- Web (lokal im Browser) · Desktop · Kommandozeile
- Sicherheit
- Nur 127.0.0.1, Sitzungs-Token für Änderungen, Prüfung von Host-Header und Dateipfaden
- Lizenz
- Online-Aktivierung mit Ed25519-signierten Freigaben; ohne Internet 14 Tage weiter nutzbar
Optional: Zugriff vom Handy über Tailscale
Wer Videos vom Smartphone hochladen möchte, kann die lokale Weboberfläche in einem privaten Tailscale-Netz freigeben (tailscale serve --bg --https=443 http://127.0.0.1:8765) und den Gerätenamen in tailnet_access.json eintragen. Die Videos gehen verschlüsselt direkt auf den eigenen PC; es gibt keinen Server dazwischen.
Ausführliche Roadmap
- Erledigt Fundament: Code-Review, 13 Fehler behoben, Testabdeckung 99,5 %, automatische Tests, getrennte Warteschlangen und Aufräumen alter Aufträge, neues Design.
- In Arbeit Jede Perspektive: Referenz aus Spielstand-Einblendung für 9 Turnierspiele (606 Punkte); Perspektive und Tisch werden automatisch erkannt; TV-Perspektive an 9 Spielen (606 Punkte) 86 % Trefferquote, 9 % Fehlclips, 98 % echte Ballwechsel unter den 5 bzw. 10 längsten Clips (streng gewertet 82 % / 14 %). Als Nächstes: genauere Clip-Enden an Schnitten im Video, Aufschlagsuche für alle Perspektiven, optionale KI-Ballerkennung.
- Erledigt Version 1.0: Installationspaket für Windows und Linux mit allem Nötigen, Testversion (5 Videos) und Vollversion per Lizenzschlüssel für 2 Geräte.
- Prototyp Analyse im Browser: WebCodecs und Python im Browser (Pyodide), ohne Installation und ohne Upload. An 3 ganzen Spielen so genau wie das Programm (90 % der Punkte gefunden) und nur etwa 15 % langsamer.
- Geplant Online-Portal: Upload im Browser, eigener Verarbeitungsserver in Deutschland (getrennt von dieser Website), Konten, Freigabelinks, automatische Löschung.
- Vision Spielanalyse: Statistiken, Spielstand aus dem Video, Highlight-Reels, Trainer-Ansicht.
Technology & quality
For anyone who wants to know how TT-Motion works and how we ensure quality.
How TT-Motion detects a rally
- Find the table: three frames from the video; colour, shape and a stable position of the table top define the area in which the ball flies.
- Ball candidates: 30 frames per second are searched for small bright or orange spots that move and stand out from their surroundings.
- Trajectories: candidates are linked into fast, directed flights; a return stroke ends a flight.
- Confirm rallies: several flights with direction changes and short pauses make a rally. Plain motion is never enough.
- Cut: find the serve, complete the ending, export the clip with lead-in and lead-out from the original (H.264, original sound).
Footage from behind the table (In testing) uses its own candidate search: a temporal background separates the ball from table and barriers, large moving areas (players) are masked, and trajectories are measured along the image height.
How we measure detection
We measure on complete, uncut matches. The reference comes from the stream's scoreboard overlay: a tool reads set and point scores frame by frame and detects every point – including set wins and umpire corrections. A detected rally counts as a hit if it ends shortly before a score change or at most 3 s after it – when points follow quickly, the next server is often already bouncing the ball before the overlay updates. We also report strict numbers (at most 1 s after).
- Hit rate – share of actual rallies that are found.
- False clips – share of clips without a valid rally.
- Test conditions: tournament stream, 1080p, 30 fps, one hall, camera elevated behind the table. Other halls, lighting and cameras may differ.
Software quality
- More than 400 automated tests cover detection, export, web interface, desktop interface and error cases.
- Code coverage: 99.5 % (target was 90 % lines / 85 % branches). This measures how thoroughly the code is tested, not detection accuracy.
- Every change automatically runs linting (ruff) and all tests (GitHub Actions).
Technical setup
- Language
- Python 3.12 (included in the package)
- Distribution
- Package for Windows and Linux (PyInstaller) with FFmpeg 8.1, built automatically
- Image analysis
- NumPy 2, Pillow – no trained AI model required
- Video
- FFmpeg · NVDEC/NVENC (optional) · libx264
- Interfaces
- Web (local browser) · desktop · command line
- Security
- 127.0.0.1 only, session token for changes, host header and file path checks
- Licence
- Online activation with Ed25519-signed grants; keeps working offline for 14 days
Optional: access from your phone via Tailscale
To upload videos from a smartphone, share the local web interface in a private Tailscale network (tailscale serve --bg --https=443 http://127.0.0.1:8765) and enter the device name in tailnet_access.json. Videos travel encrypted directly to your own PC; there is no server in between.
Detailed roadmap
- Done Foundation: code review, 13 bugs fixed, 99.5 % code coverage, automated tests, separate queues and clean-up of old jobs, new design.
- In progress Every camera angle: scoreboard reference for 9 tournament matches (606 points); camera angle and table detected automatically; tournament angle on 9 matches (606 points) 86 % hit rate, 9 % false clips, 98 % real rallies among the 5 or 10 longest clips (strict scoring 82 % / 14 %). Next: more precise clip ends at cuts in the video, serve search for all angles, optional AI ball detection.
- Done Version 1.0: installation package for Windows and Linux with everything included, trial version (5 videos) and full version with a licence key for 2 devices.
- Prototype Analysis in the browser: WebCodecs and Python in the browser (Pyodide), no installation and no upload. On 3 complete matches as accurate as the program (90 % of points found) and only about 15 % slower.
- Planned Online portal: browser upload, dedicated processing server in Germany (separate from this website), accounts, share links, automatic deletion.
- Vision Match analysis: statistics, score from the video, highlight reels, coach view.