rgb2od

rgb2od(img)[source]

Convert from RGB to optical density (OD_RGB) space.

::math::

RGB = 255 * exp(-1*OD_RGB)

Parameters

img (numpy.ndarray of type numpy.uint8) – RGB image.

Returns

Optical density (OD) RGB image.

Return type

numpy.ndarray

Examples

>>> from tiatoolbox.utils import transforms, misc
>>> rgb_img = misc.imread('path/to/image')
>>> od_img = transforms.rgb2od(rgb_img)