What is the Lookup Table (LUT) feature?
The Lookup Table (LUT) feature allows you to transform the pixel values of an image directly inside the camera. Instead of applying a fixed mathematical function, the camera uses a user-defined table to map input pixel values to output values.
A LUT can be used for applications such as contrast enhancement, custom intensity mapping, or histogram equalization.
How does the LUT work?
The camera's lookup table contains 257 entries, with each entry represented by a 16-bit value.
For each pixel, the upper 8 bits of the input image data are used to select the corresponding LUT entry. The remaining bits are used to interpolate between the selected entry and one of its neighboring entries. This allows the LUT to provide a smooth mapping of the complete input range.
The LUT occupies 1028 bytes of memory. Each 16-bit LUT entry is aligned on a 32-bit boundary.
How can I configure the LUT?
The LUT is controlled using the following camera features:
-
LUT Enable - Enables or disables the lookup table.
-
LUT Index - Selects the LUT entry to be configured, with a range from 0 to 256.
-
LUT Value - Defines the 16-bit output value for the selected LUT entry, with a range from 0 to 65535.
-
LUT Value All - Allows the complete lookup table to be reprogrammed quickly.
This makes it possible to either modify individual LUT entries or replace the complete LUT efficiently.
How is the LUT applied to color images?
The way the LUT is applied depends on the selected pixel format:
-
YUV pixel formats: The LUT is applied only to the Y channel. The chrominance channels are not affected.
-
Bayer Raw and RGB24 pixel formats: The same LUT operation is applied to all color channels.
This means that a LUT can be used to modify the luminance information of a YUV image without directly altering its color information.
Can I use the LUT for histogram equalization?
Yes. A LUT can be used to implement image-processing functions such as histogram equalization directly in the camera.
The required mapping is calculated by the application and then written to the camera's LUT. The camera subsequently applies this mapping to the incoming pixel data.
Does the LUT affect gamma correction?
Yes. Gamma correction and the LUT use the same hardware in the camera.
Therefore, gamma correction is automatically disabled when the LUT is enabled. The two functions cannot be used simultaneously.
If gamma correction is required, disable the LUT. If a custom pixel-value transformation is required, enable the LUT and implement the desired mapping through the LUT values.
Are there examples of using the LUT with the IC4 SDK?
Yes. The IC4 SDK includes an example that demonstrates how to configure and use the camera's Lookup Table (LUT).
This example provides a practical starting point for applications that need to program LUT values or apply custom pixel-value mappings using IC4.