visionhdl.LineBuffer
Store video lines and return neighborhood pixels
Description
The visionhdl.LineBuffer
System object™ selects neighborhood pixels from streaming image data. It handles video control
signals and edge padding, and is pipelined for high-speed video designs. The object outputs
one column of the neighborhood at a time. To compose a neighborhood for further processing,
use the shiftEnable
signal to store the output columns, including padding,
in a shift register. This object allows you to share the line buffer resources when your
design performs multiple operations on the same neighborhood.
The following waveform shows the
visionhdl.LineBuffer
object returning 5-by-1 pixel columns that make up a
5-by-5 neighborhood. The time frame shown is at the beginning (top-left corner) of an input
frame. The output starts after the object has stored two (floor(M/2)
) lines
and is receiving the start of the third line. The shiftEnable
signal is
asserted two cycles earlier than the output ctrl.valid
signal, which
indicates that the first two (floor(M/2)
) columns are exclusively padding
pixels. Similarly, shiftEnable
stays high for two extra cycles at the end
of the line.
To extract sliding pixel neighborhoods from a video stream:
Create the
visionhdl.LineBuffer
object and set its properties.Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?
Creation
Description
lineMem = visionhdl.LineBuffer(
returns a line buffer System object. Set properties using name-value pairs. Enclose each property name in single
quotes. Name
,Value
)
Example: lineMem = visionhdl.LineBuffer('NeighborhoodSize',[5
5])
Properties
Usage
Description
[
returns a column vector of pixels in the kernel, and accompanying control signals.pixelout
,ctrlout
,shiftEnable
] = lineMem(pixelin
,ctrlin
)
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
description of the interface, see Streaming Pixel Interface.
Input Arguments
Output Arguments
Object Functions
To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named obj
, use
this syntax:
release(obj)