Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
FOV Calculator
import math
diagonal = lambda w, h: math.sqrt(w ** 2 + h ** 2)
wr = 36. # Reference 24mm * 36mm sensor.
hr = 24.
dr = diagonal(wr, hr)
w = 7.6 # Current sensor: http://en.wikipedia.org/wiki/Image_sensor_format
h = 5.7
d = diagonal(w, h)
cropFactor = dr / d
f = 7.2 # Current focal.
print 2 * math.degrees(math.atan(w / (2 * f))) # Current sensor FOV.
f = 7.2 * cropFactor
print 2 * math.degrees(math.atan(wr / (2 * f))) # 24mm * 36mm equivalent FOV.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.