dmytromishkin commited on
Commit
b0a56aa
·
1 Parent(s): 339a1bc
Files changed (1) hide show
  1. hoho2025/viz3d.py +5 -3
hoho2025/viz3d.py CHANGED
@@ -188,7 +188,6 @@ def plot_camera_colmap(
188
  name: Optional[str] = None,
189
  **kwargs):
190
  """Plot a camera frustum from PyCOLMAP objects"""
191
- # Use camera intrinsics method if available, otherwise fallback to params
192
  intr = camera.calibration_matrix()
193
  if intr[0][0] > 5000:
194
  print("Bad camera")
@@ -196,10 +195,13 @@ def plot_camera_colmap(
196
  cfw = image.cam_from_world
197
  if callable(cfw):
198
  cfw = cfw()
 
 
 
199
  plot_camera(
200
  fig,
201
- cfw.rotation.matrix(), # Use rotation matrix method (World-to-Camera)
202
- cfw.translation, # Use camera center in world coordinates
203
  intr,
204
  name=name or str(image.name),
205
  **kwargs)
 
188
  name: Optional[str] = None,
189
  **kwargs):
190
  """Plot a camera frustum from PyCOLMAP objects"""
 
191
  intr = camera.calibration_matrix()
192
  if intr[0][0] > 5000:
193
  print("Bad camera")
 
195
  cfw = image.cam_from_world
196
  if callable(cfw):
197
  cfw = cfw()
198
+ # plot_camera expects camera-to-world R and camera center in world space,
199
+ # so invert the cam_from_world pose before passing.
200
+ world_t_camera = cfw.inverse()
201
  plot_camera(
202
  fig,
203
+ world_t_camera.rotation.matrix(),
204
+ world_t_camera.translation,
205
  intr,
206
  name=name or str(image.name),
207
  **kwargs)