Skip to main content

separable_conv2d

Function separable_conv2d 

Source
pub fn separable_conv2d(
    image: &[f32],
    width: usize,
    height: usize,
    h_kernel: &[f32],
    v_kernel: &[f32],
    border: BorderMode,
) -> Result<Vec<f32>, ImageError>
Expand description

Separable 2D convolution: apply horizontal then vertical 1D kernels.

Equivalent to conv2d(image, outer_product(v, h)) but O(kw + kh) per pixel instead of O(kw * kh).

§Errors

Returns error on invalid dimensions.