有没有办法用 ARCore 相机设置自动对焦? [英] Is there any way to set auto focus with ARCore camera?

查看:38
本文介绍了有没有办法用 ARCore 相机设置自动对焦?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个需要使用 ARCore 放置对象的应用程序.然后我需要将帧保存为图像.

I am working on an application where I need to put object using ARCore. And then I need to save the frames as an image.

那么有没有办法为 ARCore 相机设置自动对焦?

So is there any way to set auto focus for ARCore camera?

推荐答案

从 ARCore 1.4 开始,您可以通过 ARCore 会话的配置启用或禁用自动对焦:

As of ARCore 1.4, you can enable or disable autofocus through your ARCore Session's Config:

Session session = new Session(context);
Config config = new Config(session);
if (enableAutoFocus) {
  config.setFocusMode(Config.FocusMode.AUTO);
} else {
  config.setFocusMode(Config.FocusMode.FIXED);
}
session.configure(config);

https://developers.google.com/ar/reference/java/com/google/ar/core/Config.html#setFocusMode(com.google.ar.core.Config.FocusMode)

这篇关于有没有办法用 ARCore 相机设置自动对焦?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