darsia.ExperimentalColorCorrection#

class ExperimentalColorCorrection(config=None, roi=None, verbosity=False, whitebalancing=True)[source]#

Bases: BaseCorrection

Colour correction that locates the colour checker automatically.

Convenient when the chart position is only approximately known, but less robust than ColorCorrection on high-resolution images.

Constructor of converter, setting up a priori all data needed for fast conversion.

Attributes:
configdict, str, Path

Config file for initialization of images. Can be used instead of roi, but roi is always prefered if it is present.

roituple of slices, np.ndarray, or None

ROI containing a colour checker, provided either as intervals, corner points, or nothing.

verbositybool

Displays corrected color checker on top of the reference one if True, default is False.

whitebalancingbool

Apply white balancing based on the third bottom left swatch if True, default is True.

Methods

correct_array(image)

Apply workflow from colour-science to match the colors of the color checker with the corresponding color values, cf.

correct_metadata([metadata])

Correction routine on metadata level.

load(path)

save(path)

correct_array(image)[source]#

Apply workflow from colour-science to match the colors of the color checker with the corresponding color values, cf. colour-science/colour-checker-detection

Parameters:
imagenp.ndarray

Image with uint8 value in (linear) RGB color space.

Returns:
np.ndarray

Corrected image with uint8 values in (linear) RGB color space, with colors matched based on the color checker within the roi.