2
$\begingroup$

In image processing, we have two kinds of major kernels that are average kernel and Gaussian kernel. For image segmentation, which is difference between average kernel and Gaussian kernel? I found some paper said that they are similar, and average kernel implement faster than Gaussian kernel, right?When we use average kernel

$\endgroup$
2

2 Answers 2

0
$\begingroup$

If you pre calculate the filter coefficients the complexity of the convolution is set by its radius only.

Yet, if all coefficients are the same, it could be reduced into summation and one normalization multiplication.

I don't think it will have major effect on modern CPU's.
Certainly not on those who supports fused multiply and addition.

$\endgroup$
9
  • $\begingroup$ Except that for an average filter the coefficient for each input point is 1, so you only have one multiplication. $\endgroup$
    – Paul R
    Commented Aug 1, 2014 at 7:10
  • $\begingroup$ You're right. I will mention this. $\endgroup$
    – Royi
    Commented Aug 1, 2014 at 7:18
  • $\begingroup$ I read that average kernel similar gaussian kernel but it take larger error than gaussian kernel. So, when we use average kernel? $\endgroup$
    – John
    Commented Aug 1, 2014 at 8:20
  • 2
    $\begingroup$ Why would you need 2N-2 adds? Calculating a running sum for each row takes one add per pixel, calculating a box filter from that takes another subtraction. Then repeat that for each column. That makes 4 additions and one multiplication per pixel, no matter what N is. $\endgroup$ Commented Aug 1, 2014 at 8:51
  • 1
    $\begingroup$ @nikie: yes, you can make it more efficient computationally if you treat it as a separable filter, but this generally requires two passes through the data. For a single pass you can use the column sum optimisation I mentioned above - although it's not as optimal it lends itself well to SIMD/GPGPU optimisation and is also more cache-friendly. $\endgroup$
    – Paul R
    Commented Aug 1, 2014 at 10:25
-1
$\begingroup$

Average Filter (Box Blur) can be approximated using Integral Images / Running Sums.
In those efficient methods their complexity depends on the size of the image only and not the radius of the filter.

Gaussian Blur is often approximated by repetitive Box Blur (Hence, in this method, is slower) hence also has ability to be approximated by operation with complexity of the size of the image only.

$\endgroup$

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.