pytransform3d.visualizer.Camera#
- class pytransform3d.visualizer.Camera(M, cam2world=None, virtual_image_distance=1, sensor_size=(1920, 1080), strict_check=True)[source]#
Bases:
Artist
Camera.
- Parameters:
- Marray-like, shape (3, 3)
Intrinsic camera matrix that contains the focal lengths on the diagonal and the center of the the image in the last column. It does not matter whether values are given in meters or pixels as long as the unit is the same as for the sensor size.
- cam2worldarray-like, shape (4, 4), optional (default: I)
Transformation matrix of camera in world frame. We assume that the position is given in meters.
- virtual_image_distancefloat, optional (default: 1)
Distance from pinhole to virtual image plane that will be displayed. We assume that this distance is given in meters. The unit has to be consistent with the unit of the position in cam2world.
- sensor_sizearray-like, shape (2,), optional (default: [1920, 1080])
Size of the image sensor: (width, height). It does not matter whether values are given in meters or pixels as long as the unit is the same as for the sensor size.
- strict_checkbool, optional (default: True)
Raise a ValueError if the transformation matrix is not numerically close enough to a real transformation matrix. Otherwise we print a warning.
- __init__(M, cam2world=None, virtual_image_distance=1, sensor_size=(1920, 1080), strict_check=True)[source]#
Methods
__init__
(M[, cam2world, ...])add_artist
(figure)Add artist to figure.
set_data
([M, cam2world, ...])Update camera parameters.
Attributes
Expose geometries.
- set_data(M=None, cam2world=None, virtual_image_distance=None, sensor_size=None)[source]#
Update camera parameters.
- Parameters:
- Marray-like, shape (3, 3), optional (default: old value)
Intrinsic camera matrix that contains the focal lengths on the diagonal and the center of the the image in the last column. It does not matter whether values are given in meters or pixels as long as the unit is the same as for the sensor size.
- cam2worldarray-like, shape (4, 4), optional (default: old value)
Transformation matrix of camera in world frame. We assume that the position is given in meters.
- virtual_image_distancefloat, optional (default: old value)
Distance from pinhole to virtual image plane that will be displayed. We assume that this distance is given in meters. The unit has to be consistent with the unit of the position in cam2world.
- sensor_sizearray-like, shape (2,), optional (default: old value)
Size of the image sensor: (width, height). It does not matter whether values are given in meters or pixels as long as the unit is the same as for the sensor size.
- property geometries#
Expose geometries.
- Returns:
- geometrieslist
List of geometries that can be added to the visualizer.
- add_artist(figure)#
Add artist to figure.
- Parameters:
- figureFigure
Figure to which the artist will be added.