darsia.TranslationCorrection#

class TranslationCorrection(translation=None)[source]#

Bases: BaseCorrection

Translation correction based on user-input global translation.

Translation is provided as array or path to numpy array.

Contructor.

Parameters:
translationstr or Path

Path to predefined translation.

Methods

correct_array(img)

Main routine.

correct_metadata([metadata])

Correction routine on metadata level.

load(path)

save(path)

Attributes

translation

Translation map/array.

active

Flag controlling whether the correction is active.

correct_array(img)[source]#

Main routine. Perform translation.

Parameters:
imgnp.ndarray

Image to be corrected.

Returns:
array

Corrected image.

active#

Flag controlling whether the correction is active.

translation#

Translation map/array.