openCV 3.0, openCL and meanShiftFiltering

╄→尐↘猪︶ㄣ 提交于 2019-12-13 02:26:16

问题


Based on the changes in openCV 3.0 and openCL, I can not seem to get pyrMeanShiftFiltering to work using openCL. I know that ocl::meanShiftFiltering was supported in openCV 2.4.10. The two functions below take the same amount of time to execute.

How can I even check which functions in openCV 3.0 are supported under openCL? Any suggestions?

 #include <opencv2/core/ocl.hpp>   //attempting to use openCL
 using namespace cv;
 using namespace ocl;
    void meanShiftOCL()
    {
      setUseOpenCL(true)
      UMat in, out;
      imread("./images/img.png").copyTo(in);
      pyrMeanShiftFiltering(in, out, 40, 20, 3);    
    }


   //not using openCL
   void meanShift()
   {
     Mat in, out;
     imread("./images/img.png").copyTo(in);
     pyrMeanShiftFiltering(in, out, 40, 20, 3);        
   }

回答1:


I'm not sure that there is simple way to determine it with given OpenCV binaries, but you can recompile OpenCV yourself with additional define (can be specified in cmake):

CV_OPENCL_RUN_VERBOSE

With this define every function for which OpenCL implementation is available will print to console (stdout) the following message:

<function name>: OpenCL implementation is running

Regarded to your question - currently pyrMeanShiftFiltering doesn't have OpenCL implementation, as I know.



来源:https://stackoverflow.com/questions/34203627/opencv-3-0-opencl-and-meanshiftfiltering

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!