Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

why cv::cuda::createMedianFilter function is slower than cv::medianBlur?

As you know, Ptr<Filter> cv::cuda::createMedianFilter (int srcType, int windowSize, int partition=128) function added to OpenCV3.1.0.

I'm trying to do a median filter on 8 bit large images (6000*6000) with custom window size(up to 21). I compare cv::medianBlur and cv::cuda::createMedianFilter and results was

windowSize    cv::medianBlur    cv::cuda::createMedianFilter
    3             0.071 sec         3.637 sec
    5             0.285 sec         3.679 sec
    11            2.641 sec         3.652 sec
    19            2.566 sec         3.719 sec

1) why cuda::createMedianFilter is slower than cv::medianBlur?

2) How can i write a kernel code to implement median filter that use opencv Mat with custom kernel size?