I have been assuming for quite some time that "blur" and "get_blur" are Gaussian blurs.
1) I recently noticed that the documentation says it is a Canny-Deriche filter. This confused me because the only Canny-Deriche filter I know is an edge filter.
I did some tests to see if it is in fact a Gaussian blur. Because the Gaussian is the only kernel linear operator, this should hold:
G(s1)*G(s2) = G( sqrt(s1^2 + s2^2) )
I did a test, and it is fairly close, but not equivalent -- the two-pass blurred image was slightly more blurred than the single pass version. This could be due to approximation or round-off errors.
Because a Gaussian is linearly separable, it should also be the case that
G_x(s1)*G_y(s1) = G(s1)
I did a test of this, and they appeared very much equal. So it seems that the blur function is in fact a Gaussian blur. But why is it called Canny-Deriche in the documentation then?
2) Secondly, I am curious how the function is implemented -- does it use 2 passes with recursive filters?
The blur() function in CImg is indeed not a Gaussian one, but it should be close enough for usual applications.
1) The fact is that it is implemented using a recursive Deriche filter which theoretically implements the convolution with the kernel g(x) = exp(-k|x|).
Here, the 'k' parameter is automatically chosen from 'sigma' (the blur amplitude) so that the filter has the same values at 'g(sigma)'.
This is why is is relatively close to a real Gaussian function f(x) = exp(-x*x/2sigma).
2) You are absolutely right, this is implemented as a 2 passes recursive filter.
David.