[][src]Function imageproc::contrast::threshold_mut

pub fn threshold_mut(image: &mut GrayImage, thresh: u8)

Mutates given image to form a binarized version produced by applying the given threshold. Pixels with intensity equal to the threshold are assigned to the background.

Examples

use imageproc::contrast::threshold_mut;

let mut image = gray_image!(
    10, 80, 20;
    50, 90, 70);

let thresholded = gray_image!(
    0, 255,   0;
    0, 255, 255);

threshold_mut(&mut image, 50);

assert_pixels_eq!(image, thresholded);