Back to Adaptive Vision Studio website

You are here: Start » Filter Reference » Image » Image Point Transforms » LUTTransformImage

LUTTransformImage


Module: FoundationLite

Changes pixel values for data stored in array.

Name Type Description
inImage Image Input image
inRoi Region* Range of pixels to be processed
inColorPoints IntegerArray Last pixel value in which corresponding color will be replaced.
inColors PixelArray Colors corresponding to pixel levels defined in inColorPoints.
inComputeGradient Bool Compute the linear change of pixels colors between next palette colors.
outImage Image Output image

Requirements

For input inImage only pixel formats are supported: 1⨯uint8, 1⨯uint16, 1⨯int8, 1⨯int16.

Read more about pixel formats in Image documentation.

Description

Filter applies pixel color transformation using the defined transformation colors (look-up table).

Input inColorPoints defines the maximal pixel values that should be replaced with colors defined in inColors. First color replace all pixels from 0 to inColorPoints[0], second color will replace all colors from inColors[1]+1 to inColors[2] and so on. All pixel values higher than last inColorPoints will be replaced with black pixel.

If the input inComputeGradient is set to True then the pixel value is computed as a linear interpolation between current and previous color defined in inColors. For the first color in inColors the previous color is set to minimal value of current pixel format.

Filter converts a single channel image to three RGB channels image.

This filter works only with single channel images.

Hints

  • Consider resizing image to smaller format if image does not require to contain details.
  • This filter can be used to show differences between object and background noises.

Examples

The LUTTransformImage applied to a result of TestImage. In the middle image the inComputeGradient is set to False in the left image the inComputeGradient is set to True.

Remarks

Filter pre-computes after changing its parameter which can affect the filter's execution speed. Try to avoid changing filter's parameter during program execution.

If no color values are provided in inColorPoints filter returns an empty image.

If a single color value is provided in inColorPoints filter returns an image filled with this color.

Hardware Acceleration

This operation supports automatic parallelization for multicore and multiprocessor systems.

Errors

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

List of possible exceptions:

Error type Description
DomainError inColorPoints and InColors has different sizes LUTTransformImage.
DomainError inColorPoints must be sorted in raising order in LUTTransformImage.
DomainError Input image must have 1xUInt8, 1xUInt16, 1xInt8 or 1xInt16 format in LUTTransformImage.
DomainError Region exceeds an input image in LUTTransformImage.
DomainError Not supported inImage pixel format in LUTTransformImage.

Complexity Level

This filter is available on Expert Complexity Level.

See Also