Created
February 4, 2022 16:13
-
-
Save Shrinks99/04ecc04da478ee6bd4a53c935971e3c5 to your computer and use it in GitHub Desktop.
A simple calculator to determine an image's focal length in pixels based on recorded camera data, lens info, and plate info
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imgWidthPx = float(input("Image width in pixels: ")) | |
sensorWidth = float(input("Sensor width in mm: ")) | |
focalLen = float(input("Lens focal length in mm: ")) | |
focalLenPx = str(float(float(focalLen / sensorWidth) * imgWidthPx)) | |
print("The focal length in pixels is: " + focalLenPx) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment