Hacker News new | ask | show | jobs
by sforzando 3605 days ago
An example of a kernel that has a mathematical explanation for its values is the (discrete) Gaussian kernel, used to blur/smooth images: http://dev.theomader.com/gaussian-kernel-calculator/

The values of the gaussian kernel matrix are determined by doing a discrete sampling of the gaussian function. You get to choose sigma (gaussian's standard deviation) and kernel size (spatial neighborhood of the kernel, ie how much of the surroundings that the kernel will examine).

Another example is the Sobel operator, used to extract edges from images: https://en.wikipedia.org/wiki/Sobel_operator

The kernel matrix is the result of composing a gaussian smoothing with a spatial-differencing operation. Thus, the Sobel estimates edges from smoothed images.

As for the sharpen kernel described in the post -- an intuitive explanation is that you want to accentuate differences in pixel intensities.