Ask Your Question

medianBlur KxK matrix size

asked 2015-10-13 06:10:15 -0600

NicoCarosio gravatar image

Do anyone knows why medianBlur use a KxK size for the Matrix Kernel while Blur and Gaussian use a MxN matrix as Kernel? May be you @StevenPuttemans know the answer ;)

edit retag flag offensive close merge delete



Lol I tell to many people to call me by my name =/ nope sorry, I have not a clue. First guess would be implementation details, but I should have a deeper look.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-10-13 06:18:35 -0600 )edit

I am guessing that it depends on the nature of the filter. Look here on how OpenCV calculates it median filtering. It needs a center value, which means that you would need odd dimensions for a starter.

Why it doesn't allow for example to use a 5x3 kernel, I yet have to discover.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-10-13 06:22:15 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-10-13 06:29:36 -0600

Btw, it is possible in OpenCV to use a mask combined with bluring to achieve non-square median blurring. Take a look here:

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-10-13 06:10:15 -0600

Seen: 276 times

Last updated: Oct 13 '15