Android camera2 API在AF模式下获得对焦距离 [英] Android camera2 API get focus distance in AF mode

查看:535
本文介绍了Android camera2 API在AF模式下获得对焦距离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Android camera2 API.

I'm working with Android camera2 API.

在手动对焦模式下,我可以使用LENS_FOCUS_DISTANCE获得对焦距离值.但是,该属性在AF模式下始终为零.在自动对焦模式下有什么方法可以获取对焦距离?

I can get focus distance value using LENS_FOCUS_DISTANCE in manual focus mode. However, the property is always zero in AF mode. Is there any way to get focus distance in AF mode?

推荐答案

距镜头最前面的最短距离 成为焦点.

Shortest distance from frontmost surface of the lens that can be brought into sharp focus.

如果镜头是定焦镜头,则为0.

If the lens is fixed-focus, this will be 0.

http://developer.android.com/intl/es/reference/android/hardware/camera2/CameraCharacteristics.html

以另一种方式,如果要管理焦点,请记住LENS_INFO_MINIMUM_FOCUS_DISTANCE为您提供最小的焦点,但是要获得最大"焦点,则必须使用LENS_INFO_HYPERFOCAL_DISTANCE.

In other way, if you want to manage focus, remember that LENS_INFO_MINIMUM_FOCUS_DISTANCE give you the minimum focus, but to get the "Max" focus you must use LENS_INFO_HYPERFOCAL_DISTANCE.

float yourMinFocus = mCameraCharacteristics.get(CameraCharacteristics.LENS_INFO_MINIMUM_FOCUS_DISTANCE);
float yourMaxFocus = mCameraCharacteristics.get(CameraCharacteristics.LENS_INFO_HYPERFOCAL_DISTANCE);

这篇关于Android camera2 API在AF模式下获得对焦距离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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