Main Content

Gamma Corrector

Apply or remove gamma correction of pixel stream

  • Library:
  • Vision HDL Toolbox / Conversions

  • Gamma Corrector block

Description

Gamma Corrector applies or removes gamma correction on a stream of pixels. Gamma correction adjusts linear pixel values so that the modified values fit a curve. The de-gamma operation performs the opposite operation to obtain linear pixel values.

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

Single image pixel of a pixel stream, specified as a scalar value representing intensity. 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

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.

Data Types: bus

Output

expand all

Single image pixel in a pixel stream, returned as a scalar value representing intensity. The data type of the output pixels is the same as the data type of the input pixels.

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

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.

Data Types: bus

Parameters

expand all

Direction of pixel value adjustment, specified as one of these options:

  • Gamma — Apply gamma correction.

  • De-gamma — Remove gamma correction.

Target gamma value, specified as a scalar greater than or equal to 1.

  • When you set Operation to Gamma, Gamma is the target gamma value of the output video stream.

  • When you set Operation to De-gamma, Gamma is the gamma value of the input video stream.

Option to include a linear segment in the gamma curve. When you select this check box, the gamma curve has a linear portion near the origin.

Pixel value that corresponds to the point where the gamma curve and linear segment meet, specified as a scalar value between 0 and 1, exclusive.

Dependencies

This parameter applies only when you select the Linear segment check box.

Algorithms

expand all

For the equations used for gamma correction, see Gamma Correction (Computer Vision Toolbox) in the Computer Vision Toolbox™ documentation.

To save hardware resources, the block implements the gamma correction equation as a lookup table. The lookup table maps each input pixel value to a corrected output value.

Extended Capabilities

See Also

Blocks

Objects

Introduced in R2015a