MCPcopy Create free account
hub / github.com/colmap/colmap / get_virtual_rotations

Function get_virtual_rotations

python/examples/panorama_sfm.py:142–156  ·  view source on GitHub ↗

Get the relative rotations of the virtual cameras w.r.t. the panorama.

(
    num_steps_yaw: int, pitches_deg: Sequence[float]
)

Source from the content-addressed store, hash-verified

140
141
142def get_virtual_rotations(
143 num_steps_yaw: int, pitches_deg: Sequence[float]
144) -> Sequence[npt.NDArray[np.floating]]:
145 """Get the relative rotations of the virtual cameras w.r.t. the panorama."""
146 # Assuming that the panos are approximately upright.
147 cams_from_pano_r = []
148 yaws = np.linspace(0, 360, num_steps_yaw, endpoint=False)
149 for pitch_deg in pitches_deg:
150 yaw_offset = (360 / num_steps_yaw / 2) if pitch_deg > 0 else 0
151 for yaw_deg in yaws + yaw_offset:
152 cam_from_pano_r = Rotation.from_euler(
153 "XY", [-pitch_deg, -yaw_deg], degrees=True
154 ).as_matrix()
155 cams_from_pano_r.append(cam_from_pano_r)
156 return cams_from_pano_r
157
158
159def create_pano_rig_config(

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected