Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding AVCaptureDevice exposureDuration, exposureTargetOffset, exposureTargetBias

Come from Android os, I'm trying to understand the AVCaptureDevice API and find a match between the different parameters of the IOS and Android. I'm working with auto-continuous exposure mode. I'm having trouble with exposure parameters above: To my understating:

  1. exposureDuration - This is the length of time in which the expose actuacly happens. It can be normalized to units of [seconds] by using the value and scale of this property.
  2. exposureTargetOffset, exposureTargetBias - I'm not sure what these values represents - are they kind of fix applied to get the desired exposure level? what is this exposure target value?
like image 723
Yair Buchbletter Avatar asked Jan 30 '26 10:01

Yair Buchbletter


1 Answers

You aren't alone. I'm not a professional photographer either, so it's pretty confusing. I think your gut is leading you in the right direction.

If you set exposureDuration, you're out of "auto-exposure mode" and it'll freeze that exposure duration and current or specified ISO setting. If the light changes, you're stuck with that setting.

If you set the exposureTargetBias, it will mimic a fancy camera and move the automatically calculated exposure settings up or down an exposure value (combination of f-number and exposure duration). There's a standard value for exposure of an image, but sometimes you want to over-expose or under-expose for style or shutter-speed priority. Changing the bias tells the automatic exposure system to aim for a value over or under the "correct" standard value.

Here's a great article explaining it in iOS: https://www.imore.com/camera-api-ios-8-explained

Exposure compensation is expressed in f-stops. +1 f-stop doubles the brightness, -1 f-stop halves the brightness. Developers can currently set exposure target biases between -8 and +8 for all existing iOS devices. However, Apple warns that that could change in the future.

If you have a new iPhone (11 or newer) you can even change the bias in real time.

Exposure Bias is explained here: https://digital-photography-school.com/using-exposure-bias-to-improve-picture-detail/

exposureTargetOffset tells you how well the camera is hitting your requested bias value. Sometimes it just can't adjust enough to darken the image (aiming at the sun, the camera tries to shorten the exposure time and drops the ISO very low) or lighten it (pitch-black closet, the camera tries to expose the image sensor for a long time and bumps up the ISO a ton to gather all the light, resulting in a dark and grainy image). If the camera can't hit the target or is in the process of adjusting to it, the offset tells you how far off it currently is. For video, the exposure is obviously limited by framerate.

like image 146
Nate Lowry Avatar answered Feb 01 '26 00:02

Nate Lowry



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!