== Gaussian kernels == The usual way to create a Gaussian kernel is to evaluate a Gaussian function at the center of each cell: k[i][j] = exp(-(i²+j²)/2σ) This usually works well, except when the kernel is thin (σ < 1). It gets worse when using our generalised kernel: k[i][j] = exp(-((i×cosθ-j×sinθ-dx)²+(j×cosθ+i×sinθ-dy)²)/2σ) == Median filter == There are several ways to optimise a median filter. Random links for now: * [http://coding.derkeiler.com/Archive/General/comp.programming/2004-10/0289.html Sliding median filter] * [http://iris.usc.edu/Vision-Notes/bibliography/twod268.html A shitload of papers about median filtering and its derivatives]