Image.chromaticity#

Image.chromaticity(which: str = 'RG') Self[source]#

Create chromaticity image

Parameters:

which (str, optional) – string comprising single letter color plane names, defaults to ‘RG’

Returns:

chromaticity image

Return type:

Image instance

Convert a tristimulus image to a chromaticity image. For the case of an RGB image and which='RG'

\[r = \frac{R}{R+G+B}, \, g = \frac{G}{R+G+B}\]

Example:

>>> from machinevisiontoolbox import Image
>>> img = Image.Read('flowers1.png')
>>> img.chromaticity()
Image(size=(640, 426), dtype=float32, nplanes=2, colororder=r:g)
>>> img.chromaticity('RB')
Image(size=(640, 426), dtype=float32, nplanes=2, colororder=r:b)

Note

The chromaticity color planes are the same as which but lower cased.

References:
Seealso:

tristim2cc