fn compute_spatial_lut(window_size: u32, sigma: f32) -> Vec<f32> {
        let (rr, cc) = window_coords(window_size);
        let mut gauss_weights = Vec::new();
        let it = rr.iter().zip(cc.iter());
        let sigma_squared = sigma.powi(2);
        for (r, c) in it {
            let dist = f32::sqrt(pow(*r as f32, 2) + pow(*c as f32, 2));
            gauss_weights.push(gaussian_weight(dist, sigma_squared));
        }
        gauss_weights
    }
/// Create look-up table of weights corresponding to flattened 2-D Gaussian kernel.
Create look-up table of weights corresponding to flattened 2-D Gaussian kernel.
Create look - up table of weights corresponding to flattened 2 - D Gaussian kernel .
fn compute_spatial_lut(window_size: u32, sigma: f32) -> Vec<f32> {
        let (rr, cc) = window_coords(window_size);
        let mut gauss_weights = Vec::new();
        let it = rr.iter().zip(cc.iter());
        let sigma_squared = sigma.powi(2);
        for (r, c) in it {
            let dist = f32::sqrt(pow(*r as f32, 2) + pow(*c as f32, 2));
            gauss_weights.push(gaussian_weight(dist, sigma_squared));
        }
        gauss_weights
    }
fn compute_spatial_lut ( window_size : u32 , sigma : f32 ) -> Vec < f32 > { let ( rr , cc ) = window_coords ( window_size ) ; let mut gauss_weights = Vec :: new ( ) ; let it = rr . iter ( ) . zip ( cc . iter ( ) ) ; let sigma_squared = sigma . powi ( 2 ) ; for ( r , c ) in it { let dist = f32 :: sqrt ( pow ( * r as f32 , 2 ) + pow ( * c as f32 , 2 ) ) ; gauss_weights . push ( gaussian_weight ( dist , sigma_squared ) ) ; } gauss_weights }
Create look-up table of weights corresponding to flattened 2-D Gaussian kernel.
Create look - up table of weights corresponding to flattened 2 - D Gaussian kernel .
window_size
u32
sigma
f32
window_size
u32
sigma
f32