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

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

问题描述

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

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

推荐答案

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

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.

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

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天全站免登陆