Jump to content
  • Advertisement
Sign in to follow this  
Endemoniada

1D Gaussian Kernel

This topic is 2571 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys,

I found a few different formulas for the 1D Gaussian blur kernel and I'm not sure if mine is correct:

float g=1.0f/(sqrtf(2.0f*pi)*sigma)*exp(-(x*x)/(2.0f*sigma*sigma));

Also, for a 5 tap filter do I simply use (-2.0f,-1.0f,0.0f,1.0f,2.0f) for the x-values ?

Thanks.

Share this post


Link to post
Share on other sites
Advertisement
What you have there is the gaussian probability density function, centered (median) at x=0, which should work fine for calculating a filter kernel.

Share this post


Link to post
Share on other sites
Hidden
The one on wikipedia is this:

float g=1.0f/(sqrtf(2.0f*pi*sigma*sigma))*exp(-(x*x)/(2.0f*sigma*sigma));

...the difference is in the sqrt()

Which one should I use for my Gaussian blur kernel ? Is the difference a typo or are they both correct ?

Thanks

Share this post


Link to post
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!