【发布时间】:2017-09-04 14:57:28
【问题描述】:
使用 Android Camera2,我想在计算曝光时使用一个区域来忽略图像的前 25%。我正在使用这个:
// Compute the metering rectangle to ignore the top 25% of the picture:
Rect newRect = new Rect(mActiveArraySize.left, (int) (mActiveArraySize.height() * 0.25), mActiveArraySize.right, mActiveArraySize.bottom);
MeteringRectangle meteringRectangle = new MeteringRectangle(newRect, 1);
MeteringRectangle[] meteringRectangleArr = { meteringRectangle };
// Set the metering rectangle:
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_REGIONS, meteringRectangleArr);
// Set the request:
try { mCaptureSession.setRepeatingRequest(mPreviewRequestBuilder.build(), null, mBackgroundHandler); }
catch (CameraAccessException e) { e.printStackTrace(); }
它在我的 Nexus 5X 上运行。但是在三星 Galaxy Note 5 上(我猜是在所有三星设备上),它不起作用,我的区域被忽略了。
我看到了这个问题:Android Camera2 API - Set AE-regions not working,操作员说他设法通过使用三星 SDK 让它工作。我真的希望避免这种情况。
是否有人设法让 AE 区域使用三星设备?
【问题讨论】:
-
我也有同样的问题。在包括 LG Nexus 5 在内的 3 部手机上尝试过,但没有成功 :( 顺便问一下,您是否设置了任何 CONTROL_AE_PRECAPTURE_TRIGGER、CONTROL_AE_MODE、CONTROL_AE_LOCK 参数?
标签: android camera2 metering exposure