In image processing, a kernel is a small matrix. It is also known as mask. The convolution of kernel and image produces different types of effects such as blurring, sharpening, embossing and so on. That is why, kernel is also known as convolution matrix. So, we can say,

In image processing, kernel is a matrix used to produce different types of effects on image though convolution operation.

Mathematically, we express kernel as:

Here, g(x, y) is the filtered image, f(x ,y) is the original image and w is the kernel, which is a small matrix. Let’s see several application of kernel.

Kernel in Edge Detection

By convolution different kernel we can detect the edges of an image. Here is an example:

In the image above, you can see that after convoluting a kernel with the an image, we obtained the edges of the image. However, the edges are not sharp enough to visualize properly. Let’s change the value of the kernel and see what happens.

After changing the values of the kernel, we obtained sharper edges. However, the result is not satisfactory yet. How about changing the values of the kernel again. Let’s see what happens after doing it.

Now, the edges are sharp and bright enough to identity properly. This is how by applying different types of kernel, we can perform edge detection.