Main Content

Lookup Table

Map input pixel to output pixel using custom rule

  • Lookup Table block

Libraries:
Vision HDL Toolbox / Conversions

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 bus for frame control signals. This interface enables the block to operate independently of image size and format. The pixel ports on this block support single pixel streaming or multipixel streaming. Single pixel streaming accepts and returns a single pixel value each clock cycle. Multipixel streaming accepts and returns a vector of M pixels per clock cycle to support high-frame-rate or high-resolution formats. The M value corresponds to the Number of pixels parameter of the Frame To Pixels block. Along with the pixel, the block accepts and returns a pixelcontrol bus that contains five control signals. The control signals indicate the validity of each pixel and their location in the frame. For multipixel streaming, one set of control signals applies to all pixels in the vector. 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. Number of pixels can be two, four, or eight. This block does not support multipixel-multicomponent streaming.

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

Data Types: uint8 | uint16 | fixdt(0,N,F), N <= 16 | Boolean

The pixelcontrol bus 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.

The software supports double and single data types for simulation, but not for HDL code generation.

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

The pixelcontrol bus 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

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

Version History

Introduced in R2015a

expand all