Ask Your Question

Revision history [back]

Some bizzare behavior of the median filter

Dear great OpenCV community,

I apply the median image filter on an 8 bit unsigned char image with the resolution of 512x512. I have down sampled my image cause not all kernel sizes are supported by 16bit images. I'd checked the execution times of the mentioned filter for several kernel sizes. As a result I can observe that the execution time growth with the kernel size. Till there every thing is like I had expected. But if the kernel size is bigger than 15x15 the computational time decreases by a factor of two. Now I wonder that a kernel size of 99x99 takes about 9 ms and a kernel size of 15x15 about 16 ms. Can somebody give me an answer why this happens? My Thought is that the median filter is "just" a sorting algorithm and if the size becomes bigger the sorting should take more time.

I hope some one knows why this strange behaviour appears and can explain it a bit.

Best Regards NewDev