rgb_to_lab — IMGMETRICS colorspace op

• 数据种类:rgbimage → lab

• 调用: import fullseye as fs; fs.ledger.rgb_to_lab(rgb, white=(0.95047, 1.0, 1.08883))(要直接调用实现,import imgmetrics; imgmetrics.rgb_to_lab(rgb, white=(0.95047, 1.0, 1.08883));从台账取用则 opsimgmetrics.get("rgb_to_lab"))

用法

sRGB → CIE L*a*b*(D65)。测 ΔE 之前的一步。

xyz_to_lab(rgb_to_xyz(rgb), white) 的合成。校验和失败条件遵循这 2 个函数:

• rgb:最后一轴为 3。整数 dtype 按 dtype 的最大值归一化到 [0, 1], float 要求落在 [0, 1] 内(超出则 MetricContractError)。请传入带伽马的 sRGB,而不是线性 RGB。

• white:Lab 的白点。sRGB 的矩阵固定为 D65,所以通常保持默认。

• 返回值:与输入同形的 float64。L 在 [0, 100],白 (1, 1, 1) 约为 (100, 0, 0)。

2 幅图像的色差可用 delta_e_map 一次完成从转换到色差的全部计算。可用 lab_to_rgb 转回,但色域外的颜色会被截断。

详细使用指南

• image_difference_metrics 族使用指南

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

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

参考(示例数据、文献)

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

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

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

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

• image_quality_metrics — py -3.11 examples/image_quality_metrics.py

• poc_colormap_readability — py -3.11 examples/poc_colormap_readability.py

• poc_leaf_disease_area — py -3.11 examples/poc_leaf_disease_area.py

• poc_solder_fillet_aoi — py -3.11 examples/poc_solder_fillet_aoi.py

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

lab_to_rgb · delta_e_2000 · delta_e_76 · luma_limited_u8 · rank_data · tid2013_index

同类别(colorspace)

lab_to_rgb · rgb_to_xyz · xyz_to_lab


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

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