This page is being translated by your browser

Translation can break parts of Roboflow. If something stops working, turn translation off and reload the page.

Segmentation · Sports Analytics

Court segmentation: Datasets & Models

Court segmentation uses instance segmentation to identify and outline playing surfaces, like basketball, tennis, and volleyball courts, along with their boundary lines and functional zones in video or image frames. It produces pixel-level masks that map the geometry of the court for downstream sports analytics.

Court segmentation example
1M+
developers
16k
organizations
50B
inferences

Court segmentation

This workflow applies segmentation to a sports court dataset, producing pixel-level masks of playing surfaces such as basketball, tennis, and volleyball courts, along with their boundary lines and functional zones like service boxes, keys, and end zones. It accepts broadcast footage, overhead camera feeds, or sideline video and image frames, mapping court geometry so you can position players and the ball for downstream sports analytics.

Try it out

Powered by general detection model

Run on custom image

Drop an image here or click to upload

Detecting classes:

Why automate court segmentation

Manually annotating court boundaries and zones frame-by-frame is tedious and does not scale across the volume of footage sports analytics teams collect. Automating court segmentation gives you a consistent geometric reference in every frame, which is what makes player position mapping, camera calibration, and event tagging reliable. Once the court is segmented, you can transform pixel coordinates into real-world court positions, normalize plays across different camera angles, and feed clean spatial data into your tracking and stats pipelines. That removes a major bottleneck between raw video and actionable analytics.

Key benefits

Pixel-accurate masks give you far more usable spatial context than boxes alone, enabling homography and true court-relative positioning. The workflow runs on the cameras and footage you already have, broadcast feeds, fixed venue cameras, or mobile captures, so there is no new hardware requirement. Because it is trained on a labeled sports court dataset, the model scales across venues, court types, and lighting conditions as you add data.

How to use it

  1. Upload an image: Drop any photo into the widget above to try court segmentation for free, right on this page.
  2. Preview instant results: The model detects basketball court, tennis court, boundary line, free throw key, service box within seconds and returns an annotated image with structured predictions, so you can immediately see how well it works. Adjust the detection classes and re-run until the results fit your scenario.
  3. Like what you see?: With a free Roboflow account, you can deploy this workflow with the Serverless Cloud API, customize it in your workspace, or train RF-DETR (instance segmentation) on your own images for production accuracy.
  4. Get started for free: No code or training data required to begin: upload, review the results, and make it part of your stack in a single click.
Recommended model

Recommended model for court segmentation

RF-DETR is state of the art for real-time object detection, instance segmentation, and keypoint detection, with higher accuracy and lower latency than comparable models, and it's Apache 2.0 licensed. When you're ready to build a production model for court segmentation, fine-tune it on your own labeled images, then deploy to a Serverless Cloud API endpoint.

Train your own model
Roboflow Agent

Not sure where to start?

Describe your Court Segmentation project to Roboflow Agent.

Agent