簡體   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