Use LUT Mapping for visualization
Sensors often output 1-channel images, such as:
- depth maps
- range images
- intensity images
For visualization purposes, it's often easier to see details in the image by using colormapping. This is done by transforming pixel values using a LUT (lookup table), also known as a colormap. To apply a LUT to a texture, use the LUT Mapping node.
Input image | Output image |
---|---|
Choose the LUT type for your application
SensorSDK comes with many LUTs, found in Assets/Samples/SensorSDK/<version>/Sensors library/Colormaps/
. LUTs group into four categories:
- Sequential
- Diverging
- Cyclic
- Qualitative
Sequential LUTs
Sequential LUTs have a color gradient with no discontinuities from start to finish. Sequential LUTs describe ordinal data, like depth or intensity.
Here are the sequential LUTs provided by SensorSDK:
Name | Colormap |
---|---|
cool | |
gray | |
inferno | |
jet | |
turbo | |
viridis |
Diverging LUTs
Diverging LUTs have two color gradients on each side of the spectrum, with a median desaturated value. Diverging LUTs describe ordinal data, with a meaningful threshold value in the middle. For example, you can use a diverging LUT to color heights with one of two different hues, whether they're above or below a surface. You can also use them to color deviations with a 0 reference point.
Here are the diverging LUTs provided by SensorSDK:
Name | Colormap |
---|---|
BrBG | |
bwr | |
RdBu |
Cyclic LUTs
Cyclic LUTs have a color gradient with no discontinuities from start to finish, with the added property of having the same color at each end of the spectrum. Cyclic LUTs describe data that naturally wraps around. For example, you can use a cyclic LUT to color angle values, so that there is no hue discontinuity between 359 degrees and 0 degrees.
You can also use cyclic LUTs as an alternative to sequential LUTs when you need more contrast to distinguish small details. Instead of mapping the range of a sequential LUT to the data, a cyclic LUT range can repeat multiple times over the same data, yielding better resolution.
Here are the cyclic LUTs provided by SensorSDK:
Name | Colormap |
---|---|
colorwheel | |
hsv | |
twilight |
Qualitative LUTs
Qualitative LUTs transition abruptly from one color to the next. They describe discrete, nominal data. This is useful to color images with segmentation labels, so that consecutive label colors are as distinctive as possible.
Here are the Qualitative LUTs provided by SensorSDK:
Name | Colormap |
---|---|
glasbey |
Define the range of input values
Use the InputStart and InputEnd inputs of the LUT Mapping node to define the expected range of input values.
For example, to color a depth map with the turbo LUT, assuming a minimum depth of 0 meters and a maximum depth of 3.5 meters, set InputStart to 0 and InputEnd to 3.5. A depth of 0 meters will appear blue, and a depth of 3.5 meters will appear red.
To reverse a LUT, swap the values of InputStart and InputEnd.
Handle invalid input data
Some types of data can include invalid or unknown values. For example, when a depth sensor is unable to determine the depth at a particular pixel, a special invalid value is written to the depth map.
To distinguish the invalid data, you can use a special color not in the given LUT. For example, when coloring a depth map with the turbo LUT, you could set invalid points to be dark gray.
To use a special color, do the following:
- Set EnableSpecialValue to
true.
- Set InputSpecialValue to the value for invalid points in the input texture.
- Set OutputSpecialValue to the desired color for invalid points in the output texture.