color
¶skimage.color.combine_stains (stains, conv_matrix) |
Stain to RGB color space conversion. |
skimage.color.convert_colorspace (arr, …) |
Convert an image array to a new color space. |
skimage.color.deltaE_cie76 (lab1, lab2) |
Euclidean distance between two points in Lab color space |
skimage.color.deltaE_ciede2000 (lab1, lab2[, …]) |
Color difference as given by the CIEDE 2000 standard. |
skimage.color.deltaE_ciede94 (lab1, lab2[, …]) |
Color difference according to CIEDE 94 standard |
skimage.color.deltaE_cmc (lab1, lab2[, kL, kC]) |
Color difference from the CMC l:c standard. |
skimage.color.gray2rgb (image[, alpha]) |
Create an RGB representation of a gray-level image. |
skimage.color.grey2rgb (image[, alpha]) |
Create an RGB representation of a gray-level image. |
skimage.color.guess_spatial_dimensions (image) |
Make an educated guess about whether an image has a channels dimension. |
skimage.color.hed2rgb (hed) |
Haematoxylin-Eosin-DAB (HED) to RGB color space conversion. |
skimage.color.hsv2rgb (hsv) |
HSV to RGB color space conversion. |
skimage.color.lab2lch (lab) |
CIE-LAB to CIE-LCH color space conversion. |
skimage.color.lab2rgb (lab[, illuminant, …]) |
Lab to RGB color space conversion. |
skimage.color.lab2xyz (lab[, illuminant, …]) |
CIE-LAB to XYZcolor space conversion. |
skimage.color.label2rgb (label[, image, …]) |
Return an RGB image where color-coded labels are painted over the image. |
skimage.color.lch2lab (lch) |
CIE-LCH to CIE-LAB color space conversion. |
skimage.color.luv2rgb (luv) |
Luv to RGB color space conversion. |
skimage.color.luv2xyz (luv[, illuminant, …]) |
CIE-Luv to XYZ color space conversion. |
skimage.color.rgb2gray (rgb) |
Compute luminance of an RGB image. |
skimage.color.rgb2grey (rgb) |
Compute luminance of an RGB image. |
skimage.color.rgb2hed (rgb) |
RGB to Haematoxylin-Eosin-DAB (HED) color space conversion. |
skimage.color.rgb2hsv (rgb) |
RGB to HSV color space conversion. |
skimage.color.rgb2lab (rgb[, illuminant, …]) |
RGB to lab color space conversion. |
skimage.color.rgb2luv (rgb) |
RGB to CIE-Luv color space conversion. |
skimage.color.rgb2rgbcie (rgb) |
RGB to RGB CIE color space conversion. |
skimage.color.rgb2xyz (rgb) |
RGB to XYZ color space conversion. |
skimage.color.rgb2ycbcr (rgb) |
RGB to YCbCr color space conversion. |
skimage.color.rgb2yiq (rgb) |
RGB to YIQ color space conversion. |
skimage.color.rgb2ypbpr (rgb) |
RGB to YPbPr color space conversion. |
skimage.color.rgb2yuv (rgb) |
RGB to YUV color space conversion. |
skimage.color.rgba2rgb (rgba[, background]) |
RGBA to RGB conversion. |
skimage.color.rgbcie2rgb (rgbcie) |
RGB CIE to RGB color space conversion. |
skimage.color.separate_stains (rgb, conv_matrix) |
RGB to stain color space conversion. |
skimage.color.xyz2lab (xyz[, illuminant, …]) |
XYZ to CIE-LAB color space conversion. |
skimage.color.xyz2luv (xyz[, illuminant, …]) |
XYZ to CIE-Luv color space conversion. |
skimage.color.xyz2rgb (xyz) |
XYZ to RGB color space conversion. |
skimage.color.ycbcr2rgb (ycbcr) |
YCbCr to RGB color space conversion. |
skimage.color.yiq2rgb (yiq) |
YIQ to RGB color space conversion. |
skimage.color.ypbpr2rgb (ypbpr) |
YPbPr to RGB color space conversion. |
skimage.color.yuv2rgb (yuv) |
YUV to RGB color space conversion. |
skimage.color.colorconv |
Functions for converting between color spaces. |
skimage.color.colorlabel |
|
skimage.color.delta_e |
Functions for calculating the “distance” between colors. |
skimage.color.rgb_colors |
skimage.color.
combine_stains
(stains, conv_matrix)[source]¶Stain to RGB color space conversion.
Parameters: | stains : array_like
conv_matrix: ndarray
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
Notes
Stain combination matrices available in the color
module and their
respective colorspace:
rgb_from_hed
: Hematoxylin + Eosin + DABrgb_from_hdx
: Hematoxylin + DABrgb_from_fgx
: Feulgen + Light Greenrgb_from_bex
: Giemsa stain : Methyl Blue + Eosinrgb_from_rbd
: FastRed + FastBlue + DABrgb_from_gdx
: Methyl Green + DABrgb_from_hax
: Hematoxylin + AECrgb_from_bro
: Blue matrix Anilline Blue + Red matrix Azocarmine + Orange matrix Orange-Grgb_from_bpx
: Methyl Blue + Ponceau Fuchsinrgb_from_ahx
: Alcian Blue + Hematoxylinrgb_from_hpx
: Hematoxylin + PASReferences
[R9393] | (1, 2) http://www.dentistry.bham.ac.uk/landinig/software/cdeconv/cdeconv.html |
Examples
>>> from skimage import data
>>> from skimage.color import (separate_stains, combine_stains,
... hdx_from_rgb, rgb_from_hdx)
>>> ihc = data.immunohistochemistry()
>>> ihc_hdx = separate_stains(ihc, hdx_from_rgb)
>>> ihc_rgb = combine_stains(ihc_hdx, rgb_from_hdx)
skimage.color.
convert_colorspace
(arr, fromspace, tospace)[source]¶Convert an image array to a new color space.
Parameters: | arr : array_like
fromspace : str
tospace : str
|
---|---|
Returns: | newarr : ndarray
|
Notes
Conversion occurs through the “central” RGB color space, i.e. conversion
from XYZ to HSV is implemented as XYZ -> RGB -> HSV
instead of
directly.
Examples
>>> from skimage import data
>>> img = data.astronaut()
>>> img_hsv = convert_colorspace(img, 'RGB', 'HSV')
skimage.color.
deltaE_cie76
(lab1, lab2)[source]¶Euclidean distance between two points in Lab color space
Parameters: | lab1 : array_like
lab2 : array_like
|
---|---|
Returns: | dE : array_like
|
References
[R9596] | http://en.wikipedia.org/wiki/Color_difference |
[R9696] | A. R. Robertson, “The CIE 1976 color-difference formulae,” Color Res. Appl. 2, 7-11 (1977). |
skimage.color.
deltaE_ciede2000
(lab1, lab2, kL=1, kC=1, kH=1)[source]¶Color difference as given by the CIEDE 2000 standard.
CIEDE 2000 is a major revision of CIDE94. The perceptual calibration is largely based on experience with automotive paint on smooth surfaces.
Parameters: | lab1 : array_like
lab2 : array_like
kL : float (range), optional
kC : float (range), optional
kH : float (range), optional
|
---|---|
Returns: | deltaE : array_like
|
Notes
CIEDE 2000 assumes parametric weighting factors for the lightness, chroma, and hue (kL, kC, kH respectively). These default to 1.
References
[R99101] | http://en.wikipedia.org/wiki/Color_difference |
[R100101] | http://www.ece.rochester.edu/~gsharma/ciede2000/ciede2000noteCRNA.pdf (doi:10.1364/AO.33.008069) |
[R101101] | M. Melgosa, J. Quesada, and E. Hita, “Uniformity of some recent color metrics tested with an accurate color-difference tolerance dataset,” Appl. Opt. 33, 8069-8077 (1994). |
skimage.color.
deltaE_ciede94
(lab1, lab2, kH=1, kC=1, kL=1, k1=0.045, k2=0.015)[source]¶Color difference according to CIEDE 94 standard
Accommodates perceptual non-uniformities through the use of application specific scale factors (kH, kC, kL, k1, and k2).
Parameters: | lab1 : array_like
lab2 : array_like
kH : float, optional
kC : float, optional
kL : float, optional
k1 : float, optional
k2 : float, optional
|
---|---|
Returns: | dE : array_like
|
Notes
deltaE_ciede94 is not symmetric with respect to lab1 and lab2. CIEDE94 defines the scales for the lightness, hue, and chroma in terms of the first color. Consequently, the first color should be regarded as the “reference” color.
kL, k1, k2 depend on the application and default to the values suggested for graphic arts
Parameter | Graphic Arts | Textiles |
---|---|---|
kL | 1.000 | 2.000 |
k1 | 0.045 | 0.048 |
k2 | 0.015 | 0.014 |
References
[R105106] | http://en.wikipedia.org/wiki/Color_difference |
[R106106] | http://www.brucelindbloom.com/index.html?Eqn_DeltaE_CIE94.html |
skimage.color.
deltaE_cmc
(lab1, lab2, kL=1, kC=1)[source]¶Color difference from the CMC l:c standard.
This color difference was developed by the Colour Measurement Committee (CMC) of the Society of Dyers and Colourists (United Kingdom). It is intended for use in the textile industry.
The scale factors kL, kC set the weight given to differences in
lightness and chroma relative to differences in hue. The usual values are
kL=2
, kC=1
for “acceptability” and kL=1
, kC=1
for
“imperceptibility”. Colors with dE > 1
are “different” for the given
scale factors.
Parameters: | lab1 : array_like
lab2 : array_like
|
---|---|
Returns: | dE : array_like
|
Notes
deltaE_cmc the defines the scales for the lightness, hue, and chroma
in terms of the first color. Consequently
deltaE_cmc(lab1, lab2) != deltaE_cmc(lab2, lab1)
References
[R109111] | http://en.wikipedia.org/wiki/Color_difference |
[R110111] | http://www.brucelindbloom.com/index.html?Eqn_DeltaE_CIE94.html |
[R111111] | F. J. J. Clarke, R. McDonald, and B. Rigg, “Modification to the JPC79 colour-difference formula,” J. Soc. Dyers Colour. 100, 128-132 (1984). |
skimage.color.
gray2rgb
(image, alpha=None)[source]¶Create an RGB representation of a gray-level image.
Parameters: | image : array_like
alpha : bool, optional
|
---|---|
Returns: | rgb : ndarray
|
Raises: | ValueError
|
skimage.color.
grey2rgb
(image, alpha=None)[source]¶Create an RGB representation of a gray-level image.
Parameters: | image : array_like
alpha : bool, optional
|
---|---|
Returns: | rgb : ndarray
|
Raises: | ValueError
|
skimage.color.
guess_spatial_dimensions
(image)[source]¶Make an educated guess about whether an image has a channels dimension.
Parameters: | image : ndarray
|
---|---|
Returns: | spatial_dims : int or None
|
Raises: | ValueError
|
skimage.color.
hed2rgb
(hed)[source]¶Haematoxylin-Eosin-DAB (HED) to RGB color space conversion.
Parameters: | hed : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
References
[R115115] | A. C. Ruifrok and D. A. Johnston, “Quantification of histochemical staining by color deconvolution.,” Analytical and quantitative cytology and histology / the International Academy of Cytology [and] American Society of Cytology, vol. 23, no. 4, pp. 291-9, Aug. 2001. |
Examples
>>> from skimage import data
>>> from skimage.color import rgb2hed, hed2rgb
>>> ihc = data.immunohistochemistry()
>>> ihc_hed = rgb2hed(ihc)
>>> ihc_rgb = hed2rgb(ihc_hed)
skimage.color.
hsv2rgb
(hsv)[source]¶HSV to RGB color space conversion.
Parameters: | hsv : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
Notes
Conversion between RGB and HSV color spaces results in some loss of precision, due to integer arithmetic and rounding [R117117].
References
[R117117] | (1, 2) http://en.wikipedia.org/wiki/HSL_and_HSV |
Examples
>>> from skimage import data
>>> img = data.astronaut()
>>> img_hsv = rgb2hsv(img)
>>> img_rgb = hsv2rgb(img_hsv)
skimage.color.
lab2lch
(lab)[source]¶CIE-LAB to CIE-LCH color space conversion.
LCH is the cylindrical representation of the LAB (Cartesian) colorspace
Parameters: | lab : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
Notes
The Hue is expressed as an angle between (0, 2*pi)
Examples
>>> from skimage import data
>>> from skimage.color import rgb2lab, lab2lch
>>> img = data.astronaut()
>>> img_lab = rgb2lab(img)
>>> img_lch = lab2lch(img_lab)
skimage.color.
lab2rgb
(lab, illuminant='D65', observer='2')[source]¶Lab to RGB color space conversion.
Parameters: | lab : array_like
illuminant : {“A”, “D50”, “D55”, “D65”, “D75”, “E”}, optional
observer : {“2”, “10”}, optional
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
Notes
This function uses lab2xyz and xyz2rgb. By default Observer= 2A, Illuminant= D65. CIE XYZ tristimulus values x_ref=95.047, y_ref=100., z_ref=108.883. See function get_xyz_coords for a list of supported illuminants.
References
[R119119] | https://en.wikipedia.org/wiki/Standard_illuminant |
skimage.color.
lab2xyz
(lab, illuminant='D65', observer='2')[source]¶CIE-LAB to XYZcolor space conversion.
Parameters: | lab : array_like
illuminant : {“A”, “D50”, “D55”, “D65”, “D75”, “E”}, optional
observer : {“2”, “10”}, optional
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
ValueError
UserWarning
|
Notes
By default Observer= 2A, Illuminant= D65. CIE XYZ tristimulus values x_ref = 95.047, y_ref = 100., z_ref = 108.883. See function ‘get_xyz_coords’ for a list of supported illuminants.
References
[R121122] | http://www.easyrgb.com/index.php?X=MATH&H=07#text7 |
[R122122] | http://en.wikipedia.org/wiki/Lab_color_space |
skimage.color.
label2rgb
(label, image=None, colors=None, alpha=0.3, bg_label=-1, bg_color=(0, 0, 0), image_alpha=1, kind='overlay')[source]¶Return an RGB image where color-coded labels are painted over the image.
Parameters: | label : array, shape (M, N)
image : array, shape (M, N, 3), optional
colors : list, optional
alpha : float [0, 1], optional
bg_label : int, optional
bg_color : str or array, optional
image_alpha : float [0, 1], optional
kind : string, one of {‘overlay’, ‘avg’}
|
---|---|
Returns: | result : array of float, shape (M, N, 3)
|
skimage.color.
lch2lab
(lch)[source]¶CIE-LCH to CIE-LAB color space conversion.
LCH is the cylindrical representation of the LAB (Cartesian) colorspace
Parameters: | lch : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
Examples
>>> from skimage import data
>>> from skimage.color import rgb2lab, lch2lab
>>> img = data.astronaut()
>>> img_lab = rgb2lab(img)
>>> img_lch = lab2lch(img_lab)
>>> img_lab2 = lch2lab(img_lch)
skimage.color.
luv2rgb
(luv)[source]¶Luv to RGB color space conversion.
Parameters: | luv : (M, N, [P,] 3) array_like
|
---|---|
Returns: | out : (M, N, [P,] 3) ndarray
|
Raises: | ValueError
|
Notes
This function uses luv2xyz and xyz2rgb.
skimage.color.
luv2xyz
(luv, illuminant='D65', observer='2')[source]¶CIE-Luv to XYZ color space conversion.
Parameters: | luv : (M, N, [P,] 3) array_like
illuminant : {“A”, “D50”, “D55”, “D65”, “D75”, “E”}, optional
observer : {“2”, “10”}, optional
|
---|---|
Returns: | out : (M, N, [P,] 3) ndarray
|
Raises: | ValueError
ValueError
|
Notes
XYZ conversion weights use observer=2A. Reference whitepoint for D65
Illuminant, with XYZ tristimulus values of (95.047, 100., 108.883)
. See
function ‘get_xyz_coords’ for a list of supported illuminants.
References
[R125126] | http://www.easyrgb.com/index.php?X=MATH&H=16#text16 |
[R126126] | http://en.wikipedia.org/wiki/CIELUV |
skimage.color.
rgb2gray
(rgb)[source]¶Compute luminance of an RGB image.
Parameters: | rgb : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
Notes
The weights used in this conversion are calibrated for contemporary CRT phosphors:
Y = 0.2125 R + 0.7154 G + 0.0721 B
If there is an alpha channel present, it is ignored.
References
[R129129] | http://www.poynton.com/PDFs/ColorFAQ.pdf |
Examples
>>> from skimage.color import rgb2gray
>>> from skimage import data
>>> img = data.astronaut()
>>> img_gray = rgb2gray(img)
skimage.color.
rgb2grey
(rgb)[source]¶Compute luminance of an RGB image.
Parameters: | rgb : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
Notes
The weights used in this conversion are calibrated for contemporary CRT phosphors:
Y = 0.2125 R + 0.7154 G + 0.0721 B
If there is an alpha channel present, it is ignored.
References
[R131131] | http://www.poynton.com/PDFs/ColorFAQ.pdf |
Examples
>>> from skimage.color import rgb2gray
>>> from skimage import data
>>> img = data.astronaut()
>>> img_gray = rgb2gray(img)
skimage.color.
rgb2hed
(rgb)[source]¶RGB to Haematoxylin-Eosin-DAB (HED) color space conversion.
Parameters: | rgb : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
References
[R133133] | A. C. Ruifrok and D. A. Johnston, “Quantification of histochemical staining by color deconvolution.,” Analytical and quantitative cytology and histology / the International Academy of Cytology [and] American Society of Cytology, vol. 23, no. 4, pp. 291-9, Aug. 2001. |
Examples
>>> from skimage import data
>>> from skimage.color import rgb2hed
>>> ihc = data.immunohistochemistry()
>>> ihc_hed = rgb2hed(ihc)
skimage.color.
rgb2hsv
(rgb)[source]¶RGB to HSV color space conversion.
Parameters: | rgb : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
Notes
Conversion between RGB and HSV color spaces results in some loss of precision, due to integer arithmetic and rounding [R135135].
References
[R135135] | (1, 2) http://en.wikipedia.org/wiki/HSL_and_HSV |
Examples
>>> from skimage import color
>>> from skimage import data
>>> img = data.astronaut()
>>> img_hsv = color.rgb2hsv(img)
skimage.color.
rgb2lab
(rgb, illuminant='D65', observer='2')[source]¶RGB to lab color space conversion.
Parameters: | rgb : array_like
illuminant : {“A”, “D50”, “D55”, “D65”, “D75”, “E”}, optional
observer : {“2”, “10”}, optional
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
Notes
This function uses rgb2xyz and xyz2lab. By default Observer= 2A, Illuminant= D65. CIE XYZ tristimulus values x_ref=95.047, y_ref=100., z_ref=108.883. See function get_xyz_coords for a list of supported illuminants.
References
[R137137] | https://en.wikipedia.org/wiki/Standard_illuminant |
skimage.color.
rgb2luv
(rgb)[source]¶RGB to CIE-Luv color space conversion.
Parameters: | rgb : (M, N, [P,] 3) array_like
|
---|---|
Returns: | out : (M, N, [P,] 3) ndarray
|
Raises: | ValueError
|
Notes
This function uses rgb2xyz and xyz2luv.
References
[R139141] | http://www.easyrgb.com/index.php?X=MATH&H=16#text16 |
[R140141] | http://www.easyrgb.com/index.php?X=MATH&H=02#text2 |
[R141141] | http://en.wikipedia.org/wiki/CIELUV |
skimage.color.
rgb2rgbcie
(rgb)[source]¶RGB to RGB CIE color space conversion.
Parameters: | rgb : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
References
[R145145] | http://en.wikipedia.org/wiki/CIE_1931_color_space |
Examples
>>> from skimage import data
>>> from skimage.color import rgb2rgbcie
>>> img = data.astronaut()
>>> img_rgbcie = rgb2rgbcie(img)
skimage.color.
rgb2xyz
(rgb)[source]¶RGB to XYZ color space conversion.
Parameters: | rgb : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
Notes
The CIE XYZ color space is derived from the CIE RGB color space. Note however that this function converts from sRGB.
References
[R147147] | http://en.wikipedia.org/wiki/CIE_1931_color_space |
Examples
>>> from skimage import data
>>> img = data.astronaut()
>>> img_xyz = rgb2xyz(img)
skimage.color.
rgb2ycbcr
(rgb)[source]¶RGB to YCbCr color space conversion.
Parameters: | rgb : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
Notes
Y is between 16 and 235. This is the color space which is commonly used by video codecs, it is sometimes incorrectly called “YUV”
References
[R149149] | https://en.wikipedia.org/wiki/YCbCr |
skimage.color.
rgb2yiq
(rgb)[source]¶RGB to YIQ color space conversion.
Parameters: | rgb : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
skimage.color.
rgb2ypbpr
(rgb)[source]¶RGB to YPbPr color space conversion.
Parameters: | rgb : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
References
[R151151] | https://en.wikipedia.org/wiki/YPbPr |
skimage.color.
rgb2yuv
(rgb)[source]¶RGB to YUV color space conversion.
Parameters: | rgb : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
Notes
Y is between 0 and 1. Use YCbCr instead of YUV for the color space which is commonly used by video codecs (where Y ranges from 16 to 235)
References
[R153153] | https://en.wikipedia.org/wiki/YUV |
skimage.color.
rgba2rgb
(rgba, background=(1, 1, 1))[source]¶RGBA to RGB conversion.
Parameters: | rgba : array_like
background : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
References
[R155155] | https://en.wikipedia.org/wiki/Alpha_compositing#Alpha_blending |
Examples
>>> from skimage import color
>>> from skimage import data
>>> img_rgba = data.logo()
>>> img_rgb = color.rgba2rgb(img_rgba)
skimage.color.
rgbcie2rgb
(rgbcie)[source]¶RGB CIE to RGB color space conversion.
Parameters: | rgbcie : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
References
[R157157] | http://en.wikipedia.org/wiki/CIE_1931_color_space |
Examples
>>> from skimage import data
>>> from skimage.color import rgb2rgbcie, rgbcie2rgb
>>> img = data.astronaut()
>>> img_rgbcie = rgb2rgbcie(img)
>>> img_rgb = rgbcie2rgb(img_rgbcie)
skimage.color.
separate_stains
(rgb, conv_matrix)[source]¶RGB to stain color space conversion.
Parameters: | rgb : array_like
conv_matrix: ndarray
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
Notes
Stain separation matrices available in the color
module and their
respective colorspace:
hed_from_rgb
: Hematoxylin + Eosin + DABhdx_from_rgb
: Hematoxylin + DABfgx_from_rgb
: Feulgen + Light Greenbex_from_rgb
: Giemsa stain : Methyl Blue + Eosinrbd_from_rgb
: FastRed + FastBlue + DABgdx_from_rgb
: Methyl Green + DABhax_from_rgb
: Hematoxylin + AECbro_from_rgb
: Blue matrix Anilline Blue + Red matrix Azocarmine + Orange matrix Orange-Gbpx_from_rgb
: Methyl Blue + Ponceau Fuchsinahx_from_rgb
: Alcian Blue + Hematoxylinhpx_from_rgb
: Hematoxylin + PASReferences
[R159159] | (1, 2) http://www.dentistry.bham.ac.uk/landinig/software/cdeconv/cdeconv.html |
Examples
>>> from skimage import data
>>> from skimage.color import separate_stains, hdx_from_rgb
>>> ihc = data.immunohistochemistry()
>>> ihc_hdx = separate_stains(ihc, hdx_from_rgb)
skimage.color.
xyz2lab
(xyz, illuminant='D65', observer='2')[source]¶XYZ to CIE-LAB color space conversion.
Parameters: | xyz : array_like
illuminant : {“A”, “D50”, “D55”, “D65”, “D75”, “E”}, optional
observer : {“2”, “10”}, optional
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
ValueError
|
Notes
By default Observer= 2A, Illuminant= D65. CIE XYZ tristimulus values x_ref=95.047, y_ref=100., z_ref=108.883. See function get_xyz_coords for a list of supported illuminants.
References
[R161162] | http://www.easyrgb.com/index.php?X=MATH&H=07#text7 |
[R162162] | http://en.wikipedia.org/wiki/Lab_color_space |
Examples
>>> from skimage import data
>>> from skimage.color import rgb2xyz, xyz2lab
>>> img = data.astronaut()
>>> img_xyz = rgb2xyz(img)
>>> img_lab = xyz2lab(img_xyz)
skimage.color.
xyz2luv
(xyz, illuminant='D65', observer='2')[source]¶XYZ to CIE-Luv color space conversion.
Parameters: | xyz : (M, N, [P,] 3) array_like
illuminant : {“A”, “D50”, “D55”, “D65”, “D75”, “E”}, optional
observer : {“2”, “10”}, optional
|
---|---|
Returns: | out : (M, N, [P,] 3) ndarray
|
Raises: | ValueError
ValueError
|
Notes
By default XYZ conversion weights use observer=2A. Reference whitepoint
for D65 Illuminant, with XYZ tristimulus values of (95.047, 100.,
108.883)
. See function ‘get_xyz_coords’ for a list of supported
illuminants.
References
[R165166] | http://www.easyrgb.com/index.php?X=MATH&H=16#text16 |
[R166166] | http://en.wikipedia.org/wiki/CIELUV |
Examples
>>> from skimage import data
>>> from skimage.color import rgb2xyz, xyz2luv
>>> img = data.astronaut()
>>> img_xyz = rgb2xyz(img)
>>> img_luv = xyz2luv(img_xyz)
skimage.color.
xyz2rgb
(xyz)[source]¶XYZ to RGB color space conversion.
Parameters: | xyz : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
Notes
The CIE XYZ color space is derived from the CIE RGB color space. Note however that this function converts to sRGB.
References
[R169169] | http://en.wikipedia.org/wiki/CIE_1931_color_space |
Examples
>>> from skimage import data
>>> from skimage.color import rgb2xyz, xyz2rgb
>>> img = data.astronaut()
>>> img_xyz = rgb2xyz(img)
>>> img_rgb = xyz2rgb(img_xyz)
skimage.color.
ycbcr2rgb
(ycbcr)[source]¶YCbCr to RGB color space conversion.
Parameters: | ycbcr : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
Notes
Y is between 16 and 235. This is the color space which is commonly used by video codecs, it is sometimes incorrectly called “YUV”
References
[R171171] | https://en.wikipedia.org/wiki/YCbCr |
skimage.color.
yiq2rgb
(yiq)[source]¶YIQ to RGB color space conversion.
Parameters: | yiq : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
skimage.color.
ypbpr2rgb
(ypbpr)[source]¶YPbPr to RGB color space conversion.
Parameters: | ypbpr : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
References
[R173173] | https://en.wikipedia.org/wiki/YPbPr |
skimage.color.
yuv2rgb
(yuv)[source]¶YUV to RGB color space conversion.
Parameters: | yuv : array_like
|
---|---|
Returns: | out : ndarray
|
Raises: | ValueError
|
References
[R175175] | https://en.wikipedia.org/wiki/YUV |