Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are some of the Android camera api parameters optimizations for efficiently taking pictures when camera is moved by user?

I am creating an Android app which is sort of like stop-motion app which is intended to efficiently take pictures even during movement. I wanted to set very low shutter speed and high aperture for getting better pictures particularly when camera is in motion, but some answers on stack overflow suggest me that it is impossible to set shutter speed and aperture(Please correct me if I am wrong here). I am not using camera intent, but creating camera object with startPreview followed by setCameraParams and then takePicture.

What are the other camera parameters in android api which I could set to make it efficient precisely for camera in movement? I am setting SCENE_MODE_SPORTS and also trying to set FOCUS_MODE_CONTINUOUS_PICTURE(which is not supported in my camera though to test).

like image 769
Bharath Avatar asked May 26 '13 15:05

Bharath


1 Answers

Here is a link to the part of the Android Camera API that you need: http://developer.android.com/reference/android/hardware/Camera.Parameters.html

It is in Camera Parameters which you call like:

    mCamera = camera;
    Camera.Parameters params = mCamera.getParameters();
    params.setRotation(getCameraOrientation());
    params.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO);
    params.setFlashMode(Camera.Parameters.FLASH_MODE_ON);
    mCamera.setParameters(params);

The things that you really seem to be interested in are:

setExposureCompensation(int value)
setColorEffect(String value)
setAutoExposureLock(boolean toggle)
getExposureCompensation()

Don't forget to unlock the autoexposure when you want to use it :)

You should also set it to autofocus to take the pictures like I did in my example and flash will also help, although that will make it take longer in between pictures.

like image 105
Cheney Hester Avatar answered Oct 25 '22 04:10

Cheney Hester