deckhearth/.convoys/improve-scan-card-detection/brief-1-detect-warp-lib.md
varutasu c52891a6b2
feat(scanner): perspective warp card detection (Phase 2) (#158)
Add quad corner refinement and homography warp for rectified identify
crops; wire warped capture through identifyTrackedCardCapture with
validation and axis-aligned fallback; add detection frame a11y labels.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-14 20:31:45 -05:00

786 B

convoy brief_number depends_on recommended_model model_tier files
improve-scan-card-detection 1
composer-2.5-fast fast
lib/scanner-card-warp.js
lib/scanner-card-detection.js
test/lib/scanner-card-warp.test.js
test/lib/scanner-card-detection.test.js

Brief 1: Quad corner detection + perspective warp

Goal

Replace axis-only Sobel box hunt with four-corner refinement and a homography warp helper that produces rectified card JPEGs.

Acceptance criteria

  • lib/scanner-card-warp.js exports orderQuadCorners, computeHomography, warpCardCaptureFromVideo
  • detectCardShapesFromFrame returns corners in video space
  • Tracker merge preserves corners on tracked cards
  • Unit tests for warp math + corner refinement