Applies local thresholds to handle inhomogeneous backgrounds.

Use case: Segmenting images with uneven illumination.