12
$\begingroup$

To make Gaussian blurring a 2d image faster, I know that you can do one axis and then the other.

I'm wondering though, if I did two Gaussian blurs of size $N$, would that be the same mathematically as doing one Gaussian blur of size $2N$?

$\endgroup$

1 Answer 1

16
$\begingroup$

If I did two Gaussian blurs of size N, would that be the same mathematically as doing one Gaussian blur of size 2N?

Almost. Applying two Gaussian blurs is equivalent to doing one Gaussian blur, but with a slightly different size calculation.

Applying a Gaussian blur to an image means doing a convolution of the Gaussian with the image. Convolution is associative: Applying two Gaussian blurs to an image is equivalent to convolving the two Gaussians with each other, and convolving the resulting function with the image.

As it happens, the convolution of two Gaussians with each other is another Gaussian, whose variance is the sum of variances of the two original Gaussians. A Gaussian of N pixel width has variance $N^2$; applying it twice is equivalent to a Gaussian with variance $2\cdot N^2$, which corresponds to a width of $\sqrt{2}\cdot N$ pixels.

In the same vein, applying a Gaussian of width $2\cdot N$ is equivalent to applying a Gaussian of width $N$ four times.

$\endgroup$
6
  • $\begingroup$ Does this mean that applying a Gaussian blur 4 times would give twice the size, as required? $\endgroup$ Commented Aug 15, 2015 at 20:08
  • $\begingroup$ Yes, absolutely! $\endgroup$ Commented Aug 15, 2015 at 20:12
  • $\begingroup$ That covers the question entirely then - would it be worth mentioning how to get twice the size in the question so we can tidy away the comments? $\endgroup$ Commented Aug 15, 2015 at 20:19
  • $\begingroup$ If it takes 4 to double the size, what size would 3 represent? $\endgroup$
    – Alan Wolfe
    Commented Aug 16, 2015 at 1:01
  • 1
    $\begingroup$ N.B. this fact is also used when deriving theoretical bounds for anisotropic diffusion. $\endgroup$
    – geometrian
    Commented Nov 3, 2015 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.