step

System object: visionhdl.PixelsToFrame
Package: visionhdl

Convert pixel stream to image frame

Syntax

[frm,validOut] = step(P2F,pixels,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.

[frm,validOut] = step(P2F,pixels,ctrlIn) converts a vector of pixel values representing a padded image, pixels, and an associated vector of control structures, ctrlIn, to an image matrix, frm. The control structure indicates the validity of each pixel and its location in the frame. The output image, frm is valid if validOut is true.

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

Pixel values, specified 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. If the number of elements in pixels does not match that specified by VideoFormat, The object returns a warning.

Supported data types:

  • uint or int

  • fixdt()

  • logical

  • double or single

Control structures associated with the input pixels, specified 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. If the dimensions indicated by ctrlIn do not match that specified by VideoFormat, the object returns a warning.

Output Arguments

expand all

Image frame, returned 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. The data type of the pixel values is the same as pixels.

Frame status, returned as a logical value. When validOut is true, the frame is reassembled and ready for use.

Introduced in R2015a