Blame view

matlab/gauss_blur3d.m 346 Bytes
76a0f6f9   Laila Saadatifard   first commit to i...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  function Ib = gauss_blur3d(I, sigma)
  
  
  %convolve along the x-axis
  Gx = gauss1d(sigma(1));
  Ix = convn(I, Gx, 'same');
  
  %convolve along the y-axis
  Gy = gauss1d(sigma(2))';
  Iy = convn(Ix, Gy, 'same');
  
  %convolve along the z-axis
  Gz_prime = gauss1d(sigma(3));
  Gz = reshape(Gz_prime, [1, 1, length(Gz_prime)]);
  Iz = convn(Iy, Gz, 'same');
  
  Ib = Iz;