pytransform3d.camera.plot_camera

pytransform3d.camera.plot_camera(ax=None, M=None, cam2world=None, virtual_image_distance=1.0, sensor_size=(1920, 1080), ax_s=1, strict_check=True, **kwargs)[source]

Plot camera in world coordinates.

This function is inspired by Blender’s camera visualization. It will show the camera center, a virtual image plane, and the top of the virtual image plane.

Parameters
axMatplotlib 3d axis, optional (default: None)

If the axis is None, a new 3d axis will be created.

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.

ax_sfloat, optional (default: 1)

Scaling of the new matplotlib 3d axis.

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.

kwargsdict, optional (default: {})

Additional arguments for the plotting functions, e.g. alpha.

Returns
axMatplotlib 3d axis

New or old axis

Raises
ValueError

If input is not valid

Examples using pytransform3d.camera.plot_camera