Skip to content

Releases: Artemarius/DocShot

v1.2.6

23 Feb 18:09

Choose a tag to compare

v1.2.6 — Result Screen Persistence + Auto White Balance

Result Screen Persistence

  • Fixed: result screen no longer disappears after sharing to another app
  • Bitmap caching for process death recovery
  • Timestamped share filenames (DocShot_YYYYMMDD_HHmmss.jpg)

Auto White Balance (Gray World)

  • Corrects outdoor blue tint via per-channel mean normalization (~60ms on 12MP)
  • Applied as base correction before other filters (WB + B&W, WB + Contrast, etc.)
  • Sun icon toggle in result screen top bar
  • Settings > Output > "Auto white balance" toggle (default: ON)
  • Save/share now includes WB + filter corrections (what you see is what you save)

Gallery Import UX

  • Imported photos now go directly to corner adjustment (skip unnecessary Accept step)
  • Rotate and Adjust buttons now work on gallery import results

v1.2.5: Low-Contrast Non-White Detection

22 Feb 19:16

Choose a tag to compare

What's New

Two complementary fixes for low-contrast non-white scenes (document on beige tile, gray surface, etc.) where detection previously failed:

Strategy Broadening (WP-C)

  • isLowContrast threshold raised from stddev < 30 to stddev < 40
  • DOG and GRADIENT_MAGNITUDE strategies now available for low-contrast non-white scenes (mean 120-180)
  • Scenes that previously only got 4 standard strategies now get 6 strategies

Edge-Spanning Line Suppression (WP-D)

  • New suppressSpanningLines() removes tile grout, table seams, and counter edges before contour analysis
  • HoughLinesP detection with spansOppositeBorders filter (left↔right or top↔bottom endpoints)
  • Morph close heals junction gaps where suppressed lines crossed document boundary
  • Zero overhead on grout-free scenes (~0.3ms HoughLinesP returns empty)

In-Field Validation (S21)

  • Before: Beige tile surface — detection flaky, manual capture at 0.62 confidence
  • After: Auto-capture at 0.77 confidence via DOG + line suppression (1-10 lines suppressed per frame)
  • Re-detection drift 0.7% between preview and full-res capture

Testing

  • 69/69 instrumented tests pass on S21
  • 23 new test methods + 6 new synthetic generators
  • New test files: StrategyBroadeningTest.kt, LineSuppressionTest.kt
  • Group G regression tests in DetectionRegressionTest.kt

Previous v1.2.5 Changes (included)

  • DIRECTIONAL_GRADIENT strategy with JNI/NDK native acceleration (9.7x speedup)
  • LsdRadonDetector three-tier cascade (LSD + Radon fallback for white-on-white)
  • 5 ultra-low-contrast synthetic generators and benchmark tests

Files Changed

  • Preprocessor.kt — isLowContrast threshold + strategy list broadening
  • EdgeDetector.ktsuppressSpanningLines() + spansOppositeBorders()
  • DocumentDetector.kt — line suppression wired into detection pipeline
  • SyntheticImageFactory.kt — 6 new generators
  • build.gradle.kts — version bump to 1.2.5

Install

AAB attached (signed release bundle, 62MB). Use bundletool to install or upload to Play Console.

v1.2.3: Zero-Shutter-Lag Capture

21 Feb 16:07

Choose a tag to compare

Zero-Shutter-Lag Capture

Eliminates the capture latency mismatch where the captured frame could differ from the frozen preview overlay on slower devices.

Problem

CAPTURE_MODE_MAXIMIZE_QUALITY triggered a new sensor capture after takePicture(), introducing 50-300ms+ HAL latency (device-dependent). During this window, hand movement could cause the JPEG to show a different camera position than the frozen overlay. The Galaxy S21's fast Snapdragon 888 HAL masked this, but slower phones exposed it.

Solution

Switched to CameraX CAPTURE_MODE_ZERO_SHUTTER_LAG, which maintains a 3-frame ring buffer of full-resolution frames and selects the one closest to the shutter trigger timestamp — a past frame matching the preview, not a future frame. Hardware reprocessing (ISP + JPEG encode) produces full-quality output.

Fallback behavior

  • Flash ON: CameraX automatically falls back to MINIMIZE_LATENCY (still faster than the old MAXIMIZE_QUALITY)
  • Unsupported devices: Devices without PRIVATE_REPROCESSING capability automatically fall back to MINIMIZE_LATENCY — no crash, no error

Assets

  • docshot-v1.2.3-release.aab — Signed Android App Bundle (upload to Play Console)

v1.2.2: Manual Capture Path

20 Feb 19:44

Choose a tag to compare

What's New

