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:
Imageinstance
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
whichbut lower cased.- References:
P. Corke, Robotics, Vision & Control for Python, Springer, 2023, Section 10.2.5.
- Seealso: