有没有办法以编程方式将iOS设备的相机对焦设置为无限? [英] Is there any way to programmatically set the camera focus off an iOS device to infinity?

查看:192
本文介绍了有没有办法以编程方式将iOS设备的相机对焦设置为无限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个锁定摄像机焦点的应用程序,以便进行视频录制。我想锁定焦点到无穷无需用户手动调整焦点。这可能吗?谢谢!

解决方案

可悲的是,没有。正如Artem所说,您可以将相机设置为对焦锁定模式;进入自动对焦模式(对焦,然后锁定)或连续自动对焦模式,但不能给相机一个特定的距离来对焦。

我所能想到的最好的(用于曝光和白平衡控制的,同样有限的)是让用户将摄像机指向适当的位置场景(在你的情况下,远离的东西),并让他/她推一个锁按钮。

捕获设备API的详细信息,如:
https://developer.apple.com/library/mac/ #documentation / AVFoundation / Reference / AVCaptureDevice_Class / Reference / Reference.html


I am creating an app that locks the camera focus for video recording purposes. I want to lock the focus to infinity without having the user manually adjust the focus. Is this possible? Thanks!

解决方案

Sadly, no. You can set the camera into focus-locked mode, as Artem said; put into autofocus mode (focus, then lock), or continuous autofocus mode, but you can't give the camera a specific distance to focus at.

The best I've been able to come up with (for exposure and white balance control, which are similarly limited) is to have the user point the camera at an appropriate scene (in your case, something far away) and have him/her push a lock button.

Details on the capture device API, such as it is: https://developer.apple.com/library/mac/#documentation/AVFoundation/Reference/AVCaptureDevice_Class/Reference/Reference.html

这篇关于有没有办法以编程方式将iOS设备的相机对焦设置为无限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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