MCPcopy Create free account
hub / github.com/apple/ml-sharp / convert_focallength

Function convert_focallength

src/sharp/utils/io.py:97–99  ·  view source on GitHub ↗

Converts a focal length given in mm to pixels.

(width: float, height: float, f_mm: float = 30)

Source from the content-addressed store, hash-verified

95
96
97def 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
102def save_image(

Callers 1

load_rgbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected