简体   繁体   English

如何平滑Android相机的自动对焦

[英]How to smooth android camera autofocus

Definition: Jumpy - What appears to be zooming in and then zooming back out to autofocus. 定义:跳动-似乎在放大,然后又缩小到自动对焦。

I am writing an Android app that displays a Camera preview. 我正在编写一个显示相机预览的Android应用。 I have noticed that on my HTC One M8, the autofocus is very jumpy. 我注意到在HTC One M8上,自动对焦非常迅速。

I am using android.hardware.Camera, but have seen this on the camera2 samples as well. 我正在使用android.hardware.Camera,但是在camera2示例中也看到了这一点。 I have tried Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE, for example, with no success. 例如,我尝试了Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE,但没有成功。 I am getting a very smooth autofocus camera preview with OpenCV. 我正在使用OpenCV获得非常流畅的自动对焦相机预览。 Am I missing something? 我想念什么吗? I can't be the only one seeing this. 我不能是唯一看到这一点的人。

EDIT: Code based mostly from this article: http://developer.android.com/guide/topics/media/camera.html 编辑:主要基于本文的代码: http : //developer.android.com/guide/topics/media/camera.html

After much research, I have determined that this is an implementation issue causing what is sometimes referred to as "breathing". 经过大量研究,我确定这是一个实现问题,有时会引起“呼吸”。 This happens almost every time .autoFocus(...) is called manually, or when it is called continuously. 几乎每次手动或连续调用.autoFocus(...)时,都会发生这种情况。

I can only assume that OpenCV, using the native Camera.h API, must have much better control over how autofocusing is done. 我只能假设使用本机Camera.h API的OpenCV必须更好地控制自动对焦的方式。 It still bounces, but is noticeably smoother. 它仍然会弹跳,但明显更平滑。

I've noticed my Camera app that comes with Android also "breathes" very heavily. 我注意到Android随附的我的Camera应用程序也非常“呼吸”。 Because of this, I can only assume it is a systemic issue outside of my control, for the most part. 因此,在大多数情况下,我只能认为这是我无法控制的系统性问题。

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

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