Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AutoExposureLock resetting after calling takePicture()

Tags:

android

camera

I'm having a problem with the exposure lock in the Android Camera.Parameters class. I'm able to lock the exposure before taking a picture, but upon calling camera.takePicture(shutterCallback, rawCallback, jpegCallback) the exposure starts auto-adjusting again.

Also, getAutoExposureLock() still returns true even though the preview and the final saved images show adjusted exposure.

The Android documentation says the exposure lock won't be changed by taking a picture: http://developer.android.com/reference/android/hardware/Camera.Parameters.html#setAutoExposureLock(boolean)

What am I missing?

like image 816
Gregor Avatar asked Nov 04 '22 04:11

Gregor


1 Answers

I managed to lock exposure compensation on my Galaxy S4

Camera.Parameters parameters = mCamera.getParameters();
parameters.setAutoExposureLock(true);
mCamera.setParameters(parameters);
mCamera.startPreview();

Then in each takePicture callback I basically reset the lock to true

Camera.Parameters parameters = mCamera.getParameters();
parameters.setAutoExposureLock(true);
mCamera.setParameters(parameters);

This manages to do something. All images captured are almost equally bright. Changing exposureCompensation has no effect, but when changing ISO the exposure time is automagically adjusted.

I'll dig some more into this and update this post accordingly.

like image 103
maradatscha Avatar answered Nov 11 '22 16:11

maradatscha