Ask Your Question
1

What is `kernel`?

asked Mar 23 '14

Luek gravatar image

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.

Preview: (hide)

1 answer

Sort by » oldest newest most voted
3

answered Mar 24 '14

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

Preview: (hide)

Question Tools

Stats

Asked: Mar 23 '14

Seen: 18,742 times

Last updated: Mar 24 '14