# What is kernel?

I am looking to "smudge" text blocks together to create a blob. I have been told that I should look at the erode function. But the kernel parameter is giving me some issues, I am not sure what it represent or how I should use it. Could anyone explain it to me?

Thanks.

edit retag close merge delete

Sort by » oldest newest most voted

Hi Luek,

Don't let esoteric names, such as kernel, intimidate you :) The concept behind it is really simple.

That kernel (also known as structuring element) is nothing else but a binary matrix, that is: a matrix composed by 0's and 1's. The arrangement of those 0's and 1's will determine the neighborhood of pixels over which the minimum (in the case of erode) or maximum (in the case of dilate) is taken.

The erode function will slide the kernel over the original image and all the pixel values on the original image that "fall under" a 1 value on the kernel will be considered for the calculation of the minimum value.

To make things easy, OpenCV provides the function getStructuringElement.

You can also take a look at this wikipedia article: Erosion

I hope this helps

more

Official site

GitHub

Wiki

Documentation

## Stats

Asked: 2014-03-23 16:23:48 -0500

Seen: 9,641 times

Last updated: Mar 24 '14