Color Space Converter

Convert color information between color spaces

  • Library:
  • Vision HDL Toolbox / Conversions

  • Color Space Converter block

Description

The Color Space Converter block converts between R'G'B' and Y'CbCr color spaces, and also converts R'G'B' to intensity.

Note

The Color Space Converter block operates on gamma-corrected color spaces. However, for simplicity, the block and mask labels do not include the prime notation.

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 in Y'CbCr or R'G'B' color space, specified as a vector of three values. The values can be uint8, uint16, or fixdt(0,N,0), where N is from 8 through 16.

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

Data Types: single | double | uint8 | uint16 | fixed point

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.

Data Types: bus

Output

expand all

Single image pixel in intensity, Y'CbCr, or R'G'B' color space, returned as a scalar or a vector of three values. 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: single | double | uint8 | uint16 | fixed point

Control signals associated with the pixel stream, returned as 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.

Data Types: bus

Parameters

expand all

The block accepts input as a vector of three values representing a single pixel. If you choose RGB to intensity, the output is a scalar value. Otherwise, the output is a vector of three values.

Conversion equation used between R'G'B' and Y'CbCr color spaces.

Dependencies

This parameter applies only when you set Conversion to RGB to YCbCr or YCbCr to RGB.

Scanning standard used to convert between R'G'B' and Y'CbCr color spaces in HDTV format.

Dependencies

This parameter applies when you set Use conversion specified by to Rec. 709 (HDTV).

Algorithms

expand all

Extended Capabilities

Introduced in R2015a