我可以通过编程设置 iPhone 相机的焦距吗?
你好,我想知道是否可以将iPhone相机的焦距固定在一定的距离,例如120mm。是否有可能以编程方式实现这一目标?
感谢您的时间和帮助:D
Hey therer, I am wondering whether I could fix the focal length of iPhone camera to certain distance, such as 120mm. Is it possible to achieve this programmatically?
Thank you for your time and help :D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,iPhone 摄像头是固定焦距的(iPhone 4 为 5.4mm)并且无法缩放 - 也许您的意思是焦距,这是图像距镜头的距离焦点集中?如果您指的是焦距,那么这个答案对您没有用。 :-(
如果您想模拟不同焦距(即变焦)的效果,您可以简单地裁剪图像,尽管裁剪后的图像的分辨率会低于未裁剪的原始图像的分辨率。iPhone
4实际焦距为5.4mm,全画幅等效焦距为29.4mm。你想要的120mm焦距也是全画幅等效焦距
120/29.4约为4。所以剪掉中间的1/4(25)。使用您的应用程序计算 iPhone 照片的高度和宽度,并且您模拟了 120mm 镜头的视野,
因此裁剪后的照片分辨率约为 648x484。
No, the iPhone camera is fixed focal length (5.4mm for the iPhone 4) and cannot zoom - perhaps you mean focal distance which is the distance from the lens at which an image is in focus? If you mean focal distance, then this answer is of no use to you. :-(
If you want to simulate the effect of different focal length (i.e. zoom), you can simply crop the image, although your cropped image will be of lower resolution than the uncropped original.
The iPhone 4 has a real focal length of 5.4mm, and a full-frame equivalent focal length of 29.4mm. Your desired 120mm focal length is also full-frame equivalent.
120/29.4 is about 4. So crop out the middle 1/4 (25%) of the height and width of the iPhone photo using your application, and you have simulated the Field of View of a 120mm lens.
The iPhone 4 takes photos at 2592x1936, so the cropped photo will be 648x484. That's approximately VGA resolution.