Re: Gaussian blur kernels

"Sam Martin" <[email protected]>
Newsgroups gmane.games.devel.algorithms
Message-ID <A78F73023D9DAC4B967091570A1540CF01D5DE03@THHS2EXBE1X.hostedservice2.net>
I was typing a reply but Simon beat me to it!

Some extra bits:

You should think about reducing the sampling rate as a totally separate
thing to any averaging/bluring that may also happen. When people say
downsampling in computer graphics they usually mean a combination of
averaging and reducing the sampling rate. You can 'downsample' simply by
removing remove every other pixel, but this provides no defence against
high frequencies aliasing.

Small changes can have a large impact. For instance, downsampling by
using the mid-points, as opposed to just adding up even and odd pixel
pairs, approximates a Gaussian fairly well - particularly if you do it
more than once. You can produce some very nice blurs by down+up sampling
using this trick.

Applying one filter then another is equivalent to convolving the two
filters together first - so you can always reduce a series of filters
down to a single filter (although this filter might be a lot larger!).
You can google all the details, but this is a great starting point:
http://www.dspguide.com/

And lastly, regardless of what the filters are, if you convolve several
together the result will quickly start to look like a Gaussian anyway
(known as the central limit theorem). Gaussians are like the home land
all filters want to return to.

Hope that helps,
Sam 

-----Original Message-----
From: Simon Fenney [mailto:[email protected]] 
Sent: 16 July 2009 09:57
To: Game Development Algorithms
Subject: Re: [Algorithms] Gaussian blur kernels

Jon Watte wrote:

> Actually, they are both low-pass filters, so
> downsampling-plus-upsampling is a form of blur. However, box
> filtering (the traditional downsampling function) isn't actually all
> that great at low-pass filtering, so it can generate aliasing, which
> a Gaussian filter does not.

AFAICS a box filter won't "generate" aliasing, it's just that it's not
very good at eliminating the high frequencies which cause aliasing. A
Gaussian, OTOH, has better behaviour in this respect...

> (AFAICR, the Gaussian filter kernel
> shares some properties with a sinc reconstruction kernel, and thus is
> "optimal" under certain conditions/assumptions, but details are
> hazy).       

...again, (and my recollection, too, is a bit hazy), the shape of a
Gaussian filter in the frequency domain is, again, a Gaussian, so it's
still going to let through some amount of illegally high frequencies. In
order to stop that, one will probably need to make it a bit wider which,
unfortunately, means it'll over-filter some of the legal frequencies
you'd want to keep.

A sinc filter, when mapped into the frequency domain, is a box and so
has a hard cut-off of higher frequencies, which should be ideal.

OTOH, I think that a box filter, when mapped into the frequency domain,
looks a bit like a sinc, which is why it behaves so poorly.

Cheers
Simon


------------------------------------------------------------------------
------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,

vendors submitting new applications to BlackBerry App World(TM) will
have
the opportunity to enter the BlackBerry Developer Challenge. See full
prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
GDAlgorithms-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-lis
t

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
GDAlgorithms-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.