I did code for processing the image from camera and it works fine, After capturing the image (clicking on take a picture button) it is asking for click ok in camera and then it starts processing image, and what I want is to start processing image immediately after capturing a picture (clicking on take a picture button). I tried with startForActivityResult method but then onActivityResult starts executing after i click on ok button. I also tried with broadcastreceiver but it states that it's depricated way to do this. All in all, I want on pressing take a photo button to take a picture and process it and not after clicking ok button.
b.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
}
});
Use the new API cameraX ( https://developer.android.com/training/camerax ) It will be more efficient than with camera2basic
With camera2basic : byte[] rgb = new byte[4 * 1920 * 1080]; // contient la trame (frame) reçue, au format RGB 8888 byte[] rgb2 = new byte[4 * 1920 * 1080]; // contient l'image affichée à l'écran après traitement byte[] hls = new byte[4 * 1920 * 1080];
private final TextureView.SurfaceTextureListener mSurfaceTextureListener = new TextureView.SurfaceTextureListener() {
Use google translate for translating comments