isl-org / isl-org/Open3D

Can not append camera views to camera.PinholeCameraTrajectory()

Open
#3,390 3 comments 0 reactions 0 assignees View on GitHub
callback legacy (Open3D 0.x API) viewcontrol visualization
Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Description

I am trying to append the current camera view to a trajectory class

```
import numpy as np
import open3d as o3d

trajectory = o3d.camera.PinholeCameraTrajectory()

def key_callback(vis):
ctr = vis.get_view_control()
param = ctr.convert_to_pinhole_camera_parameters()
trajectory.parameters.append(param)
print(np.asarray(trajectory.parameters))

points = np.random.rand(100000, 3)
point_cloud = o3d.geometry.PointCloud()
point_cloud.points = o3d.utility.Vector3dVector(points)

vis = o3d.visualization.VisualizerWithKeyCallback()
vis.create_window()
vis.add_geometry(point_cloud)
vis.register_key_callback(ord("S"), key_callback)

vis.run()
vis.destroy_window()
```
when I press `"S"` I always get an empty list
`[]`

The trajectory is always empty, I checked the param it has intrinsic and extrinsic so it is not empty!

`print(np.asarray(param.extrinsic))`

```
[[ 0.98384893 0.00565312 0.17891152 -0.58419041]
[-0.00457813 -0.99837954 0.05672158 0.47312568]
[ 0.17894225 -0.05662455 -0.98222876 2.09271794]
[ 0. 0. 0. 1. ]]
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.