I am developing an android application in which the camera preview is shown at all times. When the user wants, he can take a picture of that preview with the takePicture (), and apply different filters that picture.
The problem is that when I take a picture with takePicture () method, the picture freezes for a while and I want this freeze-frame remains as long as the user wants to apply the necessary filters, and when he wants, return to preview mode the camera immediately.
I am using the OpenCV library and specifically the JavaCameraView class to get the parameters of the camera and then take the pictures I want.
mCamera.takePicture(null,null,new Camera.PictureCallback() {
@Override
public void onPictureTaken(byte[] data, Camera myCamera) {
if(data != null){
bm = BitmapFactory.decodeByteArray(data, 0, data.length);
Log.i(TAG, "Caracteristicas de la foto: "+bm.getWidth()+"x"+bm.getHeight());
mCamera.startPreview();
}
}
};
In the onPictureTaken () method I store the image into a bitmap, and then to draw it on a canvas with the resolution of the camera. This will be done in CameraBridgeViewBase class.
Thank you in advance!