MCPcopy Create free account
hub / github.com/MotrixLab/ViMoGen / estimate_focal_length

Function estimate_focal_length

motion_rep/motion_checker.py:101–106  ·  view source on GitHub ↗

Compute focal length based on FOV.

(img_w: int, img_h: int, fov: float = 55)

Source from the content-addressed store, hash-verified

99
100
101def estimate_focal_length(img_w: int, img_h: int, fov: float = 55) -> float:
102 """Compute focal length based on FOV."""
103 fov_rad = fov * np.pi / 180
104 larger_side = max(img_w, img_h)
105 focal = larger_side / (2 * np.tan(fov_rad / 2))
106 return float(focal)
107
108
109def visualize_depth_map(depth_map: torch.Tensor) -> np.ndarray:

Callers 1

motion_visFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected