Skip to main content

compute_gaussian_kernel

Function compute_gaussian_kernel 

Source
pub fn compute_gaussian_kernel(std_deviation: f32) -> ([f32; 13], u8)
Expand description

Compute 1D Gaussian kernel weights for separable convolution.

Returns (kernel_weights, kernel_size) where kernel_size = 2×radius + 1. The kernel is stored in a fixed-size array to avoid heap allocation. Uses the standard Gaussian formula: G(x) = exp(-x² / (2σ²)), normalized to sum to 1.