Manual capture always works — the shutter button now captures even when no document is detected. Instead of showing "No document detected" and blocking, the app routes to the corner adjustment screen with a default rectangle so you can manually place the corners.

Changes

  • No-detection capture: Tap shutter on blank wall/sky/cluttered scene → full-frame capture → manual corner placement with 10%-inset default quad
  • Updated hint: "Tap to capture manually" when no document detected (was "Point at a document")
  • Existing paths unchanged: Auto-capture, low-confidence corner adjustment, and high-confidence direct result all work as before

Technical

  • CaptureProcessor returns CaptureResult with empty corners instead of null
  • CameraViewModel routes empty corners to LowConfidence state with defaultCorners()
  • 3 source files changed, ~25 lines of code
  • All ~151 tests passing

v1.2.1: AR Estimation Fixes & Robustness

20 Feb 19:15

Choose a tag to compare

What's Changed

Fixed aspect ratio estimation to be robust at all document orientations and viewing angles.

Fixes

  • Projective decomposition: Fixed H direction (world→image) and camera intrinsics scaling from sensor to capture frame coords. Added sanity checks (norm ratio, orthogonality)
  • Angular correction: Fixed orientation-dependent over/undershoot by correcting each dimension independently
  • Severity thresholds: Lowered from 15/20° to 5/10° so projective kicks in for most real-world captures
  • Estimation confidence: Separated from format snap confidence — valid custom ratios no longer fall back to A4
  • Format snapping: Removed Business Card & Receipt (too aggressive), tightened snap threshold to 0.035

UI

  • Two-row aspect ratio layout: lock + format label on row 1, full-width slider on row 2
  • Debug ratio display: raw estimation value alongside slider value

Validation

Tested on Galaxy S21: 0.497 for true 0.50 envelope at all orientations (portrait, landscape, angled).

Full Changelog: v1.2.0...v1.2.1

v1.2.0 — KLT Corner Tracking & Aspect Ratio Estimation

20 Feb 13:34

Choose a tag to compare

What's New

KLT Corner Tracking

  • Pyramidal Lucas-Kanade optical flow tracks document corners between frames during stabilization
  • ~65% CPU reduction during the 20-frame auto-capture window (2.1ms median vs ~20ms full detection)
  • Sub-pixel corner consistency enables reliable aspect ratio estimation

Automatic Aspect Ratio Estimation

  • Dual-regime estimation: angular correction for near-frontal views (<15°), projective decomposition for heavy skew (>20°), smooth blending in between
  • Camera intrinsics from LENS_INTRINSIC_CALIBRATION (API 28+) with sensor-size fallback
  • Format snapping to known documents (A4, US Letter, ID Card, Business Card, Receipt, Square)
  • Validated within 2% of true ratio on real documents
  • Settings toggle: Auto (estimated) vs Always A4

Auto-Capture Fixes

  • Fixed KLT confidence regression that prevented auto-capture from firing
  • KLT-tracked frames now carry forward last detection confidence

Performance (S21, Snapdragon 888)

  • KLT-only frames: 2.1ms median, 4.8ms P95
  • KLT + correction detection: 11.8ms median
  • 97.2% of tracked frames under 30ms budget

Tests

  • ~124 unit tests + 27 instrumented (~151 total)
  • Severity classifier, angular correction, format snapping, multi-frame variance reduction coverage

Assets

  • app-release.aab — Signed Android App Bundle (63MB, ~26MB per-device)

v1.1.1

19 Feb 20:42

Choose a tag to compare

Changes

Assets

  • app-release.aab — Signed Android App Bundle (63MB bundle, ~26MB per-device)

v1.1.0

19 Feb 20:07

Choose a tag to compare

What's New

  • Flash persistence across captures: Flash stays on between successive scans — torch turns off during capture to save battery but re-enables automatically on return to camera
  • A4 default aspect ratio: ResultScreen now defaults to A4 (0.707) instead of per-scan auto-detection for consistent output
  • Aspect ratio lock: New lock button on ResultScreen persists your chosen ratio across scans (camera and gallery import). Slider and format dropdown disabled when locked.

Assets

  • app-release.aab — Signed Android App Bundle (63MB bundle, ~26MB per-device via Play Store ABI splitting)

v1.0.0 — Initial Release

19 Feb 19:05

Choose a tag to compare

Full classical CV document scanning pipeline:

  • Real-time document boundary detection with confidence scoring
  • Automatic perspective correction (rectification)
  • Auto-capture with stability detection and AF lock
  • Flash support with torch mode
  • Gallery import with manual corner adjustment
  • Post-processing filters (B&W, contrast, even lighting)
  • Aspect ratio detection (A4, US Letter, ID Card, etc.)
  • Adaptive icon and splash screen
  • Privacy policy and store listing
  • Signed release build (~26MB per device)