Adaptive Thresholding
Local mean — Compute with a window larger than the largest object. Then compare: original > (local_mean + offset). This detects locally bright structures regardless of regional illumination variation. Solomon & Breckon describe this as using "a different threshold at each pixel location" — the local mean serves as the spatially varying background estimate.
Texture Segmentation
Local variance or std dev — Textured regions (tissue with cellular structure) have high local variance, while smooth regions (glass background, homogeneous staining) have low variance. Thresholding the variance image segments by texture.
Background Estimation
Local min — With a window larger than bright objects, local minimum captures the background underneath objects. Useful as an alternative background estimation method.
Local max — With a window larger than dark artifacts, local maximum estimates the local foreground peak intensity.
Window Size Selection
The window size is critical: too small, and the statistic reflects individual objects rather than background; too large, and genuine illumination variation within the window averages out. As a rule of thumb, the window should be 3–5× larger than the objects of interest.
For adaptive thresholding: compute local mean with a large window, then compare each pixel to its local mean — brighter-than-local-mean = foreground. For texture detection: compute local standard deviation — high values mean textured tissue, low values mean smooth glass. Window size should be 3–5× larger than the objects of interest.