We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
main
When retrieving the extrinsic from the view control, after setting it, why do I get nans in the extrinsic and why is it flipped?
import numpy as np import open3d from open3d.visualization import ViewControl np.set_printoptions(precision=2, suppress=True) def main(): vis = open3d.visualization.Visualizer() vis.create_window(visible=False) view_control: ViewControl = vis.get_view_control() vis.update_renderer() vis.poll_events() target = np.random.rand(3) extrinsics = construct_extrinsics(target) camera_parameters = view_control.convert_to_pinhole_camera_parameters() extrinsics_out = camera_parameters.extrinsic # no nans print(extrinsics_out) vis.update_renderer() vis.poll_events() camera_parameters.extrinsic = extrinsics result = view_control.convert_from_pinhole_camera_parameters(camera_parameters, allow_arbitrary=True) vis.update_renderer() vis.poll_events() assert result # no nans print(extrinsics) camera_parameters = view_control.convert_to_pinhole_camera_parameters() extrinsics_out = camera_parameters.extrinsic # nans print(extrinsics_out) def construct_extrinsics(target: np.ndarray) -> np.ndarray: eye = np.zeros(3) forward = target - eye assert np.allclose(np.linalg.norm(forward), np.linalg.norm(target)) forward /= np.linalg.norm(forward) up = np.array([0.0, 1.0, 0.0]) right = np.cross(up, forward) up = np.cross(right, forward) up /= np.linalg.norm(up) right /= np.linalg.norm(right) assert up @ right < 1e-6 assert up @ forward < 1e-6 assert right @ forward < 1e-6 rotation = np.array([right, up, forward]) extrinsics = np.eye(4) extrinsics[:3, :3] = rotation extrinsics[:3, 3] = -(rotation @ eye) return extrinsics if __name__ == "__main__": main()
# default [[ 1. 0. 0. -0.] [-0. -1. -0. 0.] [-0. -0. -1. 0.] [ 0. 0. 0. 1.]] # my input [[ 0.49 0. -0.87 -0. ] [ 0.83 -0.31 0.47 -0. ] [ 0.27 0.95 0.15 -0. ] [ 0. 0. 0. 1. ]] # the output (with nans and flipped entries) [[-0.49 0. 0.87 nan] [ 0.83 -0.31 0.47 nan] [ 0.27 0.95 0.15 nan] [ 0. 0. 0. 1. ]]
open3d v0.18.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Checklist
main
branch).My Question
When retrieving the extrinsic from the view control, after setting it, why do I get nans in the extrinsic and why is it flipped?
open3d v0.18.0
The text was updated successfully, but these errors were encountered: