繁体   English   中英

ARCore - 如何将相机焦点更改为“自动对焦”?

[英]ARCore – How do I change camera focus to “Auto Focus”?

我正在尝试实现增强图像示例,但是对于非常接近相机的对象。 因此,我需要改变焦点,因为固定焦点使前景物体完全模糊。

我在Android Studio中使用Java以及Sceneform ARCore 1.6用于此项目,如果一些代码与解决方案一起发布,那么我可以实现这一点。

我尝试了以下内容,但收到错误消息“无法解析符号”上下文''

Session session = new Session(context);
Config config = new Config(session);

config.setFocusMode(Config.FocusMode.AUTO);
session.configure(config);

使用以下代码进行正确配置:

Session session = new Session(context);
Config configuration = new Config(session);

if (enableAutoFocus) {
    configuration.setFocusMode(Config.FocusMode.AUTO);
} else {
    configuration.setFocusMode(Config.FocusMode.FIXED);
}

session.configure(configuration);

但在撰写本文时,Google 确认自动对焦在某些LG型号的ARCore 1.8中无效。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM