darsia.ExperimentalColorCorrection#
- class ExperimentalColorCorrection(config=None, roi=None, verbosity=False, whitebalancing=True)[source]#
Bases:
BaseCorrectionColour correction that locates the colour checker automatically.
Convenient when the chart position is only approximately known, but less robust than
ColorCorrectionon high-resolution images.Constructor of converter, setting up a priori all data needed for fast conversion.
- Attributes:
- config
dict,str,Path Config file for initialization of images. Can be used instead of roi, but roi is always prefered if it is present.
- roi
tupleofslices,np.ndarray,orNone 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.
- config
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:
- image
np.ndarray Image with uint8 value in (linear) RGB color space.
- image
- Returns:
np.ndarrayCorrected image with uint8 values in (linear) RGB color space, with colors matched based on the color checker within the roi.