iOS 4.2,寻找操纵 iPhone 4 相机焦距的方法
我正在从事一个 AR 项目,我们想要操纵 iPhone4 摄像头的对焦距离。这可能吗?到目前为止,我们发现只有切换和自动对焦作为此处列出的选项:http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVCaptureDevice_Class/Reference/Reference.html%23 //apple_ref/occ/instm/AVCaptureDevice/isAdjustingFocus
预先感谢您的任何提示! :)
I am working in an AR project, and we want to manipulate the focusing distance of the iPhone4 camera. Is this even possible? So far, we've found just toggling and auto focusing as options listed here : http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVCaptureDevice_Class/Reference/Reference.html%23//apple_ref/occ/instm/AVCaptureDevice/isAdjustingFocus
Thanks in advance for any tips! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
关于 API,似乎唯一支持的操作是:
- 检查设备是否支持 AF(我认为仅限 iPhone 3GS 和 4)
- 启用/禁用自动对焦
- 设置兴趣点,不是距离,而只是相机视图中的一个点。
当然不是你想做的事。
私有 API 可能支持...但这不会通过验证过程。
Regarding the API it seems that the only supported actions are:
- check if AF is supported on the device (iPhones 3GS an 4 only I think)
- enable/disable AF
- set the point-of-interest that is NOT the distance, but only a point in the camera view.
Certainly not what you want to do.
Might be supported in private API... but that would not pass the validation process.
解决方法可能是查看用户稍微移动时移动了多少像素,以了解图像某些部分的距离,然后根据该情况将自动对焦点设置为更近或更远的图像区域。
但是,如果可能的话,还要提交一份雷达票,请求访问以指定焦距 - 如果有足够多的人要求苹果将其添加到 API 中。
A workaround might be to see how much pixels move as the user shifts slightly, to get a sense of how distant some parts of the image are, and then set the AF point to a region of the image either closer or further based on that.
But, also file a Radar ticket requesting access to specify the focus distance if possible - if enough people ask Apple will add it to the API.