CameraModel.project_directions

abstract CameraModel.project_directions(directions_in_camera_frame, image=0)[source]

This method transforms 3D directions expressed in the camera frame into the corresponding 2D image directions.

The direction input should be either 1 or 2 dimensional, with the first axis being length 3 (each direction in the camera frame is specified as a column).

The optional image key word argument specifies the index of the image you are projecting onto (this only applies if you have a separate misalignment for each image)

This method is different from method project_onto_image() in that it only projects the direction component perpendicular to the optical axis of the camera (x, y axes of the camera frame) into a unit vector in the image plane. Therefore, you do not get a location in the image out of this, rather a unitless direction in the image.

Parameters:
  • directions_in_camera_frame (Sequence | ndarray) – a shape (3,) or shape (3, n) array of points to project

  • image (int) – The index of the image being projected onto (only applicable with multiple misalignments)

Returns:

A shape (2,) or shape (2, n) numpy array of image direction unit vectors

Return type:

ndarray