All work04 / 07
Fédération Française de TennisEfrei Research LabParis, France
2024

WhereSports field registration

CourtAlign

PublishedAIAI 2024

Geometry from a single broadcast frame.

Registers each broadcast frame to a metric court model, and declines frames that show no usable court.

  • 0.87 pxmean reprojection error on tennis, best of all compared methods
  • 0false registrations on frames with no usable court: CourtAlign abstains instead, in tennis and badminton
  • 8.62Mtrainable parameters, the smallest budget compared (PnLCalib: 131.90M)

Overview

The problem

Quantitative analysis of broadcast sport happens in court coordinates, not in pixels, so every frame has to be mapped to the court through a homography. In racket-sport broadcasts that mapping rests on thin painted lines that players occlude, that are brushed over on clay, compressed by perspective, or absent altogether in replays, close-ups and crowd shots. A method that always returns a homography will project a court onto those frames too.

What was missing

Sports-field registration has been studied mainly on soccer and basketball. Across line-fitting, keypoint and segmentation approaches, the intermediate representation and the geometric estimate are optimised against different objectives, so a representation can score well on its own metric while still inducing an unstable court-to-image mapping. No public racket-sport dataset supplied court-zone masks, per-frame homographies and frames without a court.

Architecture

COURTALIGN-E2E · END-TO-END, TRAINED IN REGISTRATION SPACECOURTALIGN-2S · TWO-STAGE, SEGMENTATION THEN GEOMETRYINPUTBroadcast framesingle camera,tennis or badmintonFROZENSAM 3 imageencoderViT backbone, frozenLEARNEDFPN neckfine-tuned ·7.80M paramsHEADKeypoint heatmapssoft-argmax · 14 / 30landmarksHEADVisibility πₖper-landmark confidenceHEADCourt-zone maskauxiliary segmentationPROCESSINGWeighted DLTdifferentiable,confidence-weightedPROCESSINGValidity gatecourt area ·keypoint spread ·mean πₖOUTPUTHomographycourt → imageABSTAINNo courtframerejectedreprojection and template losses flow back through the solverMODELMetric courttemplateLEARNEDDeepLabV3+ResNet-34 encoder ·ASPPPROCESSINGCourt-zone masksfull court (tennis) ·13 zones (badminton)PROCESSINGContours →cornersconvex hull ·four-side fittingPROCESSINGDLT / RANSAC4-point (tennis) ·RANSAC + LM(badminton)PROCESSINGValidity checkshull area · fourcorners ·invertible HOUTPUTHomographycourt → imageABSTAINNo courtframerejectedThree-phase class-focused Dice: all zones → far back-singles zones only → all zones,so the perspective-compressed far badminton zones are recovered.

Swipe to see the whole diagram →

CourtAlign-E2E (top) learns keypoints, visibility and court zones on a frozen SAM 3 encoder and solves the homography inside the network. CourtAlign-2S (bottom) segments court zones and recovers the homography from fitted corners.
Technical details
  • CourtAlign-E2E: frozen SAM 3 ViT encoder; fine-tuned FPN neck (7.80M) and convolutional heads (0.82M) predict 14 (tennis) or 30 (badminton) line-axis landmarks, their visibility and the court zones.
  • The homography comes from a confidence-weighted, Hartley-normalised DLT with a differentiable SVD backward pass, which replaces RANSAC and Levenberg–Marquardt refinement.
  • Objective: Dice segmentation + heatmap cross-entropy + visibility BCE + Huber coordinate term + Huber reprojection in pixels (δ = 1 px) + template consistency. Geometric terms warm up only once the keypoints are non-degenerate.
  • Validity: a frame is accepted only if the predicted court covers ≥ 0.02 of the frame, the keypoints spread ≥ 0.05 of the image diagonal and mean visibility ≥ 0.5. The thresholds are fixed before training and identical for both sports.
  • CourtAlign-2S: DeepLabV3+ with a ResNet-34 encoder (22.44M); per-zone convex hulls and four-side fitting give corner correspondences; exact four-point DLT for tennis, RANSAC (8 px) + normalised DLT + Levenberg–Marquardt for badminton.
  • Multi-seed evaluation: IoU, projection error (m), reprojection error (px), PCK-H at 5 px, Line-IoU at 0, 3 and 5 px, and false registrations on non-registrable frames (NC-FP).

What I built

  1. 01

    A registration framework for racket sports

    Two variants that place the geometric objective at different points of the pipeline: segmentation then geometry (2S), and keypoints trained directly in registration space (E2E).

  2. 02

    Three-phase class-focused training

    Isolates the far-side badminton zones that perspective compresses, recovers them and restores the correspondences they contribute.

  3. 03

    A differentiable homography solver

    A confidence-weighted DLT lets reprojection and template losses reach the visual representation; supervision in image pixels gave the strongest precision.

  4. 04

    Learned visibility and an explicit validity test

    The model decides whether a frame shows a court before reporting any homography.

  5. 05

    A racket-sport registration benchmark

    Court-zone masks, per-frame homographies, line masks and non-registrable frames for tennis and badminton broadcasts.

Main results

