我有一个应用程序,我试图通过Android智能手机的闪光灯将最大可能的光能传递给主体。
在使用多部手机的实验室测量中,我们观察到在拍摄自动曝光照片时闪光灯的光输出可能明显高于稳态火炬开启(当然这取决于设备)。如果可以在更高的输出电平触发闪光灯,无论外部照明条件如何,并且在可靠,足够高的频率(5 Hz?),在某些情况下,可以输出更多的光,而不仅仅是让手电筒保持稳定州。
不幸的是,似乎不可能实现对闪光灯的细粒度控制,我猜是因为闪光灯的强度控制(除了火炬之外)与自动曝光控制相关联的处于非常低的水平。
我可以在请求具有以下内容的预览帧时触发闪光灯:
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_MODE,
CaptureRequest.CONTROL_AF_MODE_OFF);
mPreviewRequestBuilder.set( CaptureRequest.FLASH_MODE,
CaptureRequest.FLASH_MODE_SINGLE );
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_PRECAPTURE_TRIGGER,
CaptureRequest
.CONTROL_AE_PRECAPTURE_TRIGGER_START);
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE,
CaptureRequest.CONTROL_AE_MODE_OFF);
// Finally, we start displaying the camera preview.
mPreviewRequest = mPreviewRequestBuilder.build();
setState( STATE_PREVIEW );
mCaptureSession.setRepeatingRequest(mPreviewRequest,
mCaptureCallback, mBackgroundHandler);
当捕获结果返回FLASH_STATE_FIRED
时,我用:
final CaptureRequest.Builder captureBuilder =
mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE);
captureBuilder.addTarget(surface);
// Use the same AE and AF modes as the preview.
captureBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_OFF);
captureBuilder.set( CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_OFF );
captureBuilder.set(CaptureRequest.CONTROL_AE_MODE,
CaptureRequest.CONTROL_AE_MODE_OFF);
mCaptureSession.stopRepeating();
mCaptureSession.capture(captureBuilder.build(), mCaptureCallback, null);
重置闪光灯似乎需要。然后我回到上面的预览代码再次闪烁,但闪光灯间歇性地闪光。
使用Camera2接口制作高度一致,高频率,高输出的闪光灯是否有更好的方法,而不仅仅是关闭火炬?