为了计算出iPhone相机的35mm等效焦距,我有以下功能。
func get35mmEquivalentFocalLength(format : AVCaptureDevice.Format) -> Float {
// get reported field of view. Documentation says this is the horizontal field of view
var fov = format.videoFieldOfView
// convert to radians
fov *= Float.pi/180.0
// angle and opposite of right angle triangle are half the fov and half the width of
// 35mm film (ie 18mm). The adjacent value of the right angle triangle is the equivalent
// focal length. Using some right angle triangle math you can work out focal length
let focalLen = 18 / tan(fov/2)
return focalLen
}
iPhone 7有一个不到60度的videoFieldOfView,它的焦距等于31mm。这并不是苹果公司报道的价值在他们的媒体中的等效焦距。他们报告28毫米。我将相机与其他一些相机进行了比较,iPhone 7相机确实看起来有28mm等效镜头,所以上面的计算出了什么问题呢?