-
Notifications
You must be signed in to change notification settings - Fork 6
Open
sunnypatneedi/familiar
#1Description
Problem
Every screen still is written to disk and enqueued for OCR even when the screen hasn't changed — wasting disk I/O, storage, and OCR quota on identical frames.
Solution
Implement perceptual dHash (difference hash) to compare each new frame against the last saved frame. Frames that are visually identical (Hamming distance below threshold) are skipped before any file write.
Algorithm
- Resize thumbnail to 9×8 using Electron's NativeImage API (no extra deps)
- Compare each pixel's grayscale to its right neighbour → 64-bit BigInt
- Hamming distance: 0 = identical, 10+ = meaningful change
- Threshold is configurable via
deduplication.thresholdin settings
Acceptance criteria
-
frame-hash.jsexportscomputeDHash,hammingDistance,isSimilarFrame - Recorder skips duplicate frames without writing to disk
- Hash is reset on session stop
- Tests pass
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels