title: Parallel image detection and camera preview OpenCV Android
body: <p>I'm using OpenCV to detect an image. Here is my problem: my function <code>detect_image(mRgba)</code> needs some time to perform operations and give some results. While function is computing camera preview is frozen because it only shows image when code reaches <code>return inputFrame.rgba()</code> I would like to know how to make those operation parallel, function will be computing in a background while camera preview is working with normal speed.    </p>
  
  <pre><code>public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
  mRgba = inputFrame.rgba();
  detect_image(mRgba);
  return inputFrame.rgba();
  }
  </code></pre>