RedApparat / Fotoapparat

Making Camera for Android more friendly. 📸
Apache License 2.0
3.82k stars 405 forks source link

Camera focus loses when picking multiple image #167

Closed sefaaycicek closed 6 years ago

sefaaycicek commented 6 years ago

Here is FA instance configuration

 return Fotoapparat
                .with(this)
                .into(cameraView)
                .previewScaleType(ScaleType.CenterInside)
                .lensPosition(back())
                .focusMode(firstAvailable(autoFocus(),fixed()))
                .logger(loggers(
                        logcat(),
                        fileLogger(this)
                ))
                .cameraErrorCallback(new Function1<CameraException, Unit>() {
                    @Override
                    public Unit invoke(CameraException e) {
                        Toast.makeText(BapCameraActivity2.this, e.toString(), Toast.LENGTH_LONG).show();
                        return null;
                    }
                })
                .build();

Some of them were blurred when shooting multiple photos. We try different ways.

  1. PhotoResult photoResult = fotoapparat.autoFocus().takePicture();

  2. fotoapparat.focus().whenAvailable(new Function1<FocusResult, Unit>() {
            @Override
            public Unit invoke(FocusResult focusResult) {
                Toast.makeText(BapCameraActivity2.this, focusResult.toString(), Toast.LENGTH_LONG).show();  //. **This log always focused**
                PhotoResult photoResult = fotoapparat.takePicture();
    }
    }
Diolor commented 6 years ago

Both capturing ways are exactly the same. Maybe the camera was focused but on a different focal length for some reason? All these operations are sequential when capturing multiple photos (e.g invoking those operations twice) : Focus, Capture, Focus, Capture, ...

sefaaycicek commented 6 years ago

Yes. when user click capture button, we call focus&capture.

This issue can be related with focus point? Can you add a method like FocusToCenter, could it be the solution?

Diolor commented 6 years ago

If the lower-level drive tells us that it's focused we can't really do much here 🤷‍♂️ . We will add #171 soon with manual focus, if that helps.

Diolor commented 6 years ago

So again if the device says it's focused we can't do much