A Windows desktop prototype for camera-assisted dart scoring. DartVision reads an RTSP camera feed, calibrates a dartboard, detects marked darts, and provides a single-player 301/501 interface with manual corrections.
The internal Python package is named autodarts.
- RTSP preview with automatic reconnection and full-resolution PNG captures.
- Board calibration, perspective preview, and bounded correction for small board movements.
- Night-mode detection of bright tape bands and supported dart shafts/flights.
- Persistent throw slots, 301/501 straight-in/double-out scoring, and individual manual corrections.
- Guided contact-label collection, local game reports, and offline tests.
- Windows and Python 3.11 (64-bit); other platforms have not been verified.
- An RTSP-capable camera on the same network. Development used a Tapo TC71.
- A fixed camera view, stable board lighting, and a board with 20 at the top.
- For the Night detector: a monochrome feed and darts with visible bright tape markers.
This is an experimental project. The detector and contact correction were developed for a particular camera, lighting, and dart setup. Automatic scoring needs a compatible empirical contact profile; basic setup provides preview, detection, and manual scoring. Personal reference images and trained profiles are deliberately excluded from this repository. Independent physical scoring accuracy has not been established.
Copy the HTTPS clone URL from this repository's Code button, replace REPOSITORY_URL below, and run in PowerShell from the folder where you want the project:
git clone 'REPOSITORY_URL' DartVision
Set-Location DartVision
py -3.11 -m venv .venv
& '.\.venv\Scripts\python.exe' -m pip install -r requirements.txt
Copy-Item '.env.example' '.env'
notepad '.env'Fill in your camera's IP and local camera account username/password. For Tapo, these are the RTSP camera-account credentials, not the cloud login. Only copy the example when creating a new .env; preserve an existing configuration.
Test the camera before creating calibration files:
& '.\.venv\Scripts\python.exe' '.\camera_test.py'Press S to save a clean screenshot, R to select a board crop, and Q to exit. See the setup guide for the required empty reference, board calibration, detector configuration, scoring controls, and troubleshooting. A fresh clone does not include ready-made camera calibration.
# Camera and detector preview
& '.\.venv\Scripts\python.exe' '.\main.py' --detect-darts
# Scoring window
& '.\.venv\Scripts\python.exe' '.\play_darts.py'Start-DartVision.cmd opens the diagnostic preview. Start-Scoring.cmd opens the scoring app, preferring a locally built EXE when present. In the scoring window, choose 301/501, press Play, and wait for Ready — throw. Use the number grid to enter or correct uncertain scores. Remove darts between visits.
& '.\.venv\Scripts\python.exe' -m unittest discover -s tests -v
& '.\.venv\Scripts\python.exe' -m pip check
# Optional Windows executable
& '.\.venv\Scripts\python.exe' -m pip install -r requirements-build.txt
.\Build-DartVision.cmdSynthetic tests run without a camera or credentials. Tests using private recorded images skip when those fixtures are absent. The EXE reads .env, calibration/, and detection/ beside itself; it does not include those files. Keep it in your configured project folder.
| Path | Purpose |
|---|---|
autodarts/ |
Camera, calibration, detection, contact estimation, scoring, UI |
camera_test.py, main.py |
Camera test and diagnostic preview |
calibrate_board.py |
Board landmark editor |
collect_calibration.py, calibrate_tips.py |
Contact-label collection |
detect_darts.py |
Offline before/after image analysis |
play_darts.py |
Scoring app entry point |
examples/ |
Placeholder detector configuration |
tests/ |
Synthetic checks and optional private-fixture regressions |
docs/SETUP.md |
Setup, operating instructions, and limitations |
.gitignore excludes .env and other secret files, camera captures, recordings, game reports, logs, temporary/build files, local calibration and contact profiles, executables, and personal project notes. .env.example and examples/ contain placeholders only. Camera URLs are constructed at runtime; the normal application logs omit credentials.
The app saves full-resolution camera images and reports locally. Review anything you explicitly share, and avoid force-adding ignored files to Git.
Built by Marton Vegh. Read the project case study.