Colormap¶
- class Colormap(self, colormapType: visp._visp.core.Colormap.ColormapType)¶
Bases:
pybind11_object
Creates a colormap class to be able to recolor an image with different grayscale values into some corresponding color values, for better visualization for example.
Methods
Overloaded function.
Inherited Methods
Operators
__doc__
__module__
Attributes
COLORMAP_AUTUMN
COLORMAP_CIVIDIS
COLORMAP_COOL
COLORMAP_GIST_EARTH
COLORMAP_GNUPLOT
COLORMAP_GNUPLOT2
COLORMAP_HOT
COLORMAP_HSV
COLORMAP_INFERNO
COLORMAP_JET
COLORMAP_MAGMA
COLORMAP_OCEAN
COLORMAP_PLASMA
COLORMAP_RAINBOW
COLORMAP_SPRING
COLORMAP_SUMMER
COLORMAP_TERRAIN
COLORMAP_TURBO
COLORMAP_TWILIGHT
COLORMAP_TWILIGHT_SHIFTED
COLORMAP_VIRIDIS
COLORMAP_WINTER
__annotations__
- class ColormapType(self, value: int)¶
Bases:
pybind11_object
Values:
COLORMAP_AUTUMN
COLORMAP_CIVIDIS
COLORMAP_COOL
COLORMAP_GIST_EARTH
COLORMAP_GNUPLOT
COLORMAP_GNUPLOT2
COLORMAP_HOT
COLORMAP_HSV
COLORMAP_INFERNO
COLORMAP_JET
COLORMAP_MAGMA
COLORMAP_OCEAN
COLORMAP_PLASMA
COLORMAP_RAINBOW
COLORMAP_SPRING
COLORMAP_SUMMER
COLORMAP_TERRAIN
COLORMAP_TURBO
COLORMAP_TWILIGHT
COLORMAP_TWILIGHT_SHIFTED
COLORMAP_VIRIDIS
COLORMAP_WINTER
- __init__(self, colormapType: visp._visp.core.Colormap.ColormapType)¶
- convert(*args, **kwargs)¶
Overloaded function.
convert(self: visp._visp.core.Colormap, I: visp._visp.core.ImageGray, Icolor: visp._visp.core.ImageRGBa, normalize: bool = false) -> None
Apply a colormap to a 8-bit grayscale image:
if normalize is set to true, the min, max values are first extracted from I
the different values are remapped into the [0 - 255] range,
the colormap is applied on these unsigned char values,
otherwise, the grayscale values are directly mapped using the colormap.
- Parameters:
- I
The 8-bit grayscale image on which the colormap will be apply.
- Icolor
Colorized image.
- normalize
If true, normalization into the [0 - 255] range is applied, otherwise the grayscale values are directly mapped.
convert(self: visp._visp.core.Colormap, I: visp._visp.core.ImageRGBa, Icolor: visp._visp.core.ImageRGBa, normalize: bool = false) -> None
Apply a colormap to a 8-bit RGB image:
the RGB values are first converted to grayscale values,
if normalize is set to true, the min, max values are then extracted from I
the different values are remapped into the [0 - 255] range,
the colormap is applied on these unsigned char values,
otherwise, the grayscale values are directly mapped using the colormap.
- Parameters:
- I
The 8-bit grayscale image on which the colormap will be apply.
- Icolor
Colorized image.
- normalize
If true, normalization into the [0 - 255] range is applied, otherwise the grayscale values are directly mapped.
convert(self: visp._visp.core.Colormap, I: visp._visp.core.ImageFloat, Icolor: visp._visp.core.ImageRGBa) -> None
Apply a colormap to a floating-point image:
the min, max values are first extracted from I
the different values are remapped into the [0 - 255] range,
the colormap is applied on these unsigned char values.
- Parameters:
- I
The float image on which the colormap will be apply.
- Icolor
Colorized image.
convert(self: visp._visp.core.Colormap, I: visp._visp.core.ImageRGBf, Icolor: visp._visp.core.ImageRGBa) -> None
Apply a colormap to a 3 channels floating-point image:
the RGB values are converted using the grayscale formula,
the min, max values are first extracted from I
the different values are remapped into the [0 - 255] range,
the colormap is applied on these unsigned char values.
- Parameters:
- I
The float image on which the colormap will be apply.
- Icolor
Colorized image.