transport op• Data kinds: signal × signal → transport_plan
• Call: import fullseye as fs; fs.ledger.transport_plan_1d(u_values, v_values) (to call the implementation directly, import colortransport; colortransport.transport_plan_1d(u_values, v_values); from the registry, opscolortransport.get("transport_plan_1d"))
The exact 1-D transport plan (north-west corner rule). Returns an (n, m) mass matrix.
Row sums are 1/n and column sums 1/m -- this is exact by construction, and it never deviates except by numerical error (pinned by a test).
Procedure: sort u (n values) and v (m values) each in ascending order, and from the smallest assign mass min(remaining u, remaining v) in turn (monotone coupling). Each sample's mass is equally 1/n and 1/m (weights are not accepted). In 1 dimension, as long as a convex function of distance is the cost, this monotone coupling is the optimal solution, so you get the same transport as wasserstein_1d as a matrix of "which sample goes where".
• u_values, v_values: flattened to 1 dimension (ravel). The lengths may differ. Empty gives MetricContractError. Finiteness is not checked (NaN is sorted to the end and silently coupled).
• Return value: float64 of shape (n, m) (transport_plan type). plan[i, j] is the mass carried from u[i] to v[j] in the original input order. At most n + m - 1 non-zero elements. If n == m, a permutation matrix / n (one-to-one correspondence).
• Complexity is an O((n + m) log) sort + an O(n + m) sweep, but the returned matrix is a dense n × m matrix, so it is not suited to samples on the scale of pixel counts (in that case histogram_match or sinkhorn).
apply_transport(plan, v) gives the destination value (centroid) of each sample on the u side, and transport_cost(plan, cost) the total cost.
• colorimetry — Colorimetry and spectra — colour is fixed only by spectrum × illuminant × observer
• 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.
• The canonical algorithm (author, year) and its uses are named in the family usage guide above.
• color_transport — py -3.11 examples/color_transport.py
transport_plan as input)transport_cost · apply_transport
transport)wasserstein_1d · sinkhorn · sinkhorn_distance · sinkhorn_divergence
*Provenance: colortransport.py — COLORTRANSPORT 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.