BrownModel.apply_distortion

giant.camera_models.brown_model:

BrownModel.apply_distortion(pinhole_locations)[source]

This method applies the distortion model to the specified pinhole (gnomic) locations in the image frame.

In general this function is not used by the user and the higher level project_onto_image() is used which calls this method (along with a few others) instead. In cases were it is desirable to use this method the pinhole locations should be input as a shape (2,) or shape (2, n) array of unitless image plane locations. The output from this function is the unitless distorted image plane locations.

For the Brown model, the distortion is defined as

\[\begin{split}\Delta\mathbf{x}_I = (k_1r^2+k_2r^4+k_3r^6)\mathbf{x}_I + \left[\begin{array}{c} 2p_1x_Iy_I+p_2(r^2+2x_I^2) \\ p_1(r^2+2y_I^2) + 2p_2x_Iy_I \end{array}\right]\end{split}\]

where \(\Delta\mathbf{x}_I\) is the additive distortion, \(k_1\) is the second order radial distortion coefficient, \(k_2\) is the fourth order radial distortion coefficient, \(k_3\) is the sixth order radial distortion coefficient, \(\mathbf{x}_I\) is the unitless gnomic location, \(p_1\) is the x tangential distortion coefficient, \(p_2\) is the y tangential distortion coefficient, and \(r = \sqrt{\mathbf{x}_I^T\mathbf{x}_I}\) is the radial distance from the optical axis.

Parameters:

pinhole_locations (Sequence | ndarray) – The unitless image plane location of points to be distorted as a shape (2,) or (2, n) array.

Returns:

The unitless distorted locations of the points on the image plane as a shape (2,) or (2, n) array.

Return type:

ndarray