Main Content

Lookup Table

Map input pixel to output pixel using custom rule

  • Library:
  • Vision HDL Toolbox / Conversions

  • Lookup Table block

Description

The Lookup Table block provides a custom one-to-one map between an input pixel value and an output pixel value.

Ports

This block uses a streaming pixel interface with a pixelcontrol bus for frame control signals. This interface enables the block to operate independently of image size and format. All Vision HDL Toolbox™ blocks use the same streaming interface. The block accepts and returns a scalar pixel value and a bus that contains five control signals. The control signals indicate the validity of each pixel and its location in the frame. To convert a frame (pixel matrix) into a serial pixel stream and control signals, use the Frame To Pixels block. For a full description of the interface, see Streaming Pixel Interface.

Input

expand all

For single pixel streaming, specify pixel as a scalar intensity value or a row vector of Number of components values. For multipixel streaming, specify pixel as a column vector of Number of pixels pixel intensity values. This block does not support multipixel-multicomponent streaming.

Integer and fixed-point data types larger than 16 bits are not supported.

double and single data types are supported for simulation, but not for HDL code generation.

Data Types: uint8 | uint16 | int8 | int16 | fixed point | Boolean | double | single

Specify a pixelcontrol bus that contains five signals. The signals describe the validity of the pixel and its location in the frame. For more information, see Pixel Control Bus.

For multipixel streaming, each vector of pixel values has one set of control signals. Because the vector has only one valid signal, the pixels in the vector must be either all valid or all invalid. The hStart and vStart signals apply to the pixel with the lowest index in the vector. The hEnd and vEnd signals apply to the pixel with the highest index in the vector.

Data Types: bus

Output

expand all

The dimensions of the output pixel match the dimensions of the input pixel. The block returns the output pixel as a scalar, a row vector of Number of components values, or a column vector of Number of pixels values.

The data type is specified by the Table data parameter.

Data Types: uint8 | uint16 | int8 | int16 | fixed point | Boolean | double | single

Specify a pixelcontrol bus that contains five signals. The signals describe the validity of the pixel and its location in the frame. For more information, see Pixel Control Bus.

For multipixel streaming, each vector of pixel values has one set of control signals. Because the vector has only one valid signal, the pixels in the vector are either all valid or all invalid. The hStart and vStart signals apply to the pixel with the lowest index in the vector. The hEnd and vEnd signals apply to the pixel with the highest index in the vector.

Data Types: bus

Parameters

expand all

Map between input pixel and output pixel, specified as a row or column vector of any data type. The data type of the table data determines the data type of the output pixel. This mapping determines the one-to-one correspondence between an input pixel value and an output pixel value.

  • The length of the vector must be 2WordLength, where WordLength is the size, in bits, of the input pixel. The Lookup Table block does not perform interpolation. Every input value must have a corresponding output value in the table.

  • The smallest representable value of the input data type maps to the first element of the table, the second smallest value maps to the second element, and so on. For example, if the input pixel has a data type of fixdt(0,3,1), the input value 0 maps to the first element of the table, 0.5 maps to the second element, 1 maps to the third element, and so on.

When the input pixel is a vector, the block replicates the lookup table for each element of the vector. In that case, the tables use VectorSize×2WordLength memory locations.

Example: uint8(linspace(255,0,256))

Algorithms

expand all

Extended Capabilities

Introduced in R2015a