0.87 pxmean reprojection error on tennis (E2E), lowest of all methodsPnLCalib 2.20 px
97.33%PCK-H at 5 px on tennis (E2E)PnLCalib 89.39%
0.02 mmean projection error on the court, tennis (E2E)PnLCalib 0.05 m
99.68%registered-court IoU on tennis (2S), highest of all methodsNo-Bells-Just-Whistles 98.99%
0false registrations on frames with no usable court, both variants, tennis and badmintonthe only methods at zero in both sports
8.62Mtrainable parameters for the most precise modelPnLCalib 131.90M
Tennis
MethodIoU (%) ↑Proj. (m) ↓Reproj. (px) ↓PCK-H @5 px (%) ↑Line-IoU (%) ↑NC-FP ↓
@0@3@5
KpSFR96.43±0.310.11±0.013.71±0.3348.65±5.327.34±0.6742.85±2.8257.18±2.580/20
No-Bells-Just-Whistles98.99±0.110.06±0.002.51±0.1584.70±0.9611.56±0.5257.71±0.6369.45±0.5518.5/20
KaliCalib95.53±0.220.08±0.013.60±1.3356.20±7.209.94±0.7248.08±2.6061.95±2.7820/20
TVCalib98.11±0.310.11±0.004.61±0.3652.09±2.667.36±0.2247.06±0.7060.90±1.050/20
PnLCalib98.93±0.150.05±0.002.20±0.3289.39±8.2213.78±2.0361.52±1.6872.40±1.352/20
CourtAlign-2S (Ours)99.68±0.050.05±0.002.20±0.2983.41±1.1213.72±0.5460.44±0.7871.41±0.580/20
CourtAlign-E2E (Ours)99.60±0.080.02±0.010.87±0.1297.33±0.7318.54±0.1765.07±0.1575.11±0.110/20
Badminton
MethodIoU (%) ↑Proj. (m) ↓Reproj. (px) ↓PCK-H @5 px (%) ↑Line-IoU (%) ↑NC-FP ↓
@0@3@5
KpSFR99.27±0.200.03±0.001.67±0.0897.95±0.6612.51±0.5355.93±0.6567.25±0.510.75/20
No-Bells-Just-Whistles99.33±0.120.05±0.002.90±0.1797.19±1.2011.13±0.6353.26±0.7265.12±0.570/20
KaliCalib97.53±0.250.10±0.036.18±2.1965.00±9.487.91±0.8945.43±3.1157.70±3.0020/20
TVCalib98.70±0.360.15±0.019.06±0.4719.76±3.885.64±0.3832.27±1.5245.40±1.125.25/20
PnLCalib99.06±0.420.06±0.023.22±0.7390.97±10.4311.37±1.1652.60±3.3164.42±2.934.00/20
CourtAlign-2S (Ours)99.45±0.190.05±0.012.28±0.3697.27±2.2511.85±0.8554.79±1.3266.29±1.050/20
CourtAlign-E2E (Ours)99.47±0.010.03±0.001.69±0.0594.86±0.6913.20±0.1656.84±0.1267.97±0.090/20

Why soccer: to test whether the end-to-end formulation still holds on a much larger field, usually seen only in part, after SoccerNet pre-training and WC14 fine-tuning.

Cross-sport transfer on WC14 soccer
MethodProj. (m) ↓Reproj. ↓
MeanMedianMeanMedian
Nie et al.0.840.650.0190.014
KpSFR0.810.630.0190.014
No-Bells-Just-Whistles*1.230.580.0260.014
PnLCalib*†0.600.420.0140.010
CourtAlign-E2E (Ours)*†0.830.460.0200.012
CourtAlign-E2E w/ Rob-Solv (Ours)*†0.780.480.0200.013

* SoccerNet pre-training · † WC14 fine-tuning · reprojection in normalised image coordinates

Qualitative results

Demo

CourtAlign-E2E run on every frame of a Roland-Garros 2022 broadcast, each frame on its own: the court is registered on main-camera views, while close-ups and crowd shots are rejected. These frames have no ground truth, so the alignment is shown, not scored.

Limits and next steps

CourtAlign estimates a planar homography without recovering physical camera parameters or lens distortion. Evaluation is frame by frame, so continuity across adjacent frames is not yet used, and the set of non-registrable frames should grow with more independent matches.

Beyond this project

Camera-to-world geometry for any planar scene: field and venue calibration, metric tracking, broadcast graphics and augmented reality. After SoccerNet pre-training and WC14 fine-tuning, CourtAlign-E2E is competitive with soccer-specific methods.

Research output

Paper

A Deep Learning-Based Framework for Racket Sports Court Registration

Ahmed Jouini, Melek Elloumi, Faten Chaieb

AIAI 2024, IFIP AICT vol. 713, Springer, pp. 17–29

Peer-reviewed core idea (CourtAlign-2S). CourtAlign-E2E and the final results are thesis work.

Code

Madou10-lab/CourtAlign

GitHub

Dataset

Court-registration annotations

Badminton frames, masks and homographies; tennis masks and homographies (no broadcast imagery). Research use.

Dataset

Contact

Interested in the work?

I'm looking for AI research engineer roles in computer vision and video understanding, ideally in sports analytics, though not only. Ready to start a new journey.

Paris, France

jouiniahmed66@gmail.com Email me