Shape and color corrections (darsia.corrections)#

Corrections are identified as pre-processing routines which alter the data without modifying the metadata. These are based on the central class BaseCorrection, which provides workflow, independent of the image type. Corrections are typical routines to be used as transformations when defining an image, see darsia.image.

The base correction#

All corrections follow the design of a base correction object.

BaseCorrection()

Abstract base correction, providing template for tailored corrections.

Color corrections with known location of a color checker#

General color correction requires the presence of a color checker allowing to match test colors with reference colors. The location of color checkers in the images can be provided explicitly or only approximately. Color corrections aim at calibrating colors identified in color checkers with reference colors, either defined by standards or customly by the user. Provided the exact location of a color checker, the colors in the entire image can be corrected using the following objects in the darsia.corrections.color.colorcorrection:

Classes

ColorCorrection([base, config])

Color correction with user-specified location of a color checker.

ColorCheckerAfter2014()

Definition of the classic color checker under (hardcoded) default illumination conditions.

CustomColorChecker([reference_colors, ...])

Swatch colors determined from user-prescribed input image.

Color corrections with approximate/unknown location of a color checker#

Knowing the position of a color checker only approximately (or not at all), machine learning based routines may identify the precise location. In addition, reference colors for calibrated illumination conditions can be used to fully automatically correct for color impurities. This features are not stable for high-resolution images and should be used with care. The central objects in the darsia.corrections.color.experimentalcolorcorrection are:

Classes

ExperimentalColorCorrection([config, roi, ...])

ClassicColorChecker()

Definition of the classic color checker under default illumination conditions.

EOTF()

Electro-optical transfer function (EOTF),the standard transfer function for sRGB, cf.

Shape corrections#

Shape correction alter the shape of the data container of the image. Several corrections are provided in the darsia.corrections.shape subpackage.

Classes

affine.AffineCorrection(...[, fit_options])

Affine correction based on affine transformation (translation, scaling, rotation).

curvature.CurvatureCorrection([config])

Polynomial curvature correction.

deformation.DeformationCorrection(base, config)

Patch-wise defined deformation correction defined through image registration.

drift.DriftCorrection([base, config])

Class for drift correction of images wrt.

rotation.RotationCorrection(anchor, **kwargs)

Rotation correction.

translation.TranslationCorrection([translation])

Translation correction based on user-input global translation.

Some of these employ tailored transformations, which may also be used as stand-alone.

Classes

affine.AffineTransformation(dim)

Affine map, restricted to translation, scaling, rotation, resulting in conservation of angles.

piecewiseperspective.PiecewisePerspectiveTransform(...)

Globally constant, patch-wise defined perspective transform.

To detect suitable translations (used in several contexts including image registration, when restricted to patches), feature-based translation estimators are essential:

Classes

translation.TranslationEstimator([...])

Estimator of translation to align images based on feature detection.