colour.characterisation.tps3d_parameters#

colour.characterisation.tps3d_parameters(source_points: ArrayLike, destination_points: ArrayLike, *, smoothing: float = 0.0, kernel: Literal['Bookstein', 'Polyharmonic 3D'] | str = 'Bookstein') tuple[np.ndarray, np.ndarray, np.ndarray][source]#

Fit TPS-3D parameters that warp RGB source_points -> destination_points.

Parameters:
  • source_points (ArrayLike) – (N,3) measured RGB points (e.g., detected ColorChecker swatches).

  • destination_points (ArrayLike) – (N,3) reference RGB points (e.g., ideal ColorChecker swatches).

  • smoothing (float) – Non-negative regularization added to diag(K) to improve conditioning (useful with noise / near-collinear points).

  • kernel (Literal['Bookstein', 'Polyharmonic 3D'] | str) – Kernel choice: - “Bookstein”: phi(r) = r^2 log(r^2) (classic TPS kernel) - “Polyharmonic 3D”: phi(r) = r (3D polyharmonic option)

Returns:

W : (N,3) non-linear weights A : (4,3) affine coefficients for [1, R, G, B] ctrl : (N,3) control points (source_points), returned for reuse

Return type:

W, A, ctrl