Ask Your Question

How to use cv::ocl::BilateralFilter in c++ code

asked 2020-05-20 07:06:28 -0500

updated 2020-05-20 07:42:35 -0500

berak gravatar image


I have built OpenCV 343 with OpenCL support, and i am trying to use cv::ocl::BilateralFilter(inp_mat,filtered,8,15,15);, but i see an error: ‘BilateralFilter’ is not a member of ‘cv::ocl’. I have included the following header

#include <opencv2/core/ocl.hpp>

Please let me know what is missed out.

Thanks in Advance

With Regards Mahesh G R

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2020-05-20 08:09:38 -0500

berak gravatar image

opencv3.4.3 is quite outdated, the function you refer to is from the dead 2.4 api.

you should use cv::bilateralFilter with cv::UMat instead, to use the opencl optimization (T api):

Mat img = imread(something, IMREAD_GRAYSCALE);
// upload to GPU
UMat src(img), dst;
bilateralFilter(src, dst, 8,15,15);

// more ocl operations on UMats (keep it on the GPU as long as you can !)

// download to CPU
Mat res = dst.getMat();
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-05-20 07:06:28 -0500

Seen: 58 times

Last updated: May 20