Function File: intlut (A, LUT)

Convert integer values with lookup table (LUT).

Replace the values from the array A with the corresponding value from the lookup table LUT. This is equivalent as indexing LUT with A, with a base equal to A minimum possible value, i.e., intmin (A).

For the simplest case of uint8 and uint16 class, it corresponds to:

LUT(double (A) +1)

but without the temporary conversion of A to floating point thus reducing memory usage.

A and LUT must be of the same class, and uint8, uint16, or int16. LUT must have exactly 256 elements for class uint8, and 65536 for classes uint16 and int16. Output is of same class as LUT.

See also: ind2gray, ind2rgb, rgb2ind.

Package: image