pub fn row_running_sum(
image: &GrayImage,
row: u32,
buffer: &mut [u32],
padding: u32,
)
Expand description
Computes the running sum of one row of image, padded at the beginning and end. The padding is by continuity. Takes a reference to buffer so that this can be reused for all rows in an image.
§Panics
- If
buffer.len() < 2 * padding + image.width()
. - If
row >= image.height()
. - If
image.width() == 0
.
§Examples
use imageproc::integral_image::row_running_sum;
let image = gray_image!(
1, 2, 3;
4, 5, 6);
// Buffer has length two greater than image width, hence padding of 1
let mut buffer = [0; 5];
row_running_sum(&image, 0, &mut buffer, 1);
// The image is padded by continuity on either side
assert_eq!(buffer, [1, 2, 4, 7, 10]);