Camera Class Reference

class MultiViewTracks.Camera(id, name, fisheye, extrinsics, intrinsics, tracks, verbose=True)

This is a class containing per camera preprocessing methods for triangulating tracks using the Scene class.

id

The camera id within a COLMAP reconstruction

Type:int
name

A common prefix used for all images of this camera in a COLMAP reconstruction

Type:str
fisheye

Was OPENCV_FISHEYE used as COLMAP camera model?

Type:bool
image_names

Contains the image names of the reconstructed views of this camera

Type:np.ndarray
view_idx

Contains the frame indices of all reconstructed views of this camera

Type:np.ndarray
n_views

Number of reconstrueced views of this camera

Type:int
R

A Rotation instance holding extrinsic parameters (rotations) for this camera

Type:scipy.spatial.transform.Rotation
r

Stores the rotation matrices retrieved from R

Type:np.ndarray
t

Stores COLMAP extrinsic camera parameters for each view of this camera

Type:np.ndarray
k

The camera matrix of this camera

Type:np.ndarray
d

The distortion parameters of this camera

Type:np.ndarray
tracks

Contains the tracks visible from this camera or None

Type:dict
tracks_undistorted

Contains undistorted tracks from Camera.undistort_tracks or None

Type:dict
tracks_projected

Contains transformed tracks from Camera.project_tracks or None

Type:dict
tracks_reprojected

Contains reprojected tracks from Camera.reproject_tracks or None

Type:dict
verbose

Do you want some verbosity? Defaults to true

Type:bool
frames_in_view(i)

Returns the frame indices in which individual i is observed in the camera views.

get_rotations()

Returns a np.ndarray of rotation matrices transformed from R.

interpolate()

Interpolates the camera path by linearly interpolating t and using SLERP for R.

position(idx, i, kind='')

Returns the position of individual i at the specified frame index.

Parameters:
  • idx (int) – The frame index
  • i (int) – The individual’s identity
  • kind (str, optional) – One of “”, “undistorted”, “projected”. Defaults to “”
Returns:

The position of individual i at frame index idx

Return type:

np.ndarray

project_tracks()

Projects the tracks to world coordinates with unknown depth using r and t, Camera.undistort_tracks first if necessary.

projection_center(idx)

Return the 3d coordinates of the idx-th view projection center.

reproject_tracks(tracks_3d)

Projects given tracks from world coordinates to image coordinates using r and t, and distortion model. The tracks must be in the original coordinate system, i.e. they should not be rotated or scaled.

Parameters:tracks_3d (dict) – The 3D tracks in the world coordiate system to be reprojected.
undistort_tracks()

Undistorts the tracks in image coordinates to normalized coordinates.

view(idx)

Returns the projection matrix of the camera at the specified frame index.