使用 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 区域与三星设备一起使用?