title: How to use OpenCL in OpenCV for Python?
body: <p>I have created a simple face detection program which uses Haar Cascade to detect faces. My code as follows:</p>
  
  <pre><code>def main():
      face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
      cap = cv2.VideoCapture(0)
  
      while 1:
          ret, frame = cap.read()
          img = rescale_frame(frame, percent=50)
  
          gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
          faces = face_cascade.detectMultiScale(gray, 1.3, 5)
  
          bColor = (255,0,0)
          gColor = (0,255,0)
          rColor = (0,0,255)
          for (x,y,w,h) in faces:
              if (len(faces)%3 == 0):
                  cv2.rectangle(img,(x,y),(x+w,y+h),rColor,2)
              if (len(faces)%3 == 1):
                  cv2.rectangle(img,(x,y),(x+w,y+h),gColor,2)
              if (len(faces)%3 == 2):
                  cv2.rectangle(img,(x,y),(x+w,y+h),bColor,2)
  
          cv2.imshow('Detected face',img)
          k = cv2.waitKey(30) &amp; 0xff
          if (k == 27) or (k == 13):
              break
  
      cap.release()
      cv2.destroyAllWindows()
  </code></pre>
  
  <p>I would like to execute <strong>face_cascade.detectMultiScale()</strong> on the GPU instead. 
  Could anyone advise how I can use the OpenCL directive for PythonOpenCV to achieve that?</p>
  
  <p>I tried following OpenCL for OpenCV: <a href="https://opencv.org/platforms/opencl.html" rel="nofollow noreferrer">https://opencv.org/platforms/opencl.html</a> and <a href="https://docs.opencv.org/2.4/modules/ocl/doc/introduction.html" rel="nofollow noreferrer">https://docs.opencv.org/2.4/modules/ocl/doc/introduction.html</a> but the examples for Python integration is ridiculously limited.</p>