camera2效果既不适用于预览和照片

发布于 2025-02-03 02:03:16 字数 717 浏览 4 评论 0原文

当我尝试在使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

停顿的约定 2025-02-10 02:03:16

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文