Converts a focal length given in mm to pixels.
(width: float, height: float, f_mm: float = 30)
| 95 | |
| 96 | |
| 97 | def convert_focallength(width: float, height: float, f_mm: float = 30) -> float: |
| 98 | """Converts a focal length given in mm to pixels.""" |
| 99 | return f_mm * np.sqrt(width**2.0 + height**2.0) / np.sqrt(36**2 + 24**2) |
| 100 | |
| 101 | |
| 102 | def save_image( |