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

2

6

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).

Sandpaper answered 26/5, 2013 at 15:36 Comment(1)
Good question - I wonder if this is possible with reasonable quality, especially considering the distortion when an Android's camera is moved. According to one comment here, the distortion is caused by some sort of wide-angle correction: android.stackexchange.com/questions/44062/…Unshackle
O
6

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.

Oculus answered 29/5, 2013 at 20:7 Comment(0)
O
2

Sorry it's late but might be helpful for others

To set aperture/shutter-speed/iso:

Camera.Parameters params = camera.getParameters();

params.set("mode", "m");

params.set("aperture", "28"); //can be 28 32 35 40 45 50 56 63 71 80 on default zoom

params.set("shutter-speed", 9); // depends on camera, eg. 1 means longest

params.set("iso", 200);

Overtime answered 21/12, 2014 at 17:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.