rgb2od

rgb2od(img)[source]

Convert from RGB to optical density (OD_RGB) space. RGB = 255 * exp(-1*OD_RGB).

Parameters

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

Returns

Optical denisty 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)