gauss
Filter a cube through a kernel using Gaussian weight
This program calculates weight based on the bell-shaped Gaussian
curve. The weight is then applied to an image kernel in such a way as to
create a filter that will move a weighted average through the image. The
end result is a blurred image with reduced detail and noise. The Gaussian
function that determines the weight for all of the values in the kernel is
as follows
/ x^2+y^2 \ - | ----------- | G(x,y) = 1 \ 2(STDDEV)^2 / --------------- e^ 2(pi)(STDDEV)^2This formula creates a kernel that then runs through the image. The center of the kernel is at (0,0). This means that a 3x3 boxcar will be of the form
The kernel coordinates (-2,-2) (-1,-2) (0,-2) (1,-2) (2,-2) (-2,-1) (-1,-1) (0,-1) (1,-1) (2,-1) (-2, 0) (-1, 0) (0, 0) (1, 0) (2, 0) (-2, 1) (-1, 1) (0, 1) (1, 1) (2, 1) (-2, 2) (-1, 2) (0, 2) (1, 2) (2, 2) The kernel values (approx) 1 4 7 4 1 4 16 26 16 4 7 26 41 26 7 x 1/273 4 16 26 16 4 1 4 7 4 1
Categories
Related Objects and Documents
Applications
History
Drew Davidson | 2004-08-05 | Original version |
Drew Davidson | 2004-08-06 | Added application test |
Drew Davidson | 2004-08-16 | Added examples |
Drew Davidson | 2005-06-27 | Fixed bug in boxcar size |
Brendan George | 2006-09-21 | Documentation fixes |
Kaitlyn Lee | 2018-02-15 | Removed the cout that was outputting e to the terminal. Fixes #5198. |