openCV 3.0,openCL和meanShiftFiltering [英] openCV 3.0, openCL and meanShiftFiltering
问题描述
基于openCV 3.0和openCL的更改,我似乎无法使pyrMeanShiftFiltering使用openCL正常工作.我知道openCV 2.4.10支持ocl :: meanShiftFiltering.下面的两个功能执行相同的时间.
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.
我什至如何检查openCL所支持的openCV 3.0中的哪些功能?有什么建议?
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);
}
推荐答案
我不确定是否可以通过给定的 OpenCV 二进制文件来确定它的简单方法,但是您可以重新编译 OpenCV 带有其他定义(可以在cmake中指定):
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
通过此定义,可以使用 OpenCL 实现的每个功能都将在控制台(stdout)中显示以下消息:
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
关于您的问题-据我所知,目前pyrMeanShiftFiltering
没有 OpenCL 实现.
Regarded to your question - currently pyrMeanShiftFiltering
doesn't have OpenCL implementation, as I know.
这篇关于openCV 3.0,openCL和meanShiftFiltering的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!