Skip to contents

Computes the Michelson (sinusoidal) contrast: \((I_{bright} - I_{dark}) / (I_{bright} + I_{dark})\). Values range from 0 (no contrast) to 1 (maximum contrast). Commonly used for periodic patterns such as gratings.

Usage

michelson_contrast(I_bright, I_dark)

Arguments

I_bright

Luminance or radiance of the brighter region (scalar or vector). Must be \(\ge I_{dark}\).

I_dark

Luminance or radiance of the darker region (scalar or vector).

Value

Contrast value(s) in \([0, 1]\).

See also

[weber_contrast()]

Examples

michelson_contrast(I_bright = 8, I_dark = 2)
#> [1] 0.6