title: How to map OpenCL gpu memory to OpenCV matrix?
body: <p>I calculated some matrixes on gpu with OpenCL, now I need to do some filtering on it using OpenCV. How can I do it with the least overhead?</p>
  
  <pre><code>cl::Buffer buffer;
  cl::Kernel kernel;
  kernel = cl::Kernel(program, "functionName", &amp;err);
  buffer = cl::Buffer(context, CL_MEM_READ_WRITE, size, NULL, &amp;err);
  kernel.setArg(0, buffer);
  queue_IQ.enqueueNDRangeKernel(kernel, cl::NullRange, cl::NDRange(size), cl::NullRange, NULL, NULL);
  
  // Here, I would like to map the content of buffer to cv::Mat.
  </code></pre>