@@ -163,6 +163,7 @@ def run_annotate(
163163 meta : PanoramaMetadata ,
164164 output : Path ,
165165 images : dict [str , Path ],
166+ shift : Angle ,
166167 scale : float | None = None ,
167168 points : list [tuple [str , Coordinate , str ]] = [],
168169 camera_offset : Coordinate | None = None ,
@@ -218,6 +219,7 @@ def run_annotate(
218219 continue
219220
220221 hz , v , _ = vec .to_polar ()
222+ hz = (hz - shift ).normalized ()
221223 height : int
222224 width : int
223225 height , width , _ = img .shape
@@ -350,14 +352,16 @@ def run_annotate(
350352 # is rotated with the preliminary angles.
351353 prelim_hz , prelim_v , _ = (coord - center ).to_polar ()
352354 offset_rot = (
353- rot_z (float (prelim_hz ))
355+ rot_z (float (( prelim_hz - shift ). normalized () ))
354356 @ rot_x (np .pi / 2 - float (prelim_v ))
355357 )
356358 pt_hz , pt_v , _ = (
357359 coord
358360 - (center + apply_rotation (camera_offset , offset_rot ))
359361 ).to_polar ()
360362
363+ pt_hz = (pt_hz - shift ).normalized ()
364+
361365 pt_hz_f = float (pt_hz - tl_hz )
362366 pt_v_f = float (pt_v - tl_v )
363367 pt_x = round (tl_x + pt_hz_f * scale ) % full_360
@@ -468,6 +472,7 @@ def main(
468472 output : Path ,
469473 image : tuple [Path ],
470474 camera_offset : tuple [float , float , float ] | None = None ,
475+ shift : str | None = None ,
471476 compensation : str = "channel" ,
472477 blending : str = "multiband" ,
473478 scale : float | None = None ,
@@ -559,6 +564,7 @@ def main(
559564 meta ,
560565 output ,
561566 image_map ,
567+ Angle .from_dms (shift ) if shift is not None else Angle (0 ),
562568 scale ,
563569 points ,
564570 cam_offset ,
0 commit comments