Main Content

step

System object: visionhdl.ColorSpaceConverter
Package: visionhdl

Convert one pixel between color spaces

Syntax

[pixelOut,ctrlOut] = step(convert_color_space,pixelIn,ctrlIn)

Description

Note

Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

[pixelOut,ctrlOut] = step(convert_color_space,pixelIn,ctrlIn) converts a single pixel from one color space to another. The input, pixelIn is a vector of three values representing one pixel in R'G'B' or Y'CbCr color space. If the Conversion property is set to RGB to YCbCr or YCbCr to RGB, then pixelOut is a vector of three values representing one pixel. If the Conversion property is set to RGB to intensity, then pixelOut is a scalar value representing one pixel.

This object uses a streaming pixel interface with a structure for frame control signals. This interface enables the object to operate independently of image size and format, and to connect with other Vision HDL Toolbox™ objects. The object accepts and returns a scalar pixel value and control signals as a structure containing five signals. The control signals indicate the validity of each pixel and its location in the frame. To convert a pixel matrix into a pixel stream and control signals, use the visionhdl.FrameToPixels object. For a full description of the interface, see Streaming Pixel Interface.

Note

The ColorSpaceConverter System object operates on gamma-corrected color spaces. However, to simplify use of the System object, the property arguments do not include the prime notation.

Note

The System object performs an initialization the first time you call the step method. This initialization locks nontunable properties and input specifications, such as dimensions, complexity, and data type of the input data. If you change a nontunable property or an input specification, the object issues an error. To change nontunable properties or inputs, first call the release method to unlock the object.

Input Arguments

expand all

Specify a visionhdl.ColorSpaceConverter System object that you created and configured.

Input pixel in gamma-corrected R'G'B' or Y'CbCr color space, specified as a vector of unsigned integer values.

Supported data types:

  • uint8 or uint16

  • fixdt(0,N,0), N = 8,9,...,16

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

Control signals accompanying input pixel stream, specified as a pixelcontrol structure containing five logical data type signals. The signals describe the validity of the pixel and its location in the frame. For more details, see Pixel Control Structure.

Data Types: struct

Output Arguments

expand all

Output pixel specified as a vector of three unsigned integer values, or a scalar unsigned integer value.

  • If you set the Conversion property to RGB to YCbCr or YCbCr to RGB, then pixelOut is a vector representing the pixel in gamma-corrected color space.

  • If you set the Conversion property to RGB to intensity, then pixelOut is a scalar representing pixel intensity.

Supported data types:

  • uint8 or uint16

  • fixdt(0,N,0), N = 8,9,....,16

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

Control signals accompanying output the pixel stream, returned as a pixelcontrol structure containing five logical data type signals. The signals describe the validity of the pixel and its location in the frame. For more details, see Pixel Control Structure.

Data Types: struct

Introduced in R2015a