Commit ·
b0a56aa
1
Parent(s): 339a1bc
viz fix
Browse files- 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 |
-
|
| 202 |
-
|
| 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)
|