PinholeModel.undistort_pixels

giant.camera_models.pinhole_model:

PinholeModel.undistort_pixels(pixels, temperature=0, allow_interp=True)[source]

This method computes undistorted pixel locations (gnomic/pinhole locations) for given distorted pixel locations according to the current model.

This method operates by calling pixels_to_gnomic() and then re-transforming the undistorted gnomic location into an undistorted pixel location using the intrinsic_matrix.

The pixels input should be specified as a shape (2,) or (2, n) array of image locations with units of pixels. The return will be an array of the same shape as pixels with units of pixels but with distortion removed.

Parameters:
  • pixels (Sequence | ndarray) – The image points to be converted to gnomic (pinhole) locations as a shape (2,) or (2, n) array

  • temperature (Real) – The temperature to use for the undistortion

  • allow_interp (bool) – Allow the approximate conversion using interpolation for speed

Returns:

The undistorted (gnomic) locations corresponding to the distorted pixel locations as an array of the same shape as pixels

Return type:

ndarray