CIE XYZ#
Tip
Learn more: https://en.wikipedia.org/wiki/CIE_1931_color_space
Functions#
- kornia.color.rgb_to_xyz(image)[source]#
Convert a RGB image to XYZ.
- Parameters:
image (
Tensor) – RGB Image to be converted to XYZ with shape \((*, 3, H, W)\).- Return type:
- Returns:
XYZ version of the image with shape \((*, 3, H, W)\).
Example
>>> input = torch.rand(2, 3, 4, 5) >>> output = rgb_to_xyz(input) # 2x3x4x5
- kornia.color.xyz_to_rgb(image)[source]#
Convert a XYZ image to RGB.
- Parameters:
image (
Tensor) – XYZ Image to be converted to RGB with shape \((*, 3, H, W)\).- Return type:
- Returns:
RGB version of the image with shape \((*, 3, H, W)\).
Example
>>> input = torch.rand(2, 3, 4, 5) >>> output = xyz_to_rgb(input) # 2x3x4x5
Modules#
- class kornia.color.RgbToXyz(*args, **kwargs)[source]#
Convert an image from RGB to XYZ.
The image data is assumed to be in the range of (0, 1).
- Returns:
XYZ version of the image.
- Shape:
image: \((*, 3, H, W)\)
output: \((*, 3, H, W)\)
Examples
>>> input = torch.rand(2, 3, 4, 5) >>> xyz = RgbToXyz() >>> output = xyz(input) # 2x3x4x5