Camera¶
The VirualCamera object provides a wrapper for the intrinsics and pose of a camera in a scene. The camera’s intrinsics are represented by a CameraIntrinsics object from the Berkeley AUTOLab’s perception package, and the camera’s pose is represented by a RigidTransform object from the autolab_core package.
The camera’s frame of reference is given by an x-axis pointing to the right, a y-axis pointing up, and a z-axis pointing away from the scene (i.e. into the eye of the camera) along the optical axis.
VirtualCamera¶
-
class
meshrender.
VirtualCamera
(intrinsics, T_camera_world=RigidTransform(rotation=[[ 1. 0. 0.] [ 0. 1. 0.] [ 0. 0. 1.]], translation=[ 0. 0. 0.], from_frame=camera, to_frame=world))¶ Bases:
object
A virtual camera, including its intrinsics and its pose.
-
__init__
(intrinsics, T_camera_world=RigidTransform(rotation=[[ 1. 0. 0.] [ 0. 1. 0.] [ 0. 0. 1.]], translation=[ 0. 0. 0.], from_frame=camera, to_frame=world))¶ Initialize a virtual camera with the given intrinsics and initial pose in the world.
Parameters: - intrinsics (percetion.CameraIntrinsics) – The intrinsic properties of the camera, from the Berkeley AUTOLab’s perception module.
- T_camera_world (autolab_core.RigidTransform) – A transform from camera to world coordinates that indicates the camera’s pose. The camera frame’s x axis points right, its y axis points down, and its z axis points towards the scene (i.e. standard OpenCV coordinates).
-
intrinsics
¶ perception.CameraIntrinsics – The camera’s intrinsic parameters.
-
T_camera_world
¶ autolab_core.RigidTransform – The camera’s pose relative to the world frame.
-
V
¶ (4,4) float – A homogenous rigid transform matrix mapping world coordinates to camera coordinates. Equivalent to the OpenGL View matrix.
Note that the OpenGL camera coordinate system has x to the right, y up, and z away from the scene towards the eye!
-
P
¶ (4,4) float – A homogenous projective matrix for the camera, equivalent to the OpenGL Projection matrix.
-
resize
(new_width, new_height)¶ Reset the camera intrinsics for a new width and height viewing window.
Parameters: - new_width (int) – The new window width, in pixels.
- new_height (int) – The new window height, in pixels.
-