Skip to main content

conv2d

Function conv2d 

Source
pub fn conv2d(
    image: &[f32],
    width: usize,
    height: usize,
    kernel: &[f32],
    kw: usize,
    kh: usize,
    border: BorderMode,
) -> Result<Vec<f32>, ImageError>
Expand description

2D convolution with same-padding.

§Contract: image-conv2d-v1.yaml / conv2d

Kernel is row-major, dimensions kw×kh (both must be odd). Output has same dimensions as input.

§Errors

Returns error on invalid dimensions or buffer mismatch.