pyfisheye.internal package

Subpackages

Submodules

pyfisheye.internal.projection module

pyfisheye.internal.projection.backproject(pixels, intrinsics, distortion_centre, scaling_matrix=None, normalise_rays=True)

Backproject pixels into the world-space.

Parameters:
  • pixels (ndarray) – The pixels to backproject. Any shape with last dimension having length 2.

  • distortion_centre (ndarray) – The distortion centre x-y in pixels.

  • intrinsics (ndarray) – The intrinsic parameters / polynomial coefficients in ascending order.

  • scaling_matrix (Optional[ndarray]) – The stretch matrix, leave as None to default to identity.

  • normalise_rays (bool) – If set to True, all returned rays will have unit length.

Return type:

ndarray

Returns:

The projected rays with the same shape as pixels except for the last dimension having length 3.

pyfisheye.internal.projection.project(points, intrinsics, distortion_centre, scaling_matrix=None)
Project world points to pixel coordinates. Uses batched method for computing

polynomial roots, but is still quite slow for large numbers of points.

Parameters:
  • pixels – The pixels to project (in image coordinates.)

  • distortion_centre (ndarray) – The camera’s distortion centre in pixel coordinates.

  • scaling_matrix (Optional[ndarray]) – The scaling matrix, leave as None to use identity.

Return type:

ndarray

Returns:

Array with same shape as points except for last dimension having length two for the x-y pixel coordinates.

pyfisheye.internal.projection.project_fast(points, lookup_theta, lookup_rho, distortion_centre, scaling_matrix=None)

Use a lookup table to perform a faster projection of 3D points onto the image space.

Parameters:
  • points (ndarray) – The points to project, can be any shape as long as the last dimension has length 2.

  • lookup_theta (ndarray) – The theta values in the lookup table in ascending order. Use build_inv_lookup_table() to compute.

  • lookup_rho (ndarray) – The rho values in the lookup table. Use build_inv_lookup_table to compute.

  • distortion_centre (ndarray) – Distortion centre in pixels.

  • scaling_matrix (Optional[ndarray]) – The scaling matrix. Leave as None to use the identity.

Return type:

ndarray

Returns:

The projected pixels.

Module contents