JuliaLang/julia — pull request #498 by stefan-k (2012-03-01 20:22:24+00:00)
Title: conv2 should zeropad around matrices

In my initial version of the `conv2` function that takes two matrices, the zeropadding was just done at the 'right' and the 'bottom' of the matrices. This led to the problem that the center of the filter kernel was the first element of the kernel (should of course be the center element). Now I'm zeropadding around the matrices, which works as expected.
At first I wanted to keep it similar to the existing `conv2` function which takes two vectors (this function also zeropads at the end of the vectors). Now I have the problem that separated kernels don't work, because the `conv2` function that takes two vectors leads to the same problem of the wrong center of the kernel. I wanted to check with you if this should be changed as well, because I don't want to just screw around in your code. I'm also not quite sure whats the "usual" way to implement this. In my understanding it should be zeropadded at both ends, but I wouldn't be surprised if I'm wrong.
I've also checked in the function `imlineardiffusion`, because with this function it's easy to see wether the filtering works or not, because it applies `imfilter` several times and therefore errors 'propagate' and finally lead to nasty artefacts.