concepts.vision.george_vision_pipeline.object_centric_vision.CameraTransformation#

class CameraTransformation[source]#

Bases: object

Camera transformation class.

Methods

c2w(u, v, d)

Converts a point in the camera coordinate system to the world coordinate system.

default_intrinsics()

Returns the default intrinsic matrix.

from_extrinsics_file(filename)

Load the camera transformation from an extrinsics file.

from_intrinsics_and_extrinsics_file(...)

Load the camera transformation from an intrinsics file and an extrinsics file.

w2c(x, y, z)

Converts a point in the world coordinate system to the camera coordinate system.

Attributes

camera_pose

Returns the camera pose in the world coordinate system (i.e. the extrinsics matrix in the form of (translation, rotation)).

intrinsics

Intrinsic matrix of the camera.

extrinsics

Extrinsic matrix of the camera.

__init__(*, intrinsics=None, extrinsics=None)[source]#
__new__(**kwargs)#
c2w(u, v, d)[source]#

Converts a point in the camera coordinate system to the world coordinate system. The inputs can be either scalars or arrays.

Parameters:
  • u (float | ndarray) – u coordinate(s) in the camera coordinate system.

  • v (float | ndarray) – v coordinate(s) in the camera coordinate system.

  • d (float | ndarray) – depth(s) in the camera coordinate system.

Returns:

a tuple of (x, y, z) in the world coordinate system.

classmethod default_intrinsics()[source]#

Returns the default intrinsic matrix.

classmethod from_extrinsics_file(filename)[source]#

Load the camera transformation from an extrinsics file.

classmethod from_intrinsics_and_extrinsics_file(intrinsics_file, extrinsics_file)[source]#

Load the camera transformation from an intrinsics file and an extrinsics file.

w2c(x, y, z)[source]#

Converts a point in the world coordinate system to the camera coordinate system. The inputs can be either scalars or arrays.

Parameters:
  • x (float | ndarray) – x coordinate(s) in the world coordinate system.

  • y (float | ndarray) – y coordinate(s) in the world coordinate system.

  • z (float | ndarray) – z coordinate(s) in the world coordinate system.

Returns:

a tuple of (u, v, z) in the camera coordinate system.

property camera_pose: Tuple[ndarray, ndarray]#

Returns the camera pose in the world coordinate system (i.e. the extrinsics matrix in the form of (translation, rotation)).

Returns:

A tuple of (translation, rotation). Rotation is represented by a matrix.

extrinsics: ndarray | None#

Extrinsic matrix of the camera. It’s the matrix that converts the camera coordinates to the world coordinates.

intrinsics: ndarray#

Intrinsic matrix of the camera.