Re:Image Kernels explained visually
by salehenrahman on Monday August 08, 2016 @03:17PM
(#12250200)
There is a well-understood math behind it.
For blur, you can either do two things:
- generate a matrix such that each element in the matrix is equal to 1 (e.g. averaging)
- generate a matrix such that it represents the Gaussian distribution (you can use a 2D Gauss function)
For edge detection, you essentially have "derivative", e.g. rate of change; the more abrupt the change, the brighter the resulting pixel, hence why edges are highlighted. A good convolution kernel for edge detection would be the Laplacian.
For sharpness, it's pretty much the Laplacian Kernel + identity kernel.
For blur, you can either do two things:
- generate a matrix such that each element in the matrix is equal to 1 (e.g. averaging)
- generate a matrix such that it represents the Gaussian distribution (you can use a 2D Gauss function)
For edge detection, you essentially have "derivative", e.g. rate of change; the more abrupt the change, the brighter the resulting pixel, hence why edges are highlighted. A good convolution kernel for edge detection would be the Laplacian.
For sharpness, it's pretty much the Laplacian Kernel + identity kernel.