tps_fit — 3D deform op

• Data kinds: points × points → deformation

• Call: import fullseye as fs; fs.ledger.tps_fit(src_ctrl, dst_ctrl, lam=0.0) (to call the implementation directly, import deform3d; deform3d.tps_fit(src_ctrl, dst_ctrl, lam=0.0); from the registry, ops3d.get("tps_fit"))

Usage

Fit a 3-D thin-plate spline from control-point correspondences.

Computes the TPS coefficients that map the moving control points src_ctrl onto the fixed dst_ctrl by solving the saddle-point system by least squares (numpy.linalg.lstsq). With λ=0 it interpolates exactly at the control points (tps_warp(model, src_ctrl) == dst_ctrl); with λ>0 it smooths.

Arguments:

src_ctrl: (K,3) control points (start points of the deformation, TPS kernel centres p_i).

dst_ctrl: (K,3) corresponding target points (end points of the deformation v_i).

lam: regularisation coefficient λ≥0. λ is added to the diagonal of the kernel matrix K. The larger, the

smoother the deformation (the fit to the control points loosens).

Returns:

model: dict. Keys are

"ctrl" (K,3) kernel centres p_i,

"w" (K,3) non-linear (bending) coefficients,

"a" (4,3) affine coefficients ([translation; linear part], a[0]=c, a[1:4]=Aᵀ),

"lam" the λ used.

Exceptions:

ValueError: shape mismatch, too few control points, non-finite values, or more than

TPS_MAX_CTRL (10,000) control points (the dense (K+4)² system is O(K³).

Thin out the correspondences before passing them — TPS is meant to represent a smooth deformation

with sparse control points).

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

Runnable examples (verified samples that actually call this op)

• nonrigid_deform — py -3.11 examples_3d/nonrigid_deform.py

Ops the type connects to (they accept deformation as input)

fuse_to_voxel · tps_warp

Same category (deform)

tps_warp · register_nonrigid · register_cpd_rigid


*Provenance: deform3d.py — 3D operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.