Releases: Artemarius/DocShot
v1.2.6
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
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)
isLowContrastthreshold raised fromstddev < 30tostddev < 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
spansOppositeBordersfilter (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_GRADIENTstrategy with JNI/NDK native acceleration (9.7x speedup)LsdRadonDetectorthree-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 broadeningEdgeDetector.kt—suppressSpanningLines()+spansOppositeBorders()DocumentDetector.kt— line suppression wired into detection pipelineSyntheticImageFactory.kt— 6 new generatorsbuild.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
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 oldMAXIMIZE_QUALITY) - Unsupported devices: Devices without
PRIVATE_REPROCESSINGcapability automatically fall back toMINIMIZE_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
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
CaptureProcessorreturnsCaptureResultwith empty corners instead ofnullCameraViewModelroutes empty corners toLowConfidencestate withdefaultCorners()- 3 source files changed, ~25 lines of code
- All ~151 tests passing
v1.2.1: AR Estimation Fixes & Robustness
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
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
Changes
- compileSdk/targetSdk bumped to 36 (Android 16)
- versionCode set to 1000003 for Play Store ABI split compatibility
- Privacy policy published at https://artemarius.github.io/privacy-policy-docshot.html
Assets
app-release.aab— Signed Android App Bundle (63MB bundle, ~26MB per-device)
v1.1.0
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
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)