Login  Register

Gaussian blur

Posted by cihat eldeniz on Jun 04, 2009; 2:09pm
URL: http://imagej.273.s1.nabble.com/Gaussian-blur-tp3692269.html

Hello,

In matlab, if we do h = fspecial('gauss',3,1), we get:

h =

    0.0751    0.1238    0.0751
    0.1238    0.2042    0.1238
    0.0751    0.1238    0.0751

Then we use imfilter(ourImage,h) to get the blurred image.

If I copy and paste this 2D kernel into the convolver [using
Process>Filters>Convolve...], I get nearly the same result as matlab.
However, I would also like to learn how to do it by using imagej commands
only within a plugin.

If I use Gaussian Blur with sigma 1, then the image is convolved with a 6x6
window right? [Since the assumed accuracy is 2e-4 for an image which is not
Byte or Color, and the sidelength of the kernel is given by
ceil(sigma*sqrt(-2*log(accuracy)))+1]. To have a 3x3 window, I have to set
the accuracy to at least exp(-2) = 0.1353, which is well above the
recommended upper limit on the website [0.02].

How could I have imagej perform the filtering operation in exactly the same
way as matlab with the 3x3 h given above, or is it possible at all?

Thanks.