Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

What is the Kernel Doing in a Blur Function?

Hi Folks, If I have the following input pixels and I apply the blur funtion below, what value will the middle pixel change to? In the case of a 3x3 kernel, does OpenCV take all 9 pixels and then use the average for the "new" middle pixel changing it from 50 to 94? Or does it take the average of all pixels in the 3x3 kernel except the middle pixel, which would mean 50 changes to 100?

Also, does it make sense to use a kernel size of (1,1)? This does work and OpenCv will process an image and change the pixels but I am not sure what pixels it considers for a kernel size of (1,1). In all cases the anchor is in the center of the kernel.

Thanks!

100 100 100

100 50 100

100 100 100

blur(image, result, Size(3,3), Point(-1,-1));