How to set a camera with given intrinsic and extrinsic parameters
InFistLee opened this issue · comments
Hi marco. I have some questions about how to set a camera with given intrinsic and extrinsic matrix. Here intrinsic matrix is a 3X3 matrix with fx,fy,cx,cy, and extrinsic matrix is a 4X4 camera2world matrix which can be easily translated into a rotation and translation.
I have multiple cameras' poses and a mesh in a scene. Here are the camera frustum that I visualized (forgive that I can only show the pointclouds but not the actual mesh here):
Questions are:
- How can I set a camera based on given camera pose (intr and cam2world) and get the corresponding screenshot? I found something like
vedo.utils.oriented_camera
andvedo.utils.camera_from_dict
but I am not sure how to set my camera pose into proper parameters. - I have many cameras so is there a way that I can get the render results from all cameras simultaneously and plot them in the plotter? (something like virtual cameras)
Hi, yes you need to build a camera object from method camera_from_dict()
and then pass it to the plotter:
plotter = Plotter(N=2, sharecam=False)
plotter.at(0).camera = camera_from_dict(...)
plotter.show(resetcam=False)