Skip to main content

threshold_otsu

Function threshold_otsu 

Source
pub fn threshold_otsu(
    input: &Tensor,
    max_val: f32,
) -> Result<(f32, Tensor), ImgProcError>
Expand description

Otsu’s automatic threshold. Input: [H, W] grayscale with values in [0, 255]. Otsu threshold for single-channel [H, W, 1] images. Returns (threshold, thresholded_image).