Re: Gaussian blur kernels

"Sam Martin" <[email protected]>
Newsgroups gmane.games.devel.algorithms
Message-ID <A78F73023D9DAC4B967091570A1540CF481C08@THHS2EXBE1X.hostedservice2.net>
Yeah, I hit send a bit quickly on this one. It might convey the rough idea, but I can poke holes in it already and need to actually bottom out the maths once and for all. It might take a bit of time, but if I complete it I'll write it up.

We had torrential rain in Cambridge (UK) yesterday. The rear entrance to our office is slightly underground. A submerged pump either broken down or was blocked causing the area to suddenly fill up with water and pour under the back door. Half the team bailed the water out while the other half rescued all the equipment. Some carpet destroyed, but otherwise we're fine!

Lesson learnt: never put your UPS on the bottom rung of your server rack.

ta,
Sam

-----Original Message-----
From: Sam Martin [mailto:[email protected]]
Sent: Fri 17/07/2009 17:10
To: Game Development Algorithms
Subject: Re: [Algorithms] Gaussian blur kernels
 
Thanks, that's clearer. 

I think there's an extra detail here that might explain things. Warning:
this contains some hand-wavey maths.

Let's imagine for a second that the space your original line lives in is
some real domain, R^2. Instead of doing the integration as we did before
we apply (convolve with) a box filter and produce a new function, also
in R^2. This would look like a blurry line. 

Note that it doesn't look like the result we got with the projection
into the pixel basis. It would instead look a bit like the bokeh effect
you get on a camera, but square.

If we now *point-sample* this new signal we could produce a nice looking
reconstruction with a pixel basis. I believe (subject to resolving some
further fiddly details) the issues with the previous solution will have
gone away - I think.

No integration per-pixel was required this time. We had already
band-limited the signal with the previous continuously-applied box
filter. 

Incidentally, I believe we could also perfectly reconstruct the R^2
blurry line from the point-sampled pixel basis, but I'm not sure exactly
what the reconstruction filter would be, and whether it requires the box
filter to be twice the size of the original pixel or not. It's one of
those things I've wanted to find out for a while, but the maths is a bit
heavy.

Eek. Have to go. Office is flooding with water.

Ta,
Sam

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

Sam Martin wrote:
> I'm not sure I quite understand what you mean by antialiasing in your
> experiment? 

Sorry, I thought that was obvious from the context :-(
Pragmatically, I meant take NxN samples per pixel, apply the (trivial)
weighting due to a box filter (i.e. 1/N^2), and either choose a "large
enough" N or take the limit as N->infinity.  The latter should then be
your integral below.

> To remove the aliasing completely you can't blur after sampling*.
> You'd need to rasterise the line by doing the integral over each
> pixel properly, rather than point sample. This will produce an
> alias-free result, but isn't exactly easy in general :).   

I wasn't intending it to be easy :-).  I just wanted to show that a box
filter is not ideal.

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

------------------------------------------------------------------------------
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.