colour.characterisation.colour_correction_TPS3D#
- colour.characterisation.colour_correction_TPS3D(RGB: ArrayLike, M_T: ArrayLike, M_R: ArrayLike, *, smoothing: float = 0.0, kernel: Literal['Bookstein', 'Polyharmonic 3D'] | str = 'Bookstein', clip: bool = True, chunk_size: int = 250_000) NDArrayFloat[source]#
Perform colour correction using TPS-3D warping in RGB space.
- Parameters:
RGB (ArrayLike) – RGB array to colour correct (… , 3).
M_T (ArrayLike) – Source control points (N,3): measured RGBs (e.g., extracted swatches).
M_R (ArrayLike) – Destination control points (N,3): reference RGBs (e.g., ideal swatches).
smoothing (float) – Regularization added to diag(K) for stability.
kernel (Literal['Bookstein', 'Polyharmonic 3D'] | str) – “Bookstein” (classic TPS) or “Polyharmonic 3D”.
clip (bool) – Clip output to [0, 1].
chunk_size (int) – Chunk size for large images.
- Returns:
Colour corrected RGB array.
- Return type:
References
The TPS-3D warping approach for RGB calibration is described by Menesatti et al. (2012), based on a TPS formulation originally popularized by Bookstein (1989).