Main Content

step

System object: visionhdl.FrameToPixels
Package: visionhdl

Convert image frame to pixel stream

Syntax

[pixels,ctrlOut] = step(F2P,frm)

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.

[pixels,ctrlOut] = step(F2P,frm) converts the input image matrix, frm, to a vector of pixel values, pixels, and an associated vector of control structures, ctrlOut. The control structure indicates the validity of each pixel and its location in the frame. The output pixels include padding around the active image, specified by the VideoFormat property.

See Streaming Pixel Interface for details of the pixel stream format.

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.PixelStreamAligner System object that you created and configured.

Input image, specified as an ActiveVideoLines-by-ActivePixelsPerLine-by-NumComponents matrix, where:

  • ActiveVideoLines is the height of the active image

  • ActivePixelsPerLine is the width of the active image

  • NumComponents is the number of components used to express a single pixel

Set the size of the active image using the VideoFormat property. If the dimensions of frm do not match that specified by VideoFormat, the object returns a warning.

Supported data types:

  • uint or int

  • fixdt()

  • logical

  • double or single

Output Arguments

expand all

Pixel values, returned as a P-by-NumComponents matrix or P-by-NumPixels matrix, where:

  • P is the total number of pixels in the padded image, calculated as TotalPixelsPerLine × TotalVideoLines.

  • NumComponents is the number of components used to express a single pixel.

  • NumPixels is the number of pixels transferred on the streaming interface per cycle. When NumPixels is greater than 1, you must set NumComponents to 1.

    Note

    You can simulate System objects with a multipixel streaming interface, but they are not supported for HDL code generation. Use the equivalent blocks to generate HDL code for multipixel algorithms.

Set the size of the padded image using the VideoFormat property. The data type of the pixel values is the same as im.

Control structures associated with the output pixels, returned as a P-by-1 vector. P is the total number of pixels in the padded image, calculated as TotalPixelsPerLine × TotalVideoLines. Each structure contains five control signals indicating the validity of the pixel and its location in the frame. For multipixel streaming, the control signals apply to each set of NumPixels values. See Pixel Control Structure.

Introduced in R2015a