Transparent Optical Math — Zero Black-Box Guessing
Unlike opaque cloud apps that reject photos without explaining why, PhotoCull Darkroom displays the exact deterministic numbers behind every Keep and Reject badge.
1. Center-Weighted 3×3 Discrete Laplacian Variance (Sharpness)
Every frame is decoded onto a deterministic 320 px wide luminance buffer (Y = 0.299R + 0.587G + 0.114B). Across the center 84% of the frame (ignoring extreme vignetted corners), we convolve the 8-neighbor discrete Laplacian kernel:
[-1, -1, -1; -1, +8, -1; -1, -1, -1]
Sharp edges produce large positive and negative second-derivative responses, driving up statistical variance (lapVar). Blurry or motion-smeared frames smooth out those high-frequency transitions, collapsing variance toward zero. We log-normalize lapVar onto an intuitive 0–100 scale.
2. Highlight & Shadow Clipping Guard (Exposure)
We measure three exposure signals across all pixels:
- Mean Luminance (
meanLum,0–255): Flags globally blown frames (> 205) or severely underexposed frames (< 52). - Blown Highlights (
hiPct): Percentage of pixels with luminance>= 246(pure white data loss). - Crushed Shadows (
loPct): Percentage of pixels with luminance<= 10(blocked black noise floor).
3. Luminance RMS Contrast (0–100)
Standard deviation of pixel luminance (stdLum) normalized against 72 measures tonal separation. Frames washed out by direct lens flare or accidental pocket triggers score under 30 and receive a Flat Contrast flag.
4. Composite Score Formula
Composite = round(0.54 × Sharpness + 0.30 × Exposure + 0.16 × Contrast)
This weighting prioritizes optical focus first (since exposure can be rescued in post, whereas true focus misses cannot), exposure integrity second, and micro-contrast third.