Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you can toggle ocl hardware / cpu usage with a flag:

#include "opencv2/core/ocl.hpp"
using namespace cv;

bool useOCL = true; 
ocl::setUseOpenCL(useOCL);
cout << "useOCL "  <<  cv::ocl::useOpenCL() << endl;

then, there's certain things, you cannot do with a UMat:

  • pixel access (at())
  • overloaded maths operators (C = A * B must be gemm(A,B,1,noArray(),0,C) )
  • printing to stdout or such
  • save / read to FileStorage or imread()/imwrite()
  • gui / imshow()

for all of these it will need copying to a "normal"(CPU) Mat, before you can do that

unfortunately, there are no nice tutorials(yet), but have a look at the samples