4
$\begingroup$

Hi Everyone i am new at image processing. I copy code from Code with C - Gaussian Filter Generation in C++, I have image $600 \times 480$ gray scale.

  • What will be the value of standard deviation or $\sigma$?
  • What will be the value of radius?
  • What will be the size of kernel?

After I get the kernel how can I use the convolution method? Can use the same like in programming-techniques - Calculating a convolution of an Image with C++: Image Processing? I know its lot to ask.

$\endgroup$
1
  • $\begingroup$ Could you please mark my answer? $\endgroup$
    – Royi
    Jan 20 at 6:06

2 Answers 2

2
$\begingroup$

When dealing with Gaussian Blur in the Image Processing context the following holds:

  • The Standard Deviation, $ \sigma $, is sometimes called radius. I think this goes back to Photoshop.
  • If you implement this using FIR Filter (Well, Gaussian Kernel is infinite so you approximate it) usually the radius of the filter will be something like ceil(4 * kernelStd). This is because the Kernel almost vanishes after $ 4 \sigma $.

Some in practice remarks:

  • The Gaussian Kernel is Separable hence if implemented as FIR filter it is implemented as 2 1D Convolutions - Along rows and along columns. You may have a look at the Image Convolution GitHub Repository for efficient C Code.
  • There are many other way to approximate the Gaussian Blur which are much faster (Though sometimes there is accuracy vs. speed balance, most of the time negligible). You may have a look at Fast Gaussian Blur GitHub Repository for IIR and Box Blur implementations which are insensitive to the radius parameter.
$\endgroup$
0
$\begingroup$

The value of "standard deviation" (SD) defines how much blurring is going to happen, larger SD means more blur.

You also need a larger kernel to encompass larger SDs - it needs to be big enough that the values at the edges of the kernel are "very small". You'll have to experiment with your particular application to decide how to define "very small".

Once you have your kernel, applying it is a standard convolution process, as you said. There are many many places to read about 2d convolution - I quite like this book: http://www.dspguide.com/pdfbook.htm

$\endgroup$
2
  • $\begingroup$ I do not understand the part. for 1024 * 768 image size i choose which size of kernel? What mean SDs? $\endgroup$
    – Alex Cerry
    May 11, 2017 at 6:53
  • $\begingroup$ Sorry, SD is an abbreviation for "standard deviation". The image size has no influence over the kernel size $\endgroup$ May 11, 2017 at 12:46

Your Answer

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

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