sym.double_sphere_camera_cal module#

class DoubleSphereCameraCal(focal_length, principal_point, xi, alpha)[source]#

Bases: object

Autogenerated Python implementation of symforce.cam.double_sphere_camera_cal.DoubleSphereCameraCal.

Camera model where a point is consecutively projected onto two unit spheres with centers shifted by xi, then projected into the image plane using the pinhole model shifted by alpha / (1 - alpha).

There are important differences here from the derivation in the paper and in other open-source packages with double sphere models; see notebooks/double_sphere_derivation.ipynb for more information.

The storage for this class is:

[ fx fy cx cy xi alpha ]

TODO(aaron): Create double_sphere_derivation.ipynb

TODO(aaron): Probably want to check that values and derivatives are correct (or at least sane) on the valid side of the is_valid boundary

Reference:

https://vision.in.tum.de/research/vslam/double-sphere

Parameters:
data: List[float]#
focal_length()[source]#

Return the focal length.

Return type:

ndarray

principal_point()[source]#

Return the principal point.

Return type:

ndarray

pixel_from_camera_point(point, epsilon)[source]#

Project a 3D point in the camera frame into 2D pixel coordinates.

Returns:
  • pixel – (x, y) coordinate in pixels if valid

  • is_valid – 1 if the operation is within bounds else 0

Parameters:
Return type:

Tuple[ndarray, float]

pixel_from_camera_point_with_jacobians(point, epsilon)[source]#

Project a 3D point in the camera frame into 2D pixel coordinates.

Returns:
  • pixel – (x, y) coordinate in pixels if valid

  • is_valid – 1 if the operation is within bounds else 0

  • pixel_D_cal – Derivative of pixel with respect to intrinsic calibration parameters

  • pixel_D_point – Derivative of pixel with respect to point

Parameters:
Return type:

Tuple[ndarray, float, ndarray, ndarray]

camera_ray_from_pixel(pixel, epsilon)[source]#

Backproject a 2D pixel coordinate into a 3D ray in the camera frame.

Returns:
  • camera_ray – The ray in the camera frame (NOT normalized)

  • is_valid – 1 if the operation is within bounds else 0

Parameters:
Return type:

Tuple[ndarray, float]

camera_ray_from_pixel_with_jacobians(pixel, epsilon)[source]#

Backproject a 2D pixel coordinate into a 3D ray in the camera frame.

Returns:
  • camera_ray – The ray in the camera frame (NOT normalized)

  • is_valid – 1 if the operation is within bounds else 0

  • point_D_cal – Derivative of point with respect to intrinsic calibration parameters

  • point_D_pixel – Derivation of point with respect to pixel

Parameters:
Return type:

Tuple[ndarray, float, ndarray, ndarray]

static storage_dim()[source]#
Return type:

int

to_storage()[source]#
Return type:

List[float]

classmethod from_storage(vec)[source]#
Parameters:

vec (Sequence[float]) –

Return type:

DoubleSphereCameraCal

static tangent_dim()[source]#
Return type:

int

classmethod from_tangent(vec, epsilon=1e-08)[source]#
Parameters:
Return type:

DoubleSphereCameraCal

to_tangent(epsilon=1e-08)[source]#
Parameters:

epsilon (float) –

Return type:

ndarray

retract(vec, epsilon=1e-08)[source]#
Parameters:
Return type:

DoubleSphereCameraCal

local_coordinates(b, epsilon=1e-08)[source]#
Parameters:
Return type:

ndarray

interpolate(b, alpha, epsilon=1e-08)[source]#
Parameters:
Return type:

DoubleSphereCameraCal