當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python cucim.skimage.color.xyz2luv用法及代碼示例

用法:

cucim.skimage.color.xyz2luv(xyz, illuminant='D65', observer='2')

XYZ 到CIE-Luv 顏色空間轉換。

參數

xyz(…, 3) 數組

XYZ 格式的圖像。最終維度表示渠道。

illuminant{“A”、“D50”、“D55”、“D65”、“D75”、“E”},可選

光源的名稱(函數不區分大小寫)。

observer{“2”, “10”},可選

觀察者的張角。

返回

out(..., 3) ndarray

CIE-Luv 格式的圖像。與輸入相同的尺寸。

拋出

ValueError

如果 xyz 不是至少具有形狀 (..., 3) 的二維。

ValueError

如果不支持或未知光源或觀察者角度。

注意

默認情況下,XYZ 轉換權重使用觀察者=2A。 D65 光源的參考白點,XYZ 三色值為 (95.047, 100., 108.883) 。有關支持的光源列表,請參見函數 ‘get_xyz_coords’。

參考

1

http://www.easyrgb.com/index.php?X=MATH&H=16#text16

2

https://en.wikipedia.org/wiki/CIELUV

例子

>>> import cupy as cp
>>> from skimage import data
>>> from cucim.skimage.color import rgb2xyz, xyz2luv
>>> img = cp.array(data.astronaut())
>>> img_xyz = rgb2xyz(img)
>>> img_luv = xyz2luv(img_xyz)

相關用法


注:本文由純淨天空篩選整理自rapids.ai大神的英文原創作品 cucim.skimage.color.xyz2luv。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。