System object: visionhdl.FrameToPixels
Convert image frame to pixel stream
[pixels,ctrlOut] = step(F2P,frm)
Starting in R2016b, instead of using the
to perform the operation defined by the System object™, you can
call the object with arguments, as if it were a function. For example,
= step(obj,x) and
y = obj(x) perform
[pixels,ctrlOut] = step(F2P,frm) converts the input image matrix,
frm, to a vector of pixel values,
and an associated vector of control structures,
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
See Streaming Pixel Interface for details of the pixel stream format.
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
to unlock the object.
visionhdl.PixelStreamAligner System object that
you created and configured.
frm— Input image
Input image, specified as an
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
If the dimensions of
frm do not match that specified
VideoFormat, the object returns a warning.
Supported data types:
pixels— Pixel values
Pixel values, returned as a P-by-
NumPixels matrix, where:
P is the total number of pixels in the
padded image, calculated as
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
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
ctrlOut— Pixel stream control signals
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
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.