torch/image — pull request #4 by jonathantompson (2013-10-01 23:52:06+00:00)
Title: Update to gaussian and laplacian functions

- I added "mean_horz" and "mean_vert" input parameters to gaussian, gaussian1D and laplacian functions
- I wrote a c-based +openmp version of gaussian
- I verified that the new c-based gaussian gives the same result as the old code (although this test is admittedly a little precarious) within floating point precision

On my machine, creating 640x480 gaussian kernels (10 kernels in a loop):

c-based gaussian with omp time: 0.010269999998854 sec
lua-based gaussian time: 3.4788540000009 sec

creating 5x5 kernels (1000 in a loop):

c-based gaussian with omp time: 0.036453000007896 sec
lua-based gaussian time: 0.046321000001626 sec

So, for small kernels there's almost no speedup (I think openmp thread spawn overhead is high), but my application needs to create a large number of large 2D gaussian kernels; so these commits help!