color_transfer — COLORTRANSPORT matching op

• 数据种类:rgbimage × rgbimage → rgbimage

• 调用: import fullseye as fs; fs.ledger.color_transfer(src, ref, method='reinhard', space='lab')(要直接调用实现,import colortransport; colortransport.color_transfer(src, ref, method='reinhard', space='lab');从台账取用则 opscolortransport.get("color_transfer"))

用法

把 src 的色调向 ref 靠拢。

Parameters

src, ref : array_like

(..., 3) 的 sRGB([0, 1] 的 float,或整数 dtype)。

大小可以不同(只使用统计量)。

method : {"reinhard", "gaussian", "histogram"}

• "reinhard" —— 只匹配各通道的均值和标准差(Reinhard, Ashikhmin, Gooch & Shirley, IEEE CG&A 21(5), 2001)。其前提是各通道为单峰正态分布这一假定。在前景与背景明显分开的双峰图像上,均值和方差虽然一致,得到的却是哪个峰都对不上的颜色(不会抛出异常)。

• "gaussian" —— 连同协方差一起搬运的 Monge 映射。相关性得以保持。

• "histogram" —— 逐通道的精确直方图匹配。边缘分布完全一致,但通道间的相关性会被破坏。

space : {"lab", "rgb"}

计算统计量的空间。默认的 lab 使用 imgmetrics 中的实现。

Returns

ndarray

与 src 形状相同的 sRGB [0, 1](色域外的值被截断)。

背景知识指南(该算子背后的物理与约定)

• colorimetry — 测色与光谱知识 —— 颜色只由“光谱 × 光源 × 观察者”决定

参考(示例数据、文献)

• 示例数据目录(下载 URL / 许可证) —— 2-D 用 skimage.data(BSD/公有领域)加合成图,3-D 给出真实数据源(Stanford/PDS 等)的下载 URL。

• 算子来历与参考文献 —— 该算子族所依据的研究/方法出处。

• 算法的正典(作者、年份)与用途见上面的族使用指南。

可运行的示例(实际调用该算子并已验证的样例)

• color_transport — py -3.11 examples/color_transport.py

类型可衔接的下一个算子(可接受 rgbimage 作为输入)

—

同类别(matching)

histogram_match · gaussian_transport_map


*Provenance: colortransport.py — COLORTRANSPORT 算子登记表。本条目由 tools/opdocs.py md 自动生成(请勿手工编辑)。*

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