The core calibration was broken because the green quad corners didn't
correspond to the correct court corners (giving Z=15m camera positions).
New approach:
1. Detect white line segments on green court surface
2. Merge into distinct lines, find intersections
3. Match intersections to known court template using initial
homography from green quad (tries both left-right mirror mappings)
4. solvePnP with matched 2D-3D correspondences
5. Sanity check: camera Z must be 0-5m, prefers ~1m height
6. Fallback to quad-only calibration with both mappings if
not enough intersections detected
Also: CameraCalibrator now uses findHomography for N>4 points,
and get_half_court_intersections() provides the 6 template keypoints.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Detect green court surface via HSV color thresholding
- Find court boundary as quadrilateral (contour approximation)
- Detect white line segments within the green area only
- Debug image: green overlay + court quad + white lines + camera XYZ
- Much more robust than angle-based line classification
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Debug images clickable — opens fullscreen overlay (click to close)
- After calibration, detected court lines highlighted on 3D scene
(blue for CAM0, pink for CAM1)
- Return matched_lines_3d from calibration (baseline, kitchen, sidelines, service)
- Show line names in calibration results
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Detect white lines via color threshold + Canny + Hough
- Group/merge nearby parallel segments into court lines
- Classify as 'across' (baseline, kitchen) and 'along' (sidelines, service)
- Match detected lines to known court geometry for solvePnP
- Debug image shows: raw segments (gray), merged across (yellow), along (magenta)
- Show line counts + matched points in calibration UI
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Split view: 3D scene on left, camera debug images + controls on right
- Debug images show detected court quad + computed camera XYZ
- Camera positions displayed as colored cones with look-direction lines on 3D scene
- Cameras cleared and redrawn on re-calibration (no duplicates)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Debug image shows only court quadrilateral + camera XYZ coords
- Remove all Hough line debug visualization noise
- Simplify _detect_court_corners — returns corners + error only
- Display camera positions in calibration card (CAM0/CAM1 X Y Z)
- Clean up auto_calibrate flow
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove try-except in CameraCalibrator — errors propagate to UI
- Remove auto-load of saved calibrations — always start uncalibrated
- Remove hardcoded "Base Setup" card with fake values
- Remove addStereocameras/getCamParams dead code
- Draw all detected Hough lines + corners on debug frame during calibration
- Show debug images in calibration tab after attempt
- Show error messages in UI instead of swallowing them
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove fallback corner estimation (_estimate_corners_from_net)
- Gate YOLO detection behind calibration check in detection_loop
- Add calibration overlay UI with prominent Calibrate button
- Disable Court/Trajectory tabs until system_ready
- Skip trajectory/VAR/event polling when uncalibrated
- Add system_ready flag to calibration status API
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Bottom bar fixed height, all items aligned
- Cam card and VAR card compact vertical, fit within bar
- Trajectory same layout as court
- VAR snapshot removed from bottom bar (too large)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Cam card vertical with Base Setup title and sensor info
- Calibrate button inside the card
- Tabs linked to URL hash (#detection, #court, #trajectory)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Position Y, Height, Stereo gap, Rotation angle, HFOV — all adjustable
in real time, 3D scene updates on change.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Blue = cam0 only, Pink = cam1 only, Purple = overlap
- Grid-based fill, no dashed lines or edge artifacts
- White court lines on top
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Camera FOV coverage fills court with visible color (opacity 0.4)
- All court lines now white (no more red/grey)
- Lines raised above coverage so they stay visible
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- FOV clipped to court boundaries (0,0)-(13.4,6.1)
- Colored overlay shows which court areas each camera covers
- Dashed center line shows each camera's look direction
- cam0 (blue) -28° from +Y, cam1 (pink) +28° from +Y
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Court and Trajectory tabs: 3D viewport full screen, cameras small
at bottom center as horizontal thumbnails
- Fix net orientation (was perpendicular, now spans court width)
- Default camera: center line, 1m from net, 1m height
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cameras now display as a horizontal panorama (cam1 left, cam0 right)
on Detection, Court, and Trajectory tabs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- src/calibration: 3D camera calibration (solvePnP, homography)
- src/physics: trajectory model with gravity/drag, close call event detector
- src/streaming: camera reader + ring buffer for VAR clips
- src/web: Flask app with 3-tab UI (Detection, Court, Trajectory) + Three.js
- jetson/main.py: unified entry point wiring all components
Court tab: one-click calibration button, 3D scene with camera positions
Trajectory tab: accumulated ball path, VAR panel with snapshot + timer
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GStreamer hardware ISP capture, YOLOv8n CUDA inference,
JPEG snapshot-based web UI for both cameras simultaneously.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>