Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should I set exposure and white balance values for custom camera

What would happen if I do not set the exposure and white balance when initializing the camera parameters in an Android custom camera.Does the Camera handle these by itself or do I need to specify values when the camera is initialized?

I have had trouble with the flash in the past,would setting exposure and white balance to specific values help me overcome these problems.I do not have any plans to let the user manually tinker with the exposure and/or white balance settings.

I have the following code set up:

if(isSupported(Camera.Parameters.SCENE_MODE_AUTO, mParameters.getSupportedSceneModes()))
    {
        mSceneMode=Camera.Parameters.SCENE_MODE_AUTO;
        mParameters.setSceneMode(mSceneMode);
    }

    int min=mParameters.getMinExposureCompensation();
    int max=mParameters.getMaxExposureCompensation();
    float step=mParameters.getExposureCompensationStep();
    //do i need to setExposureCompensation here??
    if(mSceneMode==Camera.Parameters.SCENE_MODE_AUTO && isSupported(Camera.Parameters.FLASH_MODE_AUTO,mParameters.getSupportedFlashModes()))
    {
            //ususally when I let the flash fire,the image is filled with light
            //all that does is make everything else undecipherable...  
        mFlashMode=Camera.Parameters.FLASH_MODE_AUTO;
        mParameters.setFlashMode(mFlashMode);
    }

        if(isSupported(Camera.Parameters.WHITE_BALANCE_AUTO,mParameters.getSupportedWhiteBalance()))
    {
        mWhiteBalanceMode=Camera.Parameters.WHITE_BALANCE_AUTO;
        mParameters.setWhiteBalance(mWhiteBalanceMode);
    }

I have read that auto-exposure and auto-white balance update cycles are stopped when autoExposureLock and autoWhiteBalanceLock are applied.Why and how should I use these locks in my camera code?

like image 798
vamsiampolu Avatar asked Jan 21 '14 06:01

vamsiampolu


People also ask

What is the best setting for white balance?

The color temperature of the Daylight white balance setting is relatively neutral at 5000-6500K, and will typically be the best choice for shooting outdoors. However, if the sky becomes overcast, you may need to choose the cloudy white balance setting, around 7500 K, to add warmth to the blue hues.

Should you set white balance or exposure first?

Before attempting to to adjust your white balance, make sure the image is first properly exposed (and that - first and foremost - if you're using a preset, your preset is applied). Be aware that if a shot isn't exposed correctly, it's going to lead you to set WB incorrectly.

Is white balance the same as exposure?

Is white balance the same as exposure? No, white balance is the about the color and exposure is about the light. For WB you want to make sure your temperature and tint are correct. For exposure you want to make sure you have the proper amount of light in the photo.

Does white balance affect camera exposure?

White Balance can affect the Exposure if you shoot in RAW. If you are photographing a scene with a very wide dynamic range, changing one of the color channels may affect the exposure. One of the overexposed color channels may be clipping. This is the only example of the effect of the White Balance on the Exposure.


1 Answers

Based on my own development, Exposure and White Balance are by default set to "Auto": Auto-exposure" and "Auto White Balance".

You can check the supported modes with:

mCameraParameters = mCamera.getParameters();
Log.i(TAG, "Supported Exposure Modes:" + mCameraParameters.get("exposure-mode-values"));    
Log.i(TAG, "Supported White Balance Modes:" + mCameraParameters.get("whitebalance-values"));

and check the current modes with:

Log.i(TAG, "Exposure setting = " + mCameraParameters.get("exposure")); 
Log.i(TAG, "White Balance setting = " + mCameraParameters.get("whitebalance")); 

if you want to use another mode you could set it like this:

mCameraParameters.set("exposure", "night");
mCamera.setParameters(mCameraParameters);
like image 182
Jack Dums Avatar answered Sep 21 '22 13:09

Jack Dums