title: Take picture from CameraGLSurfaceView in Android with Opencv
body: <p>I have implemented the example for apply OpenCL in Android  <a href="http://docs.opencv.org/trunk/d7/dbd/tutorial_android_ocl_intro.html" rel="nofollow noreferrer">http://docs.opencv.org/trunk/d7/dbd/tutorial_android_ocl_intro.html</a></p>
  <p>It uses a GLSurfaceView and it updates images from the camera in C++. The
  C++ code uses GL libraries with <code>glReadPixels</code></p>
  <p>My question is, is it possible to take picture (with a photo resolution) with this architecture ? I tried to implement the  <code>camera.takePicture</code> and this is my error:</p>
  <pre><code>04-28 16:57:18.237   203  9805 E Camera2ClientBase: takePicture: attempt to use a locked camera from a different process (old pid 0, new pid 32146)
  --------- beginning of crash
  04-28 16:57:18.260 32146 32279 E AndroidRuntime: FATAL EXCEPTION: GLThread 599
  04-28 16:57:18.260 32146 32279 E AndroidRuntime: Process: edu.uab.cvc.camera, PID: 32146
  04-28 16:57:18.260 32146 32279 E AndroidRuntime: java.lang.RuntimeException: takePicture failed
  04-28 16:57:18.260 32146 32279 E AndroidRuntime:    at android.hardware.Camera.native_takePicture(Native Method)
  04-28 16:57:18.260 32146 32279 E AndroidRuntime:    at android.hardware.Camera.takePicture(Camera.java:1434)
  04-28 16:57:18.260 32146 32279 E AndroidRuntime:    at edu.uab.cvc.camera.MyGLSurfaceView.takePhoto(MyGLSurfaceView.java:165)
  04-28 16:57:18.260 32146 32279 E AndroidRuntime:    at edu.uab.cvc.camera.MyGLSurfaceView.onCameraTexture(MyGLSurfaceView.java:139)
  04-28 16:57:18.260 32146 32279 E AndroidRuntime:    at org.opencv.android.CameraGLRendererBase.onDrawFrame(CameraGLRendererBase.java:131)
  04-28 16:57:18.260 32146 32279 E AndroidRuntime:    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1535)
  04-28 16:57:18.260 32146 32279 E AndroidRuntime:    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
  04-28 16:57:18.276   779  3430 W ActivityManager:   Force finishing activity edu.uab.cvc.camera/.MainActivity
  </code></pre>