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

__init__

convert

Overloaded function.

Inherited Methods

Operators

__doc__

__init__

__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

__and__(self, other: object) object
__eq__(self, other: object) bool
__ge__(self, other: object) bool
__getstate__(self) int
__gt__(self, other: object) bool
__hash__(self) int
__index__(self) int
__init__(self, value: int)
__int__(self) int
__invert__(self) object
__le__(self, other: object) bool
__lt__(self, other: object) bool
__ne__(self, other: object) bool
__or__(self, other: object) object
__rand__(self, other: object) object
__ror__(self, other: object) object
__rxor__(self, other: object) object
__setstate__(self, state: int) None
__xor__(self, other: object) object
property name : str
__init__(self, colormapType: visp._visp.core.Colormap.ColormapType)
convert(*args, **kwargs)

Overloaded function.

  1. 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.

  1. 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.

  1. 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.

  1. 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.