5

我遇到了一个奇怪的问题,特别是在 Nexus 4 上(尽管它可能存在于其他设备上),当对焦模式设置为FOCUS_MODE_CONTINUOUS_PICTURE. 相同的代码在运行相同版本的 Android (4.2.1) 的 Galaxy Nexus 上运行良好。有没有人遇到过这个问题?我可以通过简单地将焦点模式切换到FOCUS_MODE_AUTO. 我希望这个问题有一个简单的解决方法,因为连续图片对焦模式非常重要。

4

2 回答 2

4

(因为在答案中结束我的评论是值得的。)

我怀疑在 Nexus 4 上无法连续对焦的原因是我从 Barcode Scanner 用户群那里听到了一些关于此的传言(我是作者)。Nexus 4 似乎无法使用或未启用连续对焦。

我还没有看到更多细节来确认/否认这一点,但是,我确实在其他设备上看到了这种确切形式的问题。特别是 Galaxy S2 似乎有一些不好的焦点错误。

It manifests as something slightly different: there is some third parameter you are setting which should be supported, or says it's supported, but actually causes the driver to barf. Then it doesn't honor the focus or torch setting. It may be that continuous focus, and torch, work. But a third setting is tripping it up.

Look into the logcat output. You should see debug messages from the driver. The exact nature depends a lot on the firmware. But in cases like this you will likely see errors in the driver. I usually see "unsupported parameter X" and cryptic numbers; sometimes it's much clearer about what it didn't like.

这可能会给您一个线索,实际上是场景模式或测光区域之类的问题。(而且我已经看到其中的每一个都在至少一个设备上导致了这个问题。)

我也有一个 Galaxy Nexus 并且从未观察到这种形式的任何问题。

我还要说,持续聚焦在某些设备上可以很好地工作。在某些设备上,比如我的旧 Desire HD,它比简单的自动对焦模式更糟糕。YMMV;我得出的结论是它不一定有用,因此将常规自动对焦设置为条码扫描仪中的默认设置。

于 2013-02-07T21:48:32.860 回答
0

Nexus 4 的摄像头存在很多问题。

首先请尝试 parameters.getSupportedFocusModes()

要恢复继续自动对焦,只需在“AutoFocusCallback.java”中调用相机上的“cancelAutoFocus()”,

{
if (autoFocusHandler != null) {
  camera.cancelAutoFocus(); 
  ...
}

如果对焦模式为“FOCUS_MODE_AUTO”,则此调用无效,因为调用 onAutoFocus() 时自动对焦已完成。但是当使用“FOCUS_MODE_CONTINUOUS_PICTURE”时,它会恢复连续自动对焦。

希望它有帮助。我会做更多的工作和更新。

于 2013-02-07T11:15:52.803 回答