title: Using OpenCL accelerated functions with OpenCV3 in Python
body: <p>OpenCV3 introduced its T-API (Transparent API) which gives the user the possibility to use functions which are GPU (or other OpenCL enabled device) accelerated, I'm struggling to find how to tap into that with Python.</p>
  
  <p>With C++ there are calls like <code>ocl::setUseOpenCL(true);</code> that enable OpenCL acceleration when you use <code>UMat</code> instead of <code>Mat</code> objects. However I found no documentation whatsoever for Python.</p>
  
  <p>Does anybody have any sample code, links or guides on how to achieve OpenCL acceleration with OpenCV3 in Python?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>After some further digging I've found this in <code>modules/core/include/opencv2/core/ocl.hpp</code>:</p>
  
  <pre><code>CV_EXPORTS_W bool haveOpenCL();
  CV_EXPORTS_W bool useOpenCL();
  CV_EXPORTS_W bool haveAmdBlas();
  CV_EXPORTS_W bool haveAmdFft();
  CV_EXPORTS_W void setUseOpenCL(bool flag);
  CV_EXPORTS_W void finish();
  </code></pre>
  
  <p>Which I managed to call from Python:</p>
  
  <pre><code>print(cv2.ocl.haveOpenCL())
  cv2.ocl.setUseOpenCL(True)
  print(cv2.ocl.useOpenCL())
  </code></pre>
  
  <p>And it produces the following output:</p>
  
  <pre><code>True
  True
  </code></pre>
  
  <p>However it still runs the same, I suppose I'm still not using OpenCL because I don't use UMat in Python.</p>