ndarray_vision/core/util.rs
1/// Get the centre of a kernel. Determines the pixel to be
2/// modified as a window is moved over an image
3pub fn kernel_centre(rows: usize, cols: usize) -> (usize, usize) {
4 let row_offset = rows / 2 - ((rows % 2 == 0) as usize);
5 let col_offset = cols / 2 - ((cols % 2 == 0) as usize);
6 (row_offset, col_offset)
7}