adaptive_threshold

Function adaptive_threshold 

Source
pub fn adaptive_threshold(
    image: &GrayImage,
    window_size: u32,
) -> Result<GrayImage>
Expand description

Apply adaptive thresholding using local window statistics

Uses a sliding window to calculate local mean and applies threshold relative to local statistics. Better for images with varying illumination.

§Arguments

  • image - Input grayscale image
  • window_size - Size of local window (must be odd)

§Returns

Binary image with adaptive thresholding applied

§Example

use ruvector_scipix::preprocess::transforms::adaptive_threshold;
let binary = adaptive_threshold(&image, 15).unwrap();