How to calculate FOV?

后端 未结 5 1965
-上瘾入骨i
-上瘾入骨i 2020-12-25 12:10

Initial Context

I am developping an augmented reality application location based and I need to get the field of view [FOV] (I just update the value when the orient

5条回答
  •  没有蜡笔的小新
    2020-12-25 12:26

    In iOS 7 and above you can do something along these lines:

    float FOV = camera.activeFormat.videoFieldOfView;
    

    where camera is your AVCaptureDevice. Depending on what preset you choose for the video session, this can change even on the same device. It's the horizontal field-of-view (in degrees), so you'll need to calculate the vertical field-of-view from the display dimensions.

    Here's Apple's reference material.

提交回复
热议问题