camera2效果既不适用于预览和照片
当我尝试在使用Camera2 API的相机应用程序中应用相机效果时,可以在其中调整诸如AWB,成功的运行时亮度之类的相机设置时,没有预览或捕获的图片都没有变化。但是,当我通过检查特征(cameracharacteristics.control_available_effects)查看效果是否已应用于相机时,我会看到它应用了。我正在使用Android 10操作系统的设备。
设定效应函数:
public void setCameraEffect(int cameraEffect){
try{
mCameraCaptureSession.stopRepeating();
previewRequestBuilder.set(CaptureRequest.CONTROL_EFFECT_MODE, cameraEffect);
CaptureRequest previewRequest = previewRequestBuilder.build();
mCameraCaptureSession.setRepeatingRequest(previewRequest, mCaptureCallback, mHandler);
} catch (Exception e){
e.printStackTrace();
}
}
如何解决此问题?
When I try to apply the camera effect in my camera application that uses the camera2 api, where I can adjust the camera settings such as awb, brightness in runtime successfully, there is no change in the neither preview nor captured picture. However when I look to see if the effect has been applied to the camera by checking characteristics.get(CameraCharacteristics.CONTROL_AVAILABLE_EFFECTS)
I see it applied. I am using a device with Android 10 operating system.
The setEffect function:
public void setCameraEffect(int cameraEffect){
try{
mCameraCaptureSession.stopRepeating();
previewRequestBuilder.set(CaptureRequest.CONTROL_EFFECT_MODE, cameraEffect);
CaptureRequest previewRequest = previewRequestBuilder.build();
mCameraCaptureSession.setRepeatingRequest(previewRequest, mCaptureCallback, mHandler);
} catch (Exception e){
e.printStackTrace();
}
}
How can I solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
tructials.get(cameracharacteristics.control_available_effects)
告诉您该摄像机支持哪些效果,而不是当前应用哪些效果。您需要查看是否要应用的效果实际上在
control_available_effects
中列出。如果不是,则该设备不支持它。characteristics.get(CameraCharacteristics.CONTROL_AVAILABLE_EFFECTS)
tells you which effects are supported by that camera, not which effect is currently applied.You'll need to look if the effect you want to apply is actually listed in
CONTROL_AVAILABLE_EFFECTS
. If it's not, then it's not supported by the device.