AbstractLinearDistortionModel#

class optika.distortion.AbstractLinearDistortionModel[source]#

Bases: AbstractDistortionModel

A distortion model which is an affine transformation of the scene coordinates,

\[\text{distort}(\vec{c}) = \mathbf{M} \, (\vec{c} - \vec{c}_0) + \vec{b},\]

where \(\mathbf{M}\) is matrix, \(\vec{c}_0\) is center, and \(\vec{b}\) is intercept. Since the transformation is linear, undistort() is its exact inverse (unlike a polynomial fit).

Attributes

center

The reference point subtracted from the coordinates before applying matrix.

intercept

The constant offset added after applying matrix.

matrix

The linear part of the affine transformation.

Methods

__init__()

distort(coordinates)

Convert scene coordinates to sensor coordinates.

to_string([prefix])

Public-facing version of the __repr__ method that allows for defining a prefix string, which can be used to calculate how much whitespace to add to the beginning of each line of the result.

undistort(coordinates)

Convert sensor coordinates to scene coordinates.

Inheritance Diagram

Inheritance diagram of optika.distortion.AbstractLinearDistortionModel
distort(coordinates)[source]#

Convert scene coordinates to sensor coordinates.

Parameters:

coordinates (AbstractSpectralPositionalVectorArray) – The wavelength and position of each point in the scene.

Return type:

SpectralPositionalVectorArray

to_string(prefix=None)#

Public-facing version of the __repr__ method that allows for defining a prefix string, which can be used to calculate how much whitespace to add to the beginning of each line of the result.

Parameters:

prefix (None | str) – an optional string, the length of which is used to calculate how much whitespace to add to the result.

Return type:

str

undistort(coordinates)[source]#

Convert sensor coordinates to scene coordinates.

Parameters:

coordinates (AbstractSpectralPositionalVectorArray) – The wavelength and sensor position of each point.

Return type:

SpectralPositionalVectorArray

abstract property center: AbstractSpectralPositionalVectorArray#

The reference point subtracted from the coordinates before applying matrix.

abstract property intercept: AbstractSpectralPositionalVectorArray#

The constant offset added after applying matrix.

abstract property matrix: AbstractSpectralPositionalMatrixArray#

The linear part of the affine transformation.