【问题标题】:camera2 burst capture manual modecamera2 连拍手动模式
【发布时间】:2024-01-12 18:14:01
【问题描述】:
我使用基于camera2的连拍,设置Iso和曝光时间值。设置 ISO 50,曝光时间 1/30s,但有些照片会变成 ISO 100,曝光时间 1/60。
为什么?
【问题讨论】:
标签:
android
capture
android-camera2
【解决方案1】:
我已经得到了我的设置值的图片,参考:
https://android.googlesource.com/platform/cts/+/a0077cc/tests/tests/hardware/src/android/hardware/camera2/cts/BurstCaptureRawTest.java
- 构造一个具有手动曝光和灵敏度的突发请求数组。
- 对于每个捕获请求,将进行 3A 和后期处理(降噪、锐化等)
- 已关闭。然后配置曝光和敏感度值,由
决定
- EXPOSURE_MULIPLIERS 和 SENSITIVITY_MULTIPLIERS。
-
*
- @param rawBurstBuilder 构建器需要设置目标。
- @return 用于突发的数组列表捕获请求。
*/
私有 ArrayList createBurstRequest(CaptureRequest.Builder rawBurstBuilder)
{
返回 createBurstRequest(rawBurstBuilder, EXPOSURE_MULTIPLIERS, SENSITIVITY_MLTIPLIERS);
}
私有 ArrayList createBurstRequest(CaptureRequest.Builder rawBurstBuilder,
long[] exposureMultipliers,int[]sensitiveMultipliers){
//设置手动模式
rawBurstBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_OFF);
rawBurstBuilder.set(CaptureRequest.CONTROL_AWB_MODE, CaptureRequest.CONTROL_AWB_MODE_OFF);
rawBurstBuilder.set(CaptureRequest.NOISE_REDUCTION_MODE,
CaptureRequest.NOISE_REDUCTION_MODE_OFF);
rawBurstBuilder.set(CaptureRequest.EDGE_MODE, CaptureRequest.EDGE_MODE_OFF);
// 曝光优先于帧持续时间;因此帧读出时间:
// 曝光时间 + 开销
rawBurstBuilder.set(CaptureRequest.SENSOR_FRAME_DURATION, 0L);
// 获取曝光和灵敏度范围
范围 exposureRangeNs = new Range(mStaticInfo.getExposureMinimumOrDefault(),
mStaticInfo.getExposureMaximumOrDefault());
范围 isoRange = new Range(mStaticInfo.getSensitivityMinimumOrDefault(),
mStaticInfo.getSensitivityMaximumOrDefault());
Log.i(TAG, String.format("曝光时间 - 最大值: %d, 最小值: %d.", exposureRangeNs.getUpper(),
曝光范围.getLower()));
Log.i(TAG, String.format("灵敏度 - 最大值: %d, 最小值: %d.", isoRange.getUpper(),
isoRange.getLower()));
// 构建突发请求
int maxFramesBurst = exposureMultipliers.length *sensitiveMultipliers.length;
Log.i(TAG, String.format("设置突发 = %d 帧。", maxFramesBurst));
ArrayList rawRequestList = new ArrayList(maxFramesBurst);
for (int i = 0; i