Photo Quality Measures: Sharpness, Noise and Exposure Explained
Every facial measurement is read from pixels, so the quality of the pixels sets the ceiling. Selfbaus checks three of them before it trusts a geometry reading. These are checks on the photo, not on your face.
Sharpness
A sharp image has strong edges. The Laplacian is a filter that responds to rapid brightness change, and the variance of its output is high when edges are crisp and low when everything is soft. Selfbaus converts the face region (or the whole frame when no complete face box exists) to grayscale, resizes it bilinearly to a 256 px long edge, applies a four-neighbour Laplacian and takes the variance. A photo below 8 fails the frame check. That threshold is our heuristic and is unvalidated.
Literature context is narrower than the idea. Pech-Pacheco and colleagues (2000) compared autofocus measures for microscopy, including a modified Laplacian, and report it as reliable for diatom slides. That is a different setting and a different formula, so we cite it as background, not as validation of our threshold on selfies.
Where it fails: smooth skin and soft light have fewer edges even when in focus; heavy noise adds false edges; motion blur and focus blur look alike.
Noise
Immerkær (1996) describes a fast method for estimating the variance of additive, zero-mean Gaussian noise with one 3 x 3 mask, about 14 integer operations per pixel. Selfbaus applies that mask to the grayscale face region (reduced to at most 1024 px on the long edge), takes the mean absolute response and scales it by sqrt(pi/2)/6 to get sigma on a 0-255 scale. Immerkær notes the estimator treats thin lines as noise in highly textured regions, so hair, fabric and skin texture can inflate it. Real phone noise is not purely Gaussian, so this is a proxy.
Exposure, contrast and clipping
Mean luminance (0 to 1) is the average of the grayscale histogram. A photo fails below 0.12 or above 0.92, or when more than 70 percent of pixels are clipped. Shadow clipping counts gray levels 0 to 5 out of 255, highlight clipping counts 250 to 255. Contrast is read as the histogram's RMS spread and the 5th-to-95th percentile gap. All thresholds are our design choices. Color balance is reported as not measurable, because judging skin color needs a neutral reference that a selfie rarely has.
What this does not tell you
These checks say how usable the photo is. They do not rate your face, and a high photo-quality number does not mean a higher attractiveness. Research on first impressions shows people judge faces quickly, and photos of one person vary a lot (see "How Selfbaus reads a face photo"). Use the numbers to compare shots you take under the same conditions.
References
- Pech-Pacheco, J. L., Cristóbal, G., Chamorro-Martínez, J., & Fernández-Valdivia, J. (2000). Diatom autofocusing in brightfield microscopy: a comparative study. ICPR. https://doi.org/10.1109/icpr.2000.903548
- Immerkær, J. (1996). Fast noise variance estimation. Computer Vision and Image Understanding, 64(2), 300-302. https://doi.org/10.1006/cviu.1996.0060