Ask Your Question

Revision history [back]

Hi, For examples of how to use the CUDA API your best bet is to check out the code used in the performance tests. For example the median filter performance test is line 384 onward https://github.com/opencv/opencv/blob/master/modules/cudafilters/perf/perf_filters.cpp

The lines of code taken from the above which I think you are interested in are

const int kernel = 3;
const cv::cuda::GpuMat d_src(src);
cv::cuda::GpuMat dst;
cv::Ptr<cv::cuda::Filter> median = cv::cuda::createMedianFilter(d_src.type(), kernel);
median->apply(d_src, dst);

where the window size would be 3 in this example.