Skip to main content

apply_background_correct

Function apply_background_correct 

Source
pub fn apply_background_correct(
    rgb: &[u8],
    bg: RgbBg,
    out: &mut [u8],
) -> Result<(), HistoError>
Expand description

Correct RGB illumination: out = clamp(rgb * 255 / bg, 0..255) per channel.

Models flat-field style correction against a measured slide background. out length ≥ rgb.len(). Channels with near-zero bg are left unchanged.