Select a region of interest (ROI) from pixel stream
Vision HDL Toolbox / Utilities
The ROI Selector block selects a portion of the active frame from a video stream. The size of the inactive frame remains the same. The output control signals indicate a new active region of the frame. This diagram shows the inactive pixel regions in blue and the requested output region outlined in orange.
You can specify a fixed size and location for the ROI, or you can select the region location dynamically by using an input port. You can select more than one region. Define each region by specifying its upper-left corner coordinates and dimensions. By default, the block returns one set of pixels and control signals for each region you specify. The block sets the inactive pixels in the output frame to zero.
Regions are independent from each other, so they can overlap. If you specify a region that includes the edge of the active frame, the block returns only the active portion of the region. This diagram shows the output frames for three requested regions. The second output region does not include the inactive area above the image.
The block also provides a mode for vertical reuse. In this mode, you must specify regions
that have no vertical overlap and are aligned in columns. Each column of regions shares one
output pixel stream. The control signals define each region in the stream. This arrangement
enables parallel processing of each column, and the reuse of downstream processing logic for
each region in a column. To use this mode, select the Reuse output ports for
vertically aligned regions parameter. Use the visionhdlframetoregions
function to divide a frame into tiled regions for
vertical reuse.
This image shows the additional ports on the block when you configure three regions of interest from input ports.
This block uses a streaming pixel interface with a
pixelcontrol
bus for frame control signals. This interface enables the
block to operate independently of image size and format. All Vision HDL Toolbox™ blocks use the same streaming interface. The block accepts and returns a scalar
pixel value and a bus that contains five control signals. The control signals indicate the
validity of each pixel and its location in the frame. To convert a frame (pixel matrix) into a
serial pixel stream and control signals, use the Frame
To Pixels block. For a full description of the interface, see Streaming Pixel Interface.