ROI Selector
Select a region of interest (ROI) from pixel stream
Libraries:
Vision HDL Toolbox /
Utilities
Description
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. You can use this block with a single pixel, multipixel, or multipixel-multicomponent pixel stream. 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.
Examples
Ports
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 bus for
frame control signals. This interface enables the block to operate independently of image size
and format. The pixel ports on this block support single pixel streaming or
multipixel streaming. Single pixel streaming accepts and returns a single pixel value each clock
cycle. Multipixel streaming accepts and returns a vector of M pixels per
clock cycle to support high-frame-rate or high-resolution formats. The M
value corresponds to the Number of pixels parameter of the Frame To
Pixels block. Along with the pixel, the block accepts and returns a
pixelcontrol
bus that contains five control signals. The control signals
indicate the validity of each pixel and their location in the frame. For multipixel streaming,
one set of control signals applies to all pixels in the vector. 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.
This block also supports multipixel-multicomponent streams, where the pixel input is a matrix of M-by-N values. M is number of pixels and N is number of components. These values correspond to the Number of pixels and Number of components parameters of the Frame To Pixels block.