Fix clipped receipt margins, add time-of-day naming, speed up rotation detection

- vision/document.py: pad_quad() expands the detected quad outward
  before warping so a straight-line contour fit doesn't clip the first
  character of every line on a slightly curled/wrinkled receipt
- ocr/extract.py + llm/vision.py: extract transaction time (HH:MM) so
  same-day repeat visits to a vendor get distinct filenames
  (2023-03-20_1525_walmart.pdf vs. a later same-day trip)
- vision/orient.py: downscale before Tesseract OSD/confidence-sweep
  rotation detection — this was the dominant cost in the detection
  phase (7x speedup: 472s -> 67s on a 36s test video)
This commit is contained in:
2026-07-08 18:55:37 -04:00
parent a43ab20df6
commit 5be9d5935d
11 changed files with 160 additions and 12 deletions
+5
View File
@@ -47,6 +47,11 @@ document:
enhance: false
# Auto-detect and correct 0/90/180/270 rotation before OCR/PDF export.
auto_rotate: true
# Expand the detected quad outward by this fraction before warping, to
# recover paper margins clipped by curl/wrinkles (straight-line quad vs.
# a slightly bowed real edge). refine.tighten below trims any extra
# mat/background this pulls in back off.
pad_margin: 0.04
# Tighten crops to the actual paper region (cuts mat margins/hands) and
# inpaint fingers pressing on the page.
refine: